use of net.geoprism.registry.DirectedAcyclicGraphType in project geoprism-registry by terraframe.
the class DirectedAcyclicGraphTypeTest method testGetByCode.
@Test
@Request
public void testGetByCode() {
DirectedAcyclicGraphType type = DirectedAcyclicGraphType.create("TEST", new LocalizedValue("Test Label"), new LocalizedValue("Test Description"));
try {
DirectedAcyclicGraphType result = DirectedAcyclicGraphType.getByCode(type.getCode());
Assert.assertNotNull(result);
Assert.assertEquals(type.getCode(), result.getCode());
} finally {
type.delete();
}
}
use of net.geoprism.registry.DirectedAcyclicGraphType in project geoprism-registry by terraframe.
the class DirectedAcyclicGraphTypeService method create.
@Request(RequestType.SESSION)
public JsonObject create(String sessionId, String json) {
JsonObject object = JsonParser.parseString(json).getAsJsonObject();
DirectedAcyclicGraphType type = DirectedAcyclicGraphType.create(object);
((Session) Session.getCurrentSession()).reloadPermissions();
return type.toJSON();
}
use of net.geoprism.registry.DirectedAcyclicGraphType 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();
}
}
use of net.geoprism.registry.DirectedAcyclicGraphType in project geoprism-registry by terraframe.
the class DirectedAcyclicGraphTypeTest method testGetByMdEdge.
@Test
@Request
public void testGetByMdEdge() {
DirectedAcyclicGraphType type = DirectedAcyclicGraphType.create("TEST", new LocalizedValue("Test Label"), new LocalizedValue("Test Description"));
try {
DirectedAcyclicGraphType result = DirectedAcyclicGraphType.getByMdEdge(type.getMdEdge());
Assert.assertNotNull(result);
Assert.assertEquals(type.getCode(), result.getCode());
} finally {
type.delete();
}
}
use of net.geoprism.registry.DirectedAcyclicGraphType in project geoprism-registry by terraframe.
the class DirectedAcyclicGraphTypeTest method testGetByAll.
@Test
@Request
public void testGetByAll() {
DirectedAcyclicGraphType type = DirectedAcyclicGraphType.create("TEST", new LocalizedValue("Test Label"), new LocalizedValue("Test Description"));
try {
List<DirectedAcyclicGraphType> results = DirectedAcyclicGraphType.getAll();
Assert.assertEquals(1, results.size());
DirectedAcyclicGraphType result = results.get(0);
Assert.assertEquals(type.getCode(), result.getCode());
} finally {
type.delete();
}
}
Aggregations