use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationTest method testGetAncestorTree.
@Test
@Request
public void testGetAncestorTree() {
Classification parent = Classification.newInstance(type);
parent.setCode(PARENT_CODE);
parent.apply(null);
try {
Classification child = Classification.newInstance(type);
child.setCode(CHILD_CODE);
child.apply(parent);
try {
ClassificationNode tree = child.getAncestorTree(null, 200);
Assert.assertEquals(parent.getOid(), tree.getClassification().getOid());
} finally {
child.delete();
}
} finally {
parent.delete();
}
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationTest method testAddGetChild.
@Test
@Request
public void testAddGetChild() {
Classification parent = Classification.newInstance(type);
parent.setCode(PARENT_CODE);
parent.apply(null);
try {
Classification child = Classification.newInstance(type);
child.setCode(CHILD_CODE);
child.apply(null);
try {
parent.addChild(child);
Page<Classification> children = parent.getChildren(20, 1);
Assert.assertEquals(Long.valueOf(1), children.getCount());
Classification result = children.getResults().get(0);
Assert.assertEquals(child.getOid(), result.getOid());
} finally {
child.delete();
}
} finally {
parent.delete();
}
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationTypeTest method testCreate.
@Test
@Request
public void testCreate() {
String code = "TEST_PROG";
String label = "Test Prog";
String description = "Test Description";
ClassificationType type = ClassificationType.apply(createMock(code, label, description));
try {
Assert.assertEquals(code, type.getCode());
Assert.assertEquals(label, type.getDisplayLabel().getValue());
Assert.assertNotNull(type.getMdVertex());
} finally {
type.delete();
}
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class ClassificationTypeTest method testRemove.
@Test
@Request
public void testRemove() {
ClassificationType type = ClassificationType.apply(createMock());
type.delete();
try {
ClassificationType.getByCode(type.getCode());
Assert.fail("Able to get type which should have been deleted");
} catch (DataNotFoundException ex) {
// Expected
}
}
use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.
the class CurationTest method setUpTestCurate.
@Request
private Object[] setUpTestCurate() throws Throwable {
TestGeoObjectInfo noGeomGo = testData.newTestGeoObjectInfo("curationJobTest-NoGeom", FastTestDataset.PROVINCE);
noGeomGo.setWkt(null);
noGeomGo.apply();
version.publishNoAuth();
return new Object[] { noGeomGo, version.getOid() };
}
Aggregations