use of org.n52.svalbard.decode.exception.DecodingException 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));
}
use of org.n52.svalbard.decode.exception.DecodingException 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)))));
}
use of org.n52.svalbard.decode.exception.DecodingException 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)))));
}
use of org.n52.svalbard.decode.exception.DecodingException 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")));
}
use of org.n52.svalbard.decode.exception.DecodingException 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")));
}
Aggregations