Add TC_CSE_DMR_UPD_BO_005

parent 459148da
......@@ -1911,6 +1911,159 @@ module OneM2M_Testcases {
} // end g_CSE_DMR_UPD_BV_004
group g_CSE_DMR_UPD_BO_005{
testcase TC_CSE_DMR_UPD_BV_005_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var AcpType v_acp := {"ACP_ID"};
var XSD.NonNegativeInteger v_maxNrOfInstances := 5;
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_createRequest.content.any_1[0].Container_create.labels := v_labels_1;
v_createRequest.content.any_1[0].Container_create.maxNrOfInstances := v_maxNrOfInstances;
v_updateRequest.content.any_1[0].Container_update.labels := v_labels_2;
v_updateRequest.content.any_1[0].Container_update.maxNrOfInstances := 0;//TODO
v_updateRequest.content.any_1[0].Container_update.accessControlPolicyIDs := v_acp;
f_CSE_DMR_UPD_BO_005(int3, v_createRequest, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_BV_005_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var AcpType v_acp := {"ACP_ID"};
var XSD.String v_groupName := "MyGroupName";
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_createRequest.content.any_1[0].Group_create.labels := v_labels_1;
v_createRequest.content.any_1[0].Group_create.groupName := "MyGroupName";
v_updateRequest.content.any_1[0].Group_update.labels := v_labels_2;
v_updateRequest.content.any_1[0].Group_update.groupName:= "";//TODO Set to NULL
v_updateRequest.content.any_1[0].Group_update.accessControlPolicyIDs := v_acp;
f_CSE_DMR_UPD_BO_005(int9, v_createRequest, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_BV_005_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"NULL"};
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_createRequest.content.any_1[0].ACP_create.labels := v_labels_1;
//v_createRequest.content.any_1[0].ACP_create.groupName := "MyGroupName";TODO Need to find Attribute 2
v_updateRequest.content.any_1[0].ACP_update.labels := v_labels_2;
//v_updateRequest.content.any_1[0].ACP_update.groupName:= "";//TODO Set to NULL
//v_updateRequest.content.any_1[0].ACP_update.accessControlPolicyIDs := v_acp; TODO Need to find Attribute 3
f_CSE_DMR_UPD_BO_005(int1, v_createRequest, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BV_005_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"NULL"};
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_createRequest.content.any_1[0].Schedule_create.labels := v_labels_1;
//v_createRequest.content.any_1[0].Schedule_create.groupName := "MyGroupName";TODO Need to find Attribute 2
v_updateRequest.content.any_1[0].Schedule_update.labels := v_labels_2;
//v_updateRequest.content.any_1[0].Schedule_update.groupName:= "";//TODO Set to NULL
//v_updateRequest.content.any_1[0].Schedule_update.accessControlPolicyIDs := v_acp; TODO Need to find Attribute 3
f_CSE_DMR_UPD_BO_005(int18, v_createRequest, v_updateRequest);//Schedule
}
testcase TC_CSE_DMR_UPD_BV_005_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"NULL"};
var AcpType v_acp := {"ACP_ID"};
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_createRequest.content.any_1[0].PollingChannel_create.labels := v_labels_1;
//v_createRequest.content.any_1[0].PollingChannel_create.groupName := "MyGroupName";TODO Need to find Attribute 2
v_updateRequest.content.any_1[0].PollingChannel_update.labels := v_labels_2;
//v_updateRequest.content.any_1[0].PollingChannel_update.groupName:= "";//TODO Set to NULL
v_updateRequest.content.any_1[0].PollingChannel_update.accessControlPolicyIDs := v_acp;
f_CSE_DMR_UPD_BO_005(int15, v_createRequest, v_updateRequest);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BV_005_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"NULL"};
var AcpType v_acp := {"ACP_ID"};
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_createRequest.content.any_1[0].Subscription_create.labels := v_labels_1;
v_createRequest.content.any_1[0].Subscription_create.expirationCounter := 5;
v_updateRequest.content.any_1[0].Subscription_update.labels := v_labels_2;
v_updateRequest.content.any_1[0].Subscription_update.expirationCounter := 1;//TODO Set to NULL
v_updateRequest.content.any_1[0].Subscription_update.accessControlPolicyIDs := v_acp;
f_CSE_DMR_UPD_BO_005(int23, v_createRequest, v_updateRequest);//Subscription
}
function f_CSE_DMR_UPD_BO_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var XSD.ID v_resourceId_content;
var XSD.String v_resourceName := "myResource";
var XSD.String v_aeName := "ae_test";
var XSD.String v_aeResourceAddress := "/" & PX_CSE_NAME & "/" & v_aeName ;
var XSD.String v_targetResourceAddress := "/" & PX_CSE_NAME & "/" & v_aeName & "/" & v_resourceName;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
f_preamble_registerAe(v_aeName, int63);//c_CRUDNDi);
f_createResource(p_resourceType, v_aeResourceAddress, v_resourceName, p_createRequestPrimitive);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_targetResourceAddress, v_resourceName, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfuly");
//TODO: Check that name attribute is provided
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating resource type " & int2str(enum2int(p_resourceType)));
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources(v_aeName);
}//end f_CSE_DMR_UPD_BO_005
} // end g_CSE_DMR_UPD_BO_005
}//end group Update
}//end group Data_Management_and_Repository
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment