use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class GeoObjectTypeRelationshipServiceTest method testAddChildOfAbstractType.
@Test(expected = AbstractParentException.class)
@Request
public void testAddChildOfAbstractType() {
TestGeoObjectTypeInfo parentGot = new TestGeoObjectTypeInfo("HMST_Abstract", FastTestDataset.ORG_CGOV);
parentGot.setAbstract(true);
TestGeoObjectTypeInfo childGot = new TestGeoObjectTypeInfo("HMST_Child", FastTestDataset.ORG_CGOV);
try {
parentGot.apply();
childGot.apply();
ServerHierarchyType type = FastTestDataset.HIER_ADMIN.getServerObject();
ServerGeoObjectType parentType = parentGot.getServerObject();
ServerGeoObjectType childType = childGot.getServerObject();
try {
type.addToHierarchy(RootGeoObjectType.INSTANCE, parentType);
type.addToHierarchy(parentType, childType);
} finally {
type.removeChild(RootGeoObjectType.INSTANCE, parentType, false);
}
} finally {
parentGot.delete();
childGot.delete();
}
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class GeoObjectQueryTest method testFailLookupRestriction.
@Test
@Request
public void testFailLookupRestriction() {
ServerGeoObjectType type = USATestData.STATE.getServerObject();
ServerLookupRestriction restriction = new ServerLookupRestriction(USATestData.CANADA.getCode(), USATestData.CANADA.getDate());
VertexGeoObjectQuery query = new VertexGeoObjectQuery(type, null);
query.setRestriction(restriction);
ServerGeoObjectIF result = query.getSingleResult();
Assert.assertNull(result);
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class InheritedHierarchyAnnotationTest method testCreateOnNonRoot.
@Request
@Test(expected = HierarchyRootException.class)
public void testCreateOnNonRoot() {
ServerGeoObjectType sGOT = TEST_CHILD.getServerObject();
sGOT.setInheritedHierarchy(TEST_HT.getServerObject(), FastTestDataset.HIER_ADMIN.getServerObject());
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class InheritedHierarchyAnnotationTest method testGetByUniversalAndHierarchy.
@Test
@Request
public void testGetByUniversalAndHierarchy() {
ServerGeoObjectType sGOT = FastTestDataset.PROVINCE.getServerObject();
ServerHierarchyType forHierarchy = TEST_HT.getServerObject();
ServerHierarchyType inheritedHierarchy = FastTestDataset.HIER_ADMIN.getServerObject();
InheritedHierarchyAnnotation annotation = sGOT.setInheritedHierarchy(forHierarchy, inheritedHierarchy);
try {
InheritedHierarchyAnnotation test = InheritedHierarchyAnnotation.get(sGOT.getUniversal(), forHierarchy.getHierarchicalRelationshipType());
Assert.assertNotNull(test);
Assert.assertEquals(test.getOid(), annotation.getOid());
} finally {
annotation.delete();
}
}
use of net.geoprism.registry.model.ServerGeoObjectType in project geoprism-registry by terraframe.
the class InheritedHierarchyAnnotationTest method testRemove.
@Test
@Request
public void testRemove() {
ServerGeoObjectType sGOT = FastTestDataset.PROVINCE.getServerObject();
ServerHierarchyType forHierarchy = TEST_HT.getServerObject();
ServerHierarchyType inheritedHierarchy = FastTestDataset.HIER_ADMIN.getServerObject();
sGOT.setInheritedHierarchy(forHierarchy, inheritedHierarchy);
sGOT.removeInheritedHierarchy(forHierarchy);
InheritedHierarchyAnnotation test = InheritedHierarchyAnnotation.get(sGOT.getUniversal(), forHierarchy.getHierarchicalRelationshipType());
try {
Assert.assertNull(test);
} finally {
if (test != null) {
test.delete();
}
}
}
Aggregations