Search in sources :

Example 6 with VertexGeoObjectQuery

use of net.geoprism.registry.query.graph.VertexGeoObjectQuery in project geoprism-registry by terraframe.

the class GeoObjectQueryTest method testTreeSynonymRestrictionByDisplayLabel.

@Test
@Request
public void testTreeSynonymRestrictionByDisplayLabel() {
    ServerGeoObjectType type = USATestData.STATE.getServerObject();
    VertexGeoObjectQuery query = new VertexGeoObjectQuery(type, null);
    query.setRestriction(new ServerSynonymRestriction(USATestData.COLORADO.getDisplayLabel(), USATestData.COLORADO.getDate()));
    ServerGeoObjectIF result = query.getSingleResult();
    Assert.assertEquals(USATestData.COLORADO.getCode(), result.getCode());
    Assert.assertNotNull(result.getGeometry());
    Assert.assertEquals(USATestData.COLORADO.getDisplayLabel(), result.getDisplayLabel().getValue());
    Assert.assertEquals(true, result.getExists());
}
Also used : ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) VertexGeoObjectQuery(net.geoprism.registry.query.graph.VertexGeoObjectQuery) ServerSynonymRestriction(net.geoprism.registry.query.ServerSynonymRestriction) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Example 7 with VertexGeoObjectQuery

use of net.geoprism.registry.query.graph.VertexGeoObjectQuery in project geoprism-registry by terraframe.

the class ExternalSystemTest method testVertexExternalIdRestriction.

@Test
@Request
public void testVertexExternalIdRestriction() {
    RevealExternalSystem system = new RevealExternalSystem();
    system.setId(EXTERNAL_SYSTEM_ID);
    system.setOrganization(FastTestDataset.ORG_CGOV.getServerObject());
    system.getEmbeddedComponent(ExternalSystem.LABEL).setValue("defaultLocale", "Test");
    system.getEmbeddedComponent(ExternalSystem.DESCRIPTION).setValue("defaultLocale", "Test");
    system.apply();
    String externalId = "EXTERNAL ID";
    ServerGeoObjectIF serverGO = FastTestDataset.PROV_CENTRAL.getServerObject();
    serverGO.createExternalId(system, externalId, ImportStrategy.NEW_ONLY);
    VertexGeoObjectQuery query = new VertexGeoObjectQuery(FastTestDataset.PROVINCE.getServerObject(), new Date());
    query.setRestriction(new ServerExternalIdRestriction(system, externalId));
    ServerGeoObjectIF result = query.getSingleResult();
    Assert.assertNotNull(result);
    Assert.assertEquals(serverGO.getCode(), result.getCode());
}
Also used : RevealExternalSystem(net.geoprism.registry.graph.RevealExternalSystem) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) VertexGeoObjectQuery(net.geoprism.registry.query.graph.VertexGeoObjectQuery) Date(java.util.Date) ServerExternalIdRestriction(net.geoprism.registry.query.ServerExternalIdRestriction) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Aggregations

ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)7 VertexGeoObjectQuery (net.geoprism.registry.query.graph.VertexGeoObjectQuery)7 Request (com.runwaysdk.session.Request)6 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)6 Test (org.junit.Test)6 Date (java.util.Date)2 ServerSynonymRestriction (net.geoprism.registry.query.ServerSynonymRestriction)2 Business (com.runwaysdk.business.Business)1 MdAttributeConcreteDAO (com.runwaysdk.dataaccess.metadata.MdAttributeConcreteDAO)1 MdBusinessDAO (com.runwaysdk.dataaccess.metadata.MdBusinessDAO)1 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)1 MdAttributeMultiPoint (com.runwaysdk.system.gis.metadata.MdAttributeMultiPoint)1 MdAttributePoint (com.runwaysdk.system.gis.metadata.MdAttributePoint)1 MdAttributeLong (com.runwaysdk.system.metadata.MdAttributeLong)1 MdBusiness (com.runwaysdk.system.metadata.MdBusiness)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Locale (java.util.Locale)1 RevealExternalSystem (net.geoprism.registry.graph.RevealExternalSystem)1 ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)1