Search in sources :

Example 51 with Encoder

use of org.n52.svalbard.encode.Encoder in project arctic-sea by 52North.

the class InsertSensorRequestEncoderTest method shouldThrowExceptionIfVersionIsMissing.

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

Example 52 with Encoder

use of org.n52.svalbard.encode.Encoder in project arctic-sea by 52North.

the class InsertSensorRequestEncoderTest method shouldThrowExceptionWhenProcedureDescriptionFormatIsMissing.

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

Example 53 with Encoder

use of org.n52.svalbard.encode.Encoder in project arctic-sea by 52North.

the class InsertSensorRequestEncoderTest method shouldThrowExceptionIfServiceIsMissing.

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

Example 54 with Encoder

use of org.n52.svalbard.encode.Encoder in project arctic-sea by 52North.

the class InsertSensorRequestEncoderTest method shouldThrowExceptionWhenObservablePropertyIsMissing.

@Test
public void shouldThrowExceptionWhenObservablePropertyIsMissing() throws EncodingException {
    thrown.expect(UnsupportedEncoderInputException.class);
    thrown.expectMessage(Is.is("Encoder " + InsertSensorRequestEncoder.class.getSimpleName() + " can not encode 'observed property missing'"));
    InsertSensorRequest request = new InsertSensorRequest("service", "version");
    request.setProcedureDescriptionFormat("test-format");
    request.setProcedureDescription(createProcedureDescription());
    encoder.create(request);
}
Also used : InsertSensorRequest(org.n52.shetland.ogc.sos.request.InsertSensorRequest) Test(org.junit.Test)

Example 55 with Encoder

use of org.n52.svalbard.encode.Encoder in project arctic-sea by 52North.

the class OmEncoderv20Test method shouldThrowExceptionWhenReceivedInvalidObservationTypeInObservationTemplate.

@Test
public void shouldThrowExceptionWhenReceivedInvalidObservationTypeInObservationTemplate() throws EncodingException {
    thrown.expect(UnsupportedEncoderInputException.class);
    thrown.expectMessage(Is.is("Encoder " + OmEncoderv20.class.getSimpleName() + " can not encode 'missing type in OM_Observation'"));
    omEncoderv20.encode(new OmObservationConstellation());
}
Also used : OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)28 XmlObject (org.apache.xmlbeans.XmlObject)19 EncodingException (org.n52.svalbard.encode.exception.EncodingException)17 XmlOptions (org.apache.xmlbeans.XmlOptions)7 InsertResultTemplateRequest (org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest)7 InsertSensorRequest (org.n52.shetland.ogc.sos.request.InsertSensorRequest)7 Before (org.junit.Before)6 OmObservation (org.n52.shetland.ogc.om.OmObservation)5 OmObservationConstellation (org.n52.shetland.ogc.om.OmObservationConstellation)5 OwsExceptionReport (org.n52.shetland.ogc.ows.exception.OwsExceptionReport)5 OwsOperationKey (org.n52.shetland.ogc.ows.service.OwsOperationKey)5 InsertObservationRequest (org.n52.shetland.ogc.sos.request.InsertObservationRequest)5 NoEncoderForKeyException (org.n52.svalbard.encode.exception.NoEncoderForKeyException)5 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)4 ObservationStream (org.n52.shetland.ogc.om.ObservationStream)4 OwsServiceResponse (org.n52.shetland.ogc.ows.service.OwsServiceResponse)4 InsertResultRequest (org.n52.shetland.ogc.sos.request.InsertResultRequest)4 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)4 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)4 CodeType (org.n52.shetland.ogc.gml.CodeType)3