use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class GeoObjectQueryTest method testQueryTreeNodes.
@Test
@Request
public void testQueryTreeNodes() {
ServerGeoObjectType type = USATestData.STATE.getServerObject();
VertexGeoObjectQuery query = new VertexGeoObjectQuery(type, null);
List<ServerGeoObjectIF> results = query.getResults();
Assert.assertEquals(2, results.size());
ServerGeoObjectIF result = results.get(0);
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.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class GeoObjectQueryTest method testLeafCodeRestriction.
@Test
@Request
public void testLeafCodeRestriction() {
ServerGeoObjectType type = USATestData.DISTRICT.getServerObject();
VertexGeoObjectQuery query = new VertexGeoObjectQuery(type, null);
query.setRestriction(new ServerCodeRestriction(USATestData.CO_D_ONE.getCode()));
ServerGeoObjectIF result = query.getSingleResult();
Assert.assertEquals(USATestData.CO_D_ONE.getCode(), result.getCode());
Assert.assertNotNull(result.getGeometry());
Assert.assertEquals(USATestData.CO_D_ONE.getDisplayLabel(), result.getDisplayLabel().getValue());
Assert.assertEquals(true, result.getExists());
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class GeoObjectQueryTest method testTreeSynonymRestrictionByCode.
@Test
@Request
public void testTreeSynonymRestrictionByCode() {
ServerGeoObjectType type = USATestData.STATE.getServerObject();
VertexGeoObjectQuery query = new VertexGeoObjectQuery(type, null);
query.setRestriction(new ServerSynonymRestriction(USATestData.COLORADO.getCode(), 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.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class ExternalSystemTest method testAddExternalId.
@Test
@Request
public void testAddExternalId() {
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 expected = "EXTERNAL ID";
ServerGeoObjectIF serverGO = FastTestDataset.PROV_CENTRAL.getServerObject();
serverGO.createExternalId(system, expected, ImportStrategy.NEW_ONLY);
String actual = serverGO.getExternalId(system);
Assert.assertEquals(expected, actual);
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class FhirImportTest method testBasicImport.
@Request
@Test
public void testBasicImport() throws InterruptedException {
try {
FhirExternalSystem system = createExternalSystem();
SynchronizationConfig config = createSyncConfig(system);
FhirSyncImportConfig iConfig = (FhirSyncImportConfig) config.buildConfiguration();
FhirResourceProcessor processor = FhirFactory.getProcessor(iConfig.getImplementation());
IParser parser = FhirContext.forR4().newJsonParser();
Bundle bundle = new Bundle();
bundle.addEntry(new BundleEntryComponent().setResource((Resource) parser.parseResource(this.getClass().getResourceAsStream("/fhir/organization.json"))));
bundle.addEntry(new BundleEntryComponent().setResource((Resource) parser.parseResource(this.getClass().getResourceAsStream("/fhir/location.json"))));
FhirResourceImporter importer = new FhirResourceImporter(new BasicFhirConnection(system), processor, null, null);
importer.synchronize(bundle);
ServerGeoObjectIF geoobject = new ServerGeoObjectService().getGeoObjectByCode("USATestDataHsTwo", "USATestDataHealthStop");
geoobject.setDate(new Date());
LocalizedValue displayLabel = geoobject.getDisplayLabel();
Assert.assertEquals("USATestDataHsTwo ZZZZZZZ", displayLabel.getValue());
} finally {
TestDataSet.deleteExternalSystems("FHIRImportTest");
}
}
Aggregations