diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 90e940537894a07281ac4c1113a2ce46a338852e..e06b55280ad793f66f6d55a3af02ab0fb7f2b698 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -1640,12 +1640,17 @@ module OneM2M_Templates { template (value) PrimitiveContent m_primitiveContentResponsePrimitive(template ResponsePrimitive p_responsePrimitive) := { responsePrimitive := valueof(p_responsePrimitive) } + + template (value) PrimitiveContent m_primitiveContentGroup(template Group_optional p_group) := { + group_ := valueof(p_group) + } template PrimitiveContent mw_primitiveContent := ?; template PrimitiveContent mw_primitiveContentNotification (template Notification p_notification) := { notification := p_notification }; + /** * @desc Base primitiveContent for CREATE operation for AEAnnc resource diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 39902a4842471092fe0df5689c09b75314b57989..980d81d7da85137bc8a93d0764e6d6bca90d1ff7 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -10557,13 +10557,13 @@ module OneM2M_Testcases_CSE_Release_1 { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var integer v_acpIndex := -1; + var integer v_targetResourceIndex := -1; + var integer v_cseBaseIndex := -1; var RequestPrimitive v_request; var template RequestPrimitive v_containerCreateRequest := m_createContainerBase; var template RequestPrimitive v_createRequest; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, int61); //c_CUDNDi - + var XSD.ID v_targetResourceAddress; + // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); @@ -10571,22 +10571,36 @@ module OneM2M_Testcases_CSE_Release_1 { } // Test component configuration - f_cf01Up(); - + f_cf02Up(); + // Test adapter configuration - + // Preamble + + v_cseBaseIndex := f_getLatestLocalResourceIndex(vc_cse1); + + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()}))); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + + v_aeIndex := f_cse_preamble_registerAe(); + + //Creating resource in Hosting CSE + vc_cse1.start(f_generateAndSetLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), v_cseBaseIndex, int3)); + vc_cse1.done; + + // Test Body + + v_targetResourceAddress := f_getLatestLocalResourceAddress(vc_cse1, e_nonHierarchical, e_spRelative); - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerCreateRequest.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_containerIndex := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource + v_targetResourceIndex := f_getLatestLocalResourceIndex(vc_cse1); - v_createRequest := m_createGroup(1, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int3); + v_createRequest := m_createGroup(1, {v_targetResourceAddress}, omit, int3); v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // creating group - + // Test Body - + + vc_cse1.start(f_cse_retrieveResourceHandler(v_targetResourceIndex, -)); + f_send(e_mca_port, m_request(v_request)); tc_ac.start; alt { @@ -10606,9 +10620,9 @@ module OneM2M_Testcases_CSE_Release_1 { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } - - f_checkAeSimuStatus(); - + + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + //Check to see if the resource is NOT present if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); @@ -10620,7 +10634,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_cse_postamble_deleteResources(); // Tear down - f_cf01Down(); + f_cf02Down(); } /**