use of net.opengis.tsml.x10.TimeseriesMetadataType in project arctic-sea by 52North.
the class TsmlTVPEncoderv10Test method shouldSetDefaultCumulativeProperty.
@Test
public void shouldSetDefaultCumulativeProperty() throws EncodingException {
XmlObject encodedElement = encoder.encode(mv);
MatcherAssert.assertThat(encodedElement, CoreMatchers.instanceOf(TimeseriesTVPDocument.class));
final TimeseriesTVPDocument timeseriesDocument = (TimeseriesTVPDocument) encodedElement;
MatcherAssert.assertThat(timeseriesDocument.getTimeseriesTVP().isSetMetadata(), Is.is(true));
MatcherAssert.assertThat(timeseriesDocument.getTimeseriesTVP().getMetadata().getTimeseriesMetadata(), CoreMatchers.instanceOf(TimeseriesMetadataType.class));
final TimeseriesMetadataType measurementTimeseriesMetadataType = timeseriesDocument.getTimeseriesTVP().getMetadata().getTimeseriesMetadata();
MatcherAssert.assertThat(measurementTimeseriesMetadataType.isSetCumulative(), Is.is(true));
MatcherAssert.assertThat(measurementTimeseriesMetadataType.getCumulative(), Is.is(false));
}
use of net.opengis.tsml.x10.TimeseriesMetadataType in project arctic-sea by 52North.
the class TsmlTVPEncoderv10 method addTimeseriesMetadata.
private void addTimeseriesMetadata(TimeseriesTVPType mtt, String gmlId, TimeseriesMetadata timeseriesMetadata) {
TimeseriesMetadataType mtmt = (TimeseriesMetadataType) mtt.addNewMetadata().addNewTimeseriesMetadata().substitute(TimeseriesMLConstants.QN_MEASUREMENT_TIMESERIES_METADATA, TimeseriesMetadataType.type);
createMeasurementTimeseriesMetadataType(mtmt, gmlId);
if (timeseriesMetadata != null && timeseriesMetadata.getClass().isAssignableFrom(MeasurementTimeseriesMetadata.class)) {
mtmt.setCumulative(((MeasurementTimeseriesMetadata) timeseriesMetadata).isCumulative());
}
}
Aggregations