Skip to content
Snippets Groups Projects

Initial draft of Group Management (GMG) test cases

Merged Axel Rennoch requested to merge GMG into master
1 file
+ 955
0
Compare changes
  • Side-by-side
  • Inline
+ 4306
3540
/**
* Copyright Notification
* No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
* All rights reserved.
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
* $Id: OneM2M_Testcases.ttcn 99 2016-06-09 15:04:43Z reinaortega $
* @desc Module containing test cases for oneM2M
*
*/
//Test
module OneM2M_Testcases {
import from OneM2M_TestSystem all;
import from OneM2M_Templates all;
import from OneM2M_Types all;//{type XSD.ID};
import from OneM2M_TypesAndValues all;
import from OneM2M_Pixits all;
import from OneM2M_Functions all;
import from LibCommon_Time {modulepar all};
import from XSD all;
//Demos used for validation purposes
group oneM2M_demos {
group helpingTestCases {//These are not part of the test suite, just for verification purposes
testcase TC_DELETE_AE() runs on M2M system M2MSystem {
timer t_ac := 5.0;
map(self:mcaPort, system:mcaPort);
mcaPort.send(m_request(m_deleteRequest(PX_URI_CSE & PX_CSE_NAME & "/" & PX_RESOURCE_TO_BE_DELETED)));
t_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) {
t_ac.stop;
log("Postamble: Resource deleted");
setverdict(pass);
}
[] mcaPort.receive(mw_responseKO) {
t_ac.stop;
log("Postamble: Error while deleting resource");
setverdict(fail);
}
[] mcaPort.receive {
t_ac.stop;
log("Postamble: Unexpected message received");
setverdict(inconc);
}
[] t_ac.timeout {
log("Postamble: No answer while deleting resource");
setverdict(inconc);
}
}
unmap(self:mcaPort, system:mcaPort);
stop;
}
testcase TC_DELETE_RESOURCES() runs on M2M system M2MSystem {
timer t_ac := 5.0;
var integer i;
map(self:mcaPort, system:mcaPort);
for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) {
mcaPort.send(m_request(m_delete(PX_URI_CSE & "/" & PX_CSE_NAME & "/" & PX_RESOURCES_TO_BE_DELETED[i])));
t_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) {
t_ac.stop;
log("Postamble: Resource deleted");
setverdict(pass);
}
[] mcaPort.receive(mw_responseKO) {
t_ac.stop;
log("Postamble: Error while deleting resource");
setverdict(fail);
}
[] mcaPort.receive {
t_ac.stop;
log("Postamble: Unexpected message received");
setverdict(inconc);
}
[] t_ac.timeout {
log("Postamble: No answer while deleting resource");
setverdict(inconc);
}
}
}
unmap(self:mcaPort, system:mcaPort);
stop;
}
}
}//end group oneM2M_demos
group CSE {
group Data_Management_and_Repository {
group g_CSE_DMR_BV_001 {
testcase TC_CSE_DMR_BV_001_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_BV_001_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_BV_001_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int1, m_createAcpBase);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_001_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_BV_001_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_BV_001_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int0;//Nothing
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
if(ispresent(v_response.responsePrimitive_.primitiveContent)){
setverdict(fail, testcasename() & ": Providing content when RC set to 0");
} else {
setverdict(pass, testcasename() & ": No content provided with RC set to 0");
}
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_001
} // end g_CSE_DMR_BV_001
group g_CSE_DMR_BV_002 {
testcase TC_CSE_DMR_BV_002_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1;
f_CSE_DMR_BV_002(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_002_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc1;
f_CSE_DMR_BV_002(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_002_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1;
f_CSE_DMR_BV_002(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_002_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc1;
f_CSE_DMR_BV_002(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_002_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_002(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_002_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc1;
f_CSE_DMR_BV_002(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_002
} // end g_CSE_DMR_BV_002
group g_CSE_DMR_BV_003 {
testcase TC_CSE_DMR_BV_003_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentContainer_rc2;
f_CSE_DMR_BV_003(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_003_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentGroup_rc2;
f_CSE_DMR_BV_003(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_003_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentAcp_rc2;
f_CSE_DMR_BV_003(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_003_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentSchedule_rc2;
f_CSE_DMR_BV_003(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_003_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_003(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_003_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentSubscription_rc2;
f_CSE_DMR_BV_003(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int2;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Only hierarchical address provided with RC set to 2");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Not only hierarchical address provided with RC set to 2");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_003
} // end g_CSE_DMR_BV_003
group g_CSE_DMR_BV_004 {
testcase TC_CSE_DMR_BV_004_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc3;
f_CSE_DMR_BV_004(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_004_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc3;
f_CSE_DMR_BV_004(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_004_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc3;
f_CSE_DMR_BV_004(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_004_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc3;
f_CSE_DMR_BV_004(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_004_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_004_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc3;
f_CSE_DMR_BV_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_004
} // end g_CSE_DMR_BV_004
group g_CSE_DMR_BV_005 {
testcase TC_CSE_DMR_BV_005_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc4;
f_CSE_DMR_BV_005(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_005_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc4;
f_CSE_DMR_BV_005(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_005_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc4;
f_CSE_DMR_BV_005(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_005_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc4;
f_CSE_DMR_BV_005(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_005_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_005_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc4;
f_CSE_DMR_BV_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_005
} // end g_CSE_DMR_BV_005
group g_CSE_DMR_BV_006 {
testcase TC_CSE_DMR_BV_006_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc5;
f_CSE_DMR_BV_006(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_006_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc5;
f_CSE_DMR_BV_006(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_006_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc5;
f_CSE_DMR_BV_006(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_006_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc5;
f_CSE_DMR_BV_006(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_006_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_006_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc5;
f_CSE_DMR_BV_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_006
} // end g_CSE_DMR_BV_006
group g_CSE_DMR_BV_007 {
testcase TC_CSE_DMR_BV_007_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc6;
f_CSE_DMR_BV_007(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_007_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc6;
f_CSE_DMR_BV_007(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_007_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc6;
f_CSE_DMR_BV_007(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_007_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc6;
f_CSE_DMR_BV_007(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_007_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_007(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_007_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc6;
f_CSE_DMR_BV_007(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_007
} // end g_CSE_DMR_BV_007
group Create {
group g_CSE_DMR_CRE_BV_001 {
testcase TC_CSE_DMR_CRE_BV_001_01() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Container_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int3, v_createRequest);//Container
log(v_responsePrimitive);
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_02() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Group_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int9, v_createRequest);//Group
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_03() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int1, v_createRequest);//AccessControlPolicy
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_04() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int18, v_createRequest);//Schedule
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_05() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int15, v_createRequest);//PollingChannel
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_06() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest);//Subscription
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
function f_CSE_DMR_CRE_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_CRE_BV_001
} // end g_CSE_DMR_CRE_BV_001
group g_CSE_DMR_CRE_BV_002 {
testcase TC_CSE_DMR_CRE_BV_002_01() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int3, m_createContainerBase);//container
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_02() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int9, m_createGroupBase);//group
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_03() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int1, m_createAcpBase );//accessControlPolicy
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_04() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int18, m_createScheduleBase);//Schedule
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_05() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int15, m_createPollingChannelBase);//Pollingchannel
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_06() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int23, m_createSubscriptionBase);//Subscription
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
function f_CSE_DMR_CRE_BV_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M return ResponsePrimitive{//system M2MSystem { MRO system keyword not supported on functions in Titan
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Container created successfuly");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating container");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating container");
}
}
// Postamble
f_postamble_deleteResources();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_CRE_BV_002
}// end group g_CSE_DMR_CRE_BV_002
group g_CSE_DMR_CRE_BV_003 {
testcase TC_CSE_DMR_CRE_BV_003_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int3, m_createContainerBase);//container
}
testcase TC_CSE_DMR_CRE_BV_003_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int9, m_createGroupBase);//group
}
testcase TC_CSE_DMR_CRE_BV_003_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int1, m_createAcpBase);//accessControlPolicy
}
testcase TC_CSE_DMR_CRE_BV_003_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_CRE_BV_003_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int15, m_createPollingChannelBase);//Pollingchannel
}
testcase TC_CSE_DMR_CRE_BV_003_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_CRE_BV_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {//system M2MSystem { MRO system keyword not supported on functions in Titan
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
// Test Body
v_request.requestIdentifier := "Existing resource";
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4105)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource already exists");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating an already existing resource");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Creating a resource that already exists");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_CRE_BV_003
}// end group g_CSE_DMR_CRE_BV_003
group g_CSE_DMR_CRE_BV_004 {
testcase TC_CSE_DMR_CRE_BV_004_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int3, m_createContainerBase);//container
}
testcase TC_CSE_DMR_CRE_BV_004_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int9, m_createGroupBase);//group
}
testcase TC_CSE_DMR_CRE_BV_004_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int1, m_createAcpBase);//accessControlPolicy
}
testcase TC_CSE_DMR_CRE_BV_004_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_CRE_BV_004_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int15, m_createPollingChannelBase);//Pollingchannel
}
testcase TC_CSE_DMR_CRE_BV_004_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_CRE_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {//system M2MSystem { MRO system keyword not supported on functions in Titan
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
if (p_resourceType != int23) {
v_aeIndex := f_preamble_registerAe(int62);//c_RUDNDi);
} else {
v_aeIndex := f_preamble_registerAe(int60);//c_UDNDi);
}
// Test Body
if(p_resourceType == int15) {
v_request := valueof(m_createPollingChannel(f_getResourceAddress(v_aeIndex), PX_AE_ID_STEM, omit));
} else {
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
}
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4103)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Access denied to create a resource");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating a resource without privileges");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Resource created without creation privileges");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_CRE_BV_004
}// end group g_CSE_DMR_CRE_BV_004
}//end group Create
group Retrieve {
group g_CSE_DMR_RET_BV_001 {
testcase TC_CSE_DMR_RET_BV_001_01() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_001_02() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_001_03() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_001_04() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_001_05() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_001_06() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Response OK for retrieving");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_RET_BV_001
} // end g_CSE_DMR_RET_BV_001
group g_CSE_DMR_RET_BO_002 {
testcase TC_CSE_DMR_RET_BO_002() runs on M2M system M2MSystem{
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var XSD.ID v_resourceId := "NonExisting";
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
if(PX_UNSTRUCTURED) {
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(-2) & "/" & v_resourceId)));
} else {
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId)));
}
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4004)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource not found");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_002
} // end g_CSE_DMR_RET_BO_002
group g_CSE_DMR_RET_BO_003 {
testcase TC_CSE_DMR_RET_BO_003_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_RET_BO_003_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_RET_BO_003_03() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_requestPrimitive := m_createAcpBase;
v_requestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61;
f_CSE_DMR_RET_BO_003(int1, v_requestPrimitive);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BO_003_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_RET_BO_003_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_RET_BO_003_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_RET_BO_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var XSD.ID v_acpId;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
if(not(PX_ACP_SUPPORT)) {
log(testcasename() & ":AccessControlPolicy support is required for executing this test case");
stop;
}
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi;
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
f_updateAcpAuxResource(f_getResourceAddress(0), int61); //c_CUDNDi
// Test Body
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4103)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType)));
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving attributes from resource without having privileges");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Retrieving attributes from resource without having privileges");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_003
} // end g_CSE_DMR_RET_BO_003
group g_CSE_DMR_RET_BV_004 {
testcase TC_CSE_DMR_RET_BV_004_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit;
v_contentResponse.any_1[0].Container_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_004_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit;
v_contentResponse.any_1[0].Group_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_004_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit;
v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_004_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit;
v_contentResponse.any_1[0].Schedule_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int18, m_createScheduleBase,v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_004_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit;
v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_004_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit;
v_contentResponse.any_1[0].Subscription_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Requested attribute retrieved successfuly");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, not only requested attribute retrieved");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource attribute");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BV_004
} // end g_CSE_DMR_RET_BV_004
group g_CSE_DMR_RET_BV_005 {
testcase TC_CSE_DMR_RET_BV_005_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit;
v_contentResponse.any_1[0].Container_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_005_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit;
v_contentResponse.any_1[0].Group_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_005_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit;
v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_005_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit;
v_contentResponse.any_1[0].Schedule_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_005_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit;
v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_005_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit;
v_contentResponse.any_1[0].Subscription_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Requested attribute retrieved successfuly");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, not only requested attribute retrieved");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource attribute");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BV_005
} // end g_CSE_DMR_RET_BV_005
group g_CSE_DMR_RET_BV_006 {
testcase TC_CSE_DMR_RET_BV_006_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit;
v_contentResponse.any_1[0].Container_optional.parentID := ?;
v_contentResponse.any_1[0].Container_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_006_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit;
v_contentResponse.any_1[0].Group_optional.parentID := ?;
v_contentResponse.any_1[0].Group_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_006_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit;
v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?;
v_contentResponse.any_1[0].AccessControlPolicy_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_006_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit;
v_contentResponse.any_1[0].Schedule_optional.parentID := ?;
v_contentResponse.any_1[0].Schedule_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_006_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit;
v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?;
v_contentResponse.any_1[0].PollingChannel_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_006_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit;
v_contentResponse.any_1[0].Subscription_optional.parentID := ?;
v_contentResponse.any_1[0].Subscription_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) ,
{"parentID", "creationTime"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Requested attributes retrieved successfuly");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, not only requested attributes retrieved");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource attributes");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BV_006
} // end g_CSE_DMR_RET_BV_006
group g_CSE_DMR_RET_BO_007 {
testcase TC_CSE_DMR_RET_BO_007_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_RET_BO_007_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_RET_BO_007_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int1, m_createAcpBase);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BO_007_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_RET_BO_007_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_RET_BO_007_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_RET_BO_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
{"lbl"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4004)) -> value v_response {
tc_ac.stop;
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attribute");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attribute");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_007
} // end g_CSE_DMR_RET_BO_007
group g_CSE_DMR_RET_BO_008 {
testcase TC_CSE_DMR_RET_BO_008_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_RET_BO_008_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_RET_BO_008_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int1, m_createAcpBase);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BO_008_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_RET_BO_008_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_RET_BO_008_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_RET_BO_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
{"lbl", "at"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4004)) -> value v_response {
tc_ac.stop;
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attributes");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attributes");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_008
} // end f_CSE_DMR_RET_BO_008
}//end group Retrieve
group Update {
group g_CSE_DMR_UPD_BV_001 {
testcase TC_CSE_DMR_UPD_BV_001_01() runs on M2M system M2MSystem {
// Local variables
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;
v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int3, v_createRequest, v_updateRequest);//Container
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int9, v_createRequest, v_updateRequest);//Group
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int1, v_createRequest, v_updateRequest);//ACP
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy)) {
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int18, v_createRequest, v_updateRequest);//Schedule
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int15, v_createRequest, v_updateRequest);//PollingChannel
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int23, v_createRequest, v_updateRequest);//Subscription
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on M2M return ResponsePrimitive{
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, 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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_001
} // end g_CSE_DMR_UPD_BV_001
group g_CSE_DMR_UPD_BV_002 {
testcase TC_CSE_DMR_UPD_BV_002_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int3, m_createContainerBase, v_updateRequest);//Container
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int9, m_createGroupBase, v_updateRequest);//Group
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int1, m_createAcpBase,v_updateRequest);//AccessControlPolicy
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int18, m_createScheduleBase,v_updateRequest);//Schedule
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int15, m_createPollingChannelBase,v_updateRequest);//PollingChannel
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int23, m_createSubscriptionBase,v_updateRequest);//Subscription
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, 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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_002
} // end g_CSE_DMR_UPD_BV_002
group g_CSE_DMR_UPD_BV_003 {
testcase TC_CSE_DMR_UPD_BV_003_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int3, v_createRequest, v_updateRequest, v_nullFields);//Container
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels)){ // FIXME: CHECK: labels set to empty
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int9, v_createRequest, v_updateRequest, v_nullFields);//Group
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int1, v_createRequest, v_updateRequest, v_nullFields);//AccessControlPolicy
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int18, v_createRequest, v_updateRequest, v_nullFields);//Schedule
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int15, v_createRequest, v_updateRequest, v_nullFields);//PollingChannel
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int23, v_createRequest, v_updateRequest, v_nullFields);//Subscription
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request, p_nullFields));
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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_003
} // end g_CSE_DMR_UPD_BV_003
group g_CSE_DMR_UPD_BV_004 {
testcase TC_CSE_DMR_UPD_BV_004_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var ResponsePrimitive v_responsePrimitive;
var AttributeList_1 v_nullFields;
v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;//Attribute 3
v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime := "20301231T012345";//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Container_optional.maxNrOfInstances := 5;//Attribute 2
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int3, v_createRequest, v_updateRequest, v_nullFields);//Container
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
//Check attribute 1
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.expirationTime != valueof(v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime)){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.any_1[0].Container_optional.maxNrOfInstances)){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_02() runs on M2M system M2MSystem {
// Local variables
var XSD.String v_groupName_1 := "VALUE_1";//Attribute 1
var XSD.String v_groupName_2 := "VALUE_2";
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AcpType v_acp := {"ACP_ID"};
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Group_optional.groupName:= v_groupName_1;//Attribute 1
v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;//Attribute 3
v_updateRequest.primitiveContent.any_1[0].Group_optional.groupName:= v_groupName_2;//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs := v_acp;//Attribute 2 //TODO Check another attribute
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int9, v_createRequest, v_updateRequest, v_nullFields);//Group
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
//Check attribute 1
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.groupName, valueof(v_updateRequest.primitiveContent.any_1[0].Group_optional.groupName))){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs))){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var SetOfAcrs v_privileges_1 := {
accessControlRule_list := {
{
accessControlOriginators := {"admin:admin"},
accessControlOperations := int63,
accessControlContexts_list := omit
}
}
}
var SetOfAcrs v_privileges_2 := {
accessControlRule_list := {
{
accessControlOriginators := {"admin:admin"},
accessControlOperations := int61,
accessControlContexts_list := omit
}
}
}
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges := v_privileges_1;//Attribute 1
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges := v_privileges_2; //Attribute 1
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo := {PX_URI_CSE};//Attribute 2
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int1, v_createRequest, v_updateRequest, v_nullFields);//AccessControlPolicy
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) {
//Check attribute 1
if(not match(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges, valueof(v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges))){
setverdict(fail, testcasename() & ": Error: Privileges attribute not updated correctly")
}
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo, valueof(v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo))){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement := {{"0,0,0 1 2,1,1,*"}};//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement := {{"1,1,1 1 2,1,1,*"}}; //Attribute 1
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.announceTo := {PX_URI_CSE};//Attribute 2
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int18, v_createRequest, v_updateRequest, v_nullFields);//Schedule
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
//Check attribute 1
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.scheduleElement != valueof(v_updateRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement)){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.announceTo != valueof(v_updateRequest.primitiveContent.any_1[0].Schedule_optional.announceTo)){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AcpType v_acp := {"ACP_ID"};
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;//Attribute 3
//No Attribute 1
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs := v_acp;//Attribute 2
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int15, v_createRequest, v_updateRequest, v_nullFields);//PollingChannel
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
//Check attribute 1
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs))){
setverdict(fail, testcasename() & ": Error: ACPI attribute not added correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_06() 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 AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;//Attribute 1
v_createRequest.primitiveContent.any_1[0].Subscription_optional.expirationCounter := 5;//Attribute 3
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2;//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs := v_acp; //Attribute 2
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationCounter := 1;//Attribute 3
v_nullFields := {"expirationCounter"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int23, v_createRequest, v_updateRequest, v_nullFields);//Subscription
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
//Check attribute 1
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels, valueof(v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels))){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs))){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.expirationCounter)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request, p_nullFields));
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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_004
} // end g_CSE_DMR_UPD_BV_004
group g_CSE_DMR_UPD_BO_005{
testcase TC_CSE_DMR_UPD_BO_005_01() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.any_1 := {{Container_update_invalid := m_contentUpdateContainer_invalid}};
v_updateRequest.primitiveContent.any_1[0].Container_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int3, m_createContainerBase, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_BO_005_02() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.any_1 := {{Group_update_invalid := m_contentUpdateGroup_invalid}};
v_updateRequest.primitiveContent.any_1[0].Group_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_BO_005_03() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.any_1 := {{ACP_update_invalid := m_contentUpdateAcp_invalid}};
v_updateRequest.primitiveContent.any_1[0].ACP_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_005_04() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_updateRequest.primitiveContent.any_1 := {{Schedule_update_invalid := m_contentUpdateSchedule_invalid}};
v_updateRequest.primitiveContent.any_1[0].Schedule_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int18, m_createScheduleBase, v_updateRequest);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_005_05() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_updateRequest.primitiveContent.any_1 := {{PollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}};
v_updateRequest.primitiveContent.any_1[0].PollingChannel_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_005_06() runs on M2M system M2MSystem {
// Local variables
var XSD.NonNegativeInteger v_maxNrOfInstances := 5;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.any_1 := {{Subscription_update_invalid := m_contentUpdateSubscription_invalid}};
v_updateRequest.primitiveContent.any_1[0].Subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances;
f_CSE_DMR_UPD_BO_005(int23, m_createSubscriptionBase, 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 integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_aeIndex, p_updateRequestPrimitive);
v_request.to_ := v_request.to_ & "/" & c_defaultResourceName;
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType)));
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating an unexisting 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();
}//end f_CSE_DMR_UPD_BO_005
} // end g_CSE_DMR_UPD_BO_005
group g_CSE_DMR_UPD_BO_006{
testcase TC_CSE_DMR_UPD_BO_006_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int3, m_createContainerBase, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_BO_006_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_BO_006_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var template RequestPrimitive v_requestPrimitive := m_createAcpBase;
v_requestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[0].accessControlOperations := int59;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int1, v_requestPrimitive, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_006_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int18, m_createScheduleBase, v_updateRequest);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_006_05() runs on M2M system M2MSystem {
// Local variable
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_006_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int23, m_createSubscriptionBase, v_updateRequest);//Subscription
}
function f_CSE_DMR_UPD_BO_006(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 integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(int59);//c_CRDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4103)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType)));
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating attributes from resource without having privileges");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Updating attributes from resource without having privileges");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_UPD_BO_006
} // end g_CSE_DMR_UPD_BO_006
group g_CSE_DMR_UPD_BO_007{
testcase TC_CSE_DMR_UPD_BO_007_01() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.any_1 := {{Container_update_invalid := m_contentUpdateContainer_invalid}};
v_updateRequest.primitiveContent.any_1[0].Container_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int3, m_createContainerBase, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_BO_007_02() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.any_1 := {{Group_update_invalid := m_contentUpdateGroup_invalid}};
v_updateRequest.primitiveContent.any_1[0].Group_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_BO_007_03() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.any_1 := {{ACP_update_invalid := m_contentUpdateAcp_invalid}};
v_updateRequest.primitiveContent.any_1[0].ACP_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_007_04() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_updateRequest.primitiveContent.any_1 := {{Schedule_update_invalid := m_contentUpdateSchedule_invalid}};
v_updateRequest.primitiveContent.any_1[0].Schedule_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int18, m_createScheduleBase, v_updateRequest);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_007_05() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_updateRequest.primitiveContent.any_1 := {{PollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}};
v_updateRequest.primitiveContent.any_1[0].PollingChannel_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_007_06() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.any_1 := {{Subscription_update_invalid := m_contentUpdateSubscription_invalid}};
v_updateRequest.primitiveContent.any_1[0].Subscription_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int23, m_createSubscriptionBase, v_updateRequest);//Subscription
}
function f_CSE_DMR_UPD_BO_007(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 integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) );
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating RO attribute");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Updating RO attribute from resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_UPD_BO_007
} // end g_CSE_DMR_UPD_BO_007
group g_CSE_DMR_UPD_BO_008{
testcase TC_CSE_DMR_UPD_BO_008_01() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int3, m_createContainerBase, v_updateRequest, v_nullFields);//Container
}
testcase TC_CSE_DMR_UPD_BO_008_02() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Group_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int9, m_createGroupBase, v_updateRequest, v_nullFields);//Group
}
testcase TC_CSE_DMR_UPD_BO_008_03() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int1, m_createAcpBase, v_updateRequest, v_nullFields);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_008_04() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int18, m_createScheduleBase, v_updateRequest, v_nullFields);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_008_05() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int15, m_createPollingChannelBase, v_updateRequest, v_nullFields);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_008_06() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int23, m_createSubscriptionBase, v_updateRequest, v_nullFields);//Subscription
}
function f_CSE_DMR_UPD_BO_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request,p_nullFields));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) );
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while deleting mandatory RW attribute");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Deleting a mandatory RW attribute from resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_UPD_BO_008
} // end g_CSE_DMR_UPD_BO_008
}//end group Update
}//end group Data_Management_and_Repository
}//end group CSE
}
/**
* Copyright Notification
* No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
* All rights reserved.
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
* $Id: OneM2M_Testcases.ttcn 99 2016-06-09 15:04:43Z reinaortega $
* @desc Module containing test cases for oneM2M
*
*/
//Test
module OneM2M_Testcases {
import from OneM2M_TestSystem all;
import from OneM2M_Templates all;
import from OneM2M_Types all;//{type XSD.ID};
import from OneM2M_TypesAndValues all;
import from OneM2M_Pixits all;
import from OneM2M_Functions all;
import from LibCommon_Time {modulepar all};
import from XSD all;
//Demos used for validation purposes
group oneM2M_demos {
group helpingTestCases {//These are not part of the test suite, just for verification purposes
testcase TC_DELETE_AE() runs on M2M system M2MSystem {
timer t_ac := 5.0;
map(self:mcaPort, system:mcaPort);
mcaPort.send(m_request(m_deleteRequest(PX_URI_CSE & PX_CSE_NAME & "/" & PX_RESOURCE_TO_BE_DELETED)));
t_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) {
t_ac.stop;
log("Postamble: Resource deleted");
setverdict(pass);
}
[] mcaPort.receive(mw_responseKO) {
t_ac.stop;
log("Postamble: Error while deleting resource");
setverdict(fail);
}
[] mcaPort.receive {
t_ac.stop;
log("Postamble: Unexpected message received");
setverdict(inconc);
}
[] t_ac.timeout {
log("Postamble: No answer while deleting resource");
setverdict(inconc);
}
}
unmap(self:mcaPort, system:mcaPort);
stop;
}
testcase TC_DELETE_RESOURCES() runs on M2M system M2MSystem {
timer t_ac := 5.0;
var integer i;
map(self:mcaPort, system:mcaPort);
for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) {
mcaPort.send(m_request(m_delete(PX_URI_CSE & "/" & PX_CSE_NAME & "/" & PX_RESOURCES_TO_BE_DELETED[i])));
t_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) {
t_ac.stop;
log("Postamble: Resource deleted");
setverdict(pass);
}
[] mcaPort.receive(mw_responseKO) {
t_ac.stop;
log("Postamble: Error while deleting resource");
setverdict(fail);
}
[] mcaPort.receive {
t_ac.stop;
log("Postamble: Unexpected message received");
setverdict(inconc);
}
[] t_ac.timeout {
log("Postamble: No answer while deleting resource");
setverdict(inconc);
}
}
}
unmap(self:mcaPort, system:mcaPort);
stop;
}
}
}//end group oneM2M_demos
group CSE {
group Data_Management_and_Repository {
group g_CSE_DMR_BV_001 {
testcase TC_CSE_DMR_BV_001_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_BV_001_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_BV_001_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int1, m_createAcpBase);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_001_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_BV_001_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_BV_001_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_BV_001(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int0;//Nothing
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
if(ispresent(v_response.responsePrimitive_.primitiveContent)){
setverdict(fail, testcasename() & ": Providing content when RC set to 0");
} else {
setverdict(pass, testcasename() & ": No content provided with RC set to 0");
}
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_001
} // end g_CSE_DMR_BV_001
group g_CSE_DMR_BV_002 {
testcase TC_CSE_DMR_BV_002_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1;
f_CSE_DMR_BV_002(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_002_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc1;
f_CSE_DMR_BV_002(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_002_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1;
f_CSE_DMR_BV_002(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_002_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc1;
f_CSE_DMR_BV_002(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_002_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_002(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_002_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc1;
f_CSE_DMR_BV_002(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_002
} // end g_CSE_DMR_BV_002
group g_CSE_DMR_BV_003 {
testcase TC_CSE_DMR_BV_003_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentContainer_rc2;
f_CSE_DMR_BV_003(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_003_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentGroup_rc2;
f_CSE_DMR_BV_003(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_003_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentAcp_rc2;
f_CSE_DMR_BV_003(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_003_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentSchedule_rc2;
f_CSE_DMR_BV_003(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_003_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_003(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_003_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AnyURI := mw_contentSubscription_rc2;
f_CSE_DMR_BV_003(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int2;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Only hierarchical address provided with RC set to 2");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Not only hierarchical address provided with RC set to 2");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_003
} // end g_CSE_DMR_BV_003
group g_CSE_DMR_BV_004 {
testcase TC_CSE_DMR_BV_004_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc3;
f_CSE_DMR_BV_004(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_004_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc3;
f_CSE_DMR_BV_004(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_004_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc3;
f_CSE_DMR_BV_004(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_004_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc3;
f_CSE_DMR_BV_004(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_004_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_004_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc3;
f_CSE_DMR_BV_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_004
} // end g_CSE_DMR_BV_004
group g_CSE_DMR_BV_005 {
testcase TC_CSE_DMR_BV_005_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc4;
f_CSE_DMR_BV_005(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_005_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc4;
f_CSE_DMR_BV_005(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_005_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc4;
f_CSE_DMR_BV_005(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_005_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc4;
f_CSE_DMR_BV_005(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_005_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_005_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc4;
f_CSE_DMR_BV_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_005
} // end g_CSE_DMR_BV_005
group g_CSE_DMR_BV_006 {
testcase TC_CSE_DMR_BV_006_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc5;
f_CSE_DMR_BV_006(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_006_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc5;
f_CSE_DMR_BV_006(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_006_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc5;
f_CSE_DMR_BV_006(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_006_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc5;
f_CSE_DMR_BV_006(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_006_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_006_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc5;
f_CSE_DMR_BV_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_006
} // end g_CSE_DMR_BV_006
group g_CSE_DMR_BV_007 {
testcase TC_CSE_DMR_BV_007_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc6;
f_CSE_DMR_BV_007(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_BV_007_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc6;
f_CSE_DMR_BV_007(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_BV_007_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc6;
f_CSE_DMR_BV_007(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_BV_007_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc6;
f_CSE_DMR_BV_007(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_BV_007_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
f_CSE_DMR_BV_007(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_BV_007_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc6;
f_CSE_DMR_BV_007(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_BV_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex)));
v_request.resultContent := int1;//Attributes
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseOK()) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_BV_007
} // end g_CSE_DMR_BV_007
group Create {
group g_CSE_DMR_CRE_BV_001 {
testcase TC_CSE_DMR_CRE_BV_001_01() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Container_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int3, v_createRequest);//Container
log(v_responsePrimitive);
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_02() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Group_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int9, v_createRequest);//Group
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_03() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int1, v_createRequest);//AccessControlPolicy
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_04() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int18, v_createRequest);//Schedule
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_05() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int15, v_createRequest);//PollingChannel
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_BV_001_06() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.resourceName := omit;
v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest);//Subscription
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
}
}
}
function f_CSE_DMR_CRE_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_CRE_BV_001
} // end g_CSE_DMR_CRE_BV_001
group g_CSE_DMR_CRE_BV_002 {
testcase TC_CSE_DMR_CRE_BV_002_01() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int3, m_createContainerBase);//container
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_02() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int9, m_createGroupBase);//group
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_03() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int1, m_createAcpBase );//accessControlPolicy
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_04() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int18, m_createScheduleBase);//Schedule
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_05() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int15, m_createPollingChannelBase);//Pollingchannel
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
testcase TC_CSE_DMR_CRE_BV_002_06() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int23, m_createSubscriptionBase);//Subscription
if(getverdict == pass){
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
}
}
function f_CSE_DMR_CRE_BV_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M return ResponsePrimitive{//system M2MSystem { MRO system keyword not supported on functions in Titan
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Container created successfuly");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating container");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating container");
}
}
// Postamble
f_postamble_deleteResources();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_CRE_BV_002
}// end group g_CSE_DMR_CRE_BV_002
group g_CSE_DMR_CRE_BV_003 {
testcase TC_CSE_DMR_CRE_BV_003_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int3, m_createContainerBase);//container
}
testcase TC_CSE_DMR_CRE_BV_003_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int9, m_createGroupBase);//group
}
testcase TC_CSE_DMR_CRE_BV_003_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int1, m_createAcpBase);//accessControlPolicy
}
testcase TC_CSE_DMR_CRE_BV_003_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_CRE_BV_003_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int15, m_createPollingChannelBase);//Pollingchannel
}
testcase TC_CSE_DMR_CRE_BV_003_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_003(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_CRE_BV_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {//system M2MSystem { MRO system keyword not supported on functions in Titan
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
// Test Body
v_request.requestIdentifier := "Existing resource";
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4105)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource already exists");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating an already existing resource");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Creating a resource that already exists");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_CRE_BV_003
}// end group g_CSE_DMR_CRE_BV_003
group g_CSE_DMR_CRE_BV_004 {
testcase TC_CSE_DMR_CRE_BV_004_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int3, m_createContainerBase);//container
}
testcase TC_CSE_DMR_CRE_BV_004_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int9, m_createGroupBase);//group
}
testcase TC_CSE_DMR_CRE_BV_004_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int1, m_createAcpBase);//accessControlPolicy
}
testcase TC_CSE_DMR_CRE_BV_004_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_CRE_BV_004_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int15, m_createPollingChannelBase);//Pollingchannel
}
testcase TC_CSE_DMR_CRE_BV_004_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_CRE_BV_004(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_CRE_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {//system M2MSystem { MRO system keyword not supported on functions in Titan
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
if (p_resourceType != int23) {
v_aeIndex := f_preamble_registerAe(int62);//c_RUDNDi);
} else {
v_aeIndex := f_preamble_registerAe(int60);//c_UDNDi);
}
// Test Body
if(p_resourceType == int15) {
v_request := valueof(m_createPollingChannel(f_getResourceAddress(v_aeIndex), PX_AE_ID_STEM, omit));
} else {
v_request := f_getCreateRequestPrimitive(p_resourceType, omit, p_requestPrimitive, v_aeIndex);
}
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4103)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Access denied to create a resource");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating a resource without privileges");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Resource created without creation privileges");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_CRE_BV_004
}// end group g_CSE_DMR_CRE_BV_004
}//end group Create
group Retrieve {
group g_CSE_DMR_RET_BV_001 {
testcase TC_CSE_DMR_RET_BV_001_01() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_001_02() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_001_03() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_001_04() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_001_05() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_001_06() runs on M2M system M2MSystem {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc1;
v_responsePrimitive := f_CSE_DMR_RET_BV_001(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Response OK for retrieving");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_RET_BV_001
} // end g_CSE_DMR_RET_BV_001
group g_CSE_DMR_RET_BO_002 {
testcase TC_CSE_DMR_RET_BO_002() runs on M2M system M2MSystem{
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var XSD.ID v_resourceId := "NonExisting";
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
if(PX_UNSTRUCTURED) {
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(-2) & "/" & v_resourceId)));
} else {
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId)));
}
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4004)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource not found");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_002
} // end g_CSE_DMR_RET_BO_002
group g_CSE_DMR_RET_BO_003 {
testcase TC_CSE_DMR_RET_BO_003_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_RET_BO_003_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_RET_BO_003_03() runs on M2M system M2MSystem {
// Local variables
var template RequestPrimitive v_requestPrimitive := m_createAcpBase;
v_requestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61;
f_CSE_DMR_RET_BO_003(int1, v_requestPrimitive);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BO_003_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_RET_BO_003_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_RET_BO_003_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_003(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_RET_BO_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var XSD.ID v_acpId;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
if(not(PX_ACP_SUPPORT)) {
log(testcasename() & ":AccessControlPolicy support is required for executing this test case");
stop;
}
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi;
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
f_updateAcpAuxResource(f_getResourceAddress(0), int61); //c_CUDNDi
// Test Body
mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4103)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType)));
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving attributes from resource without having privileges");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Retrieving attributes from resource without having privileges");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_003
} // end g_CSE_DMR_RET_BO_003
group g_CSE_DMR_RET_BV_004 {
testcase TC_CSE_DMR_RET_BV_004_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit;
v_contentResponse.any_1[0].Container_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_004_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit;
v_contentResponse.any_1[0].Group_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_004_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit;
v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_004_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit;
v_contentResponse.any_1[0].Schedule_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int18, m_createScheduleBase,v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_004_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit;
v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_004_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit;
v_contentResponse.any_1[0].Subscription_optional.parentID := ?;
f_CSE_DMR_RET_BV_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Requested attribute retrieved successfuly");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, not only requested attribute retrieved");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource attribute");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BV_004
} // end g_CSE_DMR_RET_BV_004
group g_CSE_DMR_RET_BV_005 {
testcase TC_CSE_DMR_RET_BV_005_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit;
v_contentResponse.any_1[0].Container_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_005_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit;
v_contentResponse.any_1[0].Group_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_005_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit;
v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_005_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit;
v_contentResponse.any_1[0].Schedule_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_005_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit;
v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_005_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit;
v_contentResponse.any_1[0].Subscription_optional.parentID := ?;
f_CSE_DMR_RET_BV_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Requested attribute retrieved successfuly");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, not only requested attribute retrieved");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource attribute");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BV_005
} // end g_CSE_DMR_RET_BV_005
group g_CSE_DMR_RET_BV_006 {
testcase TC_CSE_DMR_RET_BV_006_01() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit;
v_contentResponse.any_1[0].Container_optional.parentID := ?;
v_contentResponse.any_1[0].Container_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int3, m_createContainerBase, v_contentResponse);//Container
}
testcase TC_CSE_DMR_RET_BV_006_02() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit;
v_contentResponse.any_1[0].Group_optional.parentID := ?;
v_contentResponse.any_1[0].Group_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int9, m_createGroupBase, v_contentResponse);//Group
}
testcase TC_CSE_DMR_RET_BV_006_03() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit;
v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?;
v_contentResponse.any_1[0].AccessControlPolicy_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BV_006_04() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit;
v_contentResponse.any_1[0].Schedule_optional.parentID := ?;
v_contentResponse.any_1[0].Schedule_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int18, m_createScheduleBase, v_contentResponse);//Schedule
}
testcase TC_CSE_DMR_RET_BV_006_05() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit;
v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?;
v_contentResponse.any_1[0].PollingChannel_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
}
testcase TC_CSE_DMR_RET_BV_006_06() runs on M2M system M2MSystem {
// Local variables
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit;
v_contentResponse.any_1[0].Subscription_optional.parentID := ?;
v_contentResponse.any_1[0].Subscription_optional.creationTime := ?;
f_CSE_DMR_RET_BV_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
}
function f_CSE_DMR_RET_BV_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) ,
{"parentID", "creationTime"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_responseOK(p_contentResponse)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Requested attributes retrieved successfuly");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, not only requested attributes retrieved");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource attributes");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BV_006
} // end g_CSE_DMR_RET_BV_006
group g_CSE_DMR_RET_BO_007 {
testcase TC_CSE_DMR_RET_BO_007_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_RET_BO_007_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_RET_BO_007_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int1, m_createAcpBase);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BO_007_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_RET_BO_007_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_RET_BO_007_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_007(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_RET_BO_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
{"lbl"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4004)) -> value v_response {
tc_ac.stop;
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attribute");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attribute");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_007
} // end g_CSE_DMR_RET_BO_007
group g_CSE_DMR_RET_BO_008 {
testcase TC_CSE_DMR_RET_BO_008_01() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int3, m_createContainerBase);//Container
}
testcase TC_CSE_DMR_RET_BO_008_02() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int9, m_createGroupBase);//Group
}
testcase TC_CSE_DMR_RET_BO_008_03() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int1, m_createAcpBase);//AccessControlPolicy
}
testcase TC_CSE_DMR_RET_BO_008_04() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int18, m_createScheduleBase);//Schedule
}
testcase TC_CSE_DMR_RET_BO_008_05() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int15, m_createPollingChannelBase);//PollingChannel
}
testcase TC_CSE_DMR_RET_BO_008_06() runs on M2M system M2MSystem {
// Local variables
f_CSE_DMR_RET_BO_008(int23, m_createSubscriptionBase);//Subscription
}
function f_CSE_DMR_RET_BO_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
// Test Body
mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
{"lbl", "at"})));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4004)) -> value v_response {
tc_ac.stop;
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attributes");
}
[] mcaPort.receive(mw_responseOK) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving non existing resource attributes");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes");
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_RET_BO_008
} // end f_CSE_DMR_RET_BO_008
}//end group Retrieve
group Update {
group g_CSE_DMR_UPD_BV_001 {
testcase TC_CSE_DMR_UPD_BV_001_01() runs on M2M system M2MSystem {
// Local variables
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;
v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int3, v_createRequest, v_updateRequest);//Container
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int9, v_createRequest, v_updateRequest);//Group
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int1, v_createRequest, v_updateRequest);//ACP
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy)) {
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int18, v_createRequest, v_updateRequest);//Schedule
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int15, v_createRequest, v_updateRequest);//PollingChannel
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_001_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"VALUE_2"};
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2;
v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int23, v_createRequest, v_updateRequest);//Subscription
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels != v_labels_2){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on M2M return ResponsePrimitive{
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, 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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_001
} // end g_CSE_DMR_UPD_BV_001
group g_CSE_DMR_UPD_BV_002 {
testcase TC_CSE_DMR_UPD_BV_002_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int3, m_createContainerBase, v_updateRequest);//Container
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int9, m_createGroupBase, v_updateRequest);//Group
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int1, m_createAcpBase,v_updateRequest);//AccessControlPolicy
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int18, m_createScheduleBase,v_updateRequest);//Schedule
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int15, m_createPollingChannelBase,v_updateRequest);//PollingChannel
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_002_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int23, m_createSubscriptionBase,v_updateRequest);//Subscription
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels != v_labels_1){
setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, 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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_002
} // end g_CSE_DMR_UPD_BV_002
group g_CSE_DMR_UPD_BV_003 {
testcase TC_CSE_DMR_UPD_BV_003_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int3, v_createRequest, v_updateRequest, v_nullFields);//Container
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels)){ // FIXME: CHECK: labels set to empty
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int9, v_createRequest, v_updateRequest, v_nullFields);//Group
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int1, v_createRequest, v_updateRequest, v_nullFields);//AccessControlPolicy
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int18, v_createRequest, v_updateRequest, v_nullFields);//Schedule
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int15, v_createRequest, v_updateRequest, v_nullFields);//PollingChannel
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_003_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList v_nullFields;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2;
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int23, v_createRequest, v_updateRequest, v_nullFields);//Subscription
if(getverdict == pass){
//Check attribute 1
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request, p_nullFields));
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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_003
} // end g_CSE_DMR_UPD_BV_003
group g_CSE_DMR_UPD_BV_004 {
testcase TC_CSE_DMR_UPD_BV_004_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var ResponsePrimitive v_responsePrimitive;
var AttributeList_1 v_nullFields;
v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;//Attribute 3
v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime := "20301231T012345";//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Container_optional.maxNrOfInstances := 5;//Attribute 2
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int3, v_createRequest, v_updateRequest, v_nullFields);//Container
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) {
//Check attribute 1
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.expirationTime != valueof(v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime)){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.any_1[0].Container_optional.maxNrOfInstances)){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_02() runs on M2M system M2MSystem {
// Local variables
var XSD.String v_groupName_1 := "VALUE_1";//Attribute 1
var XSD.String v_groupName_2 := "VALUE_2";
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AcpType v_acp := {"ACP_ID"};
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Group_optional.groupName:= v_groupName_1;//Attribute 1
v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;//Attribute 3
v_updateRequest.primitiveContent.any_1[0].Group_optional.groupName:= v_groupName_2;//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs := v_acp;//Attribute 2 //TODO Check another attribute
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int9, v_createRequest, v_updateRequest, v_nullFields);//Group
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) {
//Check attribute 1
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.groupName, valueof(v_updateRequest.primitiveContent.any_1[0].Group_optional.groupName))){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs))){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var SetOfAcrs v_privileges_1 := {
accessControlRule_list := {
{
accessControlOriginators := {"admin:admin"},
accessControlOperations := int63,
accessControlContexts_list := omit
}
}
}
var SetOfAcrs v_privileges_2 := {
accessControlRule_list := {
{
accessControlOriginators := {"admin:admin"},
accessControlOperations := int61,
accessControlContexts_list := omit
}
}
}
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges := v_privileges_1;//Attribute 1
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges := v_privileges_2; //Attribute 1
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo := {PX_URI_CSE};//Attribute 2
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int1, v_createRequest, v_updateRequest, v_nullFields);//AccessControlPolicy
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) {
//Check attribute 1
if(not match(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges, valueof(v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges))){
setverdict(fail, testcasename() & ": Error: Privileges attribute not updated correctly")
}
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo, valueof(v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo))){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement := {{"0,0,0 1 2,1,1,*"}};//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement := {{"1,1,1 1 2,1,1,*"}}; //Attribute 1
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.announceTo := {PX_URI_CSE};//Attribute 2
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int18, v_createRequest, v_updateRequest, v_nullFields);//Schedule
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) {
//Check attribute 1
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.scheduleElement != valueof(v_updateRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement)){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.announceTo != valueof(v_updateRequest.primitiveContent.any_1[0].Schedule_optional.announceTo)){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_05() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var Labels v_labels_2 := {"To be deleted"};
var AcpType v_acp := {"ACP_ID"};
var AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;//Attribute 3
//No Attribute 1
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs := v_acp;//Attribute 2
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2;//Attribute 3
v_nullFields := {"labels"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int15, v_createRequest, v_updateRequest, v_nullFields);//PollingChannel
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) {
//Check attribute 1
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs))){
setverdict(fail, testcasename() & ": Error: ACPI attribute not added correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
testcase TC_CSE_DMR_UPD_BV_004_06() 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 AttributeList_1 v_nullFields;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;//Attribute 1
v_createRequest.primitiveContent.any_1[0].Subscription_optional.expirationCounter := 5;//Attribute 3
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2;//Attribute 1
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs := v_acp; //Attribute 2
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationCounter := 1;//Attribute 3
v_nullFields := {"expirationCounter"};
v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int23, v_createRequest, v_updateRequest, v_nullFields);//Subscription
if(getverdict == pass){
if(ispresent(v_responsePrimitive.primitiveContent)) {
if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) {
//Check attribute 1
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels, valueof(v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels))){
setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly")
}
//Check attribute 2
if(not match(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs))){
setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly")
}
//Check attribute 3
if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.expirationCounter)){
setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly")
}
}
}
}
}
function f_CSE_DMR_UPD_BV_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on M2M return ResponsePrimitive {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request, p_nullFields));
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");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
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();
return v_response.responsePrimitive_;
}//end f_CSE_DMR_UPD_BV_004
} // end g_CSE_DMR_UPD_BV_004
group g_CSE_DMR_UPD_BO_005{
testcase TC_CSE_DMR_UPD_BO_005_01() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.any_1 := {{Container_update_invalid := m_contentUpdateContainer_invalid}};
v_updateRequest.primitiveContent.any_1[0].Container_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int3, m_createContainerBase, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_BO_005_02() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.any_1 := {{Group_update_invalid := m_contentUpdateGroup_invalid}};
v_updateRequest.primitiveContent.any_1[0].Group_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_BO_005_03() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.any_1 := {{ACP_update_invalid := m_contentUpdateAcp_invalid}};
v_updateRequest.primitiveContent.any_1[0].ACP_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_005_04() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_updateRequest.primitiveContent.any_1 := {{Schedule_update_invalid := m_contentUpdateSchedule_invalid}};
v_updateRequest.primitiveContent.any_1[0].Schedule_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int18, m_createScheduleBase, v_updateRequest);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_005_05() runs on M2M system M2MSystem {
// Local variables
var XSD.PositiveInteger v_expirationCounter := 1;
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_updateRequest.primitiveContent.any_1 := {{PollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}};
v_updateRequest.primitiveContent.any_1[0].PollingChannel_update_invalid.expirationCounter := v_expirationCounter;
f_CSE_DMR_UPD_BO_005(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_005_06() runs on M2M system M2MSystem {
// Local variables
var XSD.NonNegativeInteger v_maxNrOfInstances := 5;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.any_1 := {{Subscription_update_invalid := m_contentUpdateSubscription_invalid}};
v_updateRequest.primitiveContent.any_1[0].Subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances;
f_CSE_DMR_UPD_BO_005(int23, m_createSubscriptionBase, 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 integer v_aeIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_aeIndex, p_updateRequestPrimitive);
v_request.to_ := v_request.to_ & "/" & c_defaultResourceName;
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType)));
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating an unexisting 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();
}//end f_CSE_DMR_UPD_BO_005
} // end g_CSE_DMR_UPD_BO_005
group g_CSE_DMR_UPD_BO_006{
testcase TC_CSE_DMR_UPD_BO_006_01() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int3, m_createContainerBase, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_BO_006_02() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_BO_006_03() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var template RequestPrimitive v_requestPrimitive := m_createAcpBase;
v_requestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[0].accessControlOperations := int59;
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int1, v_requestPrimitive, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_006_04() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int18, m_createScheduleBase, v_updateRequest);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_006_05() runs on M2M system M2MSystem {
// Local variable
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_006_06() runs on M2M system M2MSystem {
// Local variables
var Labels v_labels_1 := {"VALUE_1"};
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;
f_CSE_DMR_UPD_BO_006(int23, m_createSubscriptionBase, v_updateRequest);//Subscription
}
function f_CSE_DMR_UPD_BO_006(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 integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(int59);//c_CRDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4103)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType)));
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating attributes from resource without having privileges");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Updating attributes from resource without having privileges");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_UPD_BO_006
} // end g_CSE_DMR_UPD_BO_006
group g_CSE_DMR_UPD_BO_007{
testcase TC_CSE_DMR_UPD_BO_007_01() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.any_1 := {{Container_update_invalid := m_contentUpdateContainer_invalid}};
v_updateRequest.primitiveContent.any_1[0].Container_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int3, m_createContainerBase, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_BO_007_02() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.any_1 := {{Group_update_invalid := m_contentUpdateGroup_invalid}};
v_updateRequest.primitiveContent.any_1[0].Group_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_BO_007_03() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.any_1 := {{ACP_update_invalid := m_contentUpdateAcp_invalid}};
v_updateRequest.primitiveContent.any_1[0].ACP_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_007_04() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_updateRequest.primitiveContent.any_1 := {{Schedule_update_invalid := m_contentUpdateSchedule_invalid}};
v_updateRequest.primitiveContent.any_1[0].Schedule_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int18, m_createScheduleBase, v_updateRequest);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_007_05() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
v_updateRequest.primitiveContent.any_1 := {{PollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}};
v_updateRequest.primitiveContent.any_1[0].PollingChannel_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_007_06() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_creationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.any_1 := {{Subscription_update_invalid := m_contentUpdateSubscription_invalid}};
v_updateRequest.primitiveContent.any_1[0].Subscription_update_invalid.creationTime := v_creationTime;
f_CSE_DMR_UPD_BO_007(int23, m_createSubscriptionBase, v_updateRequest);//Subscription
}
function f_CSE_DMR_UPD_BO_007(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 integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) );
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating RO attribute");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Updating RO attribute from resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_UPD_BO_007
} // end g_CSE_DMR_UPD_BO_007
group g_CSE_DMR_UPD_BO_008{
testcase TC_CSE_DMR_UPD_BO_008_01() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int3, m_createContainerBase, v_updateRequest, v_nullFields);//Container
}
testcase TC_CSE_DMR_UPD_BO_008_02() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Group_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int9, m_createGroupBase, v_updateRequest, v_nullFields);//Group
}
testcase TC_CSE_DMR_UPD_BO_008_03() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int1, m_createAcpBase, v_updateRequest, v_nullFields);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_BO_008_04() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Schedule_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int18, m_createScheduleBase, v_updateRequest, v_nullFields);//Schedule
}
testcase TC_CSE_DMR_UPD_BO_008_05() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int15, m_createPollingChannelBase, v_updateRequest, v_nullFields);//PollingChannel
}
testcase TC_CSE_DMR_UPD_BO_008_06() runs on M2M system M2MSystem {
// Local variables
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
var AttributeList_1 v_nullFields;
v_nullFields := {"expirationTime"};
v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_BO_008(int23, m_createSubscriptionBase, v_updateRequest, v_nullFields);//Subscription
}
function f_CSE_DMR_UPD_BO_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on M2M {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
mcaPort.send(m_request(v_request,p_nullFields));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) );
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while deleting mandatory RW attribute");
}
[] mcaPort.receive(mw_responseOK) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Deleting a mandatory RW attribute from resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
// Postamble
f_postamble_deleteResources();
}//end f_CSE_DMR_UPD_BO_008
} // end g_CSE_DMR_UPD_BO_008
}//end group Update
}//end group Data_Management_and_Repository
group Group_Managment {
// Test objective:
// Check that the IUT rejects the creation of the group resource when member ID exceed max number
// of members.
group g_CSE_GMG_BV_001 {
testcase TC_CSE_GMG_BV_001() runs on M2M system M2MSystem {
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var ResponsePrimitive v_responsePrimitive;
v_createRequest.primitiveContent.any_1[0].Group_optional.currentNrOfMembers := 6;
v_createRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 5;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe();//c_CRUDNDi);
// Test Body
v_request := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int6010)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Creation failed because member ID exceed max number of member");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_001
// Test objective:
// Check that the IUT rejects the creation of the group resource when the memberType cannot
// be retrieved due to lack of privilege.
group g_CSE_GMG_BV_002 {
testcase TC_CSE_GMG_BV_002() runs on M2M system M2MSystem
{
//TODO
}
} // end group g_CSE_GMG_BV_002
// Test objective:
// Check that the IUT rejects the update of the group resource when the
// memberType cannot be retrieved due to lack of privilege.
group g_CSE_GMG_BV_003 {
testcase TC_CSE_GMG_BV_003() runs on M2M system M2MSystem
{
//TODO
}
} // end group g_CSE_GMG_BV_003
// Test objective:
// Check that the IUT rejects the update of the group
// resource when member ID exceed max number of members.
group g_CSE_GMG_BV_004 {
testcase TC_CSE_GMG_BV_004() runs on M2M system M2MSystem
{
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.any_1[0].Group_optional.currentNrOfMembers := 6;
v_updateRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 5;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(int9, v_resourceIndex, v_updateRequest);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Update failed because member ID exceed max number of member");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_004
// Test objective:
// Check that the IUT accepts the creation of the RESOURCE_TYPE resource by using
// fanOutPoint in group resource.
group g_CSE_GMG_BV_005 {
testcase TC_CSE_GMG_BV_005() runs on M2M system M2MSystem
{
// TODO: use right values for c_fanoutPointAddress and c_RessourceType1
var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS";
var ResourceType c_RessourceType1 := int1;
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createGroupBase;
v_createRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress;
v_createRequest.primitiveContent.any_1[0].Group_optional.resourceType := c_RessourceType1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex);
// Test Body
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2001)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource");
// TODO: check for aggregatedResponse representation
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_005
// Test objective:
// Check that the IUT returns successfully the resource of the group members by using
// fanOutPoint in group resource.
group g_CSE_GMG_BV_006 {
testcase TC_CSE_GMG_BV_006() runs on M2M system M2MSystem
{
// TODO: use right values for c_fanoutPointAddress and c_RessourceType1
var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS";
var ResourceType c_RessourceType1 := int1;
// Local variables
var XSD.ID v_resourceId := "NonExisting";
var RequestPrimitive v_request;
var M2MResponsePrimitive v_response;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
v_request := m_retrieveResource(f_getResourceAddress(-2) & "/" & v_resourceId);
v_request.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_resourceIndex := f_createResource(int9, v_request, v_aeIndex);
// Test Body
mcaPort.send(m_request(valueof(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2000)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": retrieve attributes successfull by using fanOutPoint in group resource");
// TODO: check for aggregatedResponse representation
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_006
// Test objective:
// Check that the IUT accepts the update of the RESOURCE_TYPE resource by using
// fanOutPoint in group resource.
group g_CSE_GMG_BV_007 {
testcase TC_CSE_GMG_BV_007() runs on M2M system M2MSystem
{
// TODO: use right values for c_fanoutPointAddress and c_RessourceType1
var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS";
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var Group_optional v_group_optional;
v_updateRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(int9, v_resourceIndex, v_updateRequest);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2004)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": update successfull by using fanOutPoint in group resource");
// TODO: check for aggregatedResponse representation
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_007
// Test objective:
// Check that the IUT could delete the RESOURCE_TYPE resource by using
// fanOutPoint in group resource.
group g_CSE_GMG_BV_008_1 {
testcase TC_CSE_GMG_BV_008_1() runs on M2M system M2MSystem
{
// TODO: use right values for c_fanoutPointAddress and c_deleteAddress
var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS";
var XSD.ID c_deleteAddress := "DELETE";
//Local variables
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var M2MResponsePrimitive v_response;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_deleteRequest := m_deleteRequest(c_deleteAddress);
v_deleteRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex);
// Test Body
v_request := f_getUpdateRequestPrimitive(int9, v_resourceIndex, v_deleteRequest);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2002)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": delete successfull by using fanOutPoint in group resource");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_008_1
// Test objective:
// Check that the IUT detects the presence of duplicate member IDs during the creation of the
// group resource and removes the duplicate member IDs prior to creation of the group resource.
group g_CSE_GMG_BV_008_2 {
testcase TC_CSE_GMG_BV_008_2() runs on M2M system M2MSystem
{
// TODO: use right values for c_memberRessourceAddress
var XSD.AnyURI c_memberRessourceAddress := "MEMBER_RESSOURCE_ADDRESS";
// Local variables
var M2MResponsePrimitive v_response;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createGroupBase;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_createRequest := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex);
v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup (1, {c_memberRessourceAddress, c_memberRessourceAddress}, omit);
mcaPort.send(m_request(valueof(v_createRequest)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2001)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource created successfuly");
if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberIDs)){
setverdict(fail, testcasename(), ": Error, memberID attribute not provided");
} else {
if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberIDs[0] != c_memberRessourceAddress){
setverdict(fail, testcasename(), ": Error, memberIDs attribute not correct");
}
}
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_008_2
// Test objective:
// Check that the IUT validates the resource type during the creation of the
// group resource when memberType attribute is not ‘mixed’.
group g_CSE_GMG_BV_009 {
testcase TC_CSE_GMG_BV_009() runs on M2M system M2MSystem
{
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// TODO: use right values for c_RessourceType1
var ResourceType c_RessourceType1 := int1;
var ResponsePrimitive.primitiveContent v_responsePrimitive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_request := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex);
v_request.primitiveContent.any_1[0].Group_optional.resourceType := c_RessourceType1;
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2001)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource created successfuly");
if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){
setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided");
} else {
if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false){
setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct");
}
}
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource" );
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_009
// Test objective:
// Check that the IUT handles unsuccessful validation of the resource type during the creation of the
// group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED.
group g_CSE_GMG_BV_010 {
testcase TC_CSE_GMG_BV_010() runs on M2M system M2MSystem
{
// TODO: use right values for c_RessourceType1 and c_RessourceType2
var MemberType c_RessourceType1 := int1;
var MemberType c_RessourceType2 := int2;
// Local variables
var ResponsePrimitive.primitiveContent v_responsePrimitive;
var M2MResponsePrimitive v_response;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var RequestPrimitive v_request;
var template RequestPrimitive v_createRequest := m_createGroupBase;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_request := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex);
v_request.primitiveContent.any_1[0].Group_optional.memberType := c_RessourceType2;
v_request.primitiveContent.any_1[0].Group_optional.consistencyStrategy := int3; // MIXED
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2001)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource created successfuly");
// check for memberTypeValidated
if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){
setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided");
} else {
if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false){
setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct");
}
}
// check for memberType (MIXED)
if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberType)){
setverdict(fail, testcasename(), ": Error, memberType attribute not provided");
} else {
if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberType != int3){
setverdict(fail, testcasename(), ": Error, memberType attribute not correct");
}
}
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_010
// Test objective:
// Check that the IUT handles unsuccessful validation of the resource type during the creation of the
// group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is
// ABANDON_MEMBER,.
group g_CSE_GMG_BV_011 {
testcase TC_CSE_GMG_BV_011() runs on M2M system M2MSystem
{
// TODO: use right values for c_RessourceType1 and c_RessourceType2 and c_memberRessourceAddress1 and c_memberRessourceAddress2
var MemberType c_RessourceType1 := int1;
var MemberType c_RessourceType2 := int2;
var XSD.AnyURI c_memberRessourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1";
var XSD.AnyURI c_memberRessourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2";
// Local variables
var M2MResponsePrimitive v_response;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var ResponsePrimitive.primitiveContent v_responsePrimitive;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_createRequest := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex);
v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_RessourceType1;
v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := int1; // ABANDON_MEMBER
mcaPort.send(m_request(valueof(v_createRequest)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int2001)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource created successfuly");
// check for memberTypeValidated
if(not ispresent(v_responsePrimitive.any_1[0].Group_optional.memberTypeValidated)){
setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided");
} else {
if(v_responsePrimitive.any_1[0].Group_optional.memberTypeValidated == false){
setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct");
}
}
// check for membersId
if(not ispresent(v_responsePrimitive.any_1[0].Group_optional.memberIDs)){
setverdict(fail, testcasename(), ": Error, memberIDs attribute not provided");
} else {
if(v_responsePrimitive.any_1[0].Group_optional.memberIDs[0] != c_memberRessourceAddress1){
setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct");
}
}
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_011
// Test objective:
// Check that the IUT handles unsuccessful validation of the resource type during the creation of the
// group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is
// ABANDON_GROUP.
group g_CSE_GMG_BV_012 {
testcase TC_CSE_GMG_BV_012() runs on M2M system M2MSystem
{
// TODO: use right values for c_RessourceType1 and c_RessourceType2 and c_memberRessourceAddress1 and c_memberRessourceAddress2
var MemberType c_RessourceType1 := int1;
var MemberType c_RessourceType2 := int2;
var XSD.AnyURI c_memberRessourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1";
var XSD.AnyURI c_memberRessourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2";
// Local variables
var M2MResponsePrimitive v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createGroupBase;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi
v_createRequest := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex);
v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup (1, {c_memberRessourceAddress1, c_memberRessourceAddress2}, omit);
v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_RessourceType1;
v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := int2; // ABANDON_GROUP
mcaPort.send(m_request(valueof(v_createRequest)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int6011)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": unsuccessful validation of the resource type during the creation of the group");
}
[] mcaPort.receive(mw_responseKO) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
// Postamble
f_postamble_deleteResources();
}
} // end group g_CSE_GMG_BV_012
} // end group Group_Managment
}//end group CSE
}
Loading