Search in sources :

Example 6 with Capabilities

use of net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities in project arctic-sea by 52North.

the class SensorMLEncoderV101Test method encodeSimpleDataRecord.

private SimpleDataRecordType encodeSimpleDataRecord(final SystemType xbSystem, final String capName, final int fields) {
    assertThat(xbSystem.getCapabilitiesArray().length, is(1));
    final Capabilities xbCapabilities = xbSystem.getCapabilitiesArray()[0];
    assertThat(xbCapabilities.getName(), is(capName));
    assertThat(xbCapabilities.getAbstractDataRecord(), notNullValue());
    assertThat(xbCapabilities.getAbstractDataRecord(), instanceOf(SimpleDataRecordType.class));
    final SimpleDataRecordType xbSimpleDataRecord = (SimpleDataRecordType) xbCapabilities.getAbstractDataRecord();
    assertThat(xbSimpleDataRecord.getFieldArray().length, is(fields));
    return xbSimpleDataRecord;
}
Also used : Capabilities(net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities) SimpleDataRecordType(net.opengis.swe.x101.SimpleDataRecordType)

Example 7 with Capabilities

use of net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities in project arctic-sea by 52North.

the class SensorMLDecoderV101Test method should_decode_parent_procedures_from_sml.

@Test
public void should_decode_parent_procedures_from_sml() throws DecodingException {
    SensorMLDocument xbSmlDoc = getSensorMLDoc();
    SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
    Capabilities xbCapabilities = xbSystem.addNewCapabilities();
    xbCapabilities.setName(SensorMLConstants.ELEMENT_NAME_PARENT_PROCEDURES);
    SimpleDataRecordType xbSimpleDataRecord = (SimpleDataRecordType) xbCapabilities.addNewAbstractDataRecord().substitute(SweConstants.QN_SIMPLEDATARECORD_SWE_101, SimpleDataRecordType.type);
    addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_1, TEST_NAME_1);
    addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_2, TEST_NAME_2);
    AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
    // assertThat(absProcess.getParentProcedures().size(), is(2));
    assertThat(absProcess.getCapabilities().size(), is(1));
// List<String> parentProcedures = new ArrayList<String>(absProcess.getParentProcedures());
// Collections.sort(parentProcedures);
// assertThat(parentProcedures.get(0), is(TEST_ID_1));
// assertThat(parentProcedures.get(1), is(TEST_ID_2));
}
Also used : SensorMLDocument(net.opengis.sensorML.x101.SensorMLDocument) AbstractProcess(org.n52.shetland.ogc.sensorML.AbstractProcess) Capabilities(net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities) SystemType(net.opengis.sensorML.x101.SystemType) SimpleDataRecordType(net.opengis.swe.x101.SimpleDataRecordType) Test(org.junit.Test)

Example 8 with Capabilities

use of net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities in project arctic-sea by 52North.

the class SensorMLDecoderV101Test method should_decode_offerings_from_sml.

@Test
public void should_decode_offerings_from_sml() throws DecodingException {
    SensorMLDocument xbSmlDoc = getSensorMLDoc();
    SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
    Capabilities xbCapabilities = xbSystem.addNewCapabilities();
    xbCapabilities.setName(SensorMLConstants.ELEMENT_NAME_OFFERINGS);
    SimpleDataRecordType xbSimpleDataRecord = (SimpleDataRecordType) xbCapabilities.addNewAbstractDataRecord().substitute(SweConstants.QN_SIMPLEDATARECORD_SWE_101, SimpleDataRecordType.type);
    addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_1, TEST_NAME_1);
    addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_2, TEST_NAME_2);
    AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
    // assertThat(absProcess.getOfferings().size(), is(2));
    assertThat(absProcess.getCapabilities().size(), is(1));
// List<SosOffering> sosOfferings = new ArrayList<SosOffering>(absProcess.getOfferings());
// Collections.sort(sosOfferings);
// assertThat(sosOfferings.get(0).getIdentifier(), is(TEST_ID_1));
// assertThat(sosOfferings.get(0).getOfferingName(), is(TEST_NAME_1));
// assertThat(sosOfferings.get(1).getIdentifier(), is(TEST_ID_2));
// assertThat(sosOfferings.get(1).getOfferingName(), is(TEST_NAME_2));
}
Also used : SensorMLDocument(net.opengis.sensorML.x101.SensorMLDocument) AbstractProcess(org.n52.shetland.ogc.sensorML.AbstractProcess) Capabilities(net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities) SystemType(net.opengis.sensorML.x101.SystemType) SimpleDataRecordType(net.opengis.swe.x101.SimpleDataRecordType) Test(org.junit.Test)

Aggregations

Capabilities (net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities)7 SimpleDataRecordType (net.opengis.swe.x101.SimpleDataRecordType)4 SensorMLDocument (net.opengis.sensorML.x101.SensorMLDocument)3 SystemType (net.opengis.sensorML.x101.SystemType)3 XmlObject (org.apache.xmlbeans.XmlObject)3 Test (org.junit.Test)3 AbstractProcess (org.n52.shetland.ogc.sensorML.AbstractProcess)3 SmlCapabilities (org.n52.shetland.ogc.sensorML.elements.SmlCapabilities)3 ContactList (net.opengis.sensorML.x101.ContactListDocument.ContactList)1 CapabilitiesDocument (net.opengis.sos.x10.CapabilitiesDocument)1 Capabilities (net.opengis.sos.x10.CapabilitiesDocument.Capabilities)1 FilterCapabilities (net.opengis.sos.x10.FilterCapabilitiesDocument.FilterCapabilities)1 XmlCursor (org.apache.xmlbeans.XmlCursor)1 Time (org.n52.shetland.ogc.gml.time.Time)1 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)1 TimePeriod (org.n52.shetland.ogc.gml.time.TimePeriod)1 SmlContactList (org.n52.shetland.ogc.sensorML.SmlContactList)1 SosCapabilities (org.n52.shetland.ogc.sos.SosCapabilities)1 DataRecord (org.n52.shetland.ogc.swe.DataRecord)1 SweTime (org.n52.shetland.ogc.swe.simpleType.SweTime)1