Commit c787507d authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Implementing testcase TC_CSE_REG_CRE_029


Signed-off-by: Pramod Kulkarni's avatarpkulkarni <pkulkarni75@gmail.com>
parents 4af555cd 9cf47327
...@@ -418,6 +418,7 @@ module OneM2M_Functions { ...@@ -418,6 +418,7 @@ module OneM2M_Functions {
if(p_resourceType == int23){ if(p_resourceType == int23){
p_ae2 := AeSimu.create("AE2") alive; p_ae2 := AeSimu.create("AE2") alive;
p_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred p_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred
p_ae2.done;
p_ae2Index := f_getResource(p_ae2); p_ae2Index := f_getResource(p_ae2);
if(ischosen(p_createRequestPrimitive.primitiveContent.subscription)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced if(ischosen(p_createRequestPrimitive.primitiveContent.subscription)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced
p_createRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_ae2Index)}; p_createRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_ae2Index)};
...@@ -578,7 +579,7 @@ module OneM2M_Functions { ...@@ -578,7 +579,7 @@ module OneM2M_Functions {
p_cse.start(f_sendRemoteCseResource()); p_cse.start(f_sendRemoteCseResource());
alt { alt {
[]infoPort.receive(mw_resource) -> value v_resource { []infoPort.receive(mw_resource) -> value v_resource {
v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex); v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
} }
} }
...@@ -600,7 +601,7 @@ module OneM2M_Functions { ...@@ -600,7 +601,7 @@ module OneM2M_Functions {
p_ae.start(f_sendResource(p_resourceIndex)); p_ae.start(f_sendResource(p_resourceIndex));
alt { alt {
[]infoPort.receive(mw_resource) -> value v_resource { []infoPort.receive(mw_resource) -> value v_resource {
v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex); v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
} }
} }
...@@ -1163,7 +1164,7 @@ module OneM2M_Functions { ...@@ -1163,7 +1164,7 @@ module OneM2M_Functions {
[] mcaPortIn.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_request { [] mcaPortIn.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_request {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ":INFO: Notification received"); setverdict(pass, __SCOPE__ & ":INFO: Notification received");
v_responsePrimitive.requestIdentifier := v_request.primitive.requestPrimitive.requestIdentifier;
// if(f_isHierarchical(v_request.primitive.requestPrimitive.primitiveContent.notification.creator)) { // if(f_isHierarchical(v_request.primitive.requestPrimitive.primitiveContent.notification.creator)) {
// setverdict(fail, __SCOPE__ & ": Creator cannot contain a hierarchical address"); // setverdict(fail, __SCOPE__ & ": Creator cannot contain a hierarchical address");
// v_responsePrimitive.responseStatusCode := int4000; // v_responsePrimitive.responseStatusCode := int4000;
...@@ -1174,7 +1175,6 @@ module OneM2M_Functions { ...@@ -1174,7 +1175,6 @@ module OneM2M_Functions {
// setverdict(fail, __SCOPE__ & ": Creator not set to originator of the subscription creation primitive"); // setverdict(fail, __SCOPE__ & ": Creator not set to originator of the subscription creation primitive");
// v_responsePrimitive.responseStatusCode := int4000; // v_responsePrimitive.responseStatusCode := int4000;
// } // }
mcaPortIn.send(m_httpResponse(v_responsePrimitive));
} }
[] mcaPortIn.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_request { [] mcaPortIn.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_request {
tc_ac.stop; tc_ac.stop;
...@@ -1186,9 +1186,18 @@ module OneM2M_Functions { ...@@ -1186,9 +1186,18 @@ module OneM2M_Functions {
} }
[] tc_ac.timeout { [] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No notification received"); setverdict(fail, __SCOPE__ & ":ERROR: No notification received");
stop;
} }
} }
v_responsePrimitive.requestIdentifier := v_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict() == pass) {
mcaPortIn.send(m_httpResponse(v_responsePrimitive));
} else {
v_responsePrimitive.responseStatusCode := int4000;
mcaPortIn.send(m_httpResponse(v_responsePrimitive));
}
//mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted //mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted
} //end f_subscriptionVerificationHandler } //end f_subscriptionVerificationHandler
...@@ -1533,7 +1542,7 @@ module OneM2M_Functions { ...@@ -1533,7 +1542,7 @@ module OneM2M_Functions {
} }
p_myResource.remoteCSE.nodeLink := omit; p_myResource.remoteCSE.nodeLink := omit;
return f_setResource(p_myResource, p_resourceType, p_parentIndex); return f_setResource(p_myResource, p_resourceType, p_parentIndex, false);
} }
} }
...@@ -1695,7 +1704,7 @@ module OneM2M_Functions { ...@@ -1695,7 +1704,7 @@ module OneM2M_Functions {
p_resource.aE := v_ae; p_resource.aE := v_ae;
p_modifiedResource.aE := v_aeModified; p_modifiedResource.aE := v_aeModified;
return f_setResource(p_resource, p_resourceType, p_parentIndex); return f_setResource(p_resource, p_resourceType, p_parentIndex, false);
} }
...@@ -2185,7 +2194,7 @@ module OneM2M_Functions { ...@@ -2185,7 +2194,7 @@ module OneM2M_Functions {
* @return Internal resource index of the saved resource * @return Internal resource index of the saved resource
* @verdict * @verdict
*/ */
function f_setResource(PrimitiveContent p_resource, ResourceType p_resourceType, integer p_parentIndex := -1) runs on Tester return integer { function f_setResource(PrimitiveContent p_resource, ResourceType p_resourceType, integer p_parentIndex := -1, in boolean p_resourceToBeDeleted := true) runs on Tester return integer {
var integer v_newIndex := -1; var integer v_newIndex := -1;
if(isbound(vc_resourcesList)) { if(isbound(vc_resourcesList)) {
vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resourceType, p_resource}; vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resourceType, p_resource};
...@@ -2194,8 +2203,10 @@ module OneM2M_Functions { ...@@ -2194,8 +2203,10 @@ module OneM2M_Functions {
} }
v_newIndex := lengthof(vc_resourcesList)-1; v_newIndex := lengthof(vc_resourcesList)-1;
if(match(int2, p_resourceType) or match(-1, p_parentIndex)) {//If created resource is an AE or created under CSEBase, it needs to be added to the resourceToBeDeleted list if(p_resourceToBeDeleted) {
vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_newIndex}; if(match(int2, p_resourceType) or match(-1, p_parentIndex)) {//If created resource is an AE or created under CSEBase, it needs to be added to the resourceToBeDeleted list
vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_newIndex};
}
} }
return v_newIndex; return v_newIndex;
......
...@@ -920,7 +920,6 @@ module OneM2M_Testcases { ...@@ -920,7 +920,6 @@ module OneM2M_Testcases {
f_cf01Up(); f_cf01Up();
//Preambule //Preambule
v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C-AE-ID-STEM"});//c_CRUDNDi);
//Test Body //Test Body
v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));
...@@ -955,7 +954,7 @@ module OneM2M_Testcases { ...@@ -955,7 +954,7 @@ module OneM2M_Testcases {
* @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE) * @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE)
* *
*/ */
testcase TC_CSE_REG_CRE_004() runs on InCseSimu system CseSystem { testcase TC_CSE_REG_CRE_004() runs on AeSimu system CseSystem {
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_request; var RequestPrimitive v_request;
...@@ -963,25 +962,25 @@ module OneM2M_Testcases { ...@@ -963,25 +962,25 @@ module OneM2M_Testcases {
var ResourceType v_resourceType := int2; var ResourceType v_resourceType := int2;
// Test component configuration // Test component configuration
f_cf01UpCseSimuMaster(); f_cf01Up();
//Preambule //Preambule
//vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); //vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
//TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule //TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule
//v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile(-);//c_CRUDNDi); //v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi);
//Test Body //Test Body
//v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); //v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));
vc_aeSimu.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "C"))); f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "C"));
tc_ac.start; tc_ac.start;
alt { alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int4005))) { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": AE creation rejected."); setverdict(pass, __SCOPE__ & ": AE creation rejected.");
} }
[] mccPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
} }
...@@ -991,10 +990,10 @@ module OneM2M_Testcases { ...@@ -991,10 +990,10 @@ module OneM2M_Testcases {
} }
// Postamble // Postamble
f_cse_postamble_deleteResourcesCSE(); f_cse_postamble_deleteResources();
// Tear down // Tear down
f_cf01DownCseSimuMaster(); f_cf01Down();
} }
...@@ -1173,10 +1172,13 @@ module OneM2M_Testcases { ...@@ -1173,10 +1172,13 @@ module OneM2M_Testcases {
f_cf02Up(); f_cf02Up();
//Preambule //Preambule
vc_cseSimu.start(f_cse_registrationRemoteCse(mw_createRemoteCSEBase));
vc_cseSimu.done;
v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S-AE-ID-STEM")); v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S-AE-ID-STEM"));
vc_cseSimu.start(f_cse_resourceAnnouncementHandler()); vc_cseSimu.start(f_cse_resourceAnnouncementHandler());
vc_cseSimu.done;
//TODO Deregister //TODO Deregister
//f_cse_deleteResource(v_aeIndex); //f_cse_deleteResource(v_aeIndex);
...@@ -1220,9 +1222,9 @@ module OneM2M_Testcases { ...@@ -1220,9 +1222,9 @@ module OneM2M_Testcases {
// Tear down // Tear down
f_cf02Down(); f_cf02Down();
} //end TC_CSE_REG_CRE_010 }; //end TC_CSE_REG_CRE_010
group g_CSE_REG_CRE_016{ group g_CSE_REG_CRE_016 {
/** /**
* @desc Check that the IUT accepts a create request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE. * @desc Check that the IUT accepts a create request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE.
...@@ -1539,7 +1541,7 @@ module OneM2M_Testcases { ...@@ -1539,7 +1541,7 @@ module OneM2M_Testcases {
* @desc Check that the IUT rejects the create request of <CSEBase> resource. * @desc Check that the IUT rejects the create request of <CSEBase> resource.
* *
*/ */
testcase TC_CSE_REG_CRE_027() runs on InCseSimu system CseSystem { testcase TC_CSE_REG_CRE_027() runs on AeSimu system CseSystem {
// Local variables // Local variables
var RequestPrimitive v_request; var RequestPrimitive v_request;
...@@ -1549,23 +1551,23 @@ module OneM2M_Testcases { ...@@ -1549,23 +1551,23 @@ module OneM2M_Testcases {
// Test control // Test control
// Test component configuration // Test component configuration
f_cf01UpCseSimuMaster(); f_cf02Up();
// Test adapter configuration // Test adapter configuration
// Preamble // Preamble
vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); vc_cseSimu.start(f_cse_registrationRemoteCse(mw_createRemoteCSEBase));
// Test Body // Test Body
vc_aeSimu.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit))); f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit));
tc_ac.start; tc_ac.start;
alt { alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": AE creation successful."); setverdict(pass, __SCOPE__ & ": AE creation successful.");
} }
[] mccPort.receive { [] mcaPort.receive {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE"); setverdict(fail, __SCOPE__ & ": Error while creating AE");
} }
...@@ -1575,10 +1577,10 @@ module OneM2M_Testcases { ...@@ -1575,10 +1577,10 @@ module OneM2M_Testcases {
} }
// Postamble // Postamble
f_cse_postamble_deleteResourcesCSE(); f_cse_postamble_deleteResources();
// Tear down // Tear down
f_cf01DownCseSimuMaster(); f_cf02Down();
}//end TC_CSE_REG_CRE_027 }//end TC_CSE_REG_CRE_027
...@@ -1632,50 +1634,47 @@ module OneM2M_Testcases { ...@@ -1632,50 +1634,47 @@ module OneM2M_Testcases {
} }
/**
* @desc Check that IUT sends a CSE registration request with attributes multiplicity equals to 1
*
*/
testcase TC_CSE_REG_CRE_029() runs on CseSimu system CseSystem { testcase TC_CSE_REG_CRE_029() runs on CseSimu system CseSystem {
//var MsgIn v_response; //var MsgIn v_response;
var RequestPrimitive v_request; var RequestPrimitive v_request;
var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase); var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase);
var ResourceType v_resourceType := int16; var ResourceType v_resourceType := int16;
// Test control
// Test component configuration
f_cf04Up();
// Test adapter configuration
// Preamble
v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1);
mccPort.send(m_request(v_request)); // Test control
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE");
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
} // Test component configuration
f_cf04Up();
// Test adapter configuration
// Preamble
v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1);
mccPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE");
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
}
} //end group Create } //end group Create
...@@ -2571,16 +2570,17 @@ module OneM2M_Testcases { ...@@ -2571,16 +2570,17 @@ module OneM2M_Testcases {
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code"); setverdict(fail, __SCOPE__ & ": Wrong response status code");
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
} }
...@@ -2600,14 +2600,14 @@ module OneM2M_Testcases { ...@@ -2600,14 +2600,14 @@ module OneM2M_Testcases {
// Postamble // Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
vc_resourcesIndexToBeDeleted := {}; v_ae2.start(f_cse_postamble_deleteResources());
// Tear down // Tear down
//ae2.stop; //ae2.stop;
f_cf01Down(); f_cf01Down();
unmap(v_ae2:mcaPort, system:mcaPort); unmap(v_ae2:mcaPort, system:mcaPort);
return v_response.primitive.responsePrimitive; return vc_response.primitive.responsePrimitive;
}//end f_CSE_DMR_CRE_001 }//end f_CSE_DMR_CRE_001
...@@ -2774,16 +2774,17 @@ module OneM2M_Testcases { ...@@ -2774,16 +2774,17 @@ module OneM2M_Testcases {
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex);
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code"); setverdict(fail, __SCOPE__ & ": Wrong response status code");
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
} }
...@@ -2806,7 +2807,7 @@ module OneM2M_Testcases { ...@@ -2806,7 +2807,7 @@ module OneM2M_Testcases {
// Tear down // Tear down
f_cf01Down(); f_cf01Down();
return v_response.primitive.responsePrimitive; return vc_response.primitive.responsePrimitive;
}//end f_CSE_DMR_CRE_002 }//end f_CSE_DMR_CRE_002
...@@ -3252,16 +3253,17 @@ module OneM2M_Testcases { ...@@ -3252,16 +3253,17 @@ module OneM2M_Testcases {
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType))); setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType)));
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex);
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code"); setverdict(fail, __SCOPE__ & ": Wrong response status code");
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType))); setverdict(fail, __SCOPE__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType)));
} }
...@@ -3285,7 +3287,7 @@ module OneM2M_Testcases { ...@@ -3285,7 +3287,7 @@ module OneM2M_Testcases {
// Tear down // Tear down
f_cf01Down(); f_cf01Down();
return v_response.primitive.responsePrimitive; return vc_response.primitive.responsePrimitive;
}//end f_CSE_DMR_CRE_006 }//end f_CSE_DMR_CRE_006
...@@ -4492,6 +4494,7 @@ module OneM2M_Testcases { ...@@ -4492,6 +4494,7 @@ module OneM2M_Testcases {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name); setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name);
f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
...@@ -8525,15 +8528,15 @@ module OneM2M_Testcases { ...@@ -8525,15 +8528,15 @@ module OneM2M_Testcases {
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code"); setverdict(fail, __SCOPE__ & ": Wrong response status code");
} }
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType)));
} }
...@@ -8553,7 +8556,7 @@ module OneM2M_Testcases { ...@@ -8553,7 +8556,7 @@ module OneM2M_Testcases {
// Tear down // Tear down
f_cf01Down(); f_cf01Down();
return v_response.primitive.responsePrimitive; return vc_response.primitive.responsePrimitive;
}//end f_CSE_DMR_UPD_001 }//end f_CSE_DMR_UPD_001
...@@ -8805,15 +8808,15 @@ module OneM2M_Testcases { ...@@ -8805,15 +8808,15 @@ module OneM2M_Testcases {
mcaPort.send(m_request(v_request)); mcaPort.send(m_request(v_request));
tc_ac.start; tc_ac.start;
alt { alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response {
tc_ac.stop;