Search in sources :

Example 6 with MdEdge

use of com.runwaysdk.system.metadata.MdEdge 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 MdEdge

use of com.runwaysdk.system.metadata.MdEdge 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

MdEdge (com.runwaysdk.system.metadata.MdEdge)7 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)4 MdEdgeDAO (com.runwaysdk.dataaccess.metadata.graph.MdEdgeDAO)3 Request (com.runwaysdk.session.Request)2 MdTermRelationship (com.runwaysdk.system.metadata.MdTermRelationship)2 LocalizedValue (org.commongeoregistry.adapter.dataaccess.LocalizedValue)2 Test (org.junit.Test)2 InitializationStrategyIF (com.runwaysdk.business.ontology.InitializationStrategyIF)1 RoleDAO (com.runwaysdk.business.rbac.RoleDAO)1 DuplicateDataException (com.runwaysdk.dataaccess.DuplicateDataException)1 MdVertexDAOIF (com.runwaysdk.dataaccess.MdVertexDAOIF)1 AttributeValueException (com.runwaysdk.dataaccess.attributes.AttributeValueException)1 MdAttributeDateTimeDAO (com.runwaysdk.dataaccess.metadata.MdAttributeDateTimeDAO)1 MdBusinessDAO (com.runwaysdk.dataaccess.metadata.MdBusinessDAO)1 CodeLengthException (net.geoprism.registry.CodeLengthException)1 DirectedAcyclicGraphType (net.geoprism.registry.DirectedAcyclicGraphType)1 DuplicateHierarchyTypeException (net.geoprism.registry.DuplicateHierarchyTypeException)1 HierarchicalRelationshipType (net.geoprism.registry.HierarchicalRelationshipType)1 Organization (net.geoprism.registry.Organization)1 UndirectedGraphType (net.geoprism.registry.UndirectedGraphType)1