Search in sources :

Example 6 with InsertSensorDocument

use of net.opengis.swes.x20.InsertSensorDocument in project arctic-sea by 52North.

the class InsertSensorRequestEncoderTest method shouldEncodeProcedureDescriptionFormat.

@Test
public void shouldEncodeProcedureDescriptionFormat() throws EncodingException {
    XmlObject xmlObject = encoder.create(request);
    Assert.assertThat(xmlObject, CoreMatchers.instanceOf(InsertSensorDocument.class));
    Assert.assertThat(((InsertSensorDocument) xmlObject).getInsertSensor().getProcedureDescriptionFormat(), Is.is(SensorML20Constants.SENSORML_20_OUTPUT_FORMAT_URL));
}
Also used : InsertSensorDocument(net.opengis.swes.x20.InsertSensorDocument) XmlObject(org.apache.xmlbeans.XmlObject) Test(org.junit.Test)

Example 7 with InsertSensorDocument

use of net.opengis.swes.x20.InsertSensorDocument in project arctic-sea by 52North.

the class InsertSensorRequestEncoderTest method shouldEncodeSosInsertionMetadata.

@Test
public void shouldEncodeSosInsertionMetadata() throws EncodingException {
    InsertSensorDocument isd = (InsertSensorDocument) encoder.create(request);
    Assert.assertThat(isd.getInsertSensor().getMetadataArray().length, Is.is(1));
    Assert.assertThat(isd.getInsertSensor().getMetadataArray(0).getInsertionMetadata(), CoreMatchers.instanceOf(SosInsertionMetadataType.class));
    SosInsertionMetadataType insertionMetadata = (SosInsertionMetadataType) isd.getInsertSensor().getMetadataArray(0).getInsertionMetadata();
    Assert.assertThat(insertionMetadata.getFeatureOfInterestTypeArray(), CoreMatchers.notNullValue());
    List<String> foiTypes = Arrays.asList(insertionMetadata.getFeatureOfInterestTypeArray());
    Assert.assertThat(foiTypes, Matchers.hasSize(2));
    Assert.assertThat(foiTypes, Matchers.containsInAnyOrder("test-foi-type-1", "test-foi-type-2"));
    Assert.assertThat(insertionMetadata.getObservationTypeArray(), CoreMatchers.notNullValue());
    List<String> oTypes = Arrays.asList(insertionMetadata.getObservationTypeArray());
    Assert.assertThat(oTypes, Matchers.hasSize(2));
    Assert.assertThat(oTypes, Matchers.containsInAnyOrder("test-observation-type-1", "test-observation-type-2"));
}
Also used : InsertSensorDocument(net.opengis.swes.x20.InsertSensorDocument) SosInsertionMetadataType(net.opengis.sos.x20.SosInsertionMetadataType) Test(org.junit.Test)

Aggregations

InsertSensorDocument (net.opengis.swes.x20.InsertSensorDocument)6 Test (org.junit.Test)4 XmlObject (org.apache.xmlbeans.XmlObject)3 InsertSensorType (net.opengis.swes.x20.InsertSensorType)2 SosProcedureDescription (org.n52.shetland.ogc.sos.SosProcedureDescription)2 SosInsertionMetadataType (net.opengis.sos.x20.SosInsertionMetadataType)1 DeleteSensorDocument (net.opengis.swes.x20.DeleteSensorDocument)1 DescribeSensorDocument (net.opengis.swes.x20.DescribeSensorDocument)1 ProcedureDescription (net.opengis.swes.x20.InsertSensorType.ProcedureDescription)1 UpdateSensorDescriptionDocument (net.opengis.swes.x20.UpdateSensorDescriptionDocument)1 XmlException (org.apache.xmlbeans.XmlException)1 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)1 OwsServiceCommunicationObject (org.n52.shetland.ogc.ows.service.OwsServiceCommunicationObject)1 InsertSensorRequest (org.n52.shetland.ogc.sos.request.InsertSensorRequest)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1 UnsupportedDecoderXmlInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderXmlInputException)1