Search in sources :

Example 6 with Observation

use of net.opengis.sos.x20.InsertObservationType.Observation in project arctic-sea by 52North.

the class InsertObservationRequestEncoderTest method shouldEncodeInsertObservationRequest.

@Test
public void shouldEncodeInsertObservationRequest() throws EncodingException, InvalidSridException, ParseException, DecodingException {
    InsertObservationRequest request = createInsertObservationRequest();
    XmlObject encodedRequest = encoder.create(request);
    XmlHelper.validateDocument(encodedRequest);
    Assert.assertThat(encodedRequest, Matchers.notNullValue());
    Assert.assertThat(encodedRequest, Matchers.instanceOf(InsertObservationDocument.class));
    InsertObservationType insertObservation = ((InsertObservationDocument) encodedRequest).getInsertObservation();
    Assert.assertThat(insertObservation.getOfferingArray(), Matchers.notNullValue());
    Assert.assertThat(insertObservation.getOfferingArray().length, Is.is(1));
    Assert.assertThat(insertObservation.getOfferingArray(0), Is.is(OFFERING_ID));
    Assert.assertThat(insertObservation.getObservationArray(), Matchers.notNullValue());
    Assert.assertThat(insertObservation.getObservationArray().length, Is.is(1));
// no check for observation values, because that MUST be part of OmEncoderv20Test
}
Also used : InsertObservationDocument(net.opengis.sos.x20.InsertObservationDocument) InsertObservationRequest(org.n52.shetland.ogc.sos.request.InsertObservationRequest) XmlObject(org.apache.xmlbeans.XmlObject) InsertObservationType(net.opengis.sos.x20.InsertObservationType) Test(org.junit.Test)

Example 7 with Observation

use of net.opengis.sos.x20.InsertObservationType.Observation 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

InsertObservationType (net.opengis.sos.x20.InsertObservationType)3 XmlObject (org.apache.xmlbeans.XmlObject)3 Test (org.junit.Test)3 InsertObservationRequest (org.n52.shetland.ogc.sos.request.InsertObservationRequest)3 HashMap (java.util.HashMap)2 InsertObservationDocument (net.opengis.sos.x20.InsertObservationDocument)2 SosInsertionMetadataType (net.opengis.sos.x20.SosInsertionMetadataType)2 ObservationStream (org.n52.shetland.ogc.om.ObservationStream)2 OmObservation (org.n52.shetland.ogc.om.OmObservation)2 OwsExceptionReport (org.n52.shetland.ogc.ows.exception.OwsExceptionReport)2 DecodingException (org.n52.svalbard.decode.exception.DecodingException)2 EncodingException (org.n52.svalbard.encode.exception.EncodingException)2 GetObservationByIdResponseDocument (net.opengis.sos.x20.GetObservationByIdResponseDocument)1 GetObservationByIdResponseType (net.opengis.sos.x20.GetObservationByIdResponseType)1 GetObservationResponseDocument (net.opengis.sos.x20.GetObservationResponseDocument)1 GetObservationResponseType (net.opengis.sos.x20.GetObservationResponseType)1 Observation (net.opengis.sos.x20.InsertObservationType.Observation)1 SosInsertionMetadataPropertyType (net.opengis.sos.x20.SosInsertionMetadataPropertyType)1 BooleanPropertyType (net.opengis.swe.x20.BooleanPropertyType)1 BooleanType (net.opengis.swe.x20.BooleanType)1