Search in sources :

Example 6 with GetObservationRequest

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

the class GetObservationRequestDecoderTest method hasMergeObservationsIntoDataArrayExtension.

@Test
public void hasMergeObservationsIntoDataArrayExtension() throws IOException, DecodingException {
    final GetObservationRequest req = loadMergeIntoArray();
    assertThat(req.getBooleanExtension("MergeObservationsIntoDataArray"), is(true));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Example 7 with GetObservationRequest

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

the class GetObservationRequestDecoderTest method hasSingleTemporalFilter.

@Test
public void hasSingleTemporalFilter() throws IOException, DecodingException {
    final GetObservationRequest req = loadSingle();
    assertThat(req.getTemporalFilters(), is(notNullValue()));
    assertThat(req.getTemporalFilters(), hasSize(1));
    assertThat(req.getTemporalFilters().get(0), is(notNullValue()));
    assertThat(req.getTemporalFilters().get(0).getOperator(), is(TimeOperator.TM_Equals));
    assertThat(req.getTemporalFilters().get(0).getValueReference(), is("om:phenomenonTime"));
    assertThat(req.getTemporalFilters().get(0).getTime(), is(instanceOf(TimePeriod.class)));
    final TimePeriod time = (TimePeriod) req.getTemporalFilters().get(0).getTime();
    assertThat(time.getStart(), is(equalTo(new DateTime(2013, 01, 01, 00, 00, 00, 00, DateTimeZone.forOffsetHours(2)))));
    assertThat(time.getEnd(), is(equalTo(new DateTime(2013, 01, 01, 01, 00, 00, 00, DateTimeZone.forOffsetHours(2)))));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) TimePeriod(org.n52.shetland.ogc.gml.time.TimePeriod) DateTime(org.joda.time.DateTime) Test(org.junit.Test)

Example 8 with GetObservationRequest

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

the class GetObservationRequestDecoderTest method hasMultipleTemporalFilters.

@Test
public void hasMultipleTemporalFilters() throws IOException, DecodingException {
    final GetObservationRequest req = loadMultiple();
    assertThat(req.getTemporalFilters(), is(notNullValue()));
    assertThat(req.getTemporalFilters(), hasSize(2));
    assertThat(req.getTemporalFilters().get(0), is(notNullValue()));
    assertThat(req.getTemporalFilters().get(0).getOperator(), is(TimeOperator.TM_Equals));
    assertThat(req.getTemporalFilters().get(0).getValueReference(), is("om:phenomenonTime"));
    assertThat(req.getTemporalFilters().get(0).getTime(), is(instanceOf(TimePeriod.class)));
    final TimePeriod time1 = (TimePeriod) req.getTemporalFilters().get(0).getTime();
    assertThat(time1.getStart(), is(equalTo(new DateTime(2013, 01, 01, 00, 00, 00, 00, DateTimeZone.forOffsetHours(2)))));
    assertThat(time1.getEnd(), is(equalTo(new DateTime(2013, 01, 01, 01, 00, 00, 00, DateTimeZone.forOffsetHours(2)))));
    assertThat(req.getTemporalFilters().get(1), is(notNullValue()));
    assertThat(req.getTemporalFilters().get(1).getOperator(), is(TimeOperator.TM_Equals));
    assertThat(req.getTemporalFilters().get(1).getValueReference(), is("om:phenomenonTime"));
    assertThat(req.getTemporalFilters().get(1).getTime(), is(instanceOf(TimePeriod.class)));
    final TimePeriod time2 = (TimePeriod) req.getTemporalFilters().get(1).getTime();
    assertThat(time2.getStart(), is(equalTo(new DateTime(2013, 01, 01, 20, 00, 00, 00, DateTimeZone.forOffsetHours(2)))));
    assertThat(time2.getEnd(), is(equalTo(new DateTime(2013, 01, 01, 22, 00, 00, 00, DateTimeZone.forOffsetHours(2)))));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) TimePeriod(org.n52.shetland.ogc.gml.time.TimePeriod) DateTime(org.joda.time.DateTime) Test(org.junit.Test)

Example 9 with GetObservationRequest

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

the class GetObservationRequestDecoderTest method hasFeatureOfInterest.

@Test
public void hasFeatureOfInterest() throws IOException, DecodingException {
    final GetObservationRequest req = loadSingle();
    assertThat(req.getFeatureIdentifiers(), is(notNullValue()));
    assertThat(req.getFeatureIdentifiers(), hasSize(1));
    assertThat(req.getFeatureIdentifiers().get(0), is(notNullValue()));
    assertThat(req.getFeatureIdentifiers().get(0), is(equalTo("featureOfInterest1")));
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) Test(org.junit.Test)

Example 10 with GetObservationRequest

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

the class GetObservationRequestDecoderTest method hasOffering.

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

Aggregations

GetObservationRequest (org.n52.shetland.ogc.sos.request.GetObservationRequest)22 Test (org.junit.Test)15 JsonNode (com.fasterxml.jackson.databind.JsonNode)4 OwsServiceCommunicationObject (org.n52.shetland.ogc.ows.service.OwsServiceCommunicationObject)3 GetObservationDocument (net.opengis.sos.x20.GetObservationDocument)2 DateTime (org.joda.time.DateTime)2 TimePeriod (org.n52.shetland.ogc.gml.time.TimePeriod)2 DecodingException (org.n52.svalbard.decode.exception.DecodingException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 TRUE (java.lang.Boolean.TRUE)1 Arrays (java.util.Arrays)1 Set (java.util.Set)1 GetFeatureOfInterest (net.opengis.sos.x10.GetFeatureOfInterestDocument.GetFeatureOfInterest)1 GetObservation (net.opengis.sos.x10.GetObservationDocument.GetObservation)1 FeatureOfInterest (net.opengis.sos.x10.GetObservationDocument.GetObservation.FeatureOfInterest)1 GetObservationType (net.opengis.sos.x20.GetObservationType)1 InsertResultTemplateDocument (net.opengis.sos.x20.InsertResultTemplateDocument)1 XmlException (org.apache.xmlbeans.XmlException)1 XmlObject (org.apache.xmlbeans.XmlObject)1 XmlOptions (org.apache.xmlbeans.XmlOptions)1