Search in sources :

Example 11 with InheritedHierarchyAnnotation

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();
    }
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) InheritedHierarchyAnnotation(net.geoprism.registry.InheritedHierarchyAnnotation) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Example 12 with InheritedHierarchyAnnotation

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();
    }
}
Also used : ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) InheritedHierarchyAnnotation(net.geoprism.registry.InheritedHierarchyAnnotation) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Example 13 with InheritedHierarchyAnnotation

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();
    }
}
Also used : ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) InheritedHierarchyAnnotation(net.geoprism.registry.InheritedHierarchyAnnotation) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Aggregations

InheritedHierarchyAnnotation (net.geoprism.registry.InheritedHierarchyAnnotation)13 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)10 Request (com.runwaysdk.session.Request)9 Test (org.junit.Test)9 ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)8 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)4 HierarchicalRelationshipType (net.geoprism.registry.HierarchicalRelationshipType)2 GeoObjectType (org.commongeoregistry.adapter.metadata.GeoObjectType)2 QueryFactory (com.runwaysdk.query.QueryFactory)1 Actor (com.runwaysdk.system.Actor)1 Roles (com.runwaysdk.system.Roles)1 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 Classifier (net.geoprism.ontology.Classifier)1 HierarchyRootException (net.geoprism.registry.HierarchyRootException)1 InheritedHierarchyAnnotationQuery (net.geoprism.registry.InheritedHierarchyAnnotationQuery)1 RootNodeCannotBeInheritedException (net.geoprism.registry.RootNodeCannotBeInheritedException)1 TypeInUseException (net.geoprism.registry.TypeInUseException)1 ServerHierarchyTypeBuilder (net.geoprism.registry.conversion.ServerHierarchyTypeBuilder)1 ServerGeoObjectService (net.geoprism.registry.geoobject.ServerGeoObjectService)1