use of org.n52.shetland.ogc.sensorML.v20.SmlDataInterface in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseDataInterfaceType.
protected SmlDataInterface parseDataInterfaceType(DataInterfaceType xbDataInterface) throws DecodingException {
SmlDataInterface dataInterface = new SmlDataInterface();
// TODO implement- no funding at the moment available
// When starting implementation: Do not forget to activate the already
// available unit tests
Object data = decodeXmlElement(xbDataInterface.getData());
if (data instanceof SweDataStream) {
dataInterface.setData((SweDataStream) data);
}
if (xbDataInterface.isSetInterfaceParameters()) {
Object parameter = decodeXmlElement(xbDataInterface.getInterfaceParameters());
if (parameter instanceof SweDataRecord) {
dataInterface.setInputParameters((SweDataRecord) parameter);
}
// TODO throw exception if not instance of SweDataRecord
}
return dataInterface;
}
use of org.n52.shetland.ogc.sensorML.v20.SmlDataInterface in project arctic-sea by 52North.
the class SensorMLDecoderV20Test method shouldDecodeDataInterface.
@Test
@Ignore("not yet implemented")
public void shouldDecodeDataInterface() throws DecodingException {
DataInterfaceType xbDataInterface = DataInterfaceType.Factory.newInstance();
SmlDataInterface parsedDataInterface = getDecoder().parseDataInterfaceType(xbDataInterface);
assertThat(parsedDataInterface, is(notNullValue()));
}
use of org.n52.shetland.ogc.sensorML.v20.SmlDataInterface in project arctic-sea by 52North.
the class SensorMLDecoderV20Test method shouldDecodeDataInterfaceInterfaceParameters.
@Test
@Ignore("not yet implemented")
public void shouldDecodeDataInterfaceInterfaceParameters() throws DecodingException {
DataInterfaceType xbDataInterface = DataInterfaceType.Factory.newInstance();
DataRecordPropertyType xbInterfaceParameters = xbDataInterface.addNewInterfaceParameters();
Field field = xbInterfaceParameters.addNewDataRecord().addNewField();
field.setName("test-field-name");
SmlDataInterface parsedDataInterface = getDecoder().parseDataInterfaceType(xbDataInterface);
assertThat(parsedDataInterface.isSetInterfaceParameters(), is(true));
assertThat(parsedDataInterface.getInterfaceParameters(), CoreMatchers.isA(SweDataRecord.class));
}
use of org.n52.shetland.ogc.sensorML.v20.SmlDataInterface in project arctic-sea by 52North.
the class SensorMLDecoderV20Test method shouldDecodeDataInterfaceData.
@Test
@Ignore("not yet implemented")
public void shouldDecodeDataInterfaceData() throws DecodingException {
DataInterfaceType xbDataInterface = DataInterfaceType.Factory.newInstance();
xbDataInterface.addNewData();
SmlDataInterface parsedDataInterface = getDecoder().parseDataInterfaceType(xbDataInterface);
assertThat(parsedDataInterface.getData(), is(notNullValue()));
}
Aggregations