Search in sources :

Example 1 with DirectedAcyclicGraphControllerWrapper

use of net.geoprism.registry.test.graph.DirectedAcyclicGraphControllerWrapper in project geoprism-registry by terraframe.

the class DirectedAcyclicGraphTest method testGetChildren.

@Test
public void testGetChildren() {
    // Allowed Users
    TestUserInfo[] allowedUsers = new TestUserInfo[] { FastTestDataset.USER_ADMIN };
    for (TestUserInfo user : allowedUsers) {
        FastTestDataset.runAsUser(user, (request, adapter) -> {
            DirectedAcyclicGraphControllerWrapper controller = new DirectedAcyclicGraphControllerWrapper(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_CENTRAL.getCode(), FastTestDataset.PROV_CENTRAL.getGeoObjectType().getCode(), graphTypeCode, false, FastTestDataset.DEFAULT_OVER_TIME_DATE);
            List<ServerChildGraphNode> children = node.getChildren();
            Assert.assertEquals(1, children.size());
            Assert.assertEquals(FastTestDataset.PROV_WESTERN.getCode(), children.get(0).getGeoObject().getCode());
        });
    }
}
Also used : TestUserInfo(net.geoprism.registry.test.TestUserInfo) ServerChildGraphNode(net.geoprism.registry.model.ServerChildGraphNode) DirectedAcyclicGraphControllerWrapper(net.geoprism.registry.test.graph.DirectedAcyclicGraphControllerWrapper) Test(org.junit.Test)

Example 2 with DirectedAcyclicGraphControllerWrapper

use of net.geoprism.registry.test.graph.DirectedAcyclicGraphControllerWrapper in project geoprism-registry by terraframe.

the class DirectedAcyclicGraphTest method testAddChild.

@Test
public void testAddChild() {
    // Allowed Users
    TestUserInfo[] allowedUsers = new TestUserInfo[] { FastTestDataset.USER_ADMIN };
    for (TestUserInfo user : allowedUsers) {
        FastTestDataset.runAsUser(user, (request, adapter) -> {
            DirectedAcyclicGraphControllerWrapper controller = new DirectedAcyclicGraphControllerWrapper(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);
        });
    }
}
Also used : TestUserInfo(net.geoprism.registry.test.TestUserInfo) DirectedAcyclicGraphControllerWrapper(net.geoprism.registry.test.graph.DirectedAcyclicGraphControllerWrapper) ServerParentGraphNode(net.geoprism.registry.model.ServerParentGraphNode) Test(org.junit.Test)

Aggregations

TestUserInfo (net.geoprism.registry.test.TestUserInfo)2 DirectedAcyclicGraphControllerWrapper (net.geoprism.registry.test.graph.DirectedAcyclicGraphControllerWrapper)2 Test (org.junit.Test)2 ServerChildGraphNode (net.geoprism.registry.model.ServerChildGraphNode)1 ServerParentGraphNode (net.geoprism.registry.model.ServerParentGraphNode)1