use of net.geoprism.registry.test.graph.UndirectedGraphControllerWrapper in project geoprism-registry by terraframe.
the class UndirectedGraphTest method testRemoveChild.
@Test
public void testRemoveChild() {
// Allowed Users
TestUserInfo[] allowedUsers = new TestUserInfo[] { FastTestDataset.USER_ADMIN };
for (TestUserInfo user : allowedUsers) {
FastTestDataset.runAsUser(user, (request, adapter) -> {
UndirectedGraphControllerWrapper controller = new UndirectedGraphControllerWrapper(adapter, request);
controller.addChild(FastTestDataset.PROV_CENTRAL.getCode(), FastTestDataset.PROV_CENTRAL.getGeoObjectType().getCode(), FastTestDataset.PROV_WESTERN.getCode(), FastTestDataset.PROV_WESTERN.getGeoObjectType().getCode(), graphTypeCode, FastTestDataset.DEFAULT_OVER_TIME_DATE, FastTestDataset.DEFAULT_OVER_TIME_DATE);
controller.removeChild(FastTestDataset.PROV_CENTRAL.getCode(), FastTestDataset.PROV_CENTRAL.getGeoObjectType().getCode(), FastTestDataset.PROV_WESTERN.getCode(), FastTestDataset.PROV_WESTERN.getGeoObjectType().getCode(), graphTypeCode, FastTestDataset.DEFAULT_OVER_TIME_DATE, FastTestDataset.DEFAULT_OVER_TIME_DATE);
validateRemoveChild();
});
}
}
use of net.geoprism.registry.test.graph.UndirectedGraphControllerWrapper in project geoprism-registry by terraframe.
the class UndirectedGraphTest method testGetChildren.
@Test
public void testGetChildren() {
// Allowed Users
TestUserInfo[] allowedUsers = new TestUserInfo[] { FastTestDataset.USER_ADMIN };
for (TestUserInfo user : allowedUsers) {
FastTestDataset.runAsUser(user, (request, adapter) -> {
UndirectedGraphControllerWrapper controller = new UndirectedGraphControllerWrapper(adapter, request);
controller.addChild(FastTestDataset.PROV_CENTRAL.getCode(), FastTestDataset.PROV_CENTRAL.getGeoObjectType().getCode(), FastTestDataset.PROV_WESTERN.getCode(), FastTestDataset.PROV_WESTERN.getGeoObjectType().getCode(), graphTypeCode, FastTestDataset.DEFAULT_OVER_TIME_DATE, FastTestDataset.DEFAULT_OVER_TIME_DATE);
ServerChildGraphNode node = controller.getChildren(FastTestDataset.PROV_WESTERN.getCode(), FastTestDataset.PROV_WESTERN.getGeoObjectType().getCode(), graphTypeCode, false, FastTestDataset.DEFAULT_OVER_TIME_DATE);
List<ServerChildGraphNode> children = node.getChildren();
Assert.assertEquals(1, children.size());
Assert.assertEquals(FastTestDataset.PROV_CENTRAL.getCode(), children.get(0).getGeoObject().getCode());
});
}
}
use of net.geoprism.registry.test.graph.UndirectedGraphControllerWrapper in project geoprism-registry by terraframe.
the class UndirectedGraphTest method testAddChild.
@Test
public void testAddChild() {
// Allowed Users
TestUserInfo[] allowedUsers = new TestUserInfo[] { FastTestDataset.USER_ADMIN };
for (TestUserInfo user : allowedUsers) {
FastTestDataset.runAsUser(user, (request, adapter) -> {
UndirectedGraphControllerWrapper controller = new UndirectedGraphControllerWrapper(adapter, request);
ServerParentGraphNode node = controller.addChild(FastTestDataset.PROV_CENTRAL.getCode(), FastTestDataset.PROV_CENTRAL.getGeoObjectType().getCode(), FastTestDataset.PROV_WESTERN.getCode(), FastTestDataset.PROV_WESTERN.getGeoObjectType().getCode(), graphTypeCode, FastTestDataset.DEFAULT_OVER_TIME_DATE, FastTestDataset.DEFAULT_OVER_TIME_DATE);
validateAddChild(node, FastTestDataset.PROV_CENTRAL, FastTestDataset.PROV_WESTERN);
});
}
}
Aggregations