Skip to content
Snippets Groups Projects
Commit f0ecb241 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Example of check of correctly update of resource

parent dca45e2a
No related branches found
No related tags found
2 merge requests!25Ae fixes,!20Stf531 check tpreq ttcn
......@@ -7066,16 +7066,15 @@ module OneM2M_Testcases {
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2:= {"VALUE_2"};
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_createRequest.primitiveContent.container.labels := v_labels_1;
v_updateRequest.primitiveContent.container.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_001(int3, v_createRequest, v_updateRequest);//Container
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
......@@ -7085,6 +7084,12 @@ module OneM2M_Testcases {
}
}
}
//Check that the resource has been udpated correctly
if(ischosen(v_primitiveContentRetrieveResource.container)) {
if(v_primitiveContentRetrieveResource.container.labels != v_labels_2){
setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
}
}
}
}
......@@ -7095,6 +7100,7 @@ module OneM2M_Testcases {
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_createRequest.primitiveContent.group_.labels := v_labels_1;
v_updateRequest.primitiveContent.group_.labels := v_labels_2;
......@@ -7110,6 +7116,12 @@ module OneM2M_Testcases {
}
}
}
//Check that the resource has been udpated correctly
if(ischosen(v_primitiveContentRetrieveResource.group_)) {
if(v_primitiveContentRetrieveResource.group_.labels != v_labels_2){
setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
}
}
}
}
......@@ -7120,6 +7132,7 @@ module OneM2M_Testcases {
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;
v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;
......@@ -7135,6 +7148,12 @@ module OneM2M_Testcases {
}
}
}
//Check that the resource has been udpated correctly
if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels_2){
setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
}
}
}
}
......@@ -7146,6 +7165,7 @@ module OneM2M_Testcases {
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_createRequest.primitiveContent.schedule.labels := v_labels_1;
v_updateRequest.primitiveContent.schedule.labels := v_labels_2;
......@@ -7161,6 +7181,12 @@ module OneM2M_Testcases {
}
}
}
//Check that the resource has been udpated correctly
if(ischosen(v_primitiveContentRetrieveResource.schedule)) {
if(v_primitiveContentRetrieveResource.schedule.labels != v_labels_2){
setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
}
}
}
}
......@@ -7172,6 +7198,7 @@ module OneM2M_Testcases {
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1;
v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2;
......@@ -7187,6 +7214,12 @@ module OneM2M_Testcases {
}
}
}
//Check that the resource has been udpated correctly
if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
if(v_primitiveContentRetrieveResource.pollingChannel.labels != v_labels_2){
setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
}
}
}
}
......@@ -7197,11 +7230,12 @@ module OneM2M_Testcases {
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_createRequest.primitiveContent.subscription.labels := v_labels_1;
v_updateRequest.primitiveContent.subscription.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_001(int23, v_createRequest, v_updateRequest);//Subscription
v_responsePrimitive := f_CSE_DMR_UPD_001(int23, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
if(getverdict == pass){
//Check attribute 1
......@@ -7212,11 +7246,17 @@ module OneM2M_Testcases {
}
}
}
//Check that the resource has been udpated correctly
if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_2){
setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
}
}
}
}
function f_CSE_DMR_UPD_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester return ResponsePrimitive{
function f_CSE_DMR_UPD_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive{
// Local variables
var MsgIn v_response;
......@@ -7258,7 +7298,12 @@ module OneM2M_Testcases {
setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
f_checkCseTesterStatus();
//Used to check that the resource has been updated
p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
// Postamble
f_cse_postamble_deleteResources();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment