use of net.geoprism.registry.InheritedHierarchyAnnotation in project geoprism-registry by terraframe.
the class InheritedHierarchyAnnotationTest method testGetByForHierarchy.
@Test
@Request
public void testGetByForHierarchy() {
ServerGeoObjectType sGOT = FastTestDataset.PROVINCE.getServerObject();
ServerHierarchyType forHierarchy = TEST_HT.getServerObject();
ServerHierarchyType inheritedHierarchy = FastTestDataset.HIER_ADMIN.getServerObject();
InheritedHierarchyAnnotation annotation = sGOT.setInheritedHierarchy(forHierarchy, inheritedHierarchy);
try {
List<? extends InheritedHierarchyAnnotation> annotations = InheritedHierarchyAnnotation.getByRelationship(forHierarchy.getHierarchicalRelationshipType());
Assert.assertEquals(1, annotations.size());
InheritedHierarchyAnnotation test = annotations.get(0);
Assert.assertEquals(test.getOid(), annotation.getOid());
} finally {
annotation.delete();
}
}
use of net.geoprism.registry.InheritedHierarchyAnnotation in project geoprism-registry by terraframe.
the class InheritedHierarchyAnnotationTest method testCreate.
@Test
@Request
public void testCreate() {
ServerGeoObjectType sGOT = FastTestDataset.PROVINCE.getServerObject();
InheritedHierarchyAnnotation annotation = sGOT.setInheritedHierarchy(TEST_HT.getServerObject(), FastTestDataset.HIER_ADMIN.getServerObject());
try {
Assert.assertNotNull(annotation);
} finally {
annotation.delete();
}
}
use of net.geoprism.registry.InheritedHierarchyAnnotation in project geoprism-registry by terraframe.
the class InheritedHierarchyAnnotationTest method testGetByInheritedHierarchy.
@Test
@Request
public void testGetByInheritedHierarchy() {
ServerGeoObjectType sGOT = FastTestDataset.PROVINCE.getServerObject();
ServerHierarchyType forHierarchy = TEST_HT.getServerObject();
ServerHierarchyType inheritedHierarchy = FastTestDataset.HIER_ADMIN.getServerObject();
InheritedHierarchyAnnotation annotation = sGOT.setInheritedHierarchy(forHierarchy, inheritedHierarchy);
try {
List<? extends InheritedHierarchyAnnotation> annotations = InheritedHierarchyAnnotation.getByRelationship(inheritedHierarchy.getHierarchicalRelationshipType());
Assert.assertEquals(1, annotations.size());
InheritedHierarchyAnnotation test = annotations.get(0);
Assert.assertEquals(test.getOid(), annotation.getOid());
} finally {
annotation.delete();
}
}
Aggregations