use of net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities in project arctic-sea by 52North.
the class SensorMLEncoderV101Test method encodeSimpleDataRecord.
private SimpleDataRecordType encodeSimpleDataRecord(final SystemType xbSystem, final String capName, final int fields) {
assertThat(xbSystem.getCapabilitiesArray().length, is(1));
final Capabilities xbCapabilities = xbSystem.getCapabilitiesArray()[0];
assertThat(xbCapabilities.getName(), is(capName));
assertThat(xbCapabilities.getAbstractDataRecord(), notNullValue());
assertThat(xbCapabilities.getAbstractDataRecord(), instanceOf(SimpleDataRecordType.class));
final SimpleDataRecordType xbSimpleDataRecord = (SimpleDataRecordType) xbCapabilities.getAbstractDataRecord();
assertThat(xbSimpleDataRecord.getFieldArray().length, is(fields));
return xbSimpleDataRecord;
}
use of net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities in project arctic-sea by 52North.
the class SensorMLDecoderV101Test method should_decode_parent_procedures_from_sml.
@Test
public void should_decode_parent_procedures_from_sml() throws DecodingException {
SensorMLDocument xbSmlDoc = getSensorMLDoc();
SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
Capabilities xbCapabilities = xbSystem.addNewCapabilities();
xbCapabilities.setName(SensorMLConstants.ELEMENT_NAME_PARENT_PROCEDURES);
SimpleDataRecordType xbSimpleDataRecord = (SimpleDataRecordType) xbCapabilities.addNewAbstractDataRecord().substitute(SweConstants.QN_SIMPLEDATARECORD_SWE_101, SimpleDataRecordType.type);
addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_1, TEST_NAME_1);
addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_2, TEST_NAME_2);
AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
// assertThat(absProcess.getParentProcedures().size(), is(2));
assertThat(absProcess.getCapabilities().size(), is(1));
// List<String> parentProcedures = new ArrayList<String>(absProcess.getParentProcedures());
// Collections.sort(parentProcedures);
// assertThat(parentProcedures.get(0), is(TEST_ID_1));
// assertThat(parentProcedures.get(1), is(TEST_ID_2));
}
use of net.opengis.sensorML.x101.CapabilitiesDocument.Capabilities in project arctic-sea by 52North.
the class SensorMLDecoderV101Test method should_decode_offerings_from_sml.
@Test
public void should_decode_offerings_from_sml() throws DecodingException {
SensorMLDocument xbSmlDoc = getSensorMLDoc();
SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
Capabilities xbCapabilities = xbSystem.addNewCapabilities();
xbCapabilities.setName(SensorMLConstants.ELEMENT_NAME_OFFERINGS);
SimpleDataRecordType xbSimpleDataRecord = (SimpleDataRecordType) xbCapabilities.addNewAbstractDataRecord().substitute(SweConstants.QN_SIMPLEDATARECORD_SWE_101, SimpleDataRecordType.type);
addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_1, TEST_NAME_1);
addCapabilitiesInsertionMetadata(xbSimpleDataRecord, TEST_ID_2, TEST_NAME_2);
AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
// assertThat(absProcess.getOfferings().size(), is(2));
assertThat(absProcess.getCapabilities().size(), is(1));
// List<SosOffering> sosOfferings = new ArrayList<SosOffering>(absProcess.getOfferings());
// Collections.sort(sosOfferings);
// assertThat(sosOfferings.get(0).getIdentifier(), is(TEST_ID_1));
// assertThat(sosOfferings.get(0).getOfferingName(), is(TEST_NAME_1));
// assertThat(sosOfferings.get(1).getIdentifier(), is(TEST_ID_2));
// assertThat(sosOfferings.get(1).getOfferingName(), is(TEST_NAME_2));
}
Aggregations