use of org.geotoolkit.sml.xml.v101.SystemType in project arctic-sea by 52North.
the class SensorMLDecoderV101Test method should_decode_features_of_interest_from_sml.
@Test
public void should_decode_features_of_interest_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_FEATURES_OF_INTEREST);
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.getFeaturesOfInterest().size(), is(2));
assertThat(absProcess.getCapabilities().size(), is(1));
// List<String> featuresOfInterest = new ArrayList<String>(absProcess.getFeaturesOfInterest());
// Collections.sort(featuresOfInterest);
// assertThat(featuresOfInterest.get(0), is(TEST_ID_1));
// assertThat(featuresOfInterest.get(1), is(TEST_ID_2));
}
use of org.geotoolkit.sml.xml.v101.SystemType in project arctic-sea by 52North.
the class SensorMLDecoderV101Test method should_set_identifier_by_identifier_definition.
@Test
public void should_set_identifier_by_identifier_definition() throws DecodingException {
SensorMLDocument xbSmlDoc = getSensorMLDoc();
SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
IdentifierList xbIdentifierList = xbSystem.addNewIdentification().addNewIdentifierList();
addIdentifier(xbIdentifierList, "any name", OGCConstants.URN_UNIQUE_IDENTIFIER, TEST_ID_1);
addIdentifier(xbIdentifierList, "any other name", null, TEST_ID_2);
AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
assertThat(absProcess.getIdentifier(), is(TEST_ID_1));
assertThat(absProcess.getIdentifications().size(), is(2));
}
use of org.geotoolkit.sml.xml.v101.SystemType in project arctic-sea by 52North.
the class SensorMLDecoderV101Test method should_set_gml_id.
@Test
public void should_set_gml_id() throws DecodingException {
SensorMLDocument xbSmlDoc = getSensorMLDoc();
SystemType xbSystem = (SystemType) xbSmlDoc.getSensorML().addNewMember().addNewProcess().substitute(SensorMLConstants.SYSTEM_QNAME, SystemType.type);
xbSystem.setId(TEST_ID_1);
AbstractProcess absProcess = decodeAbstractProcess(xbSmlDoc);
assertThat(absProcess.getGmlId(), is(TEST_ID_1));
}
use of org.geotoolkit.sml.xml.v101.SystemType in project osate2 by osate.
the class AbstractAadl2SemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == Aadl2Package.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case Aadl2Package.AADL_BOOLEAN:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getBooleanTypeRule()) {
sequence_BooleanType(context, (AadlBoolean) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedBooleanTypeRule()) {
sequence_UnnamedBooleanType(context, (AadlBoolean) semanticObject);
return;
} else
break;
case Aadl2Package.AADL_INTEGER:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getIntegerTypeRule()) {
sequence_IntegerType(context, (AadlInteger) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedIntegerTypeRule()) {
sequence_UnnamedIntegerType(context, (AadlInteger) semanticObject);
return;
} else
break;
case Aadl2Package.AADL_PACKAGE:
sequence_AadlPackage(context, (AadlPackage) semanticObject);
return;
case Aadl2Package.AADL_REAL:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getRealTypeRule()) {
sequence_RealType(context, (AadlReal) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedRealTypeRule()) {
sequence_UnnamedRealType(context, (AadlReal) semanticObject);
return;
} else
break;
case Aadl2Package.AADL_STRING:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getStringTypeRule()) {
sequence_StringType(context, (AadlString) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedStringTypeRule()) {
sequence_UnnamedStringType(context, (AadlString) semanticObject);
return;
} else
break;
case Aadl2Package.ABSTRACT_FEATURE:
sequence_AbstractFeature(context, (AbstractFeature) semanticObject);
return;
case Aadl2Package.ABSTRACT_IMPLEMENTATION:
sequence_AbstractImplementation(context, (AbstractImplementation) semanticObject);
return;
case Aadl2Package.ABSTRACT_PROTOTYPE:
sequence_AbstractPrototype(context, (AbstractPrototype) semanticObject);
return;
case Aadl2Package.ABSTRACT_SUBCOMPONENT:
sequence_AbstractSubcomponent(context, (AbstractSubcomponent) semanticObject);
return;
case Aadl2Package.ABSTRACT_TYPE:
sequence_AbstractType(context, (AbstractType) semanticObject);
return;
case Aadl2Package.ACCESS_CONNECTION:
sequence_AccessConnection(context, (AccessConnection) semanticObject);
return;
case Aadl2Package.ACCESS_SPECIFICATION:
sequence_AccessSpecification(context, (AccessSpecification) semanticObject);
return;
case Aadl2Package.ARRAY_DIMENSION:
sequence_ArrayDimension(context, (ArrayDimension) semanticObject);
return;
case Aadl2Package.ARRAY_RANGE:
sequence_ArrayRange(context, (ArrayRange) semanticObject);
return;
case Aadl2Package.ARRAY_SIZE:
sequence_ArraySize(context, (ArraySize) semanticObject);
return;
case Aadl2Package.BASIC_PROPERTY:
sequence_RecordField(context, (BasicProperty) semanticObject);
return;
case Aadl2Package.BASIC_PROPERTY_ASSOCIATION:
sequence_FieldPropertyAssociation(context, (BasicPropertyAssociation) semanticObject);
return;
case Aadl2Package.BOOLEAN_LITERAL:
sequence_BooleanLiteral(context, (BooleanLiteral) semanticObject);
return;
case Aadl2Package.BUS_ACCESS:
sequence_BusAccess(context, (BusAccess) semanticObject);
return;
case Aadl2Package.BUS_IMPLEMENTATION:
sequence_BusImplementation(context, (BusImplementation) semanticObject);
return;
case Aadl2Package.BUS_PROTOTYPE:
sequence_BusPrototype(context, (BusPrototype) semanticObject);
return;
case Aadl2Package.BUS_SUBCOMPONENT:
sequence_BusSubcomponent(context, (BusSubcomponent) semanticObject);
return;
case Aadl2Package.BUS_TYPE:
sequence_BusType(context, (BusType) semanticObject);
return;
case Aadl2Package.CLASSIFIER_TYPE:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getClassifierTypeRule()) {
sequence_ClassifierType(context, (ClassifierType) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedClassifierTypeRule()) {
sequence_UnnamedClassifierType(context, (ClassifierType) semanticObject);
return;
} else
break;
case Aadl2Package.CLASSIFIER_VALUE:
if (rule == grammarAccess.getConstantPropertyExpressionRule() || rule == grammarAccess.getPropertyExpressionRule() || rule == grammarAccess.getComponentClassifierTermRule()) {
sequence_ComponentClassifierTerm(context, (ClassifierValue) semanticObject);
return;
} else if (rule == grammarAccess.getQCReferenceRule() || rule == grammarAccess.getPropertyOwnerRule()) {
sequence_QCReference(context, (ClassifierValue) semanticObject);
return;
} else
break;
case Aadl2Package.COMPONENT_IMPLEMENTATION_REFERENCE:
sequence_ComponentImplementationReference(context, (ComponentImplementationReference) semanticObject);
return;
case Aadl2Package.COMPONENT_PROTOTYPE_ACTUAL:
sequence_ComponentReference(context, (ComponentPrototypeActual) semanticObject);
return;
case Aadl2Package.COMPONENT_PROTOTYPE_BINDING:
sequence_ComponentPrototypeBinding(context, (ComponentPrototypeBinding) semanticObject);
return;
case Aadl2Package.COMPONENT_TYPE_RENAME:
sequence_CTRename(context, (ComponentTypeRename) semanticObject);
return;
case Aadl2Package.COMPUTED_VALUE:
sequence_ComputedTerm(context, (ComputedValue) semanticObject);
return;
case Aadl2Package.CONNECTED_ELEMENT:
if (rule == grammarAccess.getConnectedElementChainRule()) {
sequence_ConnectedElementChain(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getConnectedElementRule()) {
sequence_ConnectedElement(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getAbstractConnectionEndRule()) {
sequence_ConnectedElement_InternalEvent_ProcessorPort(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getNestedConnectedElementRule()) {
sequence_ConnectedElement_NestedConnectedElement(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getProcessorConnectionEndRule()) {
sequence_ConnectedElement_ProcessorPort(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getAccessConnectionEndRule()) {
sequence_ConnectedElement_ProcessorSubprogram(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getInternalEventRule()) {
sequence_InternalEvent(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getProcessorPortRule()) {
sequence_ProcessorPort(context, (ConnectedElement) semanticObject);
return;
} else if (rule == grammarAccess.getProcessorSubprogramRule()) {
sequence_ProcessorSubprogram(context, (ConnectedElement) semanticObject);
return;
} else
break;
case Aadl2Package.CONTAINED_NAMED_ELEMENT:
sequence_ContainmentPath(context, (ContainedNamedElement) semanticObject);
return;
case Aadl2Package.CONTAINMENT_PATH_ELEMENT:
sequence_ContainmentPathElement(context, (ContainmentPathElement) semanticObject);
return;
case Aadl2Package.DATA_ACCESS:
sequence_DataAccess(context, (DataAccess) semanticObject);
return;
case Aadl2Package.DATA_IMPLEMENTATION:
sequence_DataImplementation(context, (DataImplementation) semanticObject);
return;
case Aadl2Package.DATA_PORT:
sequence_DataPort(context, (DataPort) semanticObject);
return;
case Aadl2Package.DATA_PROTOTYPE:
sequence_DataPrototype(context, (DataPrototype) semanticObject);
return;
case Aadl2Package.DATA_SUBCOMPONENT:
sequence_DataSubcomponent(context, (DataSubcomponent) semanticObject);
return;
case Aadl2Package.DATA_TYPE:
sequence_DataType(context, (DataType) semanticObject);
return;
case Aadl2Package.DEFAULT_ANNEX_LIBRARY:
sequence_DefaultAnnexLibrary(context, (DefaultAnnexLibrary) semanticObject);
return;
case Aadl2Package.DEFAULT_ANNEX_SUBCLAUSE:
sequence_DefaultAnnexSubclause(context, (DefaultAnnexSubclause) semanticObject);
return;
case Aadl2Package.DEVICE_IMPLEMENTATION:
sequence_DeviceImplementation(context, (DeviceImplementation) semanticObject);
return;
case Aadl2Package.DEVICE_PROTOTYPE:
sequence_DevicePrototype(context, (DevicePrototype) semanticObject);
return;
case Aadl2Package.DEVICE_SUBCOMPONENT:
sequence_DeviceSubcomponent(context, (DeviceSubcomponent) semanticObject);
return;
case Aadl2Package.DEVICE_TYPE:
sequence_DeviceType(context, (DeviceType) semanticObject);
return;
case Aadl2Package.END_TO_END_FLOW:
sequence_EndToEndFlow(context, (EndToEndFlow) semanticObject);
return;
case Aadl2Package.END_TO_END_FLOW_SEGMENT:
if (rule == grammarAccess.getETEConnectionFlowRule()) {
sequence_ETEConnectionFlow(context, (EndToEndFlowSegment) semanticObject);
return;
} else if (rule == grammarAccess.getETESubcomponentFlowRule()) {
sequence_ETESubcomponentFlow(context, (EndToEndFlowSegment) semanticObject);
return;
} else
break;
case Aadl2Package.ENUMERATION_LITERAL:
sequence_EnumerationLiteral(context, (EnumerationLiteral) semanticObject);
return;
case Aadl2Package.ENUMERATION_TYPE:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getEnumerationTypeRule()) {
sequence_EnumerationType(context, (EnumerationType) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedEnumerationTypeRule()) {
sequence_UnnamedEnumerationType(context, (EnumerationType) semanticObject);
return;
} else
break;
case Aadl2Package.EVENT_DATA_PORT:
sequence_EventDataPort(context, (EventDataPort) semanticObject);
return;
case Aadl2Package.EVENT_DATA_SOURCE:
sequence_EventDataSource(context, (EventDataSource) semanticObject);
return;
case Aadl2Package.EVENT_PORT:
sequence_EventPort(context, (EventPort) semanticObject);
return;
case Aadl2Package.EVENT_SOURCE:
sequence_EventSource(context, (EventSource) semanticObject);
return;
case Aadl2Package.FEATURE_CONNECTION:
sequence_FeatureConnection(context, (FeatureConnection) semanticObject);
return;
case Aadl2Package.FEATURE_GROUP:
sequence_FeatureGroup(context, (FeatureGroup) semanticObject);
return;
case Aadl2Package.FEATURE_GROUP_CONNECTION:
sequence_FeatureGroupConnection(context, (FeatureGroupConnection) semanticObject);
return;
case Aadl2Package.FEATURE_GROUP_PROTOTYPE:
sequence_FeatureGroupPrototype(context, (FeatureGroupPrototype) semanticObject);
return;
case Aadl2Package.FEATURE_GROUP_PROTOTYPE_ACTUAL:
sequence_FeatureGroupPrototypeActual(context, (FeatureGroupPrototypeActual) semanticObject);
return;
case Aadl2Package.FEATURE_GROUP_PROTOTYPE_BINDING:
sequence_FeatureGroupPrototypeBinding(context, (FeatureGroupPrototypeBinding) semanticObject);
return;
case Aadl2Package.FEATURE_GROUP_TYPE:
sequence_FeatureGroupType(context, (FeatureGroupType) semanticObject);
return;
case Aadl2Package.FEATURE_GROUP_TYPE_RENAME:
sequence_FGTRename(context, (FeatureGroupTypeRename) semanticObject);
return;
case Aadl2Package.FEATURE_PROTOTYPE:
sequence_FeaturePrototype(context, (FeaturePrototype) semanticObject);
return;
case Aadl2Package.FEATURE_PROTOTYPE_BINDING:
sequence_FeaturePrototypeBinding(context, (FeaturePrototypeBinding) semanticObject);
return;
case Aadl2Package.FEATURE_PROTOTYPE_REFERENCE:
sequence_FeaturePrototypeReference(context, (FeaturePrototypeReference) semanticObject);
return;
case Aadl2Package.FLOW_END:
sequence_FlowEnd(context, (FlowEnd) semanticObject);
return;
case Aadl2Package.FLOW_IMPLEMENTATION:
if (rule == grammarAccess.getFlowPathImplRule()) {
sequence_FlowPathImpl(context, (FlowImplementation) semanticObject);
return;
} else if (rule == grammarAccess.getFlowImplementationRule()) {
sequence_FlowPathImpl_FlowSinkImpl_FlowSourceImpl(context, (FlowImplementation) semanticObject);
return;
} else if (rule == grammarAccess.getFlowSinkImplRule()) {
sequence_FlowSinkImpl(context, (FlowImplementation) semanticObject);
return;
} else if (rule == grammarAccess.getFlowSourceImplRule()) {
sequence_FlowSourceImpl(context, (FlowImplementation) semanticObject);
return;
} else
break;
case Aadl2Package.FLOW_SEGMENT:
if (rule == grammarAccess.getConnectionFlowRule()) {
sequence_ConnectionFlow(context, (FlowSegment) semanticObject);
return;
} else if (rule == grammarAccess.getSubcomponentFlowRule()) {
sequence_SubcomponentFlow(context, (FlowSegment) semanticObject);
return;
} else
break;
case Aadl2Package.FLOW_SPECIFICATION:
if (rule == grammarAccess.getFlowSpecificationRule()) {
sequence_FlowPathSpec_FlowSinkSpec_FlowSourceSpec_FlowSpecRefinement(context, (FlowSpecification) semanticObject);
return;
} else if (rule == grammarAccess.getFlowPathSpecRule()) {
sequence_FlowPathSpec(context, (FlowSpecification) semanticObject);
return;
} else if (rule == grammarAccess.getFlowSinkSpecRule()) {
sequence_FlowSinkSpec(context, (FlowSpecification) semanticObject);
return;
} else if (rule == grammarAccess.getFlowSourceSpecRule()) {
sequence_FlowSourceSpec(context, (FlowSpecification) semanticObject);
return;
} else if (rule == grammarAccess.getFlowSpecRefinementRule()) {
sequence_FlowSpecRefinement(context, (FlowSpecification) semanticObject);
return;
} else
break;
case Aadl2Package.GROUP_EXTENSION:
sequence_GroupExtension(context, (GroupExtension) semanticObject);
return;
case Aadl2Package.IMPLEMENTATION_EXTENSION:
sequence_ImplementationExtension(context, (ImplementationExtension) semanticObject);
return;
case Aadl2Package.INTEGER_LITERAL:
if (rule == grammarAccess.getNumberValueRule() || rule == grammarAccess.getIntegerLitRule()) {
sequence_IntegerLit(context, (IntegerLiteral) semanticObject);
return;
} else if (rule == grammarAccess.getConstantPropertyExpressionRule() || rule == grammarAccess.getPropertyExpressionRule() || rule == grammarAccess.getIntegerTermRule() || rule == grammarAccess.getNumAltRule()) {
sequence_IntegerTerm(context, (IntegerLiteral) semanticObject);
return;
} else
break;
case Aadl2Package.LIST_TYPE:
sequence_ListType(context, (ListType) semanticObject);
return;
case Aadl2Package.LIST_VALUE:
sequence_ListTerm(context, (ListValue) semanticObject);
return;
case Aadl2Package.MEMORY_IMPLEMENTATION:
sequence_MemoryImplementation(context, (MemoryImplementation) semanticObject);
return;
case Aadl2Package.MEMORY_PROTOTYPE:
sequence_MemoryPrototype(context, (MemoryPrototype) semanticObject);
return;
case Aadl2Package.MEMORY_SUBCOMPONENT:
sequence_MemorySubcomponent(context, (MemorySubcomponent) semanticObject);
return;
case Aadl2Package.MEMORY_TYPE:
sequence_MemoryType(context, (MemoryType) semanticObject);
return;
case Aadl2Package.METACLASS_REFERENCE:
if (rule == grammarAccess.getAllReferenceRule()) {
sequence_AllReference(context, (MetaclassReference) semanticObject);
return;
} else if (rule == grammarAccess.getQMReferenceRule() || rule == grammarAccess.getPropertyOwnerRule()) {
sequence_QMReference(context, (MetaclassReference) semanticObject);
return;
} else
break;
case Aadl2Package.MODAL_PROPERTY_VALUE:
if (rule == grammarAccess.getModalPropertyValueRule()) {
sequence_ModalPropertyValue(context, (ModalPropertyValue) semanticObject);
return;
} else if (rule == grammarAccess.getOptionalModalPropertyValueRule()) {
sequence_OptionalModalPropertyValue(context, (ModalPropertyValue) semanticObject);
return;
} else if (rule == grammarAccess.getPropertyValueRule()) {
sequence_PropertyValue(context, (ModalPropertyValue) semanticObject);
return;
} else
break;
case Aadl2Package.MODE:
sequence_Mode(context, (Mode) semanticObject);
return;
case Aadl2Package.MODE_BINDING:
sequence_ModeRef(context, (ModeBinding) semanticObject);
return;
case Aadl2Package.MODE_TRANSITION:
sequence_ModeTransition(context, (ModeTransition) semanticObject);
return;
case Aadl2Package.MODE_TRANSITION_TRIGGER:
sequence_Trigger(context, (ModeTransitionTrigger) semanticObject);
return;
case Aadl2Package.NAMED_VALUE:
if (rule == grammarAccess.getConstantValueRule() || rule == grammarAccess.getNumAltRule()) {
sequence_ConstantValue(context, (NamedValue) semanticObject);
return;
} else if (rule == grammarAccess.getConstantPropertyExpressionRule() || rule == grammarAccess.getPropertyExpressionRule() || rule == grammarAccess.getLiteralorReferenceTermRule()) {
sequence_LiteralorReferenceTerm(context, (NamedValue) semanticObject);
return;
} else
break;
case Aadl2Package.NUMERIC_RANGE:
if (rule == grammarAccess.getIntegerRangeRule()) {
sequence_IntegerRange(context, (NumericRange) semanticObject);
return;
} else if (rule == grammarAccess.getRealRangeRule()) {
sequence_RealRange(context, (NumericRange) semanticObject);
return;
} else
break;
case Aadl2Package.OPERATION:
sequence_SignedConstant(context, (Operation) semanticObject);
return;
case Aadl2Package.PACKAGE_RENAME:
if (rule == grammarAccess.getPackageRenameRule()) {
sequence_PackageRename(context, (PackageRename) semanticObject);
return;
} else if (rule == grammarAccess.getRenameAllRule()) {
sequence_RenameAll(context, (PackageRename) semanticObject);
return;
} else
break;
case Aadl2Package.PARAMETER:
sequence_Parameter(context, (org.osate.aadl2.Parameter) semanticObject);
return;
case Aadl2Package.PARAMETER_CONNECTION:
sequence_ParameterConnection(context, (ParameterConnection) semanticObject);
return;
case Aadl2Package.PORT_CONNECTION:
sequence_PortConnection(context, (PortConnection) semanticObject);
return;
case Aadl2Package.PORT_PROXY:
sequence_PortProxy(context, (PortProxy) semanticObject);
return;
case Aadl2Package.PORT_SPECIFICATION:
sequence_PortSpecification(context, (PortSpecification) semanticObject);
return;
case Aadl2Package.PRIVATE_PACKAGE_SECTION:
sequence_PrivatePackageSection(context, (PrivatePackageSection) semanticObject);
return;
case Aadl2Package.PROCESS_IMPLEMENTATION:
sequence_ProcessImplementation(context, (ProcessImplementation) semanticObject);
return;
case Aadl2Package.PROCESS_PROTOTYPE:
sequence_ProcessPrototype(context, (ProcessPrototype) semanticObject);
return;
case Aadl2Package.PROCESS_SUBCOMPONENT:
sequence_ProcessSubcomponent(context, (ProcessSubcomponent) semanticObject);
return;
case Aadl2Package.PROCESS_TYPE:
sequence_ProcessType(context, (ProcessType) semanticObject);
return;
case Aadl2Package.PROCESSOR_IMPLEMENTATION:
sequence_ProcessorImplementation(context, (ProcessorImplementation) semanticObject);
return;
case Aadl2Package.PROCESSOR_PROTOTYPE:
sequence_ProcessorPrototype(context, (ProcessorPrototype) semanticObject);
return;
case Aadl2Package.PROCESSOR_SUBCOMPONENT:
sequence_ProcessorSubcomponent(context, (ProcessorSubcomponent) semanticObject);
return;
case Aadl2Package.PROCESSOR_TYPE:
sequence_ProcessorType(context, (ProcessorType) semanticObject);
return;
case Aadl2Package.PROPERTY:
sequence_PropertyDefinition(context, (Property) semanticObject);
return;
case Aadl2Package.PROPERTY_ASSOCIATION:
if (rule == grammarAccess.getBasicPropertyAssociationRule()) {
sequence_BasicPropertyAssociation(context, (PropertyAssociation) semanticObject);
return;
} else if (rule == grammarAccess.getPModelRule() || rule == grammarAccess.getContainedPropertyAssociationRule()) {
sequence_ContainedPropertyAssociation(context, (PropertyAssociation) semanticObject);
return;
} else if (rule == grammarAccess.getPropertyAssociationRule()) {
sequence_PropertyAssociation(context, (PropertyAssociation) semanticObject);
return;
} else
break;
case Aadl2Package.PROPERTY_CONSTANT:
sequence_PropertyConstant(context, (PropertyConstant) semanticObject);
return;
case Aadl2Package.PROPERTY_SET:
sequence_PropertySet(context, (PropertySet) semanticObject);
return;
case Aadl2Package.PUBLIC_PACKAGE_SECTION:
sequence_PublicPackageSection(context, (PublicPackageSection) semanticObject);
return;
case Aadl2Package.RANGE_TYPE:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getRangeTypeRule()) {
sequence_RangeType(context, (RangeType) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedRangeTypeRule()) {
sequence_UnnamedRangeType(context, (RangeType) semanticObject);
return;
} else
break;
case Aadl2Package.RANGE_VALUE:
sequence_NumericRangeTerm(context, (RangeValue) semanticObject);
return;
case Aadl2Package.REAL_LITERAL:
if (rule == grammarAccess.getNumberValueRule() || rule == grammarAccess.getRealLitRule()) {
sequence_RealLit(context, (RealLiteral) semanticObject);
return;
} else if (rule == grammarAccess.getConstantPropertyExpressionRule() || rule == grammarAccess.getPropertyExpressionRule() || rule == grammarAccess.getRealTermRule() || rule == grammarAccess.getNumAltRule()) {
sequence_RealTerm(context, (RealLiteral) semanticObject);
return;
} else
break;
case Aadl2Package.REALIZATION:
sequence_Realization(context, (Realization) semanticObject);
return;
case Aadl2Package.RECORD_TYPE:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getRecordTypeRule()) {
sequence_RecordType(context, (RecordType) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedRecordTypeRule()) {
sequence_UnnamedRecordType(context, (RecordType) semanticObject);
return;
} else
break;
case Aadl2Package.RECORD_VALUE:
if (rule == grammarAccess.getOldRecordTermRule()) {
sequence_OldRecordTerm(context, (RecordValue) semanticObject);
return;
} else if (rule == grammarAccess.getConstantPropertyExpressionRule() || rule == grammarAccess.getPropertyExpressionRule() || rule == grammarAccess.getRecordTermRule()) {
sequence_RecordTerm(context, (RecordValue) semanticObject);
return;
} else
break;
case Aadl2Package.REFERENCE_TYPE:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getReferenceTypeRule()) {
sequence_ReferenceType(context, (ReferenceType) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedReferenceTypeRule()) {
sequence_UnnamedReferenceType(context, (ReferenceType) semanticObject);
return;
} else
break;
case Aadl2Package.REFERENCE_VALUE:
sequence_ReferenceTerm(context, (ReferenceValue) semanticObject);
return;
case Aadl2Package.STRING_LITERAL:
sequence_StringTerm(context, (StringLiteral) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_ACCESS:
sequence_SubprogramAccess(context, (SubprogramAccess) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_CALL:
sequence_SubprogramCall(context, (SubprogramCall) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_CALL_SEQUENCE:
sequence_SubprogramCallSequence(context, (SubprogramCallSequence) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_GROUP_ACCESS:
sequence_SubprogramGroupAccess(context, (SubprogramGroupAccess) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_GROUP_IMPLEMENTATION:
sequence_SubprogramGroupImplementation(context, (SubprogramGroupImplementation) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_GROUP_PROTOTYPE:
sequence_SubprogramGroupPrototype(context, (SubprogramGroupPrototype) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_GROUP_SUBCOMPONENT:
sequence_SubprogramGroupSubcomponent(context, (SubprogramGroupSubcomponent) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_GROUP_TYPE:
sequence_SubprogramGroupType(context, (SubprogramGroupType) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_IMPLEMENTATION:
sequence_SubprogramImplementation(context, (SubprogramImplementation) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_PROTOTYPE:
sequence_SubprogramPrototype(context, (SubprogramPrototype) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_PROXY:
sequence_SubprogramProxy(context, (SubprogramProxy) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_SUBCOMPONENT:
sequence_SubprogramSubcomponent(context, (SubprogramSubcomponent) semanticObject);
return;
case Aadl2Package.SUBPROGRAM_TYPE:
sequence_SubprogramType(context, (SubprogramType) semanticObject);
return;
case Aadl2Package.SYSTEM_IMPLEMENTATION:
sequence_SystemImplementation(context, (SystemImplementation) semanticObject);
return;
case Aadl2Package.SYSTEM_PROTOTYPE:
sequence_SystemPrototype(context, (SystemPrototype) semanticObject);
return;
case Aadl2Package.SYSTEM_SUBCOMPONENT:
sequence_SystemSubcomponent(context, (SystemSubcomponent) semanticObject);
return;
case Aadl2Package.SYSTEM_TYPE:
sequence_SystemType(context, (SystemType) semanticObject);
return;
case Aadl2Package.THREAD_GROUP_IMPLEMENTATION:
sequence_ThreadGroupImplementation(context, (ThreadGroupImplementation) semanticObject);
return;
case Aadl2Package.THREAD_GROUP_PROTOTYPE:
sequence_ThreadGroupPrototype(context, (ThreadGroupPrototype) semanticObject);
return;
case Aadl2Package.THREAD_GROUP_SUBCOMPONENT:
sequence_ThreadGroupSubcomponent(context, (ThreadGroupSubcomponent) semanticObject);
return;
case Aadl2Package.THREAD_GROUP_TYPE:
sequence_ThreadGroupType(context, (ThreadGroupType) semanticObject);
return;
case Aadl2Package.THREAD_IMPLEMENTATION:
sequence_ThreadImplementation(context, (ThreadImplementation) semanticObject);
return;
case Aadl2Package.THREAD_PROTOTYPE:
sequence_ThreadPrototype(context, (ThreadPrototype) semanticObject);
return;
case Aadl2Package.THREAD_SUBCOMPONENT:
sequence_ThreadSubcomponent(context, (ThreadSubcomponent) semanticObject);
return;
case Aadl2Package.THREAD_TYPE:
sequence_ThreadType(context, (ThreadType) semanticObject);
return;
case Aadl2Package.TYPE_EXTENSION:
sequence_TypeExtension(context, (TypeExtension) semanticObject);
return;
case Aadl2Package.UNIT_LITERAL:
if (rule == grammarAccess.getUnitLiteralConversionRule()) {
sequence_UnitLiteralConversion(context, (UnitLiteral) semanticObject);
return;
} else if (rule == grammarAccess.getUnitLiteralRule()) {
sequence_UnitLiteral(context, (UnitLiteral) semanticObject);
return;
} else
break;
case Aadl2Package.UNITS_TYPE:
if (rule == grammarAccess.getPropertyTypeRule() || rule == grammarAccess.getUnitsTypeRule()) {
sequence_UnitsType(context, (UnitsType) semanticObject);
return;
} else if (rule == grammarAccess.getUnnamedPropertyTypeRule() || rule == grammarAccess.getUnnamedUnitsTypeRule()) {
sequence_UnnamedUnitsType(context, (UnitsType) semanticObject);
return;
} else
break;
case Aadl2Package.VIRTUAL_BUS_IMPLEMENTATION:
sequence_VirtualBusImplementation(context, (VirtualBusImplementation) semanticObject);
return;
case Aadl2Package.VIRTUAL_BUS_PROTOTYPE:
sequence_VirtualBusPrototype(context, (VirtualBusPrototype) semanticObject);
return;
case Aadl2Package.VIRTUAL_BUS_SUBCOMPONENT:
sequence_VirtualBusSubcomponent(context, (VirtualBusSubcomponent) semanticObject);
return;
case Aadl2Package.VIRTUAL_BUS_TYPE:
sequence_VirtualBusType(context, (VirtualBusType) semanticObject);
return;
case Aadl2Package.VIRTUAL_PROCESSOR_IMPLEMENTATION:
sequence_VirtualProcessorImplementation(context, (VirtualProcessorImplementation) semanticObject);
return;
case Aadl2Package.VIRTUAL_PROCESSOR_PROTOTYPE:
sequence_VirtualProcessorPrototype(context, (VirtualProcessorPrototype) semanticObject);
return;
case Aadl2Package.VIRTUAL_PROCESSOR_SUBCOMPONENT:
sequence_VirtualProcessorSubcomponent(context, (VirtualProcessorSubcomponent) semanticObject);
return;
case Aadl2Package.VIRTUAL_PROCESSOR_TYPE:
sequence_VirtualProcessorType(context, (VirtualProcessorType) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.geotoolkit.sml.xml.v101.SystemType in project geotoolkit by Geomatys.
the class SmlXMLBindingTest method SystemUnmarshallMarshalingTest.
/**
* Test simple Record Marshalling.
*
* @throws java.lang.Exception
*/
@Test
public void SystemUnmarshallMarshalingTest() throws Exception {
Unmarshaller unmarshaller = SensorMLMarshallerPool.getInstance().acquireUnmarshaller();
InputStream is = SmlXMLBindingTest.class.getResourceAsStream("/org/geotoolkit/sml/system.xml");
Object unmarshalled = unmarshaller.unmarshal(is);
if (unmarshalled instanceof JAXBElement) {
unmarshalled = ((JAXBElement) unmarshalled).getValue();
}
assertTrue(unmarshalled instanceof SensorML);
SensorML result = (SensorML) unmarshalled;
Member member = new Member();
member.setRole("urn:x-ogx:def:sensor:OGC:detector");
SystemType system = new SystemType();
List<JAXBElement<String>> kw = new ArrayList<JAXBElement<String>>();
kw.add(sml100Factory.createKeywordsKeywordListKeyword("piezometer"));
kw.add(sml100Factory.createKeywordsKeywordListKeyword("geosciences"));
kw.add(sml100Factory.createKeywordsKeywordListKeyword("point d'eau"));
Keywords keywords = new Keywords(new KeywordList(URI.create("urn:x-brgm:def:gcmd:keywords"), kw));
system.setKeywords(keywords);
Classifier cl1 = new Classifier("intendedApplication", new Term("eaux souterraines", URI.create("urn:x-ogc:def:classifier:OGC:application")));
CodeSpacePropertyType cs = new CodeSpacePropertyType("urn:x-brgm:def:GeoPoint:bss");
Classifier cl2 = new Classifier("sensorType", new Term(cs, "piezometer", URI.create("urn:sensor:classifier:sensorType")));
CodeSpacePropertyType cs3 = new CodeSpacePropertyType("urn:x-sandre:def:mdo:identifier");
Classifier cl3 = new Classifier("waterBody", new Term(cs3, "FR6221", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs4 = new CodeSpacePropertyType("urn:x-sandre:def:mdo:name");
Classifier cl4 = new Classifier("waterBody", new Term(cs4, "Multicouche pliocene et alluvions quaternaires du Roussillon", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs5 = new CodeSpacePropertyType("urn:x-sandre:def:bdhrf:identifier");
Classifier cl5 = new Classifier("hydrologicalEntity", new Term(cs5, "225", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs6 = new CodeSpacePropertyType("urn:x-sandre:def:bdhrf:name");
Classifier cl6 = new Classifier("hydrologicalEntity", new Term(cs6, "Pliocene du Roussillon", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs7 = new CodeSpacePropertyType("urn:x-insee:def:commune:identifier");
Classifier cl7 = new Classifier("commune", new Term(cs7, "66008", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs8 = new CodeSpacePropertyType("urn:x-insee:def:commune:name");
Classifier cl8 = new Classifier("commune", new Term(cs8, "ARGELES SUR MER", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs9 = new CodeSpacePropertyType("urn:x-sandre:def:network:identifier");
Classifier cl9 = new Classifier("network", new Term(cs9, "600000221", URI.create("urn:sensor:classifier:references")));
CodeSpacePropertyType cs10 = new CodeSpacePropertyType("urn:x-sandre:def:network:identifier");
Classifier cl10 = new Classifier("network", new Term(cs10, "600000025", URI.create("urn:sensor:classifier:references")));
List<Classifier> cls = new ArrayList<Classifier>();
cls.add(cl1);
cls.add(cl2);
cls.add(cl3);
cls.add(cl4);
cls.add(cl5);
cls.add(cl6);
cls.add(cl7);
cls.add(cl8);
cls.add(cl9);
cls.add(cl10);
ClassifierList claList = new ClassifierList(null, cls);
Classification classification = new Classification(claList);
system.setClassification(classification);
List<Identifier> identifiers = new ArrayList<Identifier>();
cs = new CodeSpacePropertyType("urn:x-brgm:def:samplingStation:bss");
Identifier id1 = new Identifier("bssCode", new Term(cs, "10972X0137/PONT", URI.create("urn:x-ogc:def:identifier:OGC:modelNumber")));
cs = new CodeSpacePropertyType("urn:x-brgm:def:sensorSystem:hydras");
Identifier id2 = new Identifier("supervisorCode", new Term(cs, "00ARGLELES", URI.create("urn:x-ogc:def:identifier:OGC:modelNumber")));
Identifier id3 = new Identifier("longName", new Term("ARGELES", URI.create("urn:x-ogc:def:identifier:OGC:longname")));
identifiers.add(id1);
identifiers.add(id2);
identifiers.add(id3);
IdentifierList identifierList = new IdentifierList(null, identifiers);
Identification identification = new Identification(identifierList);
system.setIdentification(identification);
Capabilities capabilities = new Capabilities();
List<DataComponentPropertyType> fields = new ArrayList<DataComponentPropertyType>();
QuantityType quantity = new QuantityType("urn:x-ogc:def:property:temperature", new UomPropertyType(null, "urn:ogc:unit:degree:celsius"), 0.1);
DataComponentPropertyType field1 = new DataComponentPropertyType("resolution", "urn:x-ogc:def:property:resolution", quantity);
fields.add(field1);
QuantityRange quantityR = new QuantityRange(new UomPropertyType(null, "urn:ogc:unit:percent"), Arrays.asList(-0.5, 0.5));
quantityR.setDefinition("urn:x-ogc:def:property:absoluteAccuracy");
DataComponentPropertyType field2 = new DataComponentPropertyType("accuracy", "urn:x-ogc:def:property:accuracy", quantityR);
fields.add(field2);
DataRecordType record = new DataRecordType("urn:x-ogc:def:property:measurementProperties", fields);
record.setDescription("Toutes les informations sur les contraintes sur les donnees");
JAXBElement<? extends AbstractDataRecordType> jbRecord = swe100Factory.createDataRecord(record);
capabilities.setAbstractDataRecord(jbRecord);
system.setCapabilities(capabilities);
AddressType address1 = new AddressType("SGR LRO-1039 Rue de Pinville-34000 Montpellier", "MONTPELLIER", null, null, null, "m.blaise@brgm.fr");
ContactInfo contactInfo1 = new ContactInfo(null, address1);
ResponsibleParty resp1 = new ResponsibleParty("BLAISE Marion (BRGM)", "BRGM", null, contactInfo1);
Contact contact1 = new Contact("urn:x-ogc:def:role:producer", resp1);
AddressType address2 = new AddressType("Hotel du Departement, B.P. 906, 66 906 Perpignan Cedex", "PERPIGNAN", null, null, null, null);
ContactInfo contactInfo2 = new ContactInfo(null, address2);
ResponsibleParty resp2 = new ResponsibleParty("ASSENS Martine (CG66)", "CONSEIL GENERAL DES PYRENEES ORIENTALES", null, contactInfo2);
Contact contact2 = new Contact("urn:x-ogc:def:role:owner", resp2);
system.setContact(Arrays.asList(contact1, contact2));
IoComponentPropertyType io = new IoComponentPropertyType("level", new ObservableProperty("urn:x-ogc:def:phenomenon:OGC:level"));
InputList inputList = new InputList(Arrays.asList(io));
Inputs inputs = new Inputs(inputList);
system.setInputs(inputs);
fields = new ArrayList<DataComponentPropertyType>();
TimeType time = new TimeType("urn:x-ogc:def:phenomenon:observationTime", new UomPropertyType(null, "urn:x-ogc:def:unit:ISO8601"));
fields.add(new DataComponentPropertyType("time", null, time));
QuantityType q = new QuantityType("urn:x-ogc:def:phenomenon:OGC:depth", new UomPropertyType("m", null), null);
fields.add(new DataComponentPropertyType("depth", null, q));
BooleanType b = new BooleanType("urn:x-ogc:def:phenomenon:BRGM:validity", null);
fields.add(new DataComponentPropertyType("validity", null, b));
DataRecordType outRecord = new DataRecordType(null, fields);
outRecord.setId("outputGroup");
IoComponentPropertyType io2 = new IoComponentPropertyType("piezoMeasurements", swe100Factory.createDataRecord(outRecord));
OutputList outputList = new OutputList(Arrays.asList(io2));
Outputs outputs = new Outputs(outputList);
system.setOutputs(outputs);
fields = new ArrayList<DataComponentPropertyType>();
q = new QuantityType("urn:x-ogc:def:property:depth", new UomPropertyType(null, "urn:ogc:unit:m"), 166.0);
fields.add(new DataComponentPropertyType("MaxDepth", null, q));
DataRecordType charRecord = new DataRecordType(null, fields);
List<DataComponentPropertyType> fields2 = new ArrayList<DataComponentPropertyType>();
fields2.add(new DataComponentPropertyType("physicalProperties", null, swe100Factory.createDataRecord(charRecord)));
DataRecordType ccharRecord = new DataRecordType("urn:x-ogc:def:property:physicalProperties", fields2);
Characteristics characteristics = new Characteristics();
characteristics.setAbstractDataRecord(swe100Factory.createDataRecord(ccharRecord));
system.setCharacteristics(characteristics);
DirectPositionType pos = new DirectPositionType("urn:ogc:crs:EPSG:27582", 2, Arrays.asList(65400.0, 1731368.0));
PointType point = new PointType("STATION_LOCALISATION", pos);
Location location = new Location(point);
system.setSMLLocation(location);
EngineeringDatumType engineeringDatum = new EngineeringDatumType("datum", "Sensor Datum", new CodeType("X, Y et Z sont orthogonal au regard d'un point de reference."));
EngineeringDatumRefType usesEngineeringDatum = new EngineeringDatumRefType(engineeringDatum);
EngineeringCRSType engineeringCRS = new EngineeringCRSType("STATION_FRAME", "Position absolue du capteur", new CoordinateSystemRefType("urn:ogc:def:crs:ogc:1.0:xyzFrame"), usesEngineeringDatum);
SpatialReferenceFrame spatialReferenceFrame = new SpatialReferenceFrame(engineeringCRS);
system.setSpatialReferenceFrame(spatialReferenceFrame);
Document doc = new Document("Fiche descriptive de la station", "text/html", Arrays.asList(new OnlineResource("http://ades.eaufrance.fr/FichePtEau.aspx?code=10972X0137/PONT")));
Documentation documentation = new Documentation(doc);
documentation.setRole("urn:ogc:role:description");
system.setDocumentation(Arrays.asList(documentation));
List<ComponentPropertyType> compos = new ArrayList<ComponentPropertyType>();
compos.add(new ComponentPropertyType("Profondeur", "urn:x-ogc:def:sensor:detector", "capteur_"));
ComponentList componentList = new ComponentList(compos);
Components components = new Components(componentList);
system.setComponents(components);
List<CoordinateType> coordinates = new ArrayList<CoordinateType>();
QuantityType xQuant = new QuantityType("urn:ogc:def:phenomenon:distance", new UomPropertyType("m", null), 0.0);
xQuant.setAxisID("X");
CoordinateType xcoord = new CoordinateType("x", xQuant);
QuantityType yQuant = new QuantityType("urn:ogc:def:phenomenon:distance", new UomPropertyType("m", null), 0.0);
yQuant.setAxisID("Y");
CoordinateType ycoord = new CoordinateType("y", yQuant);
QuantityType zQuant = new QuantityType("urn:ogc:def:phenomenon:distance", new UomPropertyType("m", null), 0.0);
zQuant.setAxisID("Z");
CoordinateType zcoord = new CoordinateType("z", zQuant);
coordinates.add(xcoord);
coordinates.add(ycoord);
coordinates.add(zcoord);
VectorType vect = new VectorType("urn:ogc:def:phenomenon:location", coordinates);
VectorPropertyType vectP = new VectorPropertyType(vect);
PositionType Sposition = new PositionType(URI.create("#REFERENCE_POINT"), URI.create("#PIEZOMETER_FRAME"), vectP, null);
Position position = new Position("piezoPosition", Sposition);
PositionList positionList = new PositionList(null, Arrays.asList(position));
Positions positions = new Positions(positionList);
system.setPositions(positions);
TemporalReferenceFrame temporalReferenceFrame = new TemporalReferenceFrame(new TemporalCRSType("temporalReference", null, null, "calendrier gregorien en heure d'ete", new TemporalCSRefType("urn:x-brgm:temporalCS:gregorian"), new TemporalDatumRefType("urn:x-brgm:temporalDatum:UniversalTime")));
system.setTemporalReferenceFrame(temporalReferenceFrame);
List<Connection> connecL = new ArrayList<Connection>();
connecL.add(new Connection("inputTolevel", new Link(null, new LinkRef("this/inputs/level"), new LinkRef("piezometer/inputs/level"))));
Connection c2 = new Connection("depthToOutput", new Link(null, new LinkRef("piezometer/outputs/depth"), new LinkRef("this/outputs/piezoMeasurements/depth")));
ArrayLink alink = new ArrayLink();
LinkRef sa = new LinkRef("piezometer/outputs/depth");
alink.setSourceArray(sa);
LinkRef si = new LinkRef("this/outputs/piezoMeasurements/depth");
alink.setSourceIndex(si);
LinkRef da = new LinkRef("this/outputs/piezoMeasurements/depth");
alink.setDestinationArray(da);
LinkRef di = new LinkRef("this/outputs/piezoMeasurements/depth");
alink.getDestinationIndex().add(di);
c2.setArrayLink(alink);
connecL.add(c2);
ConnectionList connectionList = new ConnectionList(connecL);
Connections connections = new Connections(connectionList);
system.setConnections(connections);
LayerPropertyType applicationLayer = new LayerPropertyType(new Category("urn:ogc:def:protocol:applicationLink", "urn:x-brgm:def:protocol:hydrasIRIS"));
LayerPropertyType dataLinkLayer = new LayerPropertyType(new Category("urn:ogc:def:protocol:dataLink", "urn:x-brgm:def:dataLink:RTC"));
InterfaceDefinition definition = new InterfaceDefinition(null, applicationLayer, dataLinkLayer);
Interface i1 = new Interface("RS-232", definition);
List<Interface> interfaceL = new ArrayList<Interface>();
interfaceL.add(i1);
InterfaceList interfaceList = new InterfaceList(null, interfaceL);
Interfaces interfaces = new Interfaces(interfaceList);
system.setInterfaces(interfaces);
Rights rights = new Rights(true, true, new Documentation(new Document("Donnees sous copyright du BRGM")));
LegalConstraint legalConstraint = new LegalConstraint(rights);
system.setLegalConstraint(legalConstraint);
system.setDescription("information about the piezometer");
system.setName(new DefaultIdentifier("Piezometer Test"));
member.setProcess(sml100Factory.createSystem(system));
SensorML expectedResult = new SensorML("1.0", Arrays.asList(member));
assertEquals(result.getMember().size(), 1);
assertTrue(result.getMember().get(0).getProcess() != null);
assertTrue(result.getMember().get(0).getProcess().getValue() instanceof SystemType);
SystemType resultProcess = (SystemType) result.getMember().get(0).getProcess().getValue();
assertEquals(resultProcess.getCapabilities().size(), system.getCapabilities().size());
assertTrue(resultProcess.getCapabilities().get(0).getAbstractDataRecord().getValue() instanceof DataRecordType);
DataRecordType resultRecord = (DataRecordType) resultProcess.getCapabilities().get(0).getAbstractDataRecord().getValue();
DataRecordType expRecord = (DataRecordType) system.getCapabilities().get(0).getAbstractDataRecord().getValue();
assertEquals(resultRecord.getField().get(0), expRecord.getField().get(0));
assertEquals(resultRecord.getField().get(1), expRecord.getField().get(1));
assertEquals(resultRecord.getField(), expRecord.getField());
assertEquals(resultProcess.getCapabilities().get(0).getAbstractDataRecord().getValue(), system.getCapabilities().get(0).getAbstractDataRecord().getValue());
assertEquals(resultProcess.getCapabilities().get(0), system.getCapabilities().get(0));
assertEquals(resultProcess.getCapabilities(), system.getCapabilities());
assertTrue(resultProcess.getContact().size() == 2);
assertEquals(resultProcess.getContact().get(0).getContactList(), system.getContact().get(0).getContactList());
assertEquals(resultProcess.getContact().get(0).getResponsibleParty().getContactInfo(), system.getContact().get(0).getResponsibleParty().getContactInfo());
assertEquals(resultProcess.getContact().get(0).getResponsibleParty().getOrganizationName(), system.getContact().get(0).getResponsibleParty().getOrganizationName());
assertEquals(resultProcess.getContact().get(0).getResponsibleParty(), system.getContact().get(0).getResponsibleParty());
assertEquals(resultProcess.getContact().get(0), system.getContact().get(0));
assertEquals(resultProcess.getContact(), system.getContact());
assertTrue(resultProcess.getClassification().size() == 1);
assertTrue(resultProcess.getClassification().get(0).getClassifierList().getClassifier().size() == 10);
assertEquals(resultProcess.getClassification().get(0).getClassifierList().getClassifier().get(0).getTerm(), system.getClassification().get(0).getClassifierList().getClassifier().get(0).getTerm());
assertEquals(resultProcess.getClassification().get(0).getClassifierList().getClassifier().get(0), system.getClassification().get(0).getClassifierList().getClassifier().get(0));
assertEquals(resultProcess.getClassification().get(0).getClassifierList().getClassifier(), system.getClassification().get(0).getClassifierList().getClassifier());
assertEquals(resultProcess.getClassification().get(0).getClassifierList(), system.getClassification().get(0).getClassifierList());
assertEquals(resultProcess.getClassification().get(0), system.getClassification().get(0));
assertEquals(resultProcess.getClassification(), system.getClassification());
assertEquals(resultProcess.getIdentification(), system.getIdentification());
assertEquals(resultProcess.getValidTime(), system.getValidTime());
assertEquals(resultProcess.getParameters(), system.getParameters());
assertEquals(resultProcess.getInputs().getInputList().getInput(), system.getInputs().getInputList().getInput());
assertEquals(resultProcess.getInputs().getInputList(), system.getInputs().getInputList());
assertEquals(resultProcess.getInputs(), system.getInputs());
assertEquals(resultProcess.getOutputs(), system.getOutputs());
assertEquals(resultProcess.getSMLLocation(), system.getSMLLocation());
assertEquals(resultProcess.getPosition(), system.getPosition());
assertEquals(resultProcess.getSpatialReferenceFrame(), system.getSpatialReferenceFrame());
assertEquals(resultProcess.getDocumentation(), system.getDocumentation());
assertEquals(resultProcess.getCharacteristics(), system.getCharacteristics());
assertEquals(resultProcess.getComponents(), system.getComponents());
assertEquals(resultProcess.getPositions(), system.getPositions());
assertEquals(resultProcess.getTemporalReferenceFrame(), system.getTemporalReferenceFrame());
assertEquals(resultProcess.getConnections().getConnectionList().getConnection().get(0), system.getConnections().getConnectionList().getConnection().get(0));
assertEquals(resultProcess.getConnections().getConnectionList().getConnection().get(1), system.getConnections().getConnectionList().getConnection().get(1));
assertEquals(resultProcess.getConnections().getConnectionList().getConnection(), system.getConnections().getConnectionList().getConnection());
assertEquals(resultProcess.getConnections().getConnectionList(), system.getConnections().getConnectionList());
assertEquals(resultProcess.getConnections(), system.getConnections());
assertEquals(resultProcess.getInterfaces(), system.getInterfaces());
assertEquals(resultProcess.getLegalConstraint(), system.getLegalConstraint());
assertEquals(resultProcess.getKeywords(), system.getKeywords());
assertEquals(resultProcess.getId(), system.getId());
assertEquals(resultProcess.getName(), system.getName());
assertEquals(resultProcess, system);
assertEquals(expectedResult.getMember().get(0), result.getMember().get(0));
assertEquals(expectedResult.getMember(), result.getMember());
assertEquals(expectedResult, result);
SensorMLMarshallerPool.getInstance().recycle(unmarshaller);
}
Aggregations