Search in sources :

Example 31 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class GetObservationRequestDecoderTest method hasProcedures.

@Test
public void hasProcedures() throws IOException, DecodingException {
    final GetObservationRequest req = loadMultiple();
    assertThat(req.getProcedures(), is(notNullValue()));
    assertThat(req.getProcedures(), hasSize(2));
    assertThat(req.getProcedures().get(0), is(notNullValue()));
    assertThat(req.getProcedures().get(0), is(equalTo("procedure1")));
    assertThat(req.getProcedures().get(1), is(notNullValue()));
    assertThat(req.getProcedures().get(1), is(equalTo("procedure2")));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Example 32 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class GetObservationRequestDecoderTest method loadMergeIntoArray.

protected GetObservationRequest loadMergeIntoArray() throws DecodingException, IOException {
    final JsonNode json = JsonLoader.fromResource("/examples/sos/GetObservationRequest-merge-into-array.json");
    final GetObservationRequest req = decoder.decodeJSON(json, true);
    assertThat(req, is(notNullValue()));
    return req;
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) JsonNode(com.fasterxml.jackson.databind.JsonNode)

Example 33 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class GetObservationRequestDecoderTest method loadSingle.

protected GetObservationRequest loadSingle() throws DecodingException, IOException {
    final JsonNode json = JsonLoader.fromResource("/examples/sos/GetObservationRequest-single.json");
    final GetObservationRequest req = decoder.decodeJSON(json, true);
    assertThat(req, is(notNullValue()));
    return req;
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) JsonNode(com.fasterxml.jackson.databind.JsonNode)

Example 34 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class GetObservationRequestDecoderTest method loadNoFilters.

protected GetObservationRequest loadNoFilters() throws DecodingException, IOException {
    final JsonNode json = JsonLoader.fromResource("/examples/sos/GetObservationRequest-no-filters.json");
    final GetObservationRequest req = decoder.decodeJSON(json, true);
    assertThat(req, is(notNullValue()));
    return req;
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) JsonNode(com.fasterxml.jackson.databind.JsonNode)

Example 35 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class GetObservationRequestDecoderTest method hasOfferings.

@Test
public void hasOfferings() throws IOException, DecodingException {
    final GetObservationRequest req = loadMultiple();
    assertThat(req.getOfferings(), is(notNullValue()));
    assertThat(req.getOfferings(), hasSize(2));
    assertThat(req.getOfferings().get(0), is(notNullValue()));
    assertThat(req.getOfferings().get(0), is(equalTo("offering1")));
    assertThat(req.getOfferings().get(1), is(notNullValue()));
    assertThat(req.getOfferings().get(1), is(equalTo("offering2")));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)92 DecodingException (org.n52.svalbard.decode.exception.DecodingException)63 XmlObject (org.apache.xmlbeans.XmlObject)52 JsonNode (com.fasterxml.jackson.databind.JsonNode)25 SweField (org.n52.shetland.ogc.swe.SweField)25 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)23 XmlException (org.apache.xmlbeans.XmlException)23 GetObservationRequest (org.n52.shetland.ogc.sos.request.GetObservationRequest)22 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)21 AbstractProcess (org.n52.shetland.ogc.sensorML.AbstractProcess)13 SystemType (net.opengis.sensorML.x101.SystemType)12 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)12 Before (org.junit.Before)11 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)11 SensorMLDocument (net.opengis.sensorML.x101.SensorMLDocument)10 DateTime (org.joda.time.DateTime)10 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)10 XmlString (org.apache.xmlbeans.XmlString)9 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)8 Geometry (org.locationtech.jts.geom.Geometry)8