Search in sources :

Example 6 with IdentifierList

use of net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList 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 7 with IdentifierList

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

Example 8 with IdentifierList

use of net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList in project arctic-sea by 52North.

the class SensorMLDecoderV101Test method should_set_identifier_by_identifier_prefix_and_suffix.

@Test
public void should_set_identifier_by_identifier_prefix_and_suffix() throws DecodingException {
    SensorMLDocument xbSmlDoc = getSensorMLDoc();
    SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
    IdentifierList xbIdentifierList = xbSystem.addNewIdentification().addNewIdentifierList();
    String definiton = OGCConstants.URN_UNIQUE_IDENTIFIER_START + "anything" + OGCConstants.URN_UNIQUE_IDENTIFIER_END;
    addIdentifier(xbIdentifierList, "any name", definiton, TEST_ID_1);
    addIdentifier(xbIdentifierList, "any other 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)

Aggregations

IdentifierList (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList)7 SystemType (net.opengis.sensorML.x101.SystemType)6 Test (org.junit.Test)5 SensorMLDocument (net.opengis.sensorML.x101.SensorMLDocument)4 AbstractProcess (org.n52.shetland.ogc.sensorML.AbstractProcess)4 Identifier (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList.Identifier)3 Term (net.opengis.sensorML.x101.TermDocument.Term)2 SmlIdentifier (org.n52.shetland.ogc.sensorML.elements.SmlIdentifier)2 ComponentList (net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList)1 Component (net.opengis.sensorML.x101.ComponentsDocument.Components.ComponentList.Component)1 Identification (net.opengis.sensorML.x101.IdentificationDocument.Identification)1 SensorML (org.n52.shetland.ogc.sensorML.SensorML)1 System (org.n52.shetland.ogc.sensorML.System)1