Search in sources :

Example 1 with TimeseriesMetadataType

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));
}
Also used : TimeseriesMetadataType(net.opengis.tsml.x10.TimeseriesMetadataType) TimeseriesTVPDocument(net.opengis.tsml.x10.TimeseriesTVPDocument) XmlObject(org.apache.xmlbeans.XmlObject) Test(org.junit.jupiter.api.Test)

Example 2 with TimeseriesMetadataType

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());
    }
}
Also used : TimeseriesMetadataType(net.opengis.tsml.x10.TimeseriesMetadataType) MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.MeasurementTimeseriesMetadata)

Aggregations

TimeseriesMetadataType (net.opengis.tsml.x10.TimeseriesMetadataType)2 TimeseriesTVPDocument (net.opengis.tsml.x10.TimeseriesTVPDocument)1 XmlObject (org.apache.xmlbeans.XmlObject)1 Test (org.junit.jupiter.api.Test)1 MeasurementTimeseriesMetadata (org.n52.shetland.ogc.om.series.MeasurementTimeseriesMetadata)1