use of org.activityinfo.shared.command.Delete in project activityinfo by bedatadriven.
the class DeleteTest method testDeleteSite.
@Test
public void testDeleteSite() throws CommandException {
PagingResult<SiteDTO> sites = execute(GetSites.byId(3));
execute(new Delete(sites.getData().get(0)));
sites = execute(GetSites.byId(3));
Assert.assertEquals(0, sites.getData().size());
sites = execute(new GetSites());
Assert.assertNull(getById(sites.getData(), 3));
}
use of org.activityinfo.shared.command.Delete in project activityinfo by bedatadriven.
the class DeleteTest method testDeleteAttribute.
@Test
public void testDeleteAttribute() throws CommandException {
SchemaDTO schema = execute(new GetSchema());
execute(new Delete(schema.getActivityById(1).getAttributeById(1)));
schema = execute(new GetSchema());
Assert.assertNull(schema.getActivityById(1).getAttributeById(1));
}
use of org.activityinfo.shared.command.Delete in project activityinfo by bedatadriven.
the class DeleteTest method testDeleteActivity.
@Test
public void testDeleteActivity() throws CommandException {
SchemaDTO schema = execute(new GetSchema());
execute(new Delete(schema.getActivityById(1)));
execute(new Delete("Activity", 4));
schema = execute(new GetSchema());
Assert.assertNull("delete by entity reference", schema.getActivityById(1));
Assert.assertNull("delete by id", schema.getActivityById(4));
}
use of org.activityinfo.shared.command.Delete in project activityinfo by bedatadriven.
the class LocalSchemaChangeTest method deleteActivity.
@Test
public void deleteActivity() {
synchronizeFirstTime();
SchemaDTO schema = executeLocally(new GetSchema());
assertThat(schema.getActivityById(2), is(not(nullValue())));
executeRemotely(new Delete("Activity", 2));
synchronize();
schema = executeLocally(new GetSchema());
assertThat(schema.getActivityById(2), is(nullValue()));
}
Aggregations