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());
}
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());
}
Aggregations