Search in sources :

Example 11 with SensorMLDocument

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

the class SensorMLDecoderV101Test method getSensorMLDoc.

private SensorMLDocument getSensorMLDoc() {
    SensorMLDocument xbSmlDoc = SensorMLDocument.Factory.newInstance();
    net.opengis.sensorML.x101.SensorMLDocument.SensorML xbSensorML = xbSmlDoc.addNewSensorML();
    xbSensorML.setVersion(SensorMLConstants.VERSION_V101);
    return xbSmlDoc;
}
Also used : SensorMLDocument(net.opengis.sensorML.x101.SensorMLDocument)

Example 12 with SensorMLDocument

use of net.opengis.sensorML.x101.SensorMLDocument 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 13 with SensorMLDocument

use of net.opengis.sensorML.x101.SensorMLDocument 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)

Example 14 with SensorMLDocument

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

the class SensorMLDecoderV101Test method should_set_identifier_by_identifier_name.

@Test
public void should_set_identifier_by_identifier_name() throws DecodingException {
    SensorMLDocument xbSmlDoc = getSensorMLDoc();
    SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
    IdentifierList xbIdentifierList = xbSystem.addNewIdentification().addNewIdentifierList();
    addIdentifier(xbIdentifierList, OGCConstants.URN_UNIQUE_IDENTIFIER_END, null, TEST_ID_1);
    addIdentifier(xbIdentifierList, "any name", null, TEST_ID_2);
    AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
    assertThat(absProcess.getIdentifier(), is(TEST_ID_1));
    assertThat(absProcess.getIdentifications().size(), is(2));
}
Also used : SensorMLDocument(net.opengis.sensorML.x101.SensorMLDocument) AbstractProcess(org.n52.shetland.ogc.sensorML.AbstractProcess) SystemType(net.opengis.sensorML.x101.SystemType) IdentifierList(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList) Test(org.junit.Test)

Example 15 with SensorMLDocument

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

the class SensorMLDecoderV101Test method should_decode_child_procedure_from_sml.

@Test
public void should_decode_child_procedure_from_sml() throws DecodingException {
    SensorMLDocument xbSmlDoc = getSensorMLDoc();
    SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
    IdentifierList xbIdentifierList = xbSystem.addNewIdentification().addNewIdentifierList();
    addIdentifier(xbIdentifierList, "anyname", OGCConstants.URN_UNIQUE_IDENTIFIER, TEST_ID_1);
    ComponentList xbComponentList = xbSystem.addNewComponents().addNewComponentList();
    addChildProcedure(xbComponentList, TEST_ID_2);
    AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
    assertThat(absProcess.getIdentifier(), is(TEST_ID_1));
// assertThat(absProcess.getChildProcedures().size(), is(1));
// SosProcedureDescription childProcedure = absProcess.getChildProcedures().iterator().next();
// assertThat(childProcedure, instanceOf(System.class));
// assertThat(childProcedure.getIdentifier(), is(TEST_ID_2));
}
Also used : SensorMLDocument(net.opengis.sensorML.x101.SensorMLDocument) AbstractProcess(org.n52.shetland.ogc.sensorML.AbstractProcess) SystemType(net.opengis.sensorML.x101.SystemType) ComponentList(net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList) IdentifierList(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList) Test(org.junit.Test)

Aggregations

SensorMLDocument (net.opengis.sensorML.x101.SensorMLDocument)18 SystemType (net.opengis.sensorML.x101.SystemType)16 Test (org.junit.Test)13 AbstractProcess (org.n52.shetland.ogc.sensorML.AbstractProcess)13 XmlObject (org.apache.xmlbeans.XmlObject)5 SensorML (org.n52.shetland.ogc.sensorML.SensorML)5 IdentifierList (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList)4 SimpleDataRecordType (net.opengis.swe.x101.SimpleDataRecordType)4 System (org.n52.shetland.ogc.sensorML.System)4 AbstractProcessType (net.opengis.sensorML.x101.AbstractProcessType)3 Capabilities (net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities)3 Person (net.opengis.sensorML.x101.PersonDocument.Person)3 ResponsibleParty (net.opengis.sensorML.x101.ResponsiblePartyDocument.ResponsibleParty)3 Member (net.opengis.sensorML.x101.SensorMLDocument.SensorML.Member)3 SmlPerson (org.n52.shetland.ogc.sensorML.SmlPerson)3 SmlResponsibleParty (org.n52.shetland.ogc.sensorML.SmlResponsibleParty)3 ComponentType (net.opengis.sensorML.x101.ComponentType)2 ComponentList (net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList)2 Component (net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList.Component)2 ContactList (net.opengis.sensorML.x101.ContactListDocument.ContactList)2