Search in sources :

Example 6 with MdEdgeDAO

use of com.runwaysdk.dataaccess.metadata.graph.MdEdgeDAO in project geoprism-registry by terraframe.

the class DirectedAcyclicGraphTypeTest method testCreate.

@Test
@Request
public void testCreate() {
    String code = "TEST";
    LocalizedValue label = new LocalizedValue("Test Label");
    LocalizedValue description = new LocalizedValue("Test Description");
    DirectedAcyclicGraphType type = DirectedAcyclicGraphType.create(code, label, description);
    try {
        Assert.assertNotNull(type);
        Assert.assertEquals(code, type.getCode());
        Assert.assertEquals(label.getValue(), type.getDisplayLabel().getValue());
        Assert.assertEquals(description.getValue(), type.getDescription().getValue());
        MdEdge mdEdge = type.getMdEdge();
        Assert.assertNotNull(mdEdge);
        MdEdgeDAO mdEdgeDao = (MdEdgeDAO) BusinessFacade.getEntityDAO(mdEdge);
        Assert.assertNotNull(mdEdgeDao.definesAttribute("startDate"));
        Assert.assertNotNull(mdEdgeDao.definesAttribute("endDate"));
    } finally {
        type.delete();
    }
}
Also used : MdEdge(com.runwaysdk.system.metadata.MdEdge) LocalizedValue(org.commongeoregistry.adapter.dataaccess.LocalizedValue) DirectedAcyclicGraphType(net.geoprism.registry.DirectedAcyclicGraphType) MdEdgeDAO(com.runwaysdk.dataaccess.metadata.graph.MdEdgeDAO) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Example 7 with MdEdgeDAO

use of com.runwaysdk.dataaccess.metadata.graph.MdEdgeDAO in project geoprism-registry by terraframe.

the class UndirectedGraphTypeTest method testCreate.

@Test
@Request
public void testCreate() {
    String code = "TEST";
    LocalizedValue label = new LocalizedValue("Test Label");
    LocalizedValue description = new LocalizedValue("Test Description");
    UndirectedGraphType type = UndirectedGraphType.create(code, label, description);
    try {
        Assert.assertNotNull(type);
        Assert.assertEquals(code, type.getCode());
        Assert.assertEquals(label.getValue(), type.getDisplayLabel().getValue());
        Assert.assertEquals(description.getValue(), type.getDescription().getValue());
        MdEdge mdEdge = type.getMdEdge();
        Assert.assertNotNull(mdEdge);
        MdEdgeDAO mdEdgeDao = (MdEdgeDAO) BusinessFacade.getEntityDAO(mdEdge);
        Assert.assertNotNull(mdEdgeDao.definesAttribute("startDate"));
        Assert.assertNotNull(mdEdgeDao.definesAttribute("endDate"));
    } finally {
        type.delete();
    }
}
Also used : MdEdge(com.runwaysdk.system.metadata.MdEdge) LocalizedValue(org.commongeoregistry.adapter.dataaccess.LocalizedValue) MdEdgeDAO(com.runwaysdk.dataaccess.metadata.graph.MdEdgeDAO) UndirectedGraphType(net.geoprism.registry.UndirectedGraphType) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Aggregations

MdEdgeDAO (com.runwaysdk.dataaccess.metadata.graph.MdEdgeDAO)7 RoleDAO (com.runwaysdk.business.rbac.RoleDAO)3 MdVertexDAOIF (com.runwaysdk.dataaccess.MdVertexDAOIF)3 MdAttributeDateTimeDAO (com.runwaysdk.dataaccess.metadata.MdAttributeDateTimeDAO)3 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)3 MdEdge (com.runwaysdk.system.metadata.MdEdge)3 DuplicateDataException (com.runwaysdk.dataaccess.DuplicateDataException)2 Request (com.runwaysdk.session.Request)2 ServerHierarchyTypeBuilder (net.geoprism.registry.conversion.ServerHierarchyTypeBuilder)2 LocalizedValue (org.commongeoregistry.adapter.dataaccess.LocalizedValue)2 Test (org.junit.Test)2 VertexObject (com.runwaysdk.business.graph.VertexObject)1 InitializationStrategyIF (com.runwaysdk.business.ontology.InitializationStrategyIF)1 GraphDBService (com.runwaysdk.dataaccess.graph.GraphDBService)1 GraphDDLCommandAction (com.runwaysdk.dataaccess.graph.GraphDDLCommandAction)1 GraphRequest (com.runwaysdk.dataaccess.graph.GraphRequest)1 MdAttributeDateDAO (com.runwaysdk.dataaccess.metadata.MdAttributeDateDAO)1 MdAttributeTextDAO (com.runwaysdk.dataaccess.metadata.MdAttributeTextDAO)1 MdBusinessDAO (com.runwaysdk.dataaccess.metadata.MdBusinessDAO)1 MdVertexDAO (com.runwaysdk.dataaccess.metadata.graph.MdVertexDAO)1