Search in sources :

Example 11 with InsertResultTemplateRequest

use of org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest in project arctic-sea by 52North.

the class InsertResultTemplateRequestDecoderTest method offering.

@Test
public void offering() throws IOException, DecodingException {
    InsertResultTemplateRequest req = load();
    assertThat(req.getObservationTemplate(), is(notNullValue()));
    assertThat(req.getObservationTemplate().getOfferings(), hasSize(1));
    assertThat(req.getObservationTemplate().getOfferings(), hasItem("offering6"));
}
Also used : InsertResultTemplateRequest(org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest) Test(org.junit.Test)

Example 12 with InsertResultTemplateRequest

use of org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest in project arctic-sea by 52North.

the class InsertResultTemplateRequestEncoderTest method shouldThrowExceptionIfServiceIsMissing.

@Test
public void shouldThrowExceptionIfServiceIsMissing() throws EncodingException {
    thrown.expect(UnsupportedEncoderInputException.class);
    thrown.expectMessage(Is.is("Encoder " + InsertResultTemplateRequestEncoder.class.getSimpleName() + " can not encode 'missing service'"));
    encoder.create(new InsertResultTemplateRequest());
}
Also used : InsertResultTemplateRequest(org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest) Test(org.junit.Test)

Example 13 with InsertResultTemplateRequest

use of org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest in project arctic-sea by 52North.

the class InsertResultTemplateRequestEncoderTest method shouldThrowExceptionWhenOfferingIsMissing.

@Test
public void shouldThrowExceptionWhenOfferingIsMissing() throws EncodingException {
    thrown.expect(UnsupportedEncoderInputException.class);
    thrown.expectMessage(Is.is("Encoder " + InsertResultTemplateRequestEncoder.class.getSimpleName() + " can not encode 'missing offering'"));
    request = new InsertResultTemplateRequest("service", "version");
    request.setObservationTemplate(new OmObservationConstellation());
    encoder.create(request);
}
Also used : OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation) InsertResultTemplateRequest(org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest) Test(org.junit.Test)

Example 14 with InsertResultTemplateRequest

use of org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest in project arctic-sea by 52North.

the class InsertResultTemplateRequestEncoderTest method shouldThrowExceptionIfVersionIsMissing.

@Test
public void shouldThrowExceptionIfVersionIsMissing() throws EncodingException {
    thrown.expect(UnsupportedEncoderInputException.class);
    thrown.expectMessage(Is.is("Encoder " + InsertResultTemplateRequestEncoder.class.getSimpleName() + " can not encode 'missing version'"));
    encoder.create(new InsertResultTemplateRequest("service", ""));
}
Also used : InsertResultTemplateRequest(org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest) Test(org.junit.Test)

Aggregations

InsertResultTemplateRequest (org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest)14 Test (org.junit.Test)10 OmObservationConstellation (org.n52.shetland.ogc.om.OmObservationConstellation)6 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)3 SosResultStructure (org.n52.shetland.ogc.sos.SosResultStructure)2 SweField (org.n52.shetland.ogc.swe.SweField)2 SweTextEncoding (org.n52.shetland.ogc.swe.encoding.SweTextEncoding)2 SweTime (org.n52.shetland.ogc.swe.simpleType.SweTime)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 GetResultTemplateType (net.opengis.sos.x20.GetResultTemplateType)1 InsertResultTemplateType (net.opengis.sos.x20.InsertResultTemplateType)1 ResultTemplateType (net.opengis.sos.x20.ResultTemplateType)1 XmlException (org.apache.xmlbeans.XmlException)1 XmlOptions (org.apache.xmlbeans.XmlOptions)1 Before (org.junit.Before)1 CodeType (org.n52.shetland.ogc.gml.CodeType)1 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)1 OmObservableProperty (org.n52.shetland.ogc.om.OmObservableProperty)1 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)1 SensorML (org.n52.shetland.ogc.sensorML.SensorML)1