Loading ttcn/LibSmartAppliances/SmartAppliances_Functions.ttcn +96 −99 Original line number Diff line number Diff line Loading @@ -22,56 +22,82 @@ module SmartAppliances_Functions { import from SmartAppliances_Templates all; import from SmartAppliances_Types all; group configFunctions { /** * @desc Ports mapping and default behaviour activation for Config 03 */ function f_cf03Up() runs on AeTester system AeSystem { group aeFunctions { map(self:mcaPort, system:mcaPort); map(self:acPort, system:acPort); activate(a_ae_default_sap()); function f_getResourceIndex(in XSD.AnyURI p_address) return integer { return -1; //TODO } group preambleFunctions { /** * @desc Ports unmapping for Config 03 * @desc Creates specified resource * @param p_resource Resource to be created * @param p_parentIndex Parent index of resource to be saved * @param p_resourceType Type of the resource to be created * @param p_modifiedResource Assigned and/or modified fields * @return Internal resource index of the saved resource or -1 * @verdict */ function f_cf03Down() runs on AeTester system AeSystem { function f_createResource(in PrimitiveContent p_resource, in integer p_parentIndex, in ResourceType p_resourceType, out anytype p_modifiedResource) runs on AeTester return integer { unmap(self:mcaPort, system:mcaPort); unmap(self:acPort, system:acPort); } var integer v_resourceIndex; } // end configFunctions // AE if(p_resourceType == int2 and ischosen(p_resource.any_1[0].AE_optional)) { var AE_optional v_ae := p_resource.any_1[0].AE_optional; var AE_optional v_aeModified; group aeFunctions { v_resourceIndex := lengthof(vc_resourcesList) - 1; v_ae.resourceType := p_resourceType; v_ae.parentID := int2str(p_parentIndex); v_ae.creationTime := fx_generateTimestamp(); v_ae.lastModifiedTime := v_ae.creationTime; v_ae.resourceID := "ae" & int2char(v_resourceIndex); v_ae.aE_ID := "ae" & int2char(v_resourceIndex); v_ae.resourceName := "ae" & int2char(v_resourceIndex); group altstepFunctions { v_aeModified.parentID := v_ae.parentID; v_aeModified.creationTime := v_ae.creationTime; v_aeModified.lastModifiedTime := v_ae.lastModifiedTime; v_aeModified.resourceID := v_ae.resourceID; v_aeModified.aE_ID := v_ae.aE_ID; v_aeModified.resourceName := v_ae.resourceName; p_resource.any_1[0].AE_optional := v_ae; p_modifiedResource.AE_optional := v_aeModified; return f_setResource(p_resource, p_parentIndex); } // Error return -1; } /** * @desc Ae altstep (SAP - TODO: merge in oneM2M) * @desc Waits for CREATE request, stores resource and replies to request */ altstep a_ae_default_sap() runs on AeTester { var MsgIn v_request; var anytype v_modifiedResource; var integer v_resourceIndex, v_parentIndex; var RequestPrimitive v_rp; [] mcaPort.receive(mw_request(?)) -> value v_request { log("a_default: WARNING: Unexpected request received"); [] mcaPort.receive(mw_request(mw_create)) -> value v_request { v_rp := v_request.primitive.requestPrimitive; v_parentIndex := f_getResourceIndex(v_rp.to_); v_resourceIndex := f_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource); if(v_resourceIndex != -1) { mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, {any_1 := {v_modifiedResource}}))); } else { mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))); repeat; } [] mcaPort.receive { log("a_default: WARNING: Unexpected message received"); repeat; } } } // end altstepFunctions group preambleFunctions { /** * @desc Waits for AE registration request and process it * @return Internal resource index of AE or -1 in case of failure Loading @@ -80,34 +106,27 @@ module SmartAppliances_Functions { function f_ae_preamble_registerAe() runs on AeTester return integer { var MsgIn v_request; var AE_optional v_ae; var integer v_resourceId; var integer v_ret := -1; var anytype v_modifiedResource; var integer v_resourceIndex, v_parentIndex; var RequestPrimitive v_rp; tc_ac.start; alt { [] mcaPort.receive(mw_request(mw_createAe)) -> value v_request { tc_ac.stop; // TODO: answer registration request v_ae := valueof(v_request.primitive.requestPrimitive.primitiveContent.any_1[0].AE_optional); v_ae.resourceType := v_request.primitive.requestPrimitive.resourceType; v_ae.parentID := "~"; // FIXME: to be checked v_ae.creationTime := fx_generateTimestamp(); v_ae.lastModifiedTime := v_ae.creationTime; v_resourceId := lengthof(vc_resourcesList) - 1; v_ae.resourceID := "ae" & int2char(v_resourceId); v_ae.aE_ID := "ae" & int2char(v_resourceId); v_ae.resourceName := "ae" & int2char(v_resourceId); v_request.primitive.requestPrimitive.primitiveContent.any_1[0].AE_optional := v_ae; v_ret := f_setResource(v_request.primitive.requestPrimitive.primitiveContent, -1); mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_request.primitive.requestPrimitive.requestIdentifier, v_request.primitive.requestPrimitive.primitiveContent))); v_rp := v_request.primitive.requestPrimitive; v_parentIndex := f_getResourceIndex(v_rp.to_); v_resourceIndex := f_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource); if(v_resourceIndex != -1) { mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, {any_1 := {v_modifiedResource}}))); log("Preamble: Application registered successfuly"); } else { mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))); setverdict(inconc, testcasename() & ": AE registration failed"); } } [] tc_ac.timeout { setverdict(inconc, testcasename() & ": AE registration request not received"); Loading @@ -115,7 +134,7 @@ module SmartAppliances_Functions { } } return v_ret; return v_resourceIndex; } /** Loading Loading @@ -179,28 +198,6 @@ module SmartAppliances_Functions { } // end aeFunctions group getSetFunctions { /** * @desc Resolution of the resource address field (to) for a given resource depending on addressing and hierarchical format * @param p_targetResourceIndex Internal resource index of the given resource * @return Resource address for the given resource * @verdict */ function f_getAeId(integer p_targetResourceIndex := -1) runs on AeTester return XSD.ID { if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.any_1[0].AE_optional)) { return vc_resourcesList[p_targetResourceIndex].resource.any_1[0].AE_optional.aE_ID; } log("f_getAeId: WARNING: p_targetResourceIndex does not refer to AE resource"); return ""; } // end f_getAeId } // end getSetFunctions group rdfFunctions { function f_rdfParseDescriptor(in XSD.Base64Binary p_receivedDescriptor, out RdfDocument p_decodedDescriptor, out charstring p_verdictMsg) return verdicttype { Loading ttcn/LibSmartAppliances/SmartAppliances_Templates.ttcn +0 −135 Original line number Diff line number Diff line Loading @@ -8,139 +8,4 @@ */ module SmartAppliances_Templates { import from XSD all; // LibOneM2M import from OneM2M_TestSystem all; import from OneM2M_Types all; import from OneM2M_Pixits all; // LibSmartAppliances import from SmartAppliances_Types all; group ContentCreate { /** * @desc Base primitiveContent for CREATE operation for SemanticDescriptor resource */ template SemanticDescriptor_optional mw_contentCreateSemanticDescriptor := { resourceName := *, //O resourceType := omit, //NP resourceID := omit, //NP parentID := omit, //NP creationTime := omit, //NP lastModifiedTime := omit, //NP labels := *, //O accessControlPolicyIDs := *, //O expirationTime := *, //O dynamicAuthorizationConsultationIDs := *, //? announceTo := *, //O announcedAttribute := *, //O creator := *, //O descriptorRepresentation := ?, //M semanticOpExec := omit, //NP descriptor := ?, //M ontologyRef := *, //O relatedSemantics := *, //O choice := * //? } template SemanticDescriptor_optional mw_contentCreateSemanticDescriptor_ontologyRef(template XSD.AnyURI p_ontologyRef) modifies mw_contentCreateSemanticDescriptor := { ontologyRef := p_ontologyRef } } // end ContentCreate group RequestPrimitives { group Create { /** * @desc Base Reception template for create operation */ template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := { operation := int1, to_ := ?, from_ := p_from, requestIdentifier := ?, resourceType := ?, primitiveContent := { any_1 := ? }, roleIDs := *, originatingTimestamp := *, requestExpirationTimestamp := *, resultExpirationTimestamp := *, operationExecutionTime := *, responseType := *, resultPersistence := *, resultContent := *, eventCategory := *, deliveryAggregation := *, groupRequestIdentifier := *, filterCriteria := *, discoveryResultType := *, tokens := *, tokenIDs := *, localTokenIDs := *, tokenRequestIndicator := * } /** * @desc Reception template for AE registration */ template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { resourceType := int2, primitiveContent := { any_1 := {{AE_optional := ?}} } }; /** * @desc Reception template for SemanticDescriptor creation */ template RequestPrimitive mw_createSemanticDescriptor(template XSD.ID p_from := *, template XSD.ID p_to := ?, template SemanticDescriptor_optional p_semanticDescriptor := mw_contentCreateSemanticDescriptor) modifies mw_create := { resourceType := int24, primitiveContent := { any_1 := {{SemanticDescriptor_optional := p_semanticDescriptor}} } }; } // end Create } // end RequestPrimitives group ResponsePrimitives { /** * @desc Base template for sending ResponsePrimitive * @param p_statusCode Status code * @param p_requestId Request ID of the corresponding request */ template (value) ResponsePrimitive m_responsePrimitive(in ResponseStatusCode p_statusCode, in RequestID p_requestId) := { responseStatusCode := p_statusCode, requestIdentifier := p_requestId, primitiveContent := omit, to_ := omit, from_ := omit, originatingTimestamp := omit, resultExpirationTimestamp := omit, eventCategory := omit, contentStatus := omit, contentOffset := omit, assignedTokenIdentifiers := omit, tokenRequestInformation := omit }; /** * @desc Base template for sending ResponsePrimitive * @param p_statusCode Status code * @param p_requestId Request ID of the corresponding request */ template (value) ResponsePrimitive m_responsePrimitive_content(in ResponseStatusCode p_statusCode, in RequestID p_requestId, in PrimitiveContent p_content) modifies m_responsePrimitive := { primitiveContent := p_content } } // end ResponsePrimitives } No newline at end of file ttcn/LibSmartAppliances/SmartAppliances_Types.ttcn +0 −43 Original line number Diff line number Diff line Loading @@ -10,49 +10,6 @@ module SmartAppliances_Types { import from XSD all; // LibOneM2M import from OneM2M_Types all; group optionalResourceTypes { type record SemanticDescriptor_optional { XSD.NCName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, Labels labels optional, AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, ListOfURIs dynamicAuthorizationConsultationIDs optional, ListOfURIs announceTo optional, record length(1 .. infinity) of XSD.NCName announcedAttribute optional, XSD.ID creator optional, DescriptorRepresentation descriptorRepresentation optional, Sparql semanticOpExec optional, XSD.Base64Binary descriptor optional, XSD.AnyURI ontologyRef optional, ListOfURIs relatedSemantics optional, union { record length(1 .. infinity) of ChildResourceRef childResource_list, record length(1 .. infinity) of Subscription subscription_list } choice optional } with { variant "name as uncapitalized"; variant "element"; variant (resourceName) "attribute"; variant (announcedAttribute) "list"; variant (choice) "untagged"; variant (choice.childResource_list) "untagged"; variant (choice.childResource_list[-]) "name as 'childResource'"; variant (choice.subscription_list) "untagged"; variant (choice.subscription_list[-]) "name as 'subscription'"; }; } // end optionalResourceTypes group rdf { type set of RdfTriple RdfDocument; Loading ttcn/SmartAppliances_Testcases.ttcn +62 −31 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -711,7 +712,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -1172,7 +1174,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -1701,7 +1704,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -1930,7 +1934,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2007,7 +2012,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2219,7 +2225,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2317,7 +2324,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2524,7 +2532,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2732,7 +2741,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2939,7 +2949,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -3363,7 +3374,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -3788,7 +3800,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4215,7 +4228,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4282,7 +4296,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4349,7 +4364,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4416,7 +4432,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4483,7 +4500,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4549,7 +4567,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4612,7 +4631,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4683,7 +4703,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4749,7 +4770,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4815,7 +4837,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4881,7 +4904,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4947,7 +4971,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5012,7 +5037,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5073,7 +5099,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5144,7 +5171,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5225,7 +5253,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5306,7 +5335,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5389,7 +5419,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading
ttcn/LibSmartAppliances/SmartAppliances_Functions.ttcn +96 −99 Original line number Diff line number Diff line Loading @@ -22,56 +22,82 @@ module SmartAppliances_Functions { import from SmartAppliances_Templates all; import from SmartAppliances_Types all; group configFunctions { /** * @desc Ports mapping and default behaviour activation for Config 03 */ function f_cf03Up() runs on AeTester system AeSystem { group aeFunctions { map(self:mcaPort, system:mcaPort); map(self:acPort, system:acPort); activate(a_ae_default_sap()); function f_getResourceIndex(in XSD.AnyURI p_address) return integer { return -1; //TODO } group preambleFunctions { /** * @desc Ports unmapping for Config 03 * @desc Creates specified resource * @param p_resource Resource to be created * @param p_parentIndex Parent index of resource to be saved * @param p_resourceType Type of the resource to be created * @param p_modifiedResource Assigned and/or modified fields * @return Internal resource index of the saved resource or -1 * @verdict */ function f_cf03Down() runs on AeTester system AeSystem { function f_createResource(in PrimitiveContent p_resource, in integer p_parentIndex, in ResourceType p_resourceType, out anytype p_modifiedResource) runs on AeTester return integer { unmap(self:mcaPort, system:mcaPort); unmap(self:acPort, system:acPort); } var integer v_resourceIndex; } // end configFunctions // AE if(p_resourceType == int2 and ischosen(p_resource.any_1[0].AE_optional)) { var AE_optional v_ae := p_resource.any_1[0].AE_optional; var AE_optional v_aeModified; group aeFunctions { v_resourceIndex := lengthof(vc_resourcesList) - 1; v_ae.resourceType := p_resourceType; v_ae.parentID := int2str(p_parentIndex); v_ae.creationTime := fx_generateTimestamp(); v_ae.lastModifiedTime := v_ae.creationTime; v_ae.resourceID := "ae" & int2char(v_resourceIndex); v_ae.aE_ID := "ae" & int2char(v_resourceIndex); v_ae.resourceName := "ae" & int2char(v_resourceIndex); group altstepFunctions { v_aeModified.parentID := v_ae.parentID; v_aeModified.creationTime := v_ae.creationTime; v_aeModified.lastModifiedTime := v_ae.lastModifiedTime; v_aeModified.resourceID := v_ae.resourceID; v_aeModified.aE_ID := v_ae.aE_ID; v_aeModified.resourceName := v_ae.resourceName; p_resource.any_1[0].AE_optional := v_ae; p_modifiedResource.AE_optional := v_aeModified; return f_setResource(p_resource, p_parentIndex); } // Error return -1; } /** * @desc Ae altstep (SAP - TODO: merge in oneM2M) * @desc Waits for CREATE request, stores resource and replies to request */ altstep a_ae_default_sap() runs on AeTester { var MsgIn v_request; var anytype v_modifiedResource; var integer v_resourceIndex, v_parentIndex; var RequestPrimitive v_rp; [] mcaPort.receive(mw_request(?)) -> value v_request { log("a_default: WARNING: Unexpected request received"); [] mcaPort.receive(mw_request(mw_create)) -> value v_request { v_rp := v_request.primitive.requestPrimitive; v_parentIndex := f_getResourceIndex(v_rp.to_); v_resourceIndex := f_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource); if(v_resourceIndex != -1) { mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, {any_1 := {v_modifiedResource}}))); } else { mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))); repeat; } [] mcaPort.receive { log("a_default: WARNING: Unexpected message received"); repeat; } } } // end altstepFunctions group preambleFunctions { /** * @desc Waits for AE registration request and process it * @return Internal resource index of AE or -1 in case of failure Loading @@ -80,34 +106,27 @@ module SmartAppliances_Functions { function f_ae_preamble_registerAe() runs on AeTester return integer { var MsgIn v_request; var AE_optional v_ae; var integer v_resourceId; var integer v_ret := -1; var anytype v_modifiedResource; var integer v_resourceIndex, v_parentIndex; var RequestPrimitive v_rp; tc_ac.start; alt { [] mcaPort.receive(mw_request(mw_createAe)) -> value v_request { tc_ac.stop; // TODO: answer registration request v_ae := valueof(v_request.primitive.requestPrimitive.primitiveContent.any_1[0].AE_optional); v_ae.resourceType := v_request.primitive.requestPrimitive.resourceType; v_ae.parentID := "~"; // FIXME: to be checked v_ae.creationTime := fx_generateTimestamp(); v_ae.lastModifiedTime := v_ae.creationTime; v_resourceId := lengthof(vc_resourcesList) - 1; v_ae.resourceID := "ae" & int2char(v_resourceId); v_ae.aE_ID := "ae" & int2char(v_resourceId); v_ae.resourceName := "ae" & int2char(v_resourceId); v_request.primitive.requestPrimitive.primitiveContent.any_1[0].AE_optional := v_ae; v_ret := f_setResource(v_request.primitive.requestPrimitive.primitiveContent, -1); mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_request.primitive.requestPrimitive.requestIdentifier, v_request.primitive.requestPrimitive.primitiveContent))); v_rp := v_request.primitive.requestPrimitive; v_parentIndex := f_getResourceIndex(v_rp.to_); v_resourceIndex := f_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource); if(v_resourceIndex != -1) { mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, {any_1 := {v_modifiedResource}}))); log("Preamble: Application registered successfuly"); } else { mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))); setverdict(inconc, testcasename() & ": AE registration failed"); } } [] tc_ac.timeout { setverdict(inconc, testcasename() & ": AE registration request not received"); Loading @@ -115,7 +134,7 @@ module SmartAppliances_Functions { } } return v_ret; return v_resourceIndex; } /** Loading Loading @@ -179,28 +198,6 @@ module SmartAppliances_Functions { } // end aeFunctions group getSetFunctions { /** * @desc Resolution of the resource address field (to) for a given resource depending on addressing and hierarchical format * @param p_targetResourceIndex Internal resource index of the given resource * @return Resource address for the given resource * @verdict */ function f_getAeId(integer p_targetResourceIndex := -1) runs on AeTester return XSD.ID { if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.any_1[0].AE_optional)) { return vc_resourcesList[p_targetResourceIndex].resource.any_1[0].AE_optional.aE_ID; } log("f_getAeId: WARNING: p_targetResourceIndex does not refer to AE resource"); return ""; } // end f_getAeId } // end getSetFunctions group rdfFunctions { function f_rdfParseDescriptor(in XSD.Base64Binary p_receivedDescriptor, out RdfDocument p_decodedDescriptor, out charstring p_verdictMsg) return verdicttype { Loading
ttcn/LibSmartAppliances/SmartAppliances_Templates.ttcn +0 −135 Original line number Diff line number Diff line Loading @@ -8,139 +8,4 @@ */ module SmartAppliances_Templates { import from XSD all; // LibOneM2M import from OneM2M_TestSystem all; import from OneM2M_Types all; import from OneM2M_Pixits all; // LibSmartAppliances import from SmartAppliances_Types all; group ContentCreate { /** * @desc Base primitiveContent for CREATE operation for SemanticDescriptor resource */ template SemanticDescriptor_optional mw_contentCreateSemanticDescriptor := { resourceName := *, //O resourceType := omit, //NP resourceID := omit, //NP parentID := omit, //NP creationTime := omit, //NP lastModifiedTime := omit, //NP labels := *, //O accessControlPolicyIDs := *, //O expirationTime := *, //O dynamicAuthorizationConsultationIDs := *, //? announceTo := *, //O announcedAttribute := *, //O creator := *, //O descriptorRepresentation := ?, //M semanticOpExec := omit, //NP descriptor := ?, //M ontologyRef := *, //O relatedSemantics := *, //O choice := * //? } template SemanticDescriptor_optional mw_contentCreateSemanticDescriptor_ontologyRef(template XSD.AnyURI p_ontologyRef) modifies mw_contentCreateSemanticDescriptor := { ontologyRef := p_ontologyRef } } // end ContentCreate group RequestPrimitives { group Create { /** * @desc Base Reception template for create operation */ template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := { operation := int1, to_ := ?, from_ := p_from, requestIdentifier := ?, resourceType := ?, primitiveContent := { any_1 := ? }, roleIDs := *, originatingTimestamp := *, requestExpirationTimestamp := *, resultExpirationTimestamp := *, operationExecutionTime := *, responseType := *, resultPersistence := *, resultContent := *, eventCategory := *, deliveryAggregation := *, groupRequestIdentifier := *, filterCriteria := *, discoveryResultType := *, tokens := *, tokenIDs := *, localTokenIDs := *, tokenRequestIndicator := * } /** * @desc Reception template for AE registration */ template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { resourceType := int2, primitiveContent := { any_1 := {{AE_optional := ?}} } }; /** * @desc Reception template for SemanticDescriptor creation */ template RequestPrimitive mw_createSemanticDescriptor(template XSD.ID p_from := *, template XSD.ID p_to := ?, template SemanticDescriptor_optional p_semanticDescriptor := mw_contentCreateSemanticDescriptor) modifies mw_create := { resourceType := int24, primitiveContent := { any_1 := {{SemanticDescriptor_optional := p_semanticDescriptor}} } }; } // end Create } // end RequestPrimitives group ResponsePrimitives { /** * @desc Base template for sending ResponsePrimitive * @param p_statusCode Status code * @param p_requestId Request ID of the corresponding request */ template (value) ResponsePrimitive m_responsePrimitive(in ResponseStatusCode p_statusCode, in RequestID p_requestId) := { responseStatusCode := p_statusCode, requestIdentifier := p_requestId, primitiveContent := omit, to_ := omit, from_ := omit, originatingTimestamp := omit, resultExpirationTimestamp := omit, eventCategory := omit, contentStatus := omit, contentOffset := omit, assignedTokenIdentifiers := omit, tokenRequestInformation := omit }; /** * @desc Base template for sending ResponsePrimitive * @param p_statusCode Status code * @param p_requestId Request ID of the corresponding request */ template (value) ResponsePrimitive m_responsePrimitive_content(in ResponseStatusCode p_statusCode, in RequestID p_requestId, in PrimitiveContent p_content) modifies m_responsePrimitive := { primitiveContent := p_content } } // end ResponsePrimitives } No newline at end of file
ttcn/LibSmartAppliances/SmartAppliances_Types.ttcn +0 −43 Original line number Diff line number Diff line Loading @@ -10,49 +10,6 @@ module SmartAppliances_Types { import from XSD all; // LibOneM2M import from OneM2M_Types all; group optionalResourceTypes { type record SemanticDescriptor_optional { XSD.NCName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, Labels labels optional, AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, ListOfURIs dynamicAuthorizationConsultationIDs optional, ListOfURIs announceTo optional, record length(1 .. infinity) of XSD.NCName announcedAttribute optional, XSD.ID creator optional, DescriptorRepresentation descriptorRepresentation optional, Sparql semanticOpExec optional, XSD.Base64Binary descriptor optional, XSD.AnyURI ontologyRef optional, ListOfURIs relatedSemantics optional, union { record length(1 .. infinity) of ChildResourceRef childResource_list, record length(1 .. infinity) of Subscription subscription_list } choice optional } with { variant "name as uncapitalized"; variant "element"; variant (resourceName) "attribute"; variant (announcedAttribute) "list"; variant (choice) "untagged"; variant (choice.childResource_list) "untagged"; variant (choice.childResource_list[-]) "name as 'childResource'"; variant (choice.subscription_list) "untagged"; variant (choice.subscription_list[-]) "name as 'subscription'"; }; } // end optionalResourceTypes group rdf { type set of RdfTriple RdfDocument; Loading
ttcn/SmartAppliances_Testcases.ttcn +62 −31 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -711,7 +712,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -1172,7 +1174,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -1701,7 +1704,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -1930,7 +1934,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2007,7 +2012,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2219,7 +2225,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2317,7 +2324,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2524,7 +2532,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2732,7 +2741,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -2939,7 +2949,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -3363,7 +3374,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -3788,7 +3800,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4215,7 +4228,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4282,7 +4296,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4349,7 +4364,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4416,7 +4432,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4483,7 +4500,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4549,7 +4567,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4612,7 +4631,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4683,7 +4703,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4749,7 +4770,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4815,7 +4837,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4881,7 +4904,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -4947,7 +4971,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5012,7 +5037,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5073,7 +5099,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5144,7 +5171,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5225,7 +5253,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5306,7 +5335,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading Loading @@ -5389,7 +5419,8 @@ module SmartAppliances_Testcases { } // Test component configuration SmartAppliances_Functions.f_cf03Up(); f_cf03Up(); activate(a_ae_default_sap()); // Test adapter configuration Loading