/**
 *  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     oneM2M
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
 *              $Id: OneM2M_Testcases.ttcn 355 2017-08-18 07:54:17Z 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_Pics all;
	import from OneM2M_Functions 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_RESOURCES() runs on CseTester system CseSystem {
				
				timer t_ac := 5.0;
				var integer i; 
				var XSD.ID v_resourceAddress;
				var RequestPrimitive v_request;
				map(self:mcaPort, system:mcaPort); 
					
				for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) {  
					
					v_resourceAddress := f_getResourceAddress() & "/" & PX_RESOURCES_TO_BE_DELETED[i]; 
						
    				v_request := valueof(m_delete(v_resourceAddress, PX_SUPER_AE_ID));
    
    				mcaPort.send(m_request(v_request));
					
					t_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							t_ac.stop;
							log(__SCOPE__ & ":Resource deleted");
							setverdict(pass);
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							t_ac.stop;
							log(__SCOPE__ & ":Error while deleting resource");
							setverdict(fail);
						}
						[] mcaPort.receive {
							t_ac.stop;
							log(__SCOPE__ & ":Unexpected message received");
							setverdict(inconc);
						}
						[] t_ac.timeout {
							log(__SCOPE__ & ":No answer while deleting resource");
							setverdict(inconc);
						}	
					}	
				}
			
				unmap(self:mcaPort, system:mcaPort); 
				stop;
			}	
		
		}//end group helpingTestCases
	
	}//end group oneM2M_demos
	
	group CSE {
		
		group Generic {
			
			group Create {
				group g_CSE_GEN_CRE_001 {

					/**
					 * @desc Check that the IUT accepts the creation of a  resource using unstructured resource identifier
					 * 
					 */
					testcase TC_CSE_GEN_CRE_001_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_CRE_001(e_cseRelative);
					}

					testcase TC_CSE_GEN_CRE_001_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_CRE_001(e_spRelative);
					}
					
					testcase TC_CSE_GEN_CRE_001_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_CRE_001(e_absolute);
					}
								
					function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_nonHierarchical;
						vc_primitiveScope := p_primitiveScope;
						v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_CRE_001				
				
				
				} // end of group g_CSE_GEN_CRE_001
				
				group g_CSE_GEN_CRE_002 {

					/**
					 * @desc Check that the IUT accepts the creation of a  resource using structured resource identifier
					 * 
					 */
					testcase TC_CSE_GEN_CRE_002_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_CRE_002(e_cseRelative);
					}

					testcase TC_CSE_GEN_CRE_002_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_CRE_002(e_spRelative);
					}
					
					testcase TC_CSE_GEN_CRE_002_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_CRE_002(e_absolute);
					}
								
					function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_hierarchical;
						vc_primitiveScope := p_primitiveScope;
						v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_CRE_002				
				
				
				} // end of group g_CSE_GEN_CRE_002
				
			} // end of group Create
			
			group Retrieve {
				group g_CSE_GEN_RET_001 {

					/**
					 * @desc Check that the IUT accepts the retrieval of a <container>  resource using unstructured resource identifier
					 * 
					 */
					testcase TC_CSE_GEN_RET_001_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_RET_001(e_cseRelative);
					}

					testcase TC_CSE_GEN_RET_001_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_RET_001(e_spRelative);
					}
					
					testcase TC_CSE_GEN_RET_001_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_RET_001(e_absolute);
					}
								
					function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_nonHierarchical;
						vc_primitiveScope := p_primitiveScope;
						
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_RET_001				
				
				
				} // end of group g_CSE_GEN_RET_001
				
				group g_CSE_GEN_RET_002 {

					/**
					 * @desc Check that the IUT accepts the retrieval of a <container>  resource using structured resource identifier
					 * 
					 */
					testcase TC_CSE_GEN_RET_002_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_RET_002(e_cseRelative);
					}

					testcase TC_CSE_GEN_RET_002_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_RET_002(e_spRelative);
					}
					
					testcase TC_CSE_GEN_RET_002_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_RET_002(e_absolute);
					}
								
					function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_hierarchical;
						vc_primitiveScope := p_primitiveScope;
						
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_RET_002				
				
				} // end of group g_CSE_GEN_RET_002
				
			} // end of group Retrieve
			
			group Update {
				group g_CSE_GEN_UPD_001 {

					/**
					 * @desc Check that the IUT accepts the update of a <container>  resource using unstructured resource identifier
					 * 
					 */
					testcase TC_CSE_GEN_UPD_001_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_UPD_001(e_cseRelative);
					}

					testcase TC_CSE_GEN_UPD_001_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_UPD_001(e_spRelative);
					}
					
					testcase TC_CSE_GEN_UPD_001_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_UPD_001(e_absolute);
					}
								
					function f_CSE_GEN_UPD_001(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_nonHierarchical;
						vc_primitiveScope := p_primitiveScope;
						
						v_updateRequest.primitiveContent.container.labels := {"MyLabel"};
						
						v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
						
						mcaPort.send(m_request(v_updateRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource updated using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_UPD_001				
				
				} // end of group g_CSE_GEN_UPD_001
				
				group g_CSE_GEN_UPD_002 {

					/**
					 * @desc Check that the IUT accepts the update of a <container>  resource using structured resource identifier
					 * 
					 */
					testcase TC_CSE_GEN_UPD_002_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_UPD_002(e_cseRelative);
					}

					testcase TC_CSE_GEN_UPD_002_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_UPD_002(e_spRelative);
					}
					
					testcase TC_CSE_GEN_UPD_002_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_UPD_002(e_absolute);
					}
								
					function f_CSE_GEN_UPD_002(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_hierarchical;
						vc_primitiveScope := p_primitiveScope;
						
						v_updateRequest.primitiveContent.container.labels := {"MyLabel"};
						
						v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
						
						mcaPort.send(m_request(v_updateRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_UPD_002				
				
				
				} // end of group g_CSE_GEN_UPD_002
				
			} // end of group Update
			
			group Delete {
				group g_CSE_GEN_DEL_001 {

					/**
					 * @desc Check that the IUT accepts the deletion of a <container>  resource using unstructured resource identifier
					 *  
					 */
					testcase TC_CSE_GEN_DEL_001_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_DEL_001(e_cseRelative);
					}

					testcase TC_CSE_GEN_DEL_001_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_DEL_001(e_spRelative);
					}
					
					testcase TC_CSE_GEN_DEL_001_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_DEL_001(e_absolute);
					}
								
					function f_CSE_GEN_DEL_001(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_nonHierarchical;
						vc_primitiveScope := p_primitiveScope;
						
						v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource deleted using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while deleting container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_DEL_001				
				
				
				} // end of group g_CSE_GEN_DEL_001
				
				group g_CSE_GEN_DEL_002 {

					/**
					 * @desc Check that the IUT accepts the deletion of a <container>  resource using structured resource identifier
					 * 
					 */
					testcase TC_CSE_GEN_DEL_002_CSR() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_GEN_DEL_002(e_cseRelative);
					}

					testcase TC_CSE_GEN_DEL_002_SPR() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_GEN_DEL_002(e_spRelative);
					}
					
					testcase TC_CSE_GEN_DEL_002_ABS() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_GEN_DEL_002(e_absolute);
					}
								
					function f_CSE_GEN_DEL_002(in PrimitiveScope p_primitiveScope) runs on CseTester {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						vc_addressingMethod := e_hierarchical;
						vc_primitiveScope := p_primitiveScope;
						
						v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
							}
						}	
    								
						// Postamble
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						vc_primitiveScope := PX_PRIMITIVE_SCOPE;
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_DEL_002				
				
				
				} // end of group g_CSE_GEN_DEL_002
				
			} // end of group Delete
		
		} // end of group Generic
		
		group Registration {
			
			group Create{
				
				/**
				 * @desc Check that the IUT accepts an AE registration (allowed App-ID, C-AE-ID-STEM not provided by AE)  
				 * 
				 */
				testcase TC_CSE_REG_CRE_001() runs on CseTester system CseSystem {
		  	  	
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
	                // Test component configuration
					f_cf01Up();
	                
					//Preamble
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi);
					
					//Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, omit));	
					
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex);
					
					mcaPort.send(m_request(v_request));
					
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE successfully created.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
						
				}
		  	  	
				/**
				 * @desc Check that the IUT sends a registration CREATE Request with the value of the attribute ATTRIBUTE_NAME  of the AE resource
				 * 
				 */
				testcase TC_CSE_REG_CRE_002() runs on CseTester system CseSystem {
		  	  	
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
	                // Test component configuration
					f_cf01Up();
		  	  	
					//Preambule
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi);
					
					//Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
	    									
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex);
	
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE successfully created.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
						
				}
		  	  	
				/**
				 * @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE) 
				 * 
				 */
				testcase TC_CSE_REG_CRE_004() runs on CseTester system CseSystem {
		  	  	
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
	                // Test component configuration
					f_cf01Up();
		  	  	
					//Preambule
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule(-);//c_CRUDNDi);
		
					//Test Body	
					v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
	    									
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex);
			
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation rejected.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
						
					// Tear down
					f_cf01Down();
						
				}
		  	  	
				/**
				 * @desc Check that the IUT accepts an AE registration (allowed App-ID, S-AE-ID-STEM not provided by AE) 
				 * 
				 */
				testcase TC_CSE_REG_CRE_005() runs on CseTester system CseSystem {
		  	  	
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
	                // Test component configuration
					f_cf02Up();
		  	  	
					//Preambule
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi);
		
					//Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
	    									
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex);
		  	  		
					mcaPort.send(m_request(v_request));
					tc_ac.start;
	
					alt {
						[] mccPort.receive(mw_request(mw_createAEAnnc(-, -, -))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
						}
						[] mccPort.receive {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
						
				}
				
				/**
				 * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer request to the IN-CSE 
				 * 
				 */
				testcase TC_CSE_REG_CRE_008() runs on CseTester system CseSystem {
		  	  	
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
	                // Test component configuration
					f_cf02Up();
		  	  	
					//Preambule
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi);
		
					//Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, "S-AE-ID-STEM"));				
	    									
					v_request := f_getUpdateRequestPrimitive(v_resourceType,v_cseBaseIndex, v_request);
		  	  		
					mcaPort.send(m_request(v_request));
					tc_ac.start;
	
					alt {
						[] mccPort.receive(mw_request(mw_createAEAnnc("/S", "CSE_ID", -))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
						}
						[] mccPort.receive {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf02Down();
						
				}
		  	  	
				/**
				 * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), communication between MN-CSE and IN-CSE
				 *  
				 */
				testcase TC_CSE_REG_CRE_009() runs on CseTester system CseSystem {
		  	  	
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_aeAnncIndex := -1;
					var ResourceType v_resourceType := int2;
	                
	                // Test component configuration
					f_cf02Up();
		  	  	
					//Preambule
					v_aeAnncIndex := f_cse_preamble_registerAe();//TODO TestSystem acting as MN. It should register AeAnnc into the IUT (IN) via mcc
					f_cse_deleteResource(v_aeAnncIndex); //to deregister the AE
		
					//Test Body
					v_request := valueof(m_updateAEAnnc(-, -, -, "APP-ID", -));	//TODO to double check all parameters			
	    									
					v_request := f_getUpdateRequestPrimitive(v_resourceType,v_aeAnncIndex, v_request);//TODO 
		  	  		
					mccPort.send(m_request(v_request));
					tc_ac.start;
	
					alt {
						[] mccPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
							//continue to test the content
						}
						[] mccPort.receive {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					//v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf02Down();
						
				}
				
				/**
				 * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer response to the AE
				 * 
				 */
				testcase TC_CSE_REG_CRE_010() runs on CseTester system CseSystem {
		  	  	
					var MsgIn v_response;
					var ResponsePrimitive v_request;
					var integer v_cseBaseIndex := -1;
	                
	                // Test component configuration
					f_cf02Up();
		  	  	
					//Preambule
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi);
		
					//Test Body
					v_request := valueof(m_responsePrimitive(int2001, "To_be_defined", {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, omit, PX_APP_ID, "/CSE_ID/S-AE-ID-STEM")}));				
		  	  		
					mccPort.send(m_response(v_request));
					tc_ac.start;
	
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation success.");
							//continue to test the content
						}
						[] mcaPort.receive {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf02Down();
						
				} //end TC_CSE_REG_CRE_010
				
				group g_CSE_REG_CRE_016{
					
					/**
					 * @desc Check that the IUT accepts a create request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE. 
					 * 
					 */
					testcase TC_CSE_REG_CRE_016_LBL() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;	
						const AttributeAux c_optionalAttribute := {"labels", omit};
						
						v_createRequest.primitiveContent.remoteCSE.labels := {"MyLabel"};
						
						f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_REG_CRE_016_CST() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;	
						const AttributeAux c_optionalAttribute := {"cseType", omit};
						
						v_createRequest.primitiveContent.remoteCSE.cseType := int1;
						
						f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute);
	
					}
					
					testcase TC_CSE_REG_CRE_016_POA() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;	
						const AttributeAux c_optionalAttribute := {"pointOfAccess", omit};
	
						v_createRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"};
	
						f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute);

					}
					
					testcase TC_CSE_REG_CRE_016_NL() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;	
						const AttributeAux c_optionalAttribute := {"nodeLink", omit};

						v_createRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID;

						f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute);

					}
					
					function f_CSE_REG_CRE_016(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseTester {
					
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var ResourceType v_resourceType := int16;	//remoteCSE
										   
						// Test control
					
						// Test component configuration
						f_cf04Up(); 
					
						// Test adapter configuration
					
						// Preamble
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(v_resourceType, p_requestPrimitive, -1);
					
						mccPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mccPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Accepted creation for resource type remoteCSE containing attribute " & p_optionalAttribute.name);
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Accepted creation for resource type remoteCSE without containing attribute " & p_optionalAttribute.name);
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Rejected creation of resource type remoteCSE containing attribute" & p_optionalAttribute.name);
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE");
							}
						}	
								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf04Down();
																
					}//end f_CSE_REG_CRE_BV_016
					
				}// end group g_CSE_REG_CRE_BV_016	
			
				/**
				 * @desc Check that the IUT rejects an AE registration (not allowed App-ID) 
				 * 
				 */
				testcase TC_CSE_REG_CRE_018() runs on CseTester system CseSystem {
		  	  	
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
					// Test component configuration
					f_cf01Up();
					
					//Preambule
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule(-);//c_CRUDNDi);				
	    									
					// Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, omit));				
	    									
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex);
					
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation rejected.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
						
				}
				
				/**
				 * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1. 
				 *  
				 */
				testcase TC_CSE_REG_CRE_022() runs on CseTester system CseSystem {
				
					// Local variables
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase);	
					var ResourceType v_resourceType := int16;	//remoteCSE
					   
					// Test control

					// Test component configuration
					f_cf04Up();

					// Test adapter configuration

					// Preamble
				
					// Test Body
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1);
	
					mccPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
						}
						[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
						}
						[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE");
						}
					}	
			
					// Postamble
					f_cse_postamble_deleteResources();
	
					// Tear down
					f_cf04Down();

				}//end TC_CSE_REG_CRE_022
				
				/**
				 * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1 without the preconfigured CSE-ID
				 *
				 */
				testcase TC_CSE_REG_CRE_023() runs on CseTester system CseSystem {
				
					// Local variables
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase);	
					var ResourceType v_resourceType := int16;	//remoteCSE
	   
					// Test control

					// Test component configuration
					f_cf04Up();

					// Test adapter configuration

					// Preamble

					// Test Body
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1);

					mccPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
						}
						[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE");
						}
					}	

					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf04Down();

				}//end TC_CSE_REG_CRE_023
				
				/**
				 * @desc Check that the IUT rejects the create request of <CSEBase> resource.
				 * 
				 */
				testcase TC_CSE_REG_CRE_024() runs on CseTester system CseSystem {
    				
					// Local variables
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_aeIndex := -1;
					var ResourceType v_resourceType := int5;	//CSEBase
						   
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

					// Test Body
					v_request := f_getCreateRequestPrimitive(v_resourceType, m_createCSEBaseBase, v_aeIndex); 
	
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": CSEBase creation rejected.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating CSEBase");
						}
					}	
				
					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf01Down();

				}//end TC_CSE_REG_CRE_024
				
				/**
				 * @desc Check that the IUT rejects registration of already registered AE (C-AE-ID-STEM provided by AE) 
				 * 
				 */
				testcase TC_CSE_REG_CRE_026() runs on CseTester system CseSystem {
				  
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_aeIndex := -1;
					var ResourceType v_resourceType := int2;
					
					// Test control
	    				
					// Test component configuration
					f_cf01Up();
	    			
					// Test adapter configuration
	    			
					// Preamble
					v_aeIndex := f_cse_preamble_registerAeWithId("C-AE-ID-STEM");//c_CRUDNDi);
					
					//Test Body	
					v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
	    									
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_aeIndex);
					
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation rejected.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4105))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
						
					// Tear down
					f_cf01Down();
				
				}
				

			
			}	//end group Create
			
			group Retrieve{
				
				/**
				 * @desc Check that the IUT accepts an retrieval request of <CSEBase> resource and responds with all  attributes that have multiplicity equals to 1.
				 * 
				 */
				testcase TC_CSE_REG_RET_001() runs on CseTester system CseSystem {
    				
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var template PrimitiveContent v_contentResponse;
	    										   
					// Test control
	
					// Test component configuration
					f_cf01Up();
	
					// Test adapter configuration
	
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					// Test Body
					v_contentResponse.cSEBase := mw_contentCSEBase_rc1;
					
					mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID
	
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
						}
					}	
				
					// Postamble
					f_cse_postamble_deleteResources();
	
					// Tear down
					f_cf01Down();
	
				}//end TC_CSE_REG_RET_001
				
				/**
				 * @desc Check that if the IUT is IN-CSE, it accepts an retrieval request of <CSEBase> resource and returns the cseType attribute. cseType Attribute is mandatory for IN-CSE
				 * 
				 */
				testcase TC_CSE_REG_RET_005() runs on CseTester system CseSystem {
    				
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var template PrimitiveContent v_contentResponse;
								   
					// Test control
					if(not(PICS_IN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be IN-CSE to run this test case");
						stop;
					}

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
	
					// Test Body
					v_contentResponse.cSEBase := mw_contentCSEBase_rc1;
	
					mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID 

					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
							tc_ac.stop;
							if (ispresent(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType)){
								if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType==int1){
									setverdict(pass, __SCOPE__ & ": cseType attribute is set to 1 (IN_CSE)");
								}else{
									setverdict(fail, __SCOPE__ & ": Error, cseType attribute is set to " & int2str(enum2int(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType)));
								}
							}else{
								setverdict(fail, __SCOPE__ & ": Error, cseType attribute is not present");
							}
							
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
						}
					}	

					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf01Down();

				}//end TC_CSE_REG_RET_BV_005
				
				/**
				 * @desc Check that the IUT accepts a retrieval request of <CSEBase> resource and responds with supportedResourceTypes attribute containing a list of the supported resources and pointOfAccess containing the list of physical addresses to be used by Registree to connect to this CSE (e.g. IP address, FQDN).
				 * 
				 */
				testcase TC_CSE_REG_RET_008() runs on CseTester system CseSystem {
    				
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var template PrimitiveContent v_contentResponse;
				   
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

					// Test Body
					v_contentResponse.cSEBase := mw_contentCSEBase_rc1;

					mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID

					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
							tc_ac.stop;
							
							if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.supportedResourceType == PX_SRT) {
								setverdict(pass, __SCOPE__ & ": supportedResourceTypes attribute is set according to PX_SRT");
							}else{
								setverdict(fail, __SCOPE__ & ": supportedResourceTypes attribute is not set according to PX_SRT");
							}
							
							if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.pointOfAccess==PX_POA){
								setverdict(pass, __SCOPE__ & ": supportedResourceTypes attribute is set according to PX_POA");
							}else{
								setverdict(fail, __SCOPE__ & ": supportedResourceTypes attribute is not set according to PX_POA");
							}
			
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
						}
					}	

					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf01Down();

				}//end TC_CSE_REG_RET_008
			
			}	//end group Retrieve
			
			group Update{
			
				/**
				 * @desc Check that the IUT rejects the update request of <CSEBase> resource.
				 * 
				 */
				testcase TC_CSE_REG_UPD_001() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_aeIndex := -1;
					var Labels v_labels_1 := {"VALUE_1"};
					var template RequestPrimitive v_updateRequest := m_updateCSEBaseBase;
   					const integer c_cseBaseIndex := -1;
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

					// Test Body
					v_updateRequest.primitiveContent.cSEBase.labels := v_labels_1;
					v_request := f_getUpdateRequestPrimitive(int5, c_cseBaseIndex, v_updateRequest);
					
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": CSEBase update rejected.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while updating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while updating CSEBase");
						}
					}					    

					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf01Down();

				}//end TC_CSE_REG_UPD_BI_001			

			}// end group Update
			
			group Delete{
			
				/**
				 * @desc Check that the IUT rejects the delete request of <CSEBase> resource.
				 * 
				 */
				testcase TC_CSE_REG_DEL_001() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn 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_cse_preamble_registerAe();//c_CRUDNDi);
		
					// Test Body
					v_request := valueof(m_delete(f_getResourceAddress(), f_getOriginator()));
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": CSEBase deletion rejected.");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while deleting CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while deleting CSEBase");
						}
					}					    
	
					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf01Down();
		
				}//end TC_CSE_REG_DEL_BI_001			
			
			}// end group Delete
	  	  	
		}//end Registration
		
		group Data_Management_and_Repository {
						
			group Create {
				
				group g_CSE_DMR_CRE_001 {
					
					/**
					 * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource on the TARGET_RESOURCE_ADDRESS of type PARENT_RESOURCE_TYPE with resource name not provided
					 * 
					 */
					testcase TC_CSE_DMR_CRE_001_CNT_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;//TODO useless but need to be initialized see if we can remove it
						
						v_createRequest.primitiveContent.container.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int3, v_createRequest, -, v_notifyHandler); //Container
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
						}
						}
						
					}
						
					testcase TC_CSE_DMR_CRE_001_CNT_AE() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.container.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int3, v_createRequest, m_createAeAux(omit,omit),v_notifyHandler);//Container
							
							if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
								}
							}
						
						}  
					
					testcase TC_CSE_DMR_CRE_001_CNT_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.container.resourceName := omit;

						v_responsePrimitive := f_CSE_DMR_CRE_001(int3, v_createRequest, m_createContainerBase, v_notifyHandler);//Container
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
					}
						}

					}
					
					testcase TC_CSE_DMR_CRE_001_GRP_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.group_.resourceName := omit;

						v_responsePrimitive := f_CSE_DMR_CRE_001(int9, v_createRequest, -, v_notifyHandler);//Group
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
						}
						}
						
					}
						
					testcase TC_CSE_DMR_CRE_001_GRP_AE() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.group_.resourceName := omit;

						v_responsePrimitive := f_CSE_DMR_CRE_001(int9, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Group
							if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
								}
							}
						
						}
					
					testcase TC_CSE_DMR_CRE_001_ACP_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;

						v_createRequest.primitiveContent.accessControlPolicy.resourceName := omit;

						v_responsePrimitive := f_CSE_DMR_CRE_001(int1, v_createRequest, -, v_notifyHandler);//AccessControlPolicy
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
						}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_ACP_AE() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.accessControlPolicy.resourceName := omit;

						v_responsePrimitive := f_CSE_DMR_CRE_001(int1, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//AccessControlPolicy
							if(getverdict == pass){
								if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
								}
							}
						
						}
				
					testcase TC_CSE_DMR_CRE_001_SCH_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.schedule.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int18, v_createRequest, -, v_notifyHandler);//Schedule
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
    					}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_SCH_AE() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.schedule.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int18, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Schedule

							if(getverdict == pass){
								if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
								}
							}
						
						}
				
					testcase TC_CSE_DMR_CRE_001_SCH_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.schedule.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int18, v_createRequest, m_createSubscriptionBase, v_notifyHandler);//Schedule
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
					}
						}
					
					}
					
					testcase TC_CSE_DMR_CRE_001_PCH_AE() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						
						v_createRequest.primitiveContent.pollingChannel.resourceName := omit;

						v_responsePrimitive := f_CSE_DMR_CRE_001(int15, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//PollingChannel
							if(getverdict == pass){
								if(not ispresent(v_responsePrimitive.primitiveContent.pollingChannel.resourceName)){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
								}
							}
						
						}
					
					testcase TC_CSE_DMR_CRE_001_SUB_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.subscription.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, -, v_notifyHandler);//Subscription
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
					}
						}
					
					}
					
					testcase TC_CSE_DMR_CRE_001_SUB_AE() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.subscription.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Subscription
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
	
    					}
						
					testcase TC_CSE_DMR_CRE_001_SUB_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.subscription.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createContainerBase, v_notifyHandler);//Subscription
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}

					}
					
					testcase TC_CSE_DMR_CRE_001_SUB_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.subscription.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createAcpBase, v_notifyHandler);//Subscription
    						if(getverdict == pass){
    							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
    								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
    							}
    						}
						}
					
					testcase TC_CSE_DMR_CRE_001_SUB_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.subscription.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createScheduleBase, v_notifyHandler);//Subscription
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
					}
						}		
					}
					
					testcase TC_CSE_DMR_CRE_001_SUB_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
    				
						v_createRequest.primitiveContent.subscription.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createGroupBase, v_notifyHandler);//Subscription
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}		
					}
					
					testcase TC_CSE_DMR_CRE_001_NOD_CB() runs on CseTester system CseSystem {
    					// Local variables
						var template RequestPrimitive v_createRequest := m_createNodeBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						 
						v_createRequest.primitiveContent.node.resourceName := omit;

						v_responsePrimitive := f_CSE_DMR_CRE_001(int14, v_createRequest, -, v_notifyHandler);//Node
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.node.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_MGC_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createMgmtCmdBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.mgmtResource.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int12, v_createRequest, -, v_notifyHandler);//Management Command
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.mgmtResource.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_LCP_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createLocationPolicyBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.locationPolicy.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int10, v_createRequest, -, v_notifyHandler);//Location Policy
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.locationPolicy.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_STCG_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createStatsConfigBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.statsConfig.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int22, v_createRequest, -, v_notifyHandler);//Stats Config
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.statsConfig.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
					}
					
					testcase TC_CSE_DMR_CRE_001_STCL_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createStatsCollectBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						 
						v_createRequest.primitiveContent.statsCollect.resourceName := omit;
						
						v_responsePrimitive := f_CSE_DMR_CRE_001(int21, v_createRequest, -, v_notifyHandler);//Stats Collect
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.statsCollect.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_MSSP_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createM2mServiceSubscriptionProfileBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						
						v_createRequest.primitiveContent.m2mServiceSubscriptionProfile.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int11, v_createRequest, -, v_notifyHandler);//Subscription Profile
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.m2mServiceSubscriptionProfile.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_ASAR_CB() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createServiceSubscribedAppRuleBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
						 
						v_createRequest.primitiveContent.serviceSubscribedAppRule.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int19, v_createRequest, -, v_notifyHandler);//Service Subscribed App
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.serviceSubscribedAppRule.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}
						
					}
					
					testcase TC_CSE_DMR_CRE_001_CIN_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						var ResponsePrimitive v_responsePrimitive;
						var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;
	
						v_createRequest.primitiveContent.contentInstance.resourceName := omit;
						v_responsePrimitive := f_CSE_DMR_CRE_001(int4, v_createRequest, m_createContainerBase, v_notifyHandler);//Subscription
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							}
						}

					}
					
    				function f_CSE_DMR_CRE_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in CseTester p_notifyHandler) runs on CseTester return ResponsePrimitive {
    				
    					// Local variables
    					var MsgIn v_response;
    					var RequestPrimitive v_request;
						var integer v_parentIndex := -1;
    					var integer v_resourceIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_acpAuxIndex := -1;
						var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"};
    										   
    					// Test control
    				
    					// Test component configuration
    					f_cf01Up();
    				
    					// Test adapter configuration
    				
    					// Preamble
    					
						if(ispresent(p_parentRequestPrimitive)) {
							if(match(int23, p_parentRequestPrimitive.resourceType)){
								v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", v_poaList), -1); // AE2 is registred
								p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; 
								p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(v_parentIndex));
							}
							v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex);
						} else {//Resource under CSEBase
						
							if(p_resourceType != int1) {
							
								v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
								p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
							}
						
						}									
    									
    					// Test Body
    					
						if(match(int23, p_requestPrimitive.resourceType)){
							v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", v_poaList), -1); // AE2 is registred
							p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; 
							p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(v_parentIndex));
						}
    					
    					v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
						
    					mcaPort.send(m_request(v_request));
    					tc_ac.start;
    					alt {
    						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
    							tc_ac.stop;
    							setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
								v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
							}
    						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
    							tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
    						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
    							tc_ac.stop;
    							setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
    						}
    						[] tc_ac.timeout {
    							setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
    						}
    					}	
    					
    					f_checkCseTesterStatus();
    								
						//Check to see if the resource is present or not
						if (f_isResourcePresent(v_resourceIndex)){
							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
						} else {
							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
						}
    								
    					// Postamble
    					f_cse_postamble_deleteResources();
						vc_resourcesIndexToBeDeleted := {};
    					
						// Tear down
						//notifyHandler.stop;
						f_cf01Down();
						
    					
    					return v_response.primitive.responsePrimitive;
    					    				
    				}//end f_CSE_DMR_CRE_001
    				
				} // end g_CSE_DMR_CRE_001
								
				
				group g_CSE_DMR_CRE_002 {
					
					/**
					 * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with a non-existing resource name provided by AE
					 * 
					 */
					testcase TC_CSE_DMR_CRE_002_CNT() runs on CseTester system CseSystem {
						// Local variables
                        var ResponsePrimitive v_responsePrimitive;
                        
                        v_responsePrimitive := f_CSE_DMR_CRE_002(int3, m_createContainerBase);//container
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							} else {
								if(v_responsePrimitive.primitiveContent.container.resourceName != c_defaultContainerResourceName){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct");
								}
							}
						}
					}

					testcase TC_CSE_DMR_CRE_002_GRP() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						
						v_responsePrimitive := f_CSE_DMR_CRE_002(int9, m_createGroupBase);//group
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							} else {
								if(v_responsePrimitive.primitiveContent.group_.resourceName != c_defaultGroupResourceName){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct");
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_CRE_002_ACP() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
                        
						v_responsePrimitive := f_CSE_DMR_CRE_002(int1, m_createAcpBase );//accessControlPolicy
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							} else {
								if(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName != c_defaultAccessControlPolicyResourceName){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct");
								}
							}
						}
					}

					testcase TC_CSE_DMR_CRE_002_SCH() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						
						v_responsePrimitive := f_CSE_DMR_CRE_002(int18, m_createScheduleBase);//Schedule
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							} else {
								if(v_responsePrimitive.primitiveContent.schedule.resourceName != c_defaultScheduleResourceName){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct");
								}
							}
						}
					}
					testcase TC_CSE_DMR_CRE_002_PCH() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						
						v_responsePrimitive := f_CSE_DMR_CRE_002(int15, m_createPollingChannelBase);//Pollingchannel

						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.pollingChannel.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							} else {
								if(v_responsePrimitive.primitiveContent.pollingChannel.resourceName != c_defaultPollingChannelResourceName){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct");
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_CRE_002_SUB() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						
						v_responsePrimitive := f_CSE_DMR_CRE_002(int23, m_createSubscriptionBase);//Subscription
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
								setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
							} else {
								if(v_responsePrimitive.primitiveContent.subscription.resourceName != c_defaultSubscriptionResourceName){
									setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct");
								}
							}
						}
					}
					
					function f_CSE_DMR_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester return ResponsePrimitive{//system CseSystem { MRO system keyword not supported on functions in Titan
				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
										   
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
									
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
								v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex);
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
								
						f_checkCseTesterStatus();
						
						//Check to see if the resource is present or not
						if(f_isResourcePresent(v_resourceIndex)){
							setverdict(pass, __SCOPE__ & ":INFO: Resource created");	
						} else {
							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
						}		
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
						
						return v_response.primitive.responsePrimitive;
				
					}//end f_CSE_DMR_CRE_002
					
					
				}// end group g_CSE_DMR_CRE_002
				
				group g_CSE_DMR_CRE_003 {
					
					/**
					 * @desc Check that the IUT rejects the creation of a RESOURCE_TYPE resource with an existing resource name provided by AE
					 * 
					 */
					testcase TC_CSE_DMR_CRE_003_CNT() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_003(int3, m_createContainerBase);//container
					}

					testcase TC_CSE_DMR_CRE_003_GRP() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_CRE_003(int9, m_createGroupBase);//group
					}
					
					testcase TC_CSE_DMR_CRE_003_ACP() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_003(int1, m_createAcpBase);//accessControlPolicy
					}

					testcase TC_CSE_DMR_CRE_003_SCH() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_CRE_003(int18, m_createScheduleBase);//Schedule
					}
					testcase TC_CSE_DMR_CRE_003_PCH() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_003(int15, m_createPollingChannelBase);//Pollingchannel
					}
					
					testcase TC_CSE_DMR_CRE_003_SUB() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_003(int23, m_createSubscriptionBase);//Subscription
					}
					
				
    				function f_CSE_DMR_CRE_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {//system CseSystem { MRO system keyword not supported on functions in Titan
    				
    					// Local variables
    					var MsgIn v_response;
    					var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
    					// Test control
    				
    					// Test component configuration
    					f_cf01Up(); 
    				
    					// Test adapter configuration
    				
    					// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi)
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 	
						
						v_request := f_getCreateRequestPrimitive(p_resourceType, 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(mw_responsePrimitive(int4105))) -> value v_response {
    							tc_ac.stop;
    							setverdict(pass, __SCOPE__ & ": Resource already exists");
    						}
    						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
    							tc_ac.stop;
    							setverdict(fail, __SCOPE__ & ": Error while creating an already existing resource");
    						}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Creating a resource that already exists");
							}
    						[] tc_ac.timeout {
    							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
    						}
    					}	
    								
    					// Postamble
    					f_cse_postamble_deleteResources();
    					
						// Tear down
						f_cf01Down();
    				
    				}//end f_CSE_DMR_CRE_003
    				
				}// end group g_CSE_DMR_CRE_003
				
				group g_CSE_DMR_CRE_004 {
					
					/**
					 * @desc Check that the IUT rejects the creation of a RESOURCE_TYPE resource when AE has no privileges
					 * 
					 */
					testcase TC_CSE_DMR_CRE_004_CNT() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_004(int3, m_createContainerBase);//container
					}

					testcase TC_CSE_DMR_CRE_004_GRP() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_CRE_004(int9, m_createGroupBase);//group
					}
					
					testcase TC_CSE_DMR_CRE_004_ACP() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_004(int1, m_createAcpBase);//accessControlPolicy
					}

					testcase TC_CSE_DMR_CRE_004_SCH() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_CRE_004(int18, m_createScheduleBase);//Schedule
					}
					testcase TC_CSE_DMR_CRE_004_PCH() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_004(int15, m_createPollingChannelBase);//Pollingchannel
					}
					
					testcase TC_CSE_DMR_CRE_004_SUB() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_CRE_004(int23, m_createSubscriptionBase);//Subscription
					}
					
				
					function f_CSE_DMR_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {//system CseSystem { MRO system keyword not supported on functions in Titan
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_acpAuxIndex := -1;
						var integer v_aeIndex := -1;
											   
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up(); 
    				
						// Test adapter configuration
    				
						// Preamble
						if (p_resourceType != int23) {
							v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi)
						} else {
							v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int60);//c_UDNDi);
						}	
												
						v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);
						
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Access denied to create a resource");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating a resource without privileges");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Resource created without creation privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						f_checkCseTesterStatus();
    					
						//Check to see if the resource is NOT present
						if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
						} else {
						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
						}
						
						// Postamble
						f_cse_postamble_deleteResources();
    				
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_CRE_004
    				
				}// end group g_CSE_DMR_CRE_004
				
				group g_CSE_DMR_CRE_005 {
			
					/**
					 * @desc Check that the IUT rejects the CREATE Request of container resource when the RW ATTRIBUTE is provided with an invalid value
					 * 
					 */
					testcase TC_CSE_DMR_CRE_005_MNI() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var AttributeAux v_invalidAttribute;
						
						v_createRequest.primitiveContent.container.maxNrOfInstances := 0;
						v_invalidAttribute := {name := "maxNrOfInstances", value_ := "-1"};
						
						f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute);			
					}
					
					testcase TC_CSE_DMR_CRE_005_MBS() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var AttributeAux v_invalidAttribute;
						
						v_createRequest.primitiveContent.container.maxByteSize := 0;
						v_invalidAttribute := {name := "maxByteSize", value_ := "-1"};
						
						f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute);
						  
					}
					
					testcase TC_CSE_DMR_CRE_005_MIA() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var AttributeAux v_invalidAttribute;
						
						v_createRequest.primitiveContent.container.maxInstanceAge := 0;
						v_invalidAttribute := {name := "maxInstanceAge", value_ := "-1"};
						
						f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute);
						
					}
				
					function f_CSE_DMR_CRE_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_invalidAttribute) runs on CseTester {
    				
							// Local variables
							var MsgIn 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_cse_preamble_registerAe();//c_CRUDNDi); 
						
							// Test Body
							v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
							
    						mcaPort.send(m_request(v_request, {p_invalidAttribute}));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & p_invalidAttribute.name);
								}								
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}								
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & p_invalidAttribute.name);
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));  
								}
							}	
    								
							f_checkCseTesterStatus();
    					
							//Check to see if the resource is NOT present
							if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
							  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
							} else {
							  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
							}
						
					        		
							// Postamble
							f_cse_postamble_deleteResources();
							
							// Tear down
							f_cf01Down();
						    				
						}//end f_CSE_DMR_CRE_005
						
				}// end group g_CSE_DMR_CRE_005
				
				group g_CSE_DMR_CRE_006 {
					
					/**
					 * @desc Check that the IUT returns a default value to RW ATTRIBUTE in the response of a <container> CREATE Request where no a RW ATTRIBUTE is provided by AE
					 * 
					 */
					testcase TC_CSE_DMR_CRE_006_MNI() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						
						v_responsePrimitive := f_CSE_DMR_CRE_006(int3, v_createRequest);		
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.container.maxNrOfInstances)){
								setverdict(fail, __SCOPE__, ": Error, maxNrOfInstances attribute not provided");
							} 
						}	
					}
					
					testcase TC_CSE_DMR_CRE_006_MBS() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						
						v_responsePrimitive := f_CSE_DMR_CRE_006(int3, v_createRequest);
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.container.maxByteSize)){
								setverdict(fail, __SCOPE__, ": Error, maxByteSize attribute not provided");
							} 
						}	
						  
					}
					
					testcase TC_CSE_DMR_CRE_006_MIA() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						
						v_responsePrimitive := f_CSE_DMR_CRE_006(int3, v_createRequest);
						
						if(getverdict == pass){
							if(not ispresent(v_responsePrimitive.primitiveContent.container.maxInstanceAge)){
								setverdict(fail, __SCOPE__, ": Error, maxInstanceAge attribute not provided");
							} 
						}	
					}
				
					function f_CSE_DMR_CRE_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester return ResponsePrimitive {
    				
							// Local variables
							var MsgIn 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_cse_preamble_registerAe();//c_CRUDNDi); 
						
							// Test Body
							v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
    					
							mcaPort.send(m_request(v_request));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType)));
									v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex);
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType)));
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
								}
							}	
    								
							f_checkCseTesterStatus();
    						
						    //Check to see if the resource is present or not
						    if(f_isResourcePresent(v_resourceIndex)){
								setverdict(pass, __SCOPE__ & ":INFO: Resource created");
						    } else {
								setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
						    }
    								
							// Postamble
							f_cse_postamble_deleteResources();
							
							// Tear down
							f_cf01Down();
						
							return v_response.primitive.responsePrimitive;
    					    				
						}//end f_CSE_DMR_CRE_006
						
				}// end group g_CSE_DMR_CRE_006
				
				group g_CSE_DMR_CRE_007 {
					
					/**
					 * @desc Check that the IUT responds with error when the newly created <contentInstance> results in that the field value of attribute currentNrOfInstances exceeds the field value of maxNrOfInstances in the parent container resource.
					 * 
					 */
					testcase TC_CSE_DMR_CRE_007() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						const integer c_maxNumberOfInstances := 0;				   
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_createRequest.primitiveContent.container.maxNrOfInstances := c_maxNumberOfInstances;
												
						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), "MyValue"), v_containerIndex);
					
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Maximun number of instances exceeded");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum number of instances");
								
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
							}
						}	
								
						f_checkCseTesterStatus();
    					
						//Check to see if the resource is NOT present
						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
						} else {
						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
						}
												
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
					    				
					}//end TC_CSE_DMR_CRE_007
						
				}// end group g_CSE_DMR_CRE_007		
				
				group g_CSE_DMR_CRE_008 {
					
					/**
					 * @desc Checks that the IUT accepts a newly created contentInstance when the currentByteSize exceeds the field value set in maxByteSize in the parent container resource by removing enough of the oldest <contentInstance> resources to allow the creation of the new <contentInstance> resource.
					 * 
					 */
					testcase TC_CSE_DMR_CRE_008() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						const integer c_maxByteSize := 0;				   
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
												
						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex);
					
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Maximun byte size exceeded");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response");
							}
							
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size");
								
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
							}
						}	
								
						f_checkCseTesterStatus();
						
						//Check to see if the resource is present or not
						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
						} else {
							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
						}
								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
					    				
					}//end TC_CSE_DMR_CRE_008
						
				}// end group g_CSE_DMR_CRE_008			

				group g_CSE_DMR_CRE_009 {
					
					/**
					 * @desc Check that the IUT increaments and then copies the field value of attribute stateTag in parent container resource when contentInstance resource is created as the direct child of the parent container
					 * 
					 */
					testcase TC_CSE_DMR_CRE_009() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex := -1;
						var template PrimitiveContent v_contentResponse;
					
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
						
						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);
					
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
						
						v_contentResponse.container := mw_contentContainerBase;
						
                        tc_ac.start;
                        alt {
                        	[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
                        		tc_ac.stop;
                        		setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
                        		if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == vc_resourcesList[v_containerIndex].resource.container.stateTag + 1) {
									setverdict(pass, __SCOPE__ & ": stateTag attribute increased after creation of contentInstance resource");
                        		} else {
									setverdict(fail, __SCOPE__ & ": stateTag attribute not incremented correctly after creation of contentInstance resource");
                        		}
                        	}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
                        	[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
                        		tc_ac.stop;
                        		setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
                        	}
                        	[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                        		tc_ac.stop;
                        		setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
                        	}
                        	[] tc_ac.timeout {
                        		setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
                        	}
                        }	
								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
					    				
					}//end TC_CSE_DMR_CRE_009
						
				}// end group g_CSE_DMR_CRE_009		
				
				group g_CSE_DMR_CRE_010 {
					
					/**
					 * @desc Check that the IUT rejects the CREATE Request of a container resource named “la” as a direct child of a container resource 
					 * 
					 */
					testcase TC_CSE_DMR_CRE_010() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
					
						// Test Body
						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest;
						
						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
					
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'la'");
								
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'la' with wrong ResponseStatusCode");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'la'");
								
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
							}
						}	
								
						f_checkCseTesterStatus();
    					
						//Check to see if the resource is NOT present
						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
						} else {
						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
						}
								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
					    				
					}//end TC_CSE_DMR_CRE_010
						
				}// end group g_CSE_DMR_CRE_010	
				
				group g_CSE_DMR_CRE_011 {
					
					/**
					 * @desc Check that the IUT rejects the CREATE Request of a container resource named “ol” as a direct child of a container resource 
					 * 
					 */
					testcase TC_CSE_DMR_CRE_011() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
					
						// Test Body
						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameOldest;
						
						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
					
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'ol'");
								
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'ol' with wrong ResponseStatusCode");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'ol'");
								
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
							}
						}	
								
						f_checkCseTesterStatus();
    					
						//Check to see if the resource is NOT present
						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
						} else {
						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
						}
								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
					    				
					}//end TC_CSE_DMR_CRE_011
						
				}// end group g_CSE_DMR_CRE_011
				
				group g_CSE_DMR_CRE_012 {
					
					/**
					 * @desc Check that the IUT returns successfully after a CREATE request an empty content of created resource when the ResultContent set to 0 (Nothing)
					 * 
					 */
					testcase TC_CSE_DMR_CRE_012_CNT() runs on CseTester system CseSystem {
						// Local variables
						                        
						f_CSE_DMR_CRE_012(int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_CRE_012_GRP() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_CRE_012(int9, m_createGroupBase);//Group
					}
					
					testcase TC_CSE_DMR_CRE_012_ACP() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_DMR_CRE_012(int1, m_createAcpBase);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_CRE_012_SCH() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_DMR_CRE_012(int18, m_createScheduleBase);//Schedule
					}
					
					testcase TC_CSE_DMR_CRE_012_PCH() runs on CseTester system CseSystem {
						// Local variables
							
						f_CSE_DMR_CRE_012(int15, m_createPollingChannelBase);//PollingChannel
					}
					
					testcase TC_CSE_DMR_CRE_012_SUB() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_CRE_012(int23, m_createSubscriptionBase);//Subscription
					}
				
					function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn 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_cse_preamble_registerAe();//c_CRUDNDi);
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
						v_request.resultContent := int0;//Attributes
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, omit))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": No content provided with RC set to 0");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Content provided with RC set to 0");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_CRE_012
    				
				} // end g_CSE_DMR_CRE_012							

				group g_CSE_DMR_CRE_013 {
					
					/**
					 * @desc Check that the IUT returns successfully after a CREATE request only hierarchichal address of the created resource when the Result Content is set to 2 (hierarchical address)
					 * 
					 */
					testcase TC_CSE_DMR_CRE_013_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.uRI := mw_contentContainer_rc2;
					                        
						f_CSE_DMR_CRE_013(int3, m_createContainerBase, v_contentResponse);//Container
					}

					testcase TC_CSE_DMR_CRE_013_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.uRI := mw_contentGroup_rc2;
					
						f_CSE_DMR_CRE_013(int9, m_createGroupBase, v_contentResponse);//Group
					}
					
					testcase TC_CSE_DMR_CRE_013_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.uRI := mw_contentAcp_rc2;
						
						f_CSE_DMR_CRE_013(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_CRE_013_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.uRI := mw_contentSchedule_rc2;
						
						f_CSE_DMR_CRE_013(int18, m_createScheduleBase, v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_CRE_013_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.uRI := mw_contentPollingChannel_rc2;
						
						f_CSE_DMR_CRE_013(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
					}
					
					testcase TC_CSE_DMR_CRE_013_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.uRI := mw_contentSubscription_rc2;

						f_CSE_DMR_CRE_013(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}
				
					function f_CSE_DMR_CRE_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var CseTester v_notifyHandler; 
											   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
						v_request.resultContent := int2;//Attributes
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRI)) {
									setverdict(pass, __SCOPE__ & ": Response returning correctly only the hierarchical address of the created resource");
								} else {
									setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format");							
								}
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 2");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_CRE_013
    				
				} // end g_CSE_DMR_CRE_013	
							
				group g_CSE_DMR_CRE_014 {
					
					/**
					 * @desc Check that the IUT returns successfully after a CREATE request only attributes and hierarchichal address of the created resource when Result Content is set 3 (attributes and hierarchichal address)
					 * 
					 */
					testcase TC_CSE_DMR_CRE_014_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.resource := mw_contentContainer_rc3;
					                        
						f_CSE_DMR_CRE_014(int3, m_createContainerBase, v_contentResponse);//Container
					}

					testcase TC_CSE_DMR_CRE_014_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.resource := mw_contentGroup_rc3;
					
						f_CSE_DMR_CRE_014(int9, m_createGroupBase, v_contentResponse);//Group
					}
					
					testcase TC_CSE_DMR_CRE_014_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.resource := mw_contentAcp_rc3;
						
						f_CSE_DMR_CRE_014(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_CRE_014_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.resource := mw_contentSchedule_rc3;
						
						f_CSE_DMR_CRE_014(int18, m_createScheduleBase, v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_CRE_014_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.resource := mw_contentPollingChannel_rc3;
						
						f_CSE_DMR_CRE_014(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
					}
					
					testcase TC_CSE_DMR_CRE_014_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.resource := mw_contentSubscription_rc3;

						f_CSE_DMR_CRE_014(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}
				
					function f_CSE_DMR_CRE_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var CseTester v_notifyHandler;
											   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
						v_request.resultContent := int3;//Attributes + Hierarchichal Address
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.resource.uRI)) {
									setverdict(pass, __SCOPE__ & ": Response returning correctly the hierarchical address of the created resource and resource representation");
								} else {
									setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format");							
								}
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 3");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_CRE_014
    				
				} // end g_CSE_DMR_CRE_014
				
				group g_CSE_DMR_CRE_015 {
					
					/**
					 * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute OPTIONAL_ATTRIBUTE provided
					 * 
					 */
					testcase TC_CSE_DMR_CRE_015_CNT_ACPI() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit};
						
						v_createRequest.primitiveContent.container.accessControlPolicyIDs := {"NotInitialized"};
						
						f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute);			
					}
					
					testcase TC_CSE_DMR_CRE_015_CNT_ET() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						const AttributeAux c_optionalAttribute := {"expirationTime", omit};
						
						v_createRequest.primitiveContent.container.expirationTime := "20301231T012345";
						
						f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute);
						  
					}
					
					testcase TC_CSE_DMR_CRE_015_CNT_LBL() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						const AttributeAux c_optionalAttribute := {"labels", omit};
						
						v_createRequest.primitiveContent.container.labels := {"MyLabel"};
						
						f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_CNT_MNI() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						const AttributeAux c_optionalAttribute := {"maxNrOfInstances", omit};
						
						v_createRequest.primitiveContent.container.maxNrOfInstances := 0;
						
						f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_CNT_MBS() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						const AttributeAux c_optionalAttribute := {"maxByteSize", omit};
						
						v_createRequest.primitiveContent.container.maxByteSize := 0;
						
						f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_CNT_MIA() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						const AttributeAux c_optionalAttribute := {"maxInstanceAge", omit};
						
						v_createRequest.primitiveContent.container.maxInstanceAge := 0;
						
						f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_CNT_OR() runs on CseTester system CseSystem { 
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						const AttributeAux c_optionalAttribute := {"ontologyRef", omit};
						
						v_createRequest.primitiveContent.container.ontologyRef := "MyOntologyRef";
						
						f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute);
						
					}					
					
					testcase TC_CSE_DMR_CRE_015_CIN_ET() runs on CseTester system CseSystem {//TODO
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						const AttributeAux c_optionalAttribute := {"expirationTime", omit};
						
						v_createRequest.primitiveContent.contentInstance.expirationTime := "20301231T012345";
						
						f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute);			
					}
					
					testcase TC_CSE_DMR_CRE_015_CIN_LBL() runs on CseTester system CseSystem {//TODO
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						const AttributeAux c_optionalAttribute := {"labels", omit};
						
						v_createRequest.primitiveContent.contentInstance.labels := {"MyLabel"};
						
						f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute);
						  
					}
					
					testcase TC_CSE_DMR_CRE_015_CIN_CR() runs on CseTester system CseSystem {//TODO
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						const AttributeAux c_optionalAttribute := {"creator", omit};
						
						v_createRequest.primitiveContent.contentInstance.creator := "MyCreator";
						
						f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_CIN_CNF() runs on CseTester system CseSystem {//TODO
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						const AttributeAux c_optionalAttribute := {"contentInfo", omit};
						
						v_createRequest.primitiveContent.contentInstance.contentInfo := "MyContentInfo";
						
						f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_CIN_OR() runs on CseTester system CseSystem {//TODO
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						const AttributeAux c_optionalAttribute := {"ontologyRef", omit};
						
						v_createRequest.primitiveContent.contentInstance.ontologyRef := "MyOntologyRef";
						
						f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_ACP_ET() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						const AttributeAux c_optionalAttribute := {"expirationTime", omit};
						
						v_createRequest.primitiveContent.accessControlPolicy.expirationTime := "20301231T012345";
						
						f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_ACP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						const AttributeAux c_optionalAttribute := {"labels", omit};
						
						v_createRequest.primitiveContent.accessControlPolicy.labels := {"MyLabel"};
						
						f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_ACPI() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit};
						
						v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := {"NotInitialized"};
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);			
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_ET() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"expirationTime", omit};
						
						v_createRequest.primitiveContent.subscription.expirationTime := "20301231T012345";
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						  
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_LBL() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"labels", omit};
						
						v_createRequest.primitiveContent.subscription.labels := {"MyLabel"};
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_ENC() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"eventNotificationCriteria", omit};
						
						v_createRequest.primitiveContent.subscription.eventNotificationCriteria := valueof(m_eventNotificationCriteria({int1}, -));
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_EXC() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"expirationCounter", omit};
						
						v_createRequest.primitiveContent.subscription.expirationCounter := 1;
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_GPI() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"groupID", omit};
						
						v_createRequest.primitiveContent.subscription.groupID := "MyGroupID";
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_NFU() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"notificationForwardingURI", omit};
						
						v_createRequest.primitiveContent.subscription.notificationForwardingURI := "MyForwardingURI";
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_BN() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"batchNotify", omit};
						
						v_createRequest.primitiveContent.subscription.batchNotify := {0, "PT1S"};
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_RL() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"rateLimit", omit};
						
						v_createRequest.primitiveContent.subscription.rateLimit := {0, omit};
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_PSN() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"preSubscriptionNotify", omit};
						
						v_createRequest.primitiveContent.subscription.preSubscriptionNotify := 1;
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_PN() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"pendingNotification", omit};
						
						v_createRequest.primitiveContent.subscription.pendingNotification := int1;
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);			
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_NSP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"notificationStoragePriority", omit};
						
						v_createRequest.primitiveContent.subscription.notificationStoragePriority := 1;
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						  
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_LN() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"latestNotify", omit};
						
						v_createRequest.primitiveContent.subscription.latestNotify := true;
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_NCT() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"notificationContentType", omit};
						
						v_createRequest.primitiveContent.subscription.notificationContentType := int1;
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_NEC() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"notificationEventCat", omit};
						
						v_createRequest.primitiveContent.subscription.notificationEventCat := {alt_1 := 100};
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_CR() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"creator", omit};
						
						v_createRequest.primitiveContent.subscription.creator := "MyCreator";
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
					
					testcase TC_CSE_DMR_CRE_015_SUB_SU() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						const AttributeAux c_optionalAttribute := {"subscriberURI", omit};
						
						v_createRequest.primitiveContent.subscription.subscriberURI := "MySubscriberURI";
						
						f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute);
						
					}
				
					function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseTester {
    				
							// Local variables
							var MsgIn v_response;
							var RequestPrimitive v_request;
							var integer v_containerIndex := -1;
							var integer v_parentIndex := -1;
							var integer v_acpAuxIndex := -1;
							var CseTester v_notifyHandler;
							var integer v_ae2Index := -1;
							const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs";
						    var integer v_resourceIndex := -1;
											   
							// Test control
							if(match(c_accessControlPolicyIDs,p_optionalAttribute.name)) {
								if(not(PICS_ACP_SUPPORT)) {
									setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
									stop;
								}
							}

							// Test component configuration
							f_cf01Up(); 

							// Test adapter configuration

							// Preamble
							if (match(c_accessControlPolicyIDs, p_optionalAttribute.name)) {
								v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi)
							}     				
							
							v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 
							
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_parentIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
							
							
							if(p_resourceType == int4) {
								v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex);
								v_parentIndex := v_containerIndex;
							}
						
							// Test Body
							v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
    					
							mcaPort.send(m_request(v_request));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name);
									v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " with incorrect attributes");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Rejected creation of resource type " & int2str(enum2int(p_resourceType)));
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
								}
							}	
    								
							f_checkCseTesterStatus();
    						
    						//Check to see if the resource is present or not
						    if(f_isResourcePresent(v_resourceIndex)) {
						    	setverdict(pass, __SCOPE__ & ":INFO: Resource created");
						    } else {
								setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
						    }
    								
							// Postamble
							f_cse_postamble_deleteResources();
							
							// Tear down
							f_cf01Down();
						    					    				
						}//end f_CSE_DMR_CRE_015
						
				}// end group g_CSE_DMR_CRE_015		
				
				group g_CSE_DMR_CRE_016 {
					
					/**
					 * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announceTo provided
					 * 
					 */
					testcase TC_CSE_DMR_CRE_016_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						
						v_createRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};
						                    
						f_CSE_DMR_CRE_016(int1, v_createRequest, mw_createAccessControlPolicyAnnc);//AccessControlPolicy
					}

					testcase TC_CSE_DMR_CRE_016_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						
						v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
					
						f_CSE_DMR_CRE_016(int3, v_createRequest, mw_createContainerAnncBase);//Container
					}
					
					testcase TC_CSE_DMR_CRE_016_CIN() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						
						v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()};
						
						f_CSE_DMR_CRE_016(int4, v_createRequest, mw_createContentInstanceAnncBase);//ContentInstance
					}
				
					testcase TC_CSE_DMR_CRE_016_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createGroupBase;
						
						v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()};
						
						f_CSE_DMR_CRE_016(int9, v_createRequest, mw_createGroupAnncBase);//Group
					}
					
					testcase TC_CSE_DMR_CRE_016_LCP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit);
						
						v_createRequest.primitiveContent.locationPolicy.announceTo := {f_getAnnouncementTargetPoA()};
						
						f_CSE_DMR_CRE_016(int10, v_createRequest, mw_createLocationPolicyAnncBase);//LocationPolicy
					}
					
					testcase TC_CSE_DMR_CRE_016_MGO() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createMgmtObjBase;
						
						v_createRequest.primitiveContent.mgmtResource.announceTo := {f_getAnnouncementTargetPoA()};

						f_CSE_DMR_CRE_016(int13, v_createRequest, mw_createMgmtObjAnncBase);//MgmtObj
					}
					
					testcase TC_CSE_DMR_CRE_016_NOD() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createNodeBase;
						
						v_createRequest.primitiveContent.node.announceTo := {f_getAnnouncementTargetPoA()};
						
						f_CSE_DMR_CRE_016(int14, v_createRequest, mw_createNodeAnnc);//Node
					}
					
					testcase TC_CSE_DMR_CRE_016_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						
						v_createRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};

						f_CSE_DMR_CRE_016(int18, v_createRequest, mw_createScheduleAnncBase);//Schedule
					}
				
					function f_CSE_DMR_CRE_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_parentIndex := -1;
						var integer v_containerIndex := -1;
											   
						// Test control
    				
						// Test component configuration
						f_cf02Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						if(p_resourceType == int4) {
							v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex);
							v_parentIndex := v_containerIndex;	
						}
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mccPort.receive(mw_request(p_requestAnnc)) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Correct CREATE request for the resource announced variant");
							}
							[] mccPort.receive(mw_request(?)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong CREATE request received");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf02Down();
    				
					}//end f_CSE_DMR_CRE_016
    				
				} // end g_CSE_DMR_CRE_016			
				
				group g_CSE_DMR_CRE_017 {

					/**
					 * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announcedAttribute provided
					 * 
					 */
					testcase TC_CSE_DMR_CRE_017_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var RequestPrimitive v_requestPrimitive;
						var XSD.NonNegativeInteger maxByteSize := 512;		//Correct value? Shall be indicated in TP?
		
						v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
						v_createRequest.primitiveContent.container.maxByteSize := maxByteSize;						
						v_createRequest.primitiveContent.container.announcedAttribute := {"maxByteSize"};		//Correct value? Shall be indicated in TP?
	
						v_requestPrimitive := f_CSE_DMR_CRE_017(int3, v_createRequest, mw_createContainerAnncBase());//Container
						
						if(getverdict == pass){
							//Check if maxByteSize attribute has been announced
							if (ispresent(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize)){
								if(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize != maxByteSize){
									setverdict(fail, __SCOPE__ & ": Error: Value of maxByteSize has not been announced successfully");
								}else{
									setverdict(pass, __SCOPE__ & ": Value of maxByteSize has been announced successfully");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": Error: maxByteSize has not been announced");
							}
						}
					}
	
					testcase TC_CSE_DMR_CRE_017_CIN() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
						var RequestPrimitive v_requestPrimitive;
						var XSD.NonNegativeInteger v_contentSize := 512;			//Correct value? Shall be indicated in TP?
		
						v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()};
						v_createRequest.primitiveContent.contentInstance.contentSize := v_contentSize;						
						v_createRequest.primitiveContent.contentInstance.announcedAttribute := {"contentSize"};	//Correct value? Shall be indicated in TP?
		
						v_requestPrimitive := f_CSE_DMR_CRE_017(int4, v_createRequest, mw_createContentInstanceAnncBase());//ContentInstance
						
						if(getverdict == pass){
							//Check if contentSize attribute has been announced
							if (ispresent(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize)){
								if(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize != v_contentSize){
									setverdict(fail, __SCOPE__ & ": Error: Value of contentSize has not been announced successfully");
								}else{
									setverdict(pass, __SCOPE__ & ": Value of contentSize has been announced successfully");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": Error: contentSize has not been announced");
							}
						}
					}

					testcase TC_CSE_DMR_CRE_017_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createGroupBase;
						var RequestPrimitive v_requestPrimitive;
						var XSD.PositiveInteger maxNrOfMembers := 10;						//Correct value? Shall be indicated in TP?
		
						v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()};
						v_createRequest.primitiveContent.group_.maxNrOfMembers := maxNrOfMembers;
						v_createRequest.primitiveContent.group_.announcedAttribute := {"maxNrOfMembers"};	//Correct value? Shall be indicated in TP?
		
						v_requestPrimitive := f_CSE_DMR_CRE_017(int9, v_createRequest, mw_createGroupAnncBase());//Group
						
						if(getverdict == pass){
							//Check if maxNrOfMembers attribute has been announced
							if (ispresent(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers)){
								if(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers != maxNrOfMembers){
									setverdict(fail, __SCOPE__ & ": Error: Value of maxNrOfMembers has not been announced successfully");
								}else{
									setverdict(pass, __SCOPE__ & ": Value of maxNrOfMembers has been announced successfully");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": Error: maxNrOfMembers has not been announced");
							}
						}
					}
	
					testcase TC_CSE_DMR_CRE_017_LCP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit);
						var RequestPrimitive v_requestPrimitive;
						var LocationSource locationSource := int1;//Network-based		//Correct value? Shall be indicated in TP?
		
						v_createRequest.primitiveContent.locationPolicy.announceTo := {f_getAnnouncementTargetPoA()};
						v_createRequest.primitiveContent.locationPolicy.locationSource := locationSource;
						v_createRequest.primitiveContent.locationPolicy.announcedAttribute := {"locationSource"};		//Correct value? Shall be indicated in TP?
		
						v_requestPrimitive := f_CSE_DMR_CRE_017(int10, v_createRequest, mw_createLocationPolicyAnncBase());//LocationPolicy
						
						if(getverdict == pass){
							//Check if locationSource attribute has been announced
							if (ispresent(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource)){
								if(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource != locationSource){
									setverdict(fail, __SCOPE__ & ": Error: Value of locationSource has not been announced successfully");
								}else{
									setverdict(pass, __SCOPE__ & ": Value of locationSource has been announced successfully");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": Error: locationSource has not been announced");
							}
						}
					}
	
					testcase TC_CSE_DMR_CRE_017_MGO() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createMgmtObjBase;
						var RequestPrimitive v_requestPrimitive;
						var XSD.String description := "Description of mgmtObj";	//Correct value? Shall be indicated in TP?
		
						v_createRequest.primitiveContent.mgmtResource.announceTo := {f_getAnnouncementTargetPoA()};
						v_createRequest.primitiveContent.mgmtResource.description := description;			
						v_createRequest.primitiveContent.mgmtResource.announcedAttribute := {"description"};			//Correct value? Shall be indicated in TP?

						v_requestPrimitive := f_CSE_DMR_CRE_017(int13, v_createRequest, mw_createMgmtObjAnncBase());//MgmtObj
						
						if(getverdict == pass){
							//Check if description attribute has been announced
							if (ispresent(v_requestPrimitive.primitiveContent.announcedMgmtResource.description)){
								if(v_requestPrimitive.primitiveContent.announcedMgmtResource.description != description){
									setverdict(fail, __SCOPE__ & ": Error: Value of description has not been announced successfully");
								}else{
									setverdict(pass, __SCOPE__ & ": Value of description has been announced successfully");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": Error: description has not been announced");
							}
						}
					}
	
					testcase TC_CSE_DMR_CRE_017_NOD() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createNodeBase;
						var RequestPrimitive v_requestPrimitive;
		
						v_createRequest.primitiveContent.node.announceTo := {f_getAnnouncementTargetPoA()};
						
						//TODO node to be done. hostedCSELink attribute (OA) to be added!!!
		
						v_requestPrimitive := f_CSE_DMR_CRE_017(int14, v_createRequest, mw_createNodeAnnc);//Node
					}
	
					testcase TC_CSE_DMR_CRE_017_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						var RequestPrimitive v_requestPrimitive;
						var ScheduleEntries scheduleElement := {{"0,0,0 1 2,1,1,*"}};
		
						v_createRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};
						v_createRequest.primitiveContent.schedule.scheduleElement := scheduleElement;			//Correct value? Shall be indicated in TP?
						v_createRequest.primitiveContent.schedule.announcedAttribute := {"scheduleElement"};			//Correct value? Shall be indicated in TP?
						
						v_requestPrimitive := f_CSE_DMR_CRE_017(int18, v_createRequest, mw_createScheduleAnncBase());//Schedule
						
						if(getverdict == pass){
							//Check if scheduleElement attribute has been announced
							if (ispresent(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement)){
								if(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement != scheduleElement){
									setverdict(fail, __SCOPE__ & ": Error: Value of scheduleElement has not been announced successfully");
								}else{
									setverdict(pass, __SCOPE__ & ": Value of scheduleElement has been announced successfully");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": Error: scheduleElement has not been announced");
							}
						}
					}

					function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on CseTester return RequestPrimitive{
	
						// Local variables
						var MsgIn v_anncRequest;
						var RequestPrimitive v_request;
						var integer v_parentIndex := -1;
						var integer v_containerIndex := -1;
							   
						// Test control
	
						// Test component configuration
						f_cf02Up();
	
						// Test adapter configuration
	
						// Preamble
						v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
						if(p_resourceType == int4) {
							v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex);
							v_parentIndex := v_containerIndex;	
						}
	
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
		
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mccPort.receive(mw_request(p_requestAnnc)) -> value v_anncRequest {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Correct CREATE request for the resource announced variant");
							}
							[] mccPort.receive(mw_request(?)) -> value v_anncRequest {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong CREATE request received");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
					
						// Postamble
						f_cse_postamble_deleteResources();
	
						// Tear down
						f_cf02Down();
						
						return v_anncRequest.primitive.requestPrimitive;
	
					}//end f_CSE_DMR_CRE_017
	
				} // end g_CSE_DMR_CRE_017		
				
				group g_CSE_DMR_CRE_020{
					
					/**
					 * @desc Check that the IUT rejects the CREATE Request of a contentInstance resource with error “NOT_ACCEPTABLE” when contentSize exceeds maxByteSize
					 * 
					 */
					testcase TC_CSE_DMR_CRE_020() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						const integer c_maxByteSize := 0;				   
						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
						v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
								
						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
	
						// Test Body
						v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex);
	
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Maximum byte size exceeded");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response");
							}
			
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
							}
						}	
				
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
	    				
					}//end TC_CSE_DMR_CRE_020
		
				}// end group g_CSE_DMR_CRE_020	
				
				group g_CSE_DMR_CRE_021{
					
					/**
					 * @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created. 
					 * 
					 */
					testcase TC_CSE_DMR_CRE_021() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_createRequest;
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex := -1;
						const integer c_maxByteSize := 512;				   
						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

						v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
						
						v_createRequest := m_createContainerBase;
				
						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
						
						
						v_contentInstanceIndex := f_cse_createResource(int4, v_createRequest, v_containerIndex);	

						// Test Body
						v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); //Default content: "AnyValue" (8 bytes length)
	
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": ContentInstance resource created");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error when creating contentInstance resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
							}
						}	
						
						//Check currentByteSize
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length)
									setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully");	
								}
								else{
									setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully");
								}
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	

						// Postamble
						f_cse_postamble_deleteResources();

						// Tear down
						f_cf01Down();
		
					}//end TC_CSE_DMR_CRE_021

				}// end group g_CSE_DMR_CRE_021		
				
			}//end group Create
			
			group Retrieve {
				
				group g_CSE_DMR_RET_001 {
					
					/**
					 * @desc Check that the IUT returns successfully the TARGET_RESOURCE_ADDRESS resource 
					 * 
					 */
					testcase TC_CSE_DMR_RET_001_CNT() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := mw_contentContainer_rc1;
						    
						v_responsePrimitive := f_CSE_DMR_RET_001(int3, m_createContainerBase, v_contentResponse);//Container
						
					}

					testcase TC_CSE_DMR_RET_001_GRP() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := mw_contentGroup_rc1;
                        
						v_responsePrimitive := f_CSE_DMR_RET_001(int9, m_createGroupBase, v_contentResponse);//Group
						
					}
					
					testcase TC_CSE_DMR_RET_001_ACP() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := mw_contentAcp_rc1;
							
						v_responsePrimitive := f_CSE_DMR_RET_001(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
						
					}
				
					testcase TC_CSE_DMR_RET_001_SCH() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := mw_contentSchedule_rc1;
						
						v_responsePrimitive := f_CSE_DMR_RET_001(int18, m_createScheduleBase, v_contentResponse);//Schedule
						
					}
					
					testcase TC_CSE_DMR_RET_001_PCH() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.pollingChannel := mw_contentPollingChannelBase;
						
						v_responsePrimitive := f_CSE_DMR_RET_001(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
						
					}
					
					testcase TC_CSE_DMR_RET_001_SUB() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := mw_contentSubscription_rc1;
						
						v_responsePrimitive := f_CSE_DMR_RET_001(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					
					}
				
					testcase TC_CSE_DMR_RET_001_CIN() runs on CseTester system CseSystem {
						// Local variables
						var ResponsePrimitive v_responsePrimitive;
						var template PrimitiveContent v_contentResponse;

						v_contentResponse.contentInstance := mw_contentContentInstance_rc1;
	
						v_responsePrimitive := f_CSE_DMR_RET_001(int4, m_createContentInstanceBase, v_contentResponse);//ContentInstance

					}
				
					function f_CSE_DMR_RET_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester return ResponsePrimitive {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_parentIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						if(p_resourceType == int4) {	//ContentInstance
							v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
							v_parentIndex := v_containerIndex;
						}else{
							v_parentIndex := v_aeIndex;
						}
    									
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); 				
    									
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
						
						return v_response.primitive.responsePrimitive;
    				
					}//end f_CSE_DMR_RET_001
    				
				} // end g_CSE_DMR_RET_001
				
				group g_CSE_DMR_RET_002 {
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to retrieve the resource TARGET_RESOURCE_ADDRESS which does not exist
					 * 
					 */
					testcase TC_CSE_DMR_RET_002() runs on CseTester system CseSystem{
    				
						// Local variables
						var MsgIn v_response;
						
						var integer v_aeIndex := -1;
						var XSD.ID v_resourceId := "nonExistingId";
						var XSD.ID v_resourceName := "nonExistingName";
						var XSD.ID v_targetResourceAddress;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 		
						
						// Test Body
						if((vc_addressingMethod == e_nonHierarchical) and (vc_primitiveScope == e_cseRelative)) {
							v_targetResourceAddress := v_resourceId;
						} else if (vc_addressingMethod == e_nonHierarchical) {
							v_targetResourceAddress := f_getResourceAddress() & "/" & v_resourceId;
						} else {
							v_targetResourceAddress := f_getResourceAddress(v_aeIndex) & "/" & v_resourceName;
						}
						
						mcaPort.send(m_request(m_retrieveResource(v_targetResourceAddress, f_getOriginator(v_aeIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource not found");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_002
    				
				} // end g_CSE_DMR_RET_002
				
				group g_CSE_DMR_RET_003 {
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to retrieve a resource TARGET_RESOURCE_ADDRESS under AE without having privileges for the RETRIEVE operation
					 * 
					 */
					testcase TC_CSE_DMR_RET_003_CNT() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_RET_003(int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_003_GRP() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_RET_003(int9, m_createGroupBase);//Group
					}
					
					testcase TC_CSE_DMR_RET_003_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_requestPrimitive := m_createAcpBase;
						
						v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61;
						
						f_CSE_DMR_RET_003(int1, v_requestPrimitive);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_RET_003_SCH() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_003(int18, m_createScheduleBase);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_003_PCH() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_003(int15, m_createPollingChannelBase);//PollingChannel
					}
					
					testcase TC_CSE_DMR_RET_003_SUB() runs on CseTester system CseSystem {
							// Local variables
	
						f_CSE_DMR_RET_003(int23, m_createSubscriptionBase);//Subscription
					}
				
					function f_CSE_DMR_RET_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpAuxIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi)
						
						v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//c_CRUDNDi;
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
										
 						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 	

						f_cse_updateAcpAuxResource(int61); //c_CUDNDi
								
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_003
    				
				} // end g_CSE_DMR_RET_003
				
				group g_CSE_DMR_RET_004 {
					
					/**
					 * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“To” option)
					 * 
					 */
					testcase TC_CSE_DMR_RET_004_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := m_contentContainer_allOmit;
						v_contentResponse.container.parentID := ?;
                        
						f_CSE_DMR_RET_004(int3, m_createContainerBase, v_contentResponse);//Container
					}

					testcase TC_CSE_DMR_RET_004_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := m_contentGroup_allOmit;
						v_contentResponse.group_.parentID := ?;
												
						f_CSE_DMR_RET_004(int9, m_createGroupBase, v_contentResponse);//Group
					}
					
					testcase TC_CSE_DMR_RET_004_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := m_contentAcp_allOmit;
						v_contentResponse.accessControlPolicy.parentID := ?;
							
						f_CSE_DMR_RET_004(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_RET_004_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := m_contentSchedule_allOmit;
						v_contentResponse.schedule.parentID := ?;
							
						f_CSE_DMR_RET_004(int18, m_createScheduleBase,v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_004_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit;
						v_contentResponse.pollingChannel.parentID := ?;
							
						f_CSE_DMR_RET_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
					}
					
					testcase TC_CSE_DMR_RET_004_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := m_contentSubscription_allOmit;
						v_contentResponse.subscription.parentID := ?;
							
						f_CSE_DMR_RET_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}
				
					function f_CSE_DMR_RET_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);	
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
    									
						// Test Body
						mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_004
    				
				} // end g_CSE_DMR_RET_004
				
				group g_CSE_DMR_RET_005 {
					
					/**
					 * @desc Check that the IUT returns  successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“Content” option)
					 * 
					 */
					testcase TC_CSE_DMR_RET_005_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := m_contentContainer_allOmit;
						v_contentResponse.container.parentID := ?;
						                       
						f_CSE_DMR_RET_005(int3, m_createContainerBase, v_contentResponse);//Container
					}

					testcase TC_CSE_DMR_RET_005_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := m_contentGroup_allOmit;
						v_contentResponse.group_.parentID := ?;
																		
						f_CSE_DMR_RET_005(int9, m_createGroupBase, v_contentResponse);//Group
					}
					
					testcase TC_CSE_DMR_RET_005_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := m_contentAcp_allOmit;
						v_contentResponse.accessControlPolicy.parentID := ?;
							
						f_CSE_DMR_RET_005(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_RET_005_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := m_contentSchedule_allOmit;
						v_contentResponse.schedule.parentID := ?;
								
						f_CSE_DMR_RET_005(int18, m_createScheduleBase, v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_005_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit;
						v_contentResponse.pollingChannel.parentID := ?;
								
						f_CSE_DMR_RET_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
					}
					
					testcase TC_CSE_DMR_RET_005_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := m_contentSubscription_allOmit;
						v_contentResponse.subscription.parentID := ?;
								
						f_CSE_DMR_RET_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}

					
					function f_CSE_DMR_RET_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
    									
						// Test Body
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) ,	{"pi"}, f_getOriginator(v_resourceIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_005
    				
				} // end g_CSE_DMR_RET_005
				
				group g_CSE_DMR_RET_006 {
					
					/**
					 * @desc Check that the IUT returns  successfully multiple attributes of TARGET_RESOURCE_ADDRESS resource
					 * 
					 */
					testcase TC_CSE_DMR_RET_006_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := m_contentContainer_allOmit;
						v_contentResponse.container.parentID := ?;
						v_contentResponse.container.creationTime := ?;
                        
						f_CSE_DMR_RET_006(int3, m_createContainerBase, v_contentResponse);//Container
					}

					testcase TC_CSE_DMR_RET_006_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := m_contentGroup_allOmit;
						v_contentResponse.group_.parentID := ?;
						v_contentResponse.group_.creationTime := ?;
												
						f_CSE_DMR_RET_006(int9, m_createGroupBase, v_contentResponse);//Group
					}
					
					testcase TC_CSE_DMR_RET_006_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := m_contentAcp_allOmit;
						v_contentResponse.accessControlPolicy.parentID := ?;
						v_contentResponse.accessControlPolicy.creationTime := ?;
							
						f_CSE_DMR_RET_006(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_RET_006_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := m_contentSchedule_allOmit;
						v_contentResponse.schedule.parentID := ?;
						v_contentResponse.schedule.creationTime := ?;
							
						f_CSE_DMR_RET_006(int18, m_createScheduleBase, v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_006_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit;
						v_contentResponse.pollingChannel.parentID := ?;
						v_contentResponse.pollingChannel.creationTime := ?;
							
						f_CSE_DMR_RET_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
					}
					
					testcase TC_CSE_DMR_RET_006_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := m_contentSubscription_allOmit;
						v_contentResponse.subscription.parentID := ?;
						v_contentResponse.subscription.creationTime := ?;
							
						f_CSE_DMR_RET_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}

					
					function f_CSE_DMR_RET_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
    									
						// Test Body
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) ,
																						{"pi", "ct"}, f_getOriginator(v_resourceIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_006
    				
				} // end g_CSE_DMR_RET_006
				
				group g_CSE_DMR_RET_007 {
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“single” attribute case)
					 * 
					 */
					testcase TC_CSE_DMR_RET_007_CNT_LBL() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_RET_007(int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_007_GRP_LBL() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_RET_007(int9, m_createGroupBase);//Group
					}
					
					testcase TC_CSE_DMR_RET_007_ACP_LBL() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_007(int1, m_createAcpBase);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_RET_007_SCH_LBL() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_007(int18, m_createScheduleBase);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_007_PCH_LBL() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_007(int15, m_createPollingChannelBase);//PollingChannel
					}
					
					testcase TC_CSE_DMR_RET_007_SUB_LBL() runs on CseTester system CseSystem {
							// Local variables
	
						f_CSE_DMR_RET_007(int23, m_createSubscriptionBase);//Subscription
					}

					
					function f_CSE_DMR_RET_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
											   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
    									
						// Test Body
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
																						{"lbl"}, f_getOriginator(v_resourceIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
								tc_ac.stop;
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_007
    				
				} // end g_CSE_DMR_RET_007
				
				group g_CSE_DMR_RET_008 {
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attributes of the TARGET_RESOURCE_ADDRESS resource (“multiple” attributes case)
					 * 
					 */
					testcase TC_CSE_DMR_RET_008_CNT_AT() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_RET_008(int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_008_GRP_AT() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_RET_008(int9, m_createGroupBase);//Group
					}
					
					testcase TC_CSE_DMR_RET_008_ACP_AT() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_008(int1, m_createAcpBase);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_RET_008_SCH_AT() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_008(int18, m_createScheduleBase);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_008_PCH_AT() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_008(int15, m_createPollingChannelBase);//PollingChannel
					}
					
					testcase TC_CSE_DMR_RET_008_SUB_AT() runs on CseTester system CseSystem {
							// Local variables
	
						f_CSE_DMR_RET_008(int23, m_createSubscriptionBase);//Subscription
					}

					
					function f_CSE_DMR_RET_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
											   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
    									
						// Test Body
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
																						{"lbl", "at"}, f_getOriginator(v_resourceIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
								tc_ac.stop;
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_008
    				
				} // end f_CSE_DMR_RET_008
				
				group g_CSE_DMR_RET_009{

					/**
					 * @desc Check that the IUT rejects the RETRIEVE Request of a latest resource target to a container resource that has no direct child contentInstance resources.
					 * 
					 */
				  	testcase TC_CSE_DMR_RET_009() runs on CseTester system CseSystem {
					  	// Local variables
					  	var integer v_aeIndex := -1;
					  	var integer v_containerIndex := -1;
		    										   
					  	// Test control
	
					  	// Test component configuration
					  	f_cf01Up();
	
					  	// Test adapter configuration
	
					  	// Preamble
					  	v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
					  	v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 	
		
					  	// Test Body
					  	mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))){
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource not found");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
					
					  	// Postamble
					  	f_cse_postamble_deleteResources();
		
					  	// Tear down
					  	f_cf01Down();

				  	}//end TC_CSE_DMR_RET_009

			  	} // end group g_CSE_DMR_RET_009
			  	
				group g_CSE_DMR_RET_010{

					/**
					 * @desc Check that the IUT accepts the RETRIEVE Request of the oldest contentInstance target to a <container> resource
					 * 
					 */
					testcase TC_CSE_DMR_RET_010() runs on CseTester system CseSystem {
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex1 := -1; 
						var integer v_contentInstanceIndex2 := -1;
						var template PrimitiveContent v_contentResponse;                        
						    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 	
						
						v_contentInstanceIndex1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex);
						
						v_contentInstanceIndex2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex);  
						
						v_contentResponse.contentInstance := mw_contentContentInstanceBase;
						v_contentResponse.contentInstance.resourceName := vc_resourcesList[v_contentInstanceIndex1].resource.contentInstance.resourceName;
    									
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": resourceName attribute of <oldest> resource retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))){
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, resourceName attribute of <oldest> resource value not expected");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)){
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving <oldest> resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving <oldest> resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();

					}//end TC_CSE_DMR_RET_010

				} // end group g_CSE_DMR_RET_010
				
				group g_CSE_DMR_RET_011{

					/**
					 * @desc Check that the IUT rejects the RETRIEVE Request of a oldest resource target to a container resource that has no direct child contentInstance resources.
					 * 
					 */
					testcase TC_CSE_DMR_RET_011() runs on CseTester system CseSystem {
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
		    										   
						// Test control
	
						// Test component configuration
						f_cf01Up();
	
						// Test adapter configuration
	
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 	
		
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))){
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource not found");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
					
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();

					}//end TC_CSE_DMR_RET_011

				} // end group g_CSE_DMR_RET_011
				
				group g_CSE_DMR_RET_012{

					/**
					 * @desc Check that the IUT accepts the RETRIEVE Request of the latest contentInstance target to a <container> resource7
					 * 
					 */
				  	testcase TC_CSE_DMR_RET_012() runs on CseTester system CseSystem {
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex1 := -1; 
						var integer v_contentInstanceIndex2 := -1;
						var template PrimitiveContent v_contentResponse;                        
						    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 	
						
						v_contentInstanceIndex1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex);
						
						v_contentInstanceIndex2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex);  
						
						v_contentResponse.contentInstance := mw_contentContentInstanceBase;
						v_contentResponse.contentInstance.resourceName := vc_resourcesList[v_contentInstanceIndex2].resource.contentInstance.resourceName;
						 
    					
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex))));

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))){
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": resourceName attribute of <latest> resource retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))){
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, retrieved contentInstance with incorrect attributes");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)){
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving <latest> resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving <latest> resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();

				  	}//end TC_CSE_DMR_RET_012

			  	} // end group g_CSE_DMR_RET_012

				group g_CSE_DMR_RET_013 {
					
					/**
					 * @desc Check that the IUT returns successfully the TARGET_RESOURCE_ADDRESS resource under CSEBase
					 * 
					 */
					testcase TC_CSE_DMR_RET_013_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := mw_contentAcp_rc1;
							
						f_CSE_DMR_RET_013(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
						
					}
					
					testcase TC_CSE_DMR_RET_013_AE() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.aE := mw_contentAeBase;
							
						f_CSE_DMR_RET_013(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE
						
					}
										
					testcase TC_CSE_DMR_RET_013_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := mw_contentContainer_rc1;
						    
						f_CSE_DMR_RET_013(int3, m_createContainerBase, v_contentResponse);//Container
						
					}

					testcase TC_CSE_DMR_RET_013_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := mw_contentGroup_rc1;
                        
						f_CSE_DMR_RET_013(int9, m_createGroupBase, v_contentResponse);//Group
						
					}
				
					testcase TC_CSE_DMR_RET_013_CSR() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
							
						f_CSE_DMR_RET_013(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE
						
					}
				
					testcase TC_CSE_DMR_RET_013_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := mw_contentSchedule_rc1;
						
						f_CSE_DMR_RET_013(int18, m_createScheduleBase, v_contentResponse);//Schedule
						
					}
					
					testcase TC_CSE_DMR_RET_013_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := mw_contentSubscription_rc1;
						
						f_CSE_DMR_RET_013(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					
					}
				
					function f_CSE_DMR_RET_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var integer v_acpIndex := -1;
						    										   
						// Test control
    				
						// Test component configuration
						f_cf02Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						if(p_resourceType != int1) {
							
							v_acpIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID});
						}
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
							
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
							v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource
    									
						} else {	//ResourceType = RemoteCSE
													
							v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive);
								
						}
						
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf02Down();
						
					}//end f_CSE_DMR_RET_013
    				
				} // end g_CSE_DMR_RET_013

				group g_CSE_DMR_RET_014 {
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to retrieve a resource TARGET_RESOURCE_ADDRESS under CSEBase without having privileges for the RETRIEVE operation
					 * 
					 */
					testcase TC_CSE_DMR_RET_014_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template RequestPrimitive v_requestPrimitive := m_createAcpBase;
						
						v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61;
						
						f_CSE_DMR_RET_014(int1, v_requestPrimitive);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_RET_014_AE() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_014(int2, m_createPollingChannelBase);//AE
					}
					
					testcase TC_CSE_DMR_RET_014_CNT() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_RET_014(int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_014_GRP() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_RET_014(int9, m_createGroupBase);//Group
					}
					
					testcase TC_CSE_DMR_RET_014_SCH() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_014(int18, m_createScheduleBase);//Schedule
					}
										
					testcase TC_CSE_DMR_RET_014_SUB() runs on CseTester system CseSystem {
							// Local variables
	
						f_CSE_DMR_RET_014(int23, m_createSubscriptionBase);//Subscription
						}
				
					function f_CSE_DMR_RET_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpAuxIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						    										   
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi;
						
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, int61);
						
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
							
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
							v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource
    									
						} else {	//ResourceType = RemoteCSE
													
							v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive);
								
						}
								
						// Test Body
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_RET_014
    				
				} // end g_CSE_DMR_RET_014

				group g_CSE_DMR_RET_015 {
					
					/**
					 * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“To” option) under CSEBase
					 * 
					 */
					testcase TC_CSE_DMR_RET_015_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := m_contentAcp_allOmit;
						v_contentResponse.accessControlPolicy.parentID := ?;
							
						f_CSE_DMR_RET_015(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
					}
					
					testcase TC_CSE_DMR_RET_015_AE() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.aE := m_contentAe_allOmit;
						v_contentResponse.aE.parentID := ?;
							
						f_CSE_DMR_RET_015(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE
					}
															
					testcase TC_CSE_DMR_RET_015_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := m_contentContainer_allOmit;
						v_contentResponse.container.parentID := ?;
                        
						f_CSE_DMR_RET_015(int3, m_createContainerBase, v_contentResponse);//Container
					}

					testcase TC_CSE_DMR_RET_015_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := m_contentGroup_allOmit;
						v_contentResponse.group_.parentID := ?;
												
						f_CSE_DMR_RET_015(int9, m_createGroupBase, v_contentResponse);//Group
					}
				
					testcase TC_CSE_DMR_RET_015_CSR() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;

						v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit;
						v_contentResponse.remoteCSE.parentID := ?;
		
						f_CSE_DMR_RET_015(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE
					}
				
					testcase TC_CSE_DMR_RET_015_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := m_contentSchedule_allOmit;
						v_contentResponse.schedule.parentID := ?;
							
						f_CSE_DMR_RET_015(int18, m_createScheduleBase,v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_015_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := m_contentSubscription_allOmit;
						v_contentResponse.subscription.parentID := ?;
							
						f_CSE_DMR_RET_015(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}
				
					function f_CSE_DMR_RET_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var integer v_acpAuxIndex := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf02Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);	
						
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
							
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
							v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource
    									
						} else {
							v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive);
						}
						
						// Test Body
						mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_aeIndex))));//from AE ID

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf02Down();
    				
					}//end f_CSE_DMR_RET_015
    				
				} // end g_CSE_DMR_RET_015

				group g_CSE_DMR_RET_016 {
					
					/**
					 * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“Content” option) under CSEBase
					 * 
					 */
					testcase TC_CSE_DMR_RET_016_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := m_contentAcp_allOmit;
						v_contentResponse.accessControlPolicy.parentID := ?;
							
						f_CSE_DMR_RET_016(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
					}
					
					testcase TC_CSE_DMR_RET_016_AE() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.aE := m_contentAe_allOmit;
						v_contentResponse.aE.parentID := ?;
								
						f_CSE_DMR_RET_016(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE
					}
										
					testcase TC_CSE_DMR_RET_016_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := m_contentContainer_allOmit;
						v_contentResponse.container.parentID := ?;
						                       
						f_CSE_DMR_RET_016(int3, m_createContainerBase, v_contentResponse);//Container
					}

					testcase TC_CSE_DMR_RET_016_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := m_contentGroup_allOmit;
						v_contentResponse.group_.parentID := ?;
																		
						f_CSE_DMR_RET_016(int9, m_createGroupBase, v_contentResponse);//Group
					}
				
					testcase TC_CSE_DMR_RET_016_CSR() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit;
						v_contentResponse.remoteCSE.parentID := ?;
								
						f_CSE_DMR_RET_016(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE
					}
				
					testcase TC_CSE_DMR_RET_016_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := m_contentSchedule_allOmit;
						v_contentResponse.schedule.parentID := ?;
								
						f_CSE_DMR_RET_016(int18, m_createScheduleBase, v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_016_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := m_contentSubscription_allOmit;
						v_contentResponse.subscription.parentID := ?;
								
						f_CSE_DMR_RET_016(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}

					
					function f_CSE_DMR_RET_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var integer v_acpAuxIndex := -1;
    										   
						// Test control
    				
						// Test component configuration
						 f_cf02Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
	
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
							v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource
    									
						}else{
							v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive);
						}
						
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) ,	{"pi"}, f_getOriginator(v_aeIndex))));//from AE ID

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf02Down();
    				
					}//end f_CSE_DMR_RET_016
    				
				} // end g_CSE_DMR_RET_016

				group g_CSE_DMR_RET_017 {
					
					/**
					 * @desc Check that the IUT returns  successfully multiple attributes of TARGET_RESOURCE_ADDRESS resource under CSEBase
					 * 
					 */
					testcase TC_CSE_DMR_RET_017_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.accessControlPolicy := m_contentAcp_allOmit;
						v_contentResponse.accessControlPolicy.parentID := ?;
						v_contentResponse.accessControlPolicy.creationTime := ?;
							
						f_CSE_DMR_RET_017(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy
					}
										
					testcase TC_CSE_DMR_RET_017_AE() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.aE := m_contentAe_allOmit;
						v_contentResponse.aE.parentID := ?;
						v_contentResponse.aE.creationTime := ?;
							
						f_CSE_DMR_RET_017(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE
					}
										
					testcase TC_CSE_DMR_RET_017_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.container := m_contentContainer_allOmit;
						v_contentResponse.container.parentID := ?;
						v_contentResponse.container.creationTime := ?;
                        
						f_CSE_DMR_RET_017(int3, m_createContainerBase, v_contentResponse);//Container
					}

					/*testcase TC_CSE_DMR_RET_017_DLV() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.delivery := m_contentDelivery_allOmit;
						v_contentResponse.delivery.parentID := ?;
						v_contentResponse.delivery.creationTime := ?;

						f_CSE_DMR_RET_017(int6, m_createDeliveryBase, v_contentResponse);//Delivery
					}*/

					testcase TC_CSE_DMR_RET_017_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.group_ := m_contentGroup_allOmit;
						v_contentResponse.group_.parentID := ?;
						v_contentResponse.group_.creationTime := ?;
												
						f_CSE_DMR_RET_017(int9, m_createGroupBase, v_contentResponse);//Group
					}
				
					testcase TC_CSE_DMR_RET_017_LCP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;

						v_contentResponse.locationPolicy := m_contentLocationPolicy_allOmit;
						v_contentResponse.locationPolicy.parentID := ?;
						v_contentResponse.locationPolicy.creationTime := ?;

						f_CSE_DMR_RET_017(int10, m_createLocationPolicyBase, v_contentResponse);//LocationPolicy
					}
					
					testcase TC_CSE_DMR_RET_017_MGC() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;

						v_contentResponse.mgmtCmd := m_contentMgmtCmd_allOmit;
						v_contentResponse.mgmtCmd.parentID := ?;
						v_contentResponse.mgmtCmd.creationTime := ?;

						f_CSE_DMR_RET_017(int12, m_createMgmtCmdBase, v_contentResponse);//MgmtCmd
					}
					
					testcase TC_CSE_DMR_RET_017_NOD() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;

						v_contentResponse.node := m_contentNode_allOmit;
						v_contentResponse.node.parentID := ?;
						v_contentResponse.node.creationTime := ?;

						f_CSE_DMR_RET_017(int14, m_createNodeBase, v_contentResponse);//Node
					}
				
					testcase TC_CSE_DMR_RET_017_CSR() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;

						v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit;
						v_contentResponse.remoteCSE.parentID := ?;
						v_contentResponse.remoteCSE.creationTime := ?;
		
						f_CSE_DMR_RET_017(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE
					}
				
					testcase TC_CSE_DMR_RET_017_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.schedule := m_contentSchedule_allOmit;
						v_contentResponse.schedule.parentID := ?;
						v_contentResponse.schedule.creationTime := ?;
							
						f_CSE_DMR_RET_017(int18, m_createScheduleBase, v_contentResponse);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_017_STCL() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.statsCollect := m_contentStatsCollect_allOmit;
						v_contentResponse.statsCollect.parentID := ?;
						v_contentResponse.statsCollect.creationTime := ?;

						f_CSE_DMR_RET_017(int21, m_createStatsCollectBase, v_contentResponse);//StatsCollect
					}
					
					testcase TC_CSE_DMR_RET_017_STCG() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;

						v_contentResponse.statsConfig := m_contentStatsConfig_allOmit;
						v_contentResponse.statsConfig.parentID := ?;
						v_contentResponse.statsConfig.creationTime := ?;
		
						f_CSE_DMR_RET_017(int22, m_createStatsConfigBase, v_contentResponse);//StatsConfig
					}
					
					testcase TC_CSE_DMR_RET_017_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
					
						v_contentResponse.subscription := m_contentSubscription_allOmit;
						v_contentResponse.subscription.parentID := ?;
						v_contentResponse.subscription.creationTime := ?;
							
						f_CSE_DMR_RET_017(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
					}

					
					function f_CSE_DMR_RET_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var integer v_acpAuxIndex := -1;
    										   
						// Test control
    				
						// Test component configuration
						 f_cf02Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
	
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
							v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource
    									
						}else{
							v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive);
						}
						
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) ,
																						{"pi", "ct"}, f_getOriginator(v_aeIndex))));//from AE ID

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf02Down();
    				
					}//end f_CSE_DMR_RET_017
    				
				} // end g_CSE_DMR_RET_017

				group g_CSE_DMR_RET_018 {
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“single” attribute case) under CSEBase
					 * 
					 */
					testcase TC_CSE_DMR_RET_018_ACP_LBL() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_018(int1, m_createAcpBase);//AccessControlPolicy
					}
					
					testcase TC_CSE_DMR_RET_018_AE_LBL() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_018(int2, m_createAe(PX_APP_ID));//AE
					}
										
					testcase TC_CSE_DMR_RET_018_CNT_LBL() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_RET_018(int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_018_GRP_LBL() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_RET_018(int9, m_createGroupBase);//Group
					}
				
					testcase TC_CSE_DMR_RET_018_CSR_LBL() runs on CseTester system CseSystem {
						// Local variables

						f_CSE_DMR_RET_018(int16, m_createRemoteCSEBase);//RemoteCSE
					}
				
					testcase TC_CSE_DMR_RET_018_SCH_LBL() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_018(int18, m_createScheduleBase);//Schedule
					}
										
					testcase TC_CSE_DMR_RET_018_SUB_LBL() runs on CseTester system CseSystem {
							// Local variables
	
						f_CSE_DMR_RET_018(int23, m_createSubscriptionBase);//Subscription
					}

					
					function f_CSE_DMR_RET_018(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var integer v_acpAuxIndex := -1;
											   
						// Test control
    				
						// Test component configuration
						 f_cf02Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
	
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
						
							v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource
    									
						}else{
							v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive);
						}
						
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
																						{"lbl"}, f_getOriginator(v_aeIndex))));//from AE ID

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf02Down();
    				
					}//end f_CSE_DMR_RET_018
    				
				} // end g_CSE_DMR_RET_018

				group g_CSE_DMR_RET_019 {
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“multiple” attributes case) under CSEBase
					 * 
					 */
					testcase TC_CSE_DMR_RET_019_ACP_LBL_AT() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_019(int1, m_createAcpBase);//AccessControlPolicy
					}
					
					testcase TC_CSE_DMR_RET_019_AE_LBL_AT() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_019(int2, m_createAe(PX_APP_ID));//AE
					}
					
					testcase TC_CSE_DMR_RET_019_CNT_LBL_AT() runs on CseTester system CseSystem {
						// Local variables
                        
						f_CSE_DMR_RET_019(int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_019_GRP_LBL_AT() runs on CseTester system CseSystem {
						// Local variables
						
						f_CSE_DMR_RET_019(int9, m_createGroupBase);//Group
					}					
				
					testcase TC_CSE_DMR_RET_019_CSR_LBL_AT() runs on CseTester system CseSystem {
						// Local variables

						f_CSE_DMR_RET_019(int16, m_createRemoteCSEBase);//RemoteCSE
					}				
				
					testcase TC_CSE_DMR_RET_019_SCH_LBL_AT() runs on CseTester system CseSystem {
						// Local variables
	
						f_CSE_DMR_RET_019(int18, m_createScheduleBase);//Schedule
					}
					
					testcase TC_CSE_DMR_RET_019_SUB_LBL_AT() runs on CseTester system CseSystem {
							// Local variables
	
						f_CSE_DMR_RET_019(int23, m_createSubscriptionBase);//Subscription
					}

					
					function f_CSE_DMR_RET_019(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var integer v_acpAuxIndex := -1;
											   
						// Test control
    				
						// Test component configuration
						 f_cf02Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
	
							f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType);
							
							v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource
    									
						}else{
							v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive);
						}
						
						mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex),
																						{"lbl", "at"}, f_getOriginator(v_aeIndex))));//from AE ID

						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf02Down();
    				
					}//end f_CSE_DMR_RET_019
    				
				} // end f_CSE_DMR_RET_019
				
				group g_CSE_DMR_RET_020 {
					
					/**
					 * @desc Check that the IUT rejects a RETRIEVE Request target to TARGET_RESOURCE_ADDRESS resource  when the Result Content set to RESULT_CONTENT
					 * 
					 */
					testcase TC_CSE_DMR_RET_020_RCN_0() runs on CseTester system CseSystem {
						// Local variables
						f_CSE_DMR_RET_020(int3, m_createContainerBase, int0);//ResultContent = 0 (nothing)
					}
	
					testcase TC_CSE_DMR_RET_020_RCN_2() runs on CseTester system CseSystem {
						// Local variables
						f_CSE_DMR_RET_020(int3, m_createContainerBase, int2);//ResultContent = 2 (hierarchical address)
					}
	
					testcase TC_CSE_DMR_RET_020_RCN_3() runs on CseTester system CseSystem {
						// Local variables
						f_CSE_DMR_RET_020(int3, m_createContainerBase, int3);//ResultContent = 3 (attributes and hierarchichal address)
					}
	
					function f_CSE_DMR_RET_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, ResultContent p_resultContent) runs on CseTester {
		
						// Local variables
						var MsgIn 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_cse_preamble_registerAe();//c_CRUDNDi);
		    					
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
							
						// Test Body
						v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						v_request.resultContent := p_resultContent;
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Request successfully rejected");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, Result content set to " & int2str(enum2int(p_resultContent)) & " is impossible for a retrieve request ");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
						
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
		
					}//end f_CSE_DMR_RET_020
		
				} // end g_CSE_DMR_RET_020

				group g_CSE_DMR_RET_021 {
		
					/**
					 * @desc Check that the IUT returns successfully only attributes of TARGET_RESOURCE_ADDRESS resource when the Result Content is set to 1 (attributes)
					 * 
					 */
					testcase TC_CSE_DMR_RET_021_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.container := mw_contentContainer_rc1;
		                        
						f_CSE_DMR_RET_021(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_021_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.group_ := mw_contentGroup_rc1;
		
						f_CSE_DMR_RET_021(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group
					}
		
					testcase TC_CSE_DMR_RET_021_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.accessControlPolicy := mw_contentAcp_rc1;
			
						f_CSE_DMR_RET_021(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy
					}
	
					testcase TC_CSE_DMR_RET_021_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.schedule := mw_contentSchedule_rc1;
			
						f_CSE_DMR_RET_021(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule 
					}
		
					testcase TC_CSE_DMR_RET_021_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.pollingChannel := mw_contentPollingChannelBase;
			
						f_CSE_DMR_RET_021(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel
					}
		
					testcase TC_CSE_DMR_RET_021_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.subscription := mw_contentSubscription_rc1;

						f_CSE_DMR_RET_021(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription
					}
	
					function f_CSE_DMR_RET_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester {
		
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var CseTester v_notifyHandler;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
						var integer v_childResourceIndex := -1;
								   
						// Test control
		
						// Test component configuration
						f_cf01Up();
		
						// Test adapter configuration
		
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
						if(isvalue(p_childResourceType)) {
							if(valueof(p_childResourceType) == int23) {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType));
							} else {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType));
							}
						} 
	
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 
		
						if(p_resourceType != int15) {
							v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex);				
						}
						
						// Test Body
						v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						v_request.resultContent := int1;//Attributes
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
						
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
		
					}//end f_CSE_DMR_RET_021
		
				} // end g_CSE_DMR_RET_021


				group g_CSE_DMR_RET_022 {
		
					/**
					 * @desc Check that the IUT returns successfully a list all discovered resource addresses
					 * 
					 */
					testcase TC_CSE_DMR_RET_022_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.container := mw_contentContainer_rc4;
		                        
						f_CSE_DMR_RET_022(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_022_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.group_ := mw_contentGroup_rc4;
		
						f_CSE_DMR_RET_022(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group
					}
		
					testcase TC_CSE_DMR_RET_022_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.accessControlPolicy := mw_contentAcp_rc4;
			
						f_CSE_DMR_RET_022(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy
					}
	
					testcase TC_CSE_DMR_RET_022_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.schedule := mw_contentSchedule_rc4;
			
						f_CSE_DMR_RET_022(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule
					}
		
					testcase TC_CSE_DMR_RET_022_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.pollingChannel := mw_contentPollingChannelBase;
			
						f_CSE_DMR_RET_022(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel
					}
		
					testcase TC_CSE_DMR_RET_022_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.subscription := mw_contentSubscription_rc4;

						f_CSE_DMR_RET_022(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription
					}
	
					function f_CSE_DMR_RET_022(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester {
		
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var CseTester v_notifyHandler;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
						var integer v_childResourceIndex := -1;
								   
						// Test control
		
						// Test component configuration
						f_cf01Up();
		
						// Test adapter configuration
		
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

						if(isvalue(p_childResourceType)) {
							if(valueof(p_childResourceType) == int23) {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType));
							} else {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType));
							}
						} 
							
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex);
	
						if(p_resourceType != int15) {
							v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex);					
						}
							
						// Test Body
						v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						v_request.resultContent := int4;//Attributes and child resources
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
						
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
		
					}//end f_CSE_DMR_RET_022
		
				} // end g_CSE_DMR_RET_022

				group g_CSE_DMR_RET_023 {
		
					/**
					 * @desc Check that the IUT returns successfully only attributes and child resource references of TARGET_RESOURCE_ADDRESS resource when the Result Content is set to 5 (attributes and child resource references)
					 * 
					 */
					testcase TC_CSE_DMR_RET_023_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.container := mw_contentContainer_rc5;
		                        
						f_CSE_DMR_RET_023(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_023_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.group_ := mw_contentGroup_rc5;
		
						f_CSE_DMR_RET_023(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group
					}
		
					testcase TC_CSE_DMR_RET_023_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.accessControlPolicy := mw_contentAcp_rc5;
			
						f_CSE_DMR_RET_023(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy
					}
	
					testcase TC_CSE_DMR_RET_023_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.schedule := mw_contentSchedule_rc5;
			
						f_CSE_DMR_RET_023(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule 
					}
		
					testcase TC_CSE_DMR_RET_023_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.pollingChannel := mw_contentPollingChannelBase;
			
						f_CSE_DMR_RET_023(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel
					}
		
					testcase TC_CSE_DMR_RET_023_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.subscription := mw_contentSubscription_rc5;

						f_CSE_DMR_RET_023(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription
					}
	
					function f_CSE_DMR_RET_023(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester {
		
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var CseTester v_notifyHandler;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
						var integer v_childResourceIndex := -1;
								   
						// Test control
		
						// Test component configuration
						f_cf01Up();
		
						// Test adapter configuration
		
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

						if(isvalue(p_childResourceType)) {
							if(valueof(p_childResourceType) == int23) {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType));
							} else {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType));
							}
						} 
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 
					
		
						if(p_resourceType != int15) {
							v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex);					
						}				
							
						// Test Body
						v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						v_request.resultContent := int5;//attributes and child resource references
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
						
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
		
					}//end f_CSE_DMR_RET_023
		
				} // end g_CSE_DMR_RET_023

				group g_CSE_DMR_RET_024 {
		
					/**
					 * @desc Check that the IUT returns successfully only child resource references of TARGET_RESOURCE_ADDRESS resource when Result Content is set to 6 (child resource references)
					 * 
					 */
					testcase TC_CSE_DMR_RET_024_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.container := mw_contentContainer_rc6;
		                        
						f_CSE_DMR_RET_024(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_024_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.group_ := mw_contentGroup_rc6;
		
						f_CSE_DMR_RET_024(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group
					}
		
					testcase TC_CSE_DMR_RET_024_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.accessControlPolicy := mw_contentAcp_rc6;
			
						f_CSE_DMR_RET_024(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy
					}
	
					testcase TC_CSE_DMR_RET_024_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.schedule := mw_contentSchedule_rc6;
			
						f_CSE_DMR_RET_024(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule
					}
		
					testcase TC_CSE_DMR_RET_024_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.pollingChannel := mw_contentPollingChannelBase;
			
						f_CSE_DMR_RET_024(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel
					}
		
					testcase TC_CSE_DMR_RET_024_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.subscription := mw_contentSubscription_rc6;

						f_CSE_DMR_RET_024(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription
					}
	
					function f_CSE_DMR_RET_024(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester {
		
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var CseTester v_notifyHandler;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
						var integer v_childResourceIndex := -1;
								   
						// Test control
		
						// Test component configuration
						f_cf01Up();
		
						// Test adapter configuration
		
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

						if(isvalue(p_childResourceType)) {
							if(valueof(p_childResourceType) == int23) {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType));
							} else {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType));
							}
						} 
							
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
		
						if(p_resourceType != int15) {
							v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex);				
						}				
							
						// Test Body
						v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						v_request.resultContent := int6;//Child resource references
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
						
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
		
					}//end f_CSE_DMR_RET_024
		
				} // end g_CSE_DMR_RET_024

				group g_CSE_DMR_RET_025 {
		
					/**
					 * @desc Check that the IUT returns successfully only child resources of TARGET_RESOURCE_ADDRESS resource when Result Content is set to 8 (child resources)
					 * 
					 */
					testcase TC_CSE_DMR_RET_025_CNT() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.container := mw_contentContainer_rc8;
		                        
						f_CSE_DMR_RET_025(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container
					}

					testcase TC_CSE_DMR_RET_025_GRP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.group_ := mw_contentGroup_rc8;
		
						f_CSE_DMR_RET_025(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group
					}
		
					testcase TC_CSE_DMR_RET_025_ACP() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.accessControlPolicy := mw_contentAcp_rc8;
			
						f_CSE_DMR_RET_025(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy
					}
	
					testcase TC_CSE_DMR_RET_025_SCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.schedule := mw_contentSchedule_rc8;
			
						f_CSE_DMR_RET_025(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule 
					}
		
					testcase TC_CSE_DMR_RET_025_PCH() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.pollingChannel := mw_contentPollingChannelBase;
			
						f_CSE_DMR_RET_025(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel
					}
		
					testcase TC_CSE_DMR_RET_025_SUB() runs on CseTester system CseSystem {
						// Local variables
						var template PrimitiveContent v_contentResponse;
		
						v_contentResponse.subscription := mw_contentSubscription_rc8;

						f_CSE_DMR_RET_025(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription
					}
	
					function f_CSE_DMR_RET_025(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester {
		
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var CseTester v_notifyHandler;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
						var integer v_childResourceIndex := -1;
								   
						// Test control
		
						// Test component configuration
						f_cf01Up();
		
						// Test adapter configuration
		
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

						if(isvalue(p_childResourceType)) {
							if(valueof(p_childResourceType) == int23) {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType));
							} else {
								f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType));
							}
						}
							
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
		
						if(p_resourceType != int15) {
							v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex);				
						}				
							
						// Test Body
						v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
						v_request.resultContent := int6;//Child resource references
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
						
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
		
					}//end f_CSE_DMR_RET_025
		
				} // end g_CSE_DMR_RET_025
			
			}//end group Retrieve
			
			group Update {
				group g_CSE_DMR_UPD_001 {
					
					/**
					 * @desc Check that the IUT updates successfully the value of the attribute ATTRIBUTE_NAME of the TARGET_RESOURCE_ADDRESS resource 
					 * 
					 */
					testcase TC_CSE_DMR_UPD_001_CNT_LBL() runs on CseTester system CseSystem {
						// 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;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_createRequest.primitiveContent.container.labels := v_labels_1;
						v_updateRequest.primitiveContent.container.labels := v_labels_2;
						
						v_responsePrimitive := f_CSE_DMR_UPD_001(int3, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Container
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
        							if(v_responsePrimitive.primitiveContent.container.labels != v_labels_2){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.container)) {
								if(v_primitiveContentRetrieveResource.container.labels != v_labels_2){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}

					testcase TC_CSE_DMR_UPD_001_GRP_LBL() runs on CseTester system CseSystem {
						// 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;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.group_.labels := v_labels_1;
						v_updateRequest.primitiveContent.group_.labels := v_labels_2;

						v_responsePrimitive := f_CSE_DMR_UPD_001(int9, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Group
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									if(v_responsePrimitive.primitiveContent.group_.labels != v_labels_2){
										setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
									}
								}
							}
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.group_)) {
								if(v_primitiveContentRetrieveResource.group_.labels != v_labels_2){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}
					
					testcase TC_CSE_DMR_UPD_001_ACP_LBL() runs on CseTester system CseSystem {
						// 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;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;
						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;

						v_responsePrimitive := f_CSE_DMR_UPD_001(int1, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//ACP
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_2){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
								if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels_2){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
							}							
						}
						
					}
				
					testcase TC_CSE_DMR_UPD_001_SCH_LBL() runs on CseTester system CseSystem {
						// 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;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.schedule.labels := v_labels_1;
						v_updateRequest.primitiveContent.schedule.labels := v_labels_2;

						v_responsePrimitive := f_CSE_DMR_UPD_001(int18, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Schedule
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.schedule)) {
									if(v_responsePrimitive.primitiveContent.schedule.labels != v_labels_2){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.schedule)) {
								if(v_primitiveContentRetrieveResource.schedule.labels != v_labels_2){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
							}
						}
					
					}
					
					testcase TC_CSE_DMR_UPD_001_PCH_LBL() runs on CseTester system CseSystem {
						// 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;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1;
						v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2;

						v_responsePrimitive := f_CSE_DMR_UPD_001(int15, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) {
        							if(v_responsePrimitive.primitiveContent.pollingChannel.labels != v_labels_2){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
								if(v_primitiveContentRetrieveResource.pollingChannel.labels != v_labels_2){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}
					
					testcase TC_CSE_DMR_UPD_001_SUB_LBL() runs on CseTester system CseSystem {
						// 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;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.subscription.labels := v_labels_1;
						v_updateRequest.primitiveContent.subscription.labels := v_labels_2;

						v_responsePrimitive := f_CSE_DMR_UPD_001(int23, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_2){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
								if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_2){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
							}
						}
					
					}
					
					function f_CSE_DMR_UPD_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive{
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						f_checkCseTesterStatus();
						
						//Used to check that the resource has been updated
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
						
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
						
						return v_response.primitive.responsePrimitive;
    					    				
					}//end f_CSE_DMR_UPD_001
    				
				} // end g_CSE_DMR_UPD_001
				
				group g_CSE_DMR_UPD_002 {
					
					/**
					 * @desc Check that the IUT adds successfully the attribute ATTRIBUTE_NAME to the TARGET_RESOURCE_ADDRESS resource
					 * 
					 */
					testcase TC_CSE_DMR_UPD_002_CNT_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
                        var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.container.labels := v_labels_1;
                        
						v_responsePrimitive := f_CSE_DMR_UPD_002(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
        							if(v_responsePrimitive.primitiveContent.container.labels != v_labels_1){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
								  if(v_primitiveContentRetrieveResource.container.labels != v_labels_1){
									  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}

					testcase TC_CSE_DMR_UPD_002_GRP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.group_.labels := v_labels_1;
						
						v_responsePrimitive := f_CSE_DMR_UPD_002(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
        							if(v_responsePrimitive.primitiveContent.group_.labels != v_labels_1){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.group_)) {
								if(v_primitiveContentRetrieveResource.group_.labels != v_labels_1){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}
					
					testcase TC_CSE_DMR_UPD_002_ACP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;
							
						v_responsePrimitive := f_CSE_DMR_UPD_002(int1, m_createAcpBase,v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
        							if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_1){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							  if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels_1){
								  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}
				
					testcase TC_CSE_DMR_UPD_002_SCH_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.schedule.labels := v_labels_1;
						
						v_responsePrimitive := f_CSE_DMR_UPD_002(int18, m_createScheduleBase,v_updateRequest, v_primitiveContentRetrieveResource);//Schedule
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.schedule)) {
        							if(v_responsePrimitive.primitiveContent.schedule.labels != v_labels_1){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.schedule)) {
								if(v_primitiveContentRetrieveResource.schedule.labels != v_labels_1){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}
					
					testcase TC_CSE_DMR_UPD_002_PCH_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_1;
						
						v_responsePrimitive := f_CSE_DMR_UPD_002(int15, m_createPollingChannelBase,v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) {
        							if(v_responsePrimitive.primitiveContent.pollingChannel.labels != v_labels_1){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
							  if(v_primitiveContentRetrieveResource.pollingChannel.labels != v_labels_1){
								  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}
					
					testcase TC_CSE_DMR_UPD_002_SUB_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.subscription.labels := v_labels_1;
						
						v_responsePrimitive := f_CSE_DMR_UPD_002(int23, m_createSubscriptionBase,v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
        							if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_1){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
								if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_1){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
						}
					}
						}
					}
					
					function f_CSE_DMR_UPD_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						//Used to check that the resource has been updated
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
									
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
						
						return v_response.primitive.responsePrimitive;
    					    				
					}//end f_CSE_DMR_UPD_002
    				
				} // end g_CSE_DMR_UPD_002
				
				group g_CSE_DMR_UPD_003 {
					
					/**
					 * @desc Check that the IUT deletes successfully the attribute ATTRIBUTE_NAME from the TARGET_RESOURCE_ADDRESS resource 
					 * 
					 */
					testcase TC_CSE_DMR_UPD_003_CNT_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var ResponsePrimitive v_responsePrimitive;
                        var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_createRequest.primitiveContent.container.labels := v_labels_1;
						v_updateRequest.primitiveContent.container.labels := v_labels_2;
						
						v_nullFields := {{"labels", omit}};
                        
						v_responsePrimitive := f_CSE_DMR_UPD_003(int3, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Container
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
        							if(ispresent(v_responsePrimitive.primitiveContent.container.labels)){ 
        								if(not(match(v_responsePrimitive.primitiveContent.container.labels,{""}))) {
        									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly");
        								}
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
								  if(ispresent(v_primitiveContentRetrieveResource.container.labels)) {
									if(not(match(v_primitiveContentRetrieveResource.container.labels,{""}))){
									  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
						}
					}
							  }
						}
					}

					testcase TC_CSE_DMR_UPD_003_GRP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var ResponsePrimitive v_responsePrimitive;
						var template RequestPrimitive v_createRequest := m_createGroupBase;
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.group_.labels := v_labels_1;
						v_updateRequest.primitiveContent.group_.labels := v_labels_2;
						
						v_nullFields := {{"labels", omit}};
						
						v_responsePrimitive := f_CSE_DMR_UPD_003(int9, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Group
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
        							if(ispresent(v_responsePrimitive.primitiveContent.group_.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.group_)) {
								if(ispresent(v_primitiveContentRetrieveResource.group_.labels)) {
								  if(not(match(v_primitiveContentRetrieveResource.group_.labels,{""}))){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
						}
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_003_ACP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var ResponsePrimitive v_responsePrimitive;
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;
						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;
						
						v_nullFields := {{"labels", omit}};
							
						v_responsePrimitive := f_CSE_DMR_UPD_003(int1, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//AccessControlPolicy
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
        							if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
  						 //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							  if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)) {
								if(not(match(v_primitiveContentRetrieveResource.accessControlPolicy.labels,{""}))){
								  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
						}
					}
						  }
						}
					}
				
					testcase TC_CSE_DMR_UPD_003_SCH_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var ResponsePrimitive v_responsePrimitive;
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.schedule.labels := v_labels_1;
						v_updateRequest.primitiveContent.schedule.labels := v_labels_2;
						
						v_nullFields := {{"labels", omit}};
						
						v_responsePrimitive := f_CSE_DMR_UPD_003(int18, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Schedule
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.schedule)) {
        							if(ispresent(v_responsePrimitive.primitiveContent.schedule.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.schedule)) {
								if(ispresent(v_primitiveContentRetrieveResource.schedule.labels)) {
								  if(not(match(v_primitiveContentRetrieveResource.schedule.labels,{""}))){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
						}
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_003_PCH_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var ResponsePrimitive v_responsePrimitive;
						var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
						var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1;
						v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2;
						
						v_nullFields := {{"labels", omit}};
						
						v_responsePrimitive := f_CSE_DMR_UPD_003(int15, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//PollingChannel
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) {
        							if(ispresent(v_responsePrimitive.primitiveContent.pollingChannel.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
							  if(ispresent(v_primitiveContentRetrieveResource.pollingChannel.labels)) {
								if(not(match(v_primitiveContentRetrieveResource.pollingChannel.labels,{""}))){
								  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
						}
					}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_003_SUB_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var ResponsePrimitive v_responsePrimitive;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.subscription.labels := v_labels_1;
						v_updateRequest.primitiveContent.subscription.labels := v_labels_2;
						
						v_nullFields := {{"labels", omit}};
						
						v_responsePrimitive := f_CSE_DMR_UPD_003(int23, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Subscription
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
        							if(ispresent(v_responsePrimitive.primitiveContent.subscription.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
								if(ispresent(v_primitiveContentRetrieveResource.subscription.labels)) {
								  if(not(match(v_primitiveContentRetrieveResource.subscription.labels,{""}))){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
						}
					}
							}
						}
					}
					
					function f_CSE_DMR_UPD_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); 				
						
						//f_match2PrimitiveContent(vc_resourcesList[v_resourceIndex].resource, p_createRequestPrimitive.primitiveContent); TODO fix the match problem
    						
						// 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(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO))  -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
									
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
						
						return v_response.primitive.responsePrimitive;
    					    				
					}//end f_CSE_DMR_UPD_003
    				
				} // end g_CSE_DMR_UPD_003
				
				group g_CSE_DMR_UPD_004 {
					
					/**
					 * @desc Check that the IUT updates  the value of the attribute ATTRIBUTE_NAME_1, and creates the ATTRIBUTE_NAME_2 and deletes the ATTRIBUTE_NAME_3 of the TARGET_RESOURCE_ADDRESS resource
					 * 
					 */
					testcase TC_CSE_DMR_UPD_004_CNT_ET_MNI_LBL() runs on CseTester system CseSystem {
						// 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 AttributeAux_list v_nullFields;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_createRequest.primitiveContent.container.labels := v_labels_1;//Attribute 3
						v_updateRequest.primitiveContent.container.expirationTime := "20301231T012345";//Attribute 1
						v_updateRequest.primitiveContent.container.maxNrOfInstances := 5;//Attribute 2
						v_updateRequest.primitiveContent.container.labels := v_labels_2;//Attribute 3
						
						v_nullFields := {{"labels", omit}};
						
						v_responsePrimitive := f_CSE_DMR_UPD_004(int3, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Container
						
						if(getverdict == pass){
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
        							//Check attribute 1
        							if(v_responsePrimitive.primitiveContent.container.expirationTime != valueof(v_updateRequest.primitiveContent.container.expirationTime)){
        								setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly")
        							}
        							//Check attribute 2
        							if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.container.maxNrOfInstances)){
        								setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly")
        							}
        							//Check attribute 3
        							if(ispresent(v_responsePrimitive.primitiveContent.container.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
								  //Check attribute 1
								  if(v_primitiveContentRetrieveResource.container.expirationTime != valueof(v_updateRequest.primitiveContent.container.expirationTime)){
									  setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly")
						}
								  //Check attribute 2
								  if(v_primitiveContentRetrieveResource.container.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.container.maxNrOfInstances)){
									  setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly")
					}
								  //Check attribute 3
								  if(ispresent(v_primitiveContentRetrieveResource.container.labels)){
									  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
								  }
							  }
						}
					}

					testcase TC_CSE_DMR_UPD_004_GRP_ET_GN_LBL() runs on CseTester system CseSystem {
						// Local variables
						var XSD.String v_groupName_1 := "VALUE_1";
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						
						var AttributeAux_list v_nullFields;
						var template RequestPrimitive v_createRequest := m_createGroupBase;
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
												
						v_createRequest.primitiveContent.group_.labels := v_labels_1;//Attribute 3
						v_updateRequest.primitiveContent.group_.expirationTime := "20301231T012345";//Attribute 1
						v_updateRequest.primitiveContent.group_.groupName:= v_groupName_1;//Attribute 2
						v_updateRequest.primitiveContent.group_.labels := v_labels_2;//Attribute 3
						
						v_nullFields := {{"labels", omit}};
                        
						v_responsePrimitive := f_CSE_DMR_UPD_004(int9, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Group
						
						if(getverdict == pass){
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
        							//Check attribute 1
        							if(not match(v_responsePrimitive.primitiveContent.group_.groupName, valueof(v_updateRequest.primitiveContent.group_.groupName))){
        								setverdict(fail, __SCOPE__ & ": Error: groupName attribute not updated correctly")
        							}
        							//Check attribute 2
        							if(not match(v_responsePrimitive.primitiveContent.group_.expirationTime, valueof(v_updateRequest.primitiveContent.group_.expirationTime))){
        								setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly")
        							}
        							//Check attribute 3
        							if(ispresent(v_responsePrimitive.primitiveContent.group_.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.group_)) {
								//Check attribute 1
								if(v_primitiveContentRetrieveResource.group_.groupName != valueof(v_updateRequest.primitiveContent.group_.groupName)){
									setverdict(fail, __SCOPE__ & ": Error: groupName attribute not updated correctly")
						}
								//Check attribute 2
								if(v_primitiveContentRetrieveResource.group_.expirationTime != valueof(v_updateRequest.primitiveContent.group_.expirationTime)){
									setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly")
					}
								//Check attribute 3
								if(ispresent(v_primitiveContentRetrieveResource.group_.labels)){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var SetOfAcrs v_privileges_2 := { accessControlRule_list := {valueof(m_createAcr({PX_SUPER_AE_ID}, int61))}};
						var AttributeAux_list v_nullFields;
						var template RequestPrimitive v_createRequest := m_createAcpBase;// privileges set by default to 63 for *
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;//Attribute 3
						v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2; //Attribute 1
						v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2
						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;//Attribute 3
						
						v_nullFields := {{"labels", omit}};
      							
						v_responsePrimitive := f_CSE_DMR_UPD_004(int1, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//AccessControlPolicy
						
						if(getverdict == pass){
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
        							//Check attribute 1
        							if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges.accessControlRule_list[0].accessControlOperations, v_privileges_2.accessControlRule_list[0].accessControlOperations)){
        								setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly")
        							}
        							//Check attribute 2
        							if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.announceTo, valueof(v_updateRequest.primitiveContent.accessControlPolicy.announceTo))){
        								setverdict(fail, __SCOPE__ & ": Error: Announce_to attribute not updated correctly")
        							}
        							//Check attribute 3
        							if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							  //Check attribute 1
							  if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.privileges.accessControlRule_list[0].accessControlOperations, v_privileges_2.accessControlRule_list[0].accessControlOperations)){
								  setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly")
						}
							  //Check attribute 2
							  if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.announceTo, valueof(v_updateRequest.primitiveContent.accessControlPolicy.announceTo))){
								  setverdict(fail, __SCOPE__ & ": Error: Announce_to attribute not updated correctly")
					}
							  //Check attribute 3
							  if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)){
								  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
							  }
						  }
						}
					}
				
					testcase TC_CSE_DMR_UPD_004_SCH_SE_AT_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_createRequest.primitiveContent.schedule.scheduleElement := {{"0,0,0 1 2,1,1,*"}};//Attribute 1
						v_updateRequest.primitiveContent.schedule.scheduleElement := {{"1,1,1 1 2,1,1,*"}}; //Attribute 1
						v_updateRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2
						v_updateRequest.primitiveContent.schedule.labels := v_labels_1;//Attribute 3
                						
						v_nullFields := {{"labels", omit}};
						
						v_responsePrimitive := f_CSE_DMR_UPD_004(int18, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Schedule
						
						if(getverdict == pass){
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.schedule)) {
        							//Check attribute 1
        							if(v_responsePrimitive.primitiveContent.schedule.scheduleElement != valueof(v_updateRequest.primitiveContent.schedule.scheduleElement)){
        								setverdict(fail, __SCOPE__ & ": Error: Schedule Element attribute not updated correctly")
        							}
        							//Check attribute 2
        							if(v_responsePrimitive.primitiveContent.schedule.announceTo != valueof(v_updateRequest.primitiveContent.schedule.announceTo)){
        								setverdict(fail, __SCOPE__ & ": Error: Announce_To attribute not updated correctly")
        							}
        							//Check attribute 3
        							if(ispresent(v_responsePrimitive.primitiveContent.schedule.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.schedule)) {
								//Check attribute 1
								if(v_primitiveContentRetrieveResource.schedule.scheduleElement != valueof(v_updateRequest.primitiveContent.schedule.scheduleElement)){
									setverdict(fail, __SCOPE__ & ": Error: Schedule Element attribute not updated correctly")
						}
								//Check attribute 2
								if(v_primitiveContentRetrieveResource.schedule.announceTo != valueof(v_updateRequest.primitiveContent.schedule.announceTo)){
									setverdict(fail, __SCOPE__ & ": Error: Announce_To attribute not updated correctly")
					}
								//Check attribute 3
								if(ispresent(v_primitiveContentRetrieveResource.schedule.labels)){
									setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_004_PCH_LBL_ACP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var Labels v_labels_2 := {"To be deleted"};
						var AttributeAux_list v_nullFields;
						var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
						var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1;//Attribute 3
						//No Attribute 1
						//v_updateRequest.primitiveContent.pollingChannel.accessControlPolicyIDs := v_acp;//Attribute 2 TODO Find another alternative for Attribute 2
						v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2;//Attribute 3
						
						v_nullFields := {{"labels", omit}};
      						
						v_responsePrimitive := f_CSE_DMR_UPD_004(int15, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//PollingChannel
						
						if(getverdict == pass){
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) {
        							//Check attribute 1
        							
        							//Check attribute 2 TODO once another alternative is found, activate this checking
        							/*if(not match(v_responsePrimitive.primitiveContent.pollingChannel.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.pollingChannel.accessControlPolicyIDs))){
        								setverdict(fail, __SCOPE__ & ": Error: ACPI attribute not added correctly")
        							}*/
        							//Check attribute 3
        							if(ispresent(v_responsePrimitive.primitiveContent.pollingChannel.labels)){
        								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
        							}
								}
							}
							
							//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
							   if(ispresent (v_primitiveContentRetrieveResource.pollingChannel.labels)){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly")
						}
					}
						}
					}
					
					testcase TC_CSE_DMR_UPD_004_SUB_ET_LBL_EXC() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var AttributeAux_list v_nullFields;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_createRequest.primitiveContent.subscription.expirationCounter := 10;//Attribute 3
						v_updateRequest.primitiveContent.subscription.expirationTime := "20301231T012345";//Attribute 1
						v_updateRequest.primitiveContent.subscription.labels := v_labels_1;//Attribute 2
						v_updateRequest.primitiveContent.subscription.expirationCounter := 5;//Attribute 3
						
						v_nullFields := {{"expirationCounter", omit}};
      							
						v_responsePrimitive := f_CSE_DMR_UPD_004(int23, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Subscription
						
						if(getverdict == pass){
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
            						//Check attribute 1
            						if(not match(v_responsePrimitive.primitiveContent.subscription.labels, valueof(v_updateRequest.primitiveContent.subscription.labels))){
            							setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
            						}
            						//Check attribute 2
            						if(not match(v_responsePrimitive.primitiveContent.subscription.expirationTime, valueof(v_updateRequest.primitiveContent.subscription.expirationTime))){
            							setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly")
            						}
            						//Check attribute 3
            						if(ispresent(v_responsePrimitive.primitiveContent.subscription.expirationCounter)){
            							setverdict(fail, __SCOPE__ & ": Error: expirationCounter attribute not deleted correctly")
            						}
								}
							}
							
						  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							  //Check attribute 1
							  if(not match (v_primitiveContentRetrieveResource.subscription.labels, valueof(v_updateRequest.primitiveContent.subscription.labels))){
								  setverdict(fail, __SCOPE__ & ": Error: Label attribute not updated correctly")
    					}
							  //Check attribute 2
							  if(not match (v_primitiveContentRetrieveResource.subscription.expirationTime, valueof(v_updateRequest.primitiveContent.subscription.expirationTime))){
								  setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly")
					}
							  //Check attribute 3
							  if(ispresent(v_primitiveContentRetrieveResource.subscription.expirationCounter)){
								  setverdict(fail, __SCOPE__ & ": Error: expirationCounter attribute not deleted correctly")
							  }
						  }
    					}
					}
					
					function f_CSE_DMR_UPD_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO))  -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
									
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
						
						return v_response.primitive.responsePrimitive;
    					    				
					}//end f_CSE_DMR_UPD_004
    				
				} // end g_CSE_DMR_UPD_004
				
				group g_CSE_DMR_UPD_005{
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to update an attribute of a  TARGET_RESOURCE_ADDRESS resource which does not exist
					 * 
					 */
					testcase TC_CSE_DMR_UPD_005_CNT_EXC() runs on CseTester system CseSystem {
						// Local variables
						var XSD.PositiveInteger v_expirationCounter := 1;
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						
						v_updateRequest.primitiveContent := {container_update_invalid := m_contentUpdateContainer_invalid};

						v_updateRequest.primitiveContent.container_update_invalid.expirationCounter := v_expirationCounter;
						
						f_CSE_DMR_UPD_005(int3, v_createRequest, v_updateRequest);//Container
					}

					testcase TC_CSE_DMR_UPD_005_GRP_EXC() runs on CseTester system CseSystem {
						// Local variables
						var XSD.PositiveInteger v_expirationCounter := 1;
						var template RequestPrimitive v_createRequest := m_createGroupBase;
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						
						v_updateRequest.primitiveContent := {group_update_invalid := m_contentUpdateGroup_invalid};
						
						v_updateRequest.primitiveContent.group_update_invalid.expirationCounter := v_expirationCounter;
						
						f_CSE_DMR_UPD_005(int9, v_createRequest, v_updateRequest);//Group
					}
					
					testcase TC_CSE_DMR_UPD_005_ACP_EXC() runs on CseTester system CseSystem {
						// Local variables
						var XSD.PositiveInteger v_expirationCounter := 1;
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						
						v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid};
						
						v_updateRequest.primitiveContent.aCP_update_invalid.expirationCounter := v_expirationCounter;
								
						f_CSE_DMR_UPD_005(int1, v_createRequest, v_updateRequest);//AccessControlPolicy
					}
				
					testcase TC_CSE_DMR_UPD_005_SCH_EXC() runs on CseTester system CseSystem {
						// Local variables
						var XSD.PositiveInteger v_expirationCounter := 1;
						var template RequestPrimitive v_createRequest := m_createScheduleBase;
						var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
						
						v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid};

						v_updateRequest.primitiveContent.schedule_update_invalid.expirationCounter := v_expirationCounter;
										
						f_CSE_DMR_UPD_005(int18, v_createRequest, v_updateRequest);//Schedule
					}
					
					testcase TC_CSE_DMR_UPD_005_PCH_EXC() runs on CseTester system CseSystem {
						// Local variables
						var XSD.PositiveInteger v_expirationCounter := 1;
						var template RequestPrimitive v_createRequest := m_createPollingChannelBase;
						var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;

						v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid};
						
						v_updateRequest.primitiveContent.pollingChannel_update_invalid.expirationCounter := v_expirationCounter;
							
						f_CSE_DMR_UPD_005(int15, v_createRequest, v_updateRequest);//PollingChannel
					}
					
					testcase TC_CSE_DMR_UPD_005_SUB_MNI() runs on CseTester system CseSystem {
						// Local variables
						var XSD.NonNegativeInteger v_maxNrOfInstances := 5;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;

						v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid};
						
						v_updateRequest.primitiveContent.subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances;
								
						f_CSE_DMR_UPD_005(int23, v_createRequest, v_updateRequest);//Subscription
					}
					
					function f_CSE_DMR_UPD_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var CseTester v_notifyHandler;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
											   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int4004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    					    				
					}//end f_CSE_DMR_UPD_005
    				
				} // end g_CSE_DMR_UPD_005
				
				group g_CSE_DMR_UPD_006{
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to update the attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource without having privileges for the UPDATE operation
					 * 
					 */
					testcase TC_CSE_DMR_UPD_006_CNT_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.container.labels := v_labels_1;
						
						f_CSE_DMR_UPD_006(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.labels == v_labels_1){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
					}
							}
						}
					}

					testcase TC_CSE_DMR_UPD_006_GRP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.group_.labels := v_labels_1;
						
						f_CSE_DMR_UPD_006(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							   if(v_primitiveContentRetrieveResource.group_.labels == v_labels_1){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_006_ACP_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var template RequestPrimitive v_requestPrimitive := m_createAcpBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int59;

						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;
								
						f_CSE_DMR_UPD_006(int1, v_requestPrimitive, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							   if(v_primitiveContentRetrieveResource.accessControlPolicy.labels == v_labels_1){
								 setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
					}
							}
						}
					}
				
					testcase TC_CSE_DMR_UPD_006_SCH_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.schedule.labels := v_labels_1;
										
						f_CSE_DMR_UPD_006(int18, m_createScheduleBase, v_updateRequest, v_primitiveContentRetrieveResource);//Schedule
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.schedule)) {
							   if(v_primitiveContentRetrieveResource.schedule.labels == v_labels_1){
								 setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_006_PCH_LBL() runs on CseTester system CseSystem {
						// Local variable
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_1;
							
						f_CSE_DMR_UPD_006(int15, m_createPollingChannelBase, v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
							   if(v_primitiveContentRetrieveResource.pollingChannel.labels == v_labels_1){
								 setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_006_SUB_LBL() runs on CseTester system CseSystem {
						// Local variables
						var Labels v_labels_1 := {"VALUE_1"};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.subscription.labels := v_labels_1;
								
						f_CSE_DMR_UPD_006(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.labels == v_labels_1){
								 setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
					}
							}
						}
					}
					
					function f_CSE_DMR_UPD_006(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_acpAuxIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
    						setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
    						stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int59);//c_CRDNDi)
						
						v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType)));
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Updating attributes from resource without having privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);	
    								
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    					    				
					}//end f_CSE_DMR_UPD_006
    				
				} // end g_CSE_DMR_UPD_006				
								
				
				group g_CSE_DMR_UPD_007{
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to update a non-RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource
					 * 
					 */
					testcase TC_CSE_DMR_UPD_007_CNT_CT() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_creationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent := {container_update_invalid := m_contentUpdateContainer_invalid};
						v_updateRequest.primitiveContent.container_update_invalid.creationTime := v_creationTime;
						
						f_CSE_DMR_UPD_007(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.container_update_invalid)) {
							   if(v_primitiveContentRetrieveResource.container_update_invalid.creationTime == v_creationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated")
					}
							}
						}
					}

					testcase TC_CSE_DMR_UPD_007_GRP_CT() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_creationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent := {group_update_invalid := m_contentUpdateGroup_invalid};
						v_updateRequest.primitiveContent.group_update_invalid.creationTime := v_creationTime;
						
						f_CSE_DMR_UPD_007(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.group_update_invalid)) {
							   if(v_primitiveContentRetrieveResource.group_update_invalid.creationTime == v_creationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_007_ACP_CT() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_creationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid};
						v_updateRequest.primitiveContent.aCP_update_invalid.creationTime := v_creationTime;
								
						f_CSE_DMR_UPD_007(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.aCP_update_invalid)) {
							   if(v_primitiveContentRetrieveResource.aCP_update_invalid.creationTime == v_creationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated")
					}
							}
						}
					}
				
					testcase TC_CSE_DMR_UPD_007_SCH_CT() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_creationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid};
						v_updateRequest.primitiveContent.schedule_update_invalid.creationTime := v_creationTime;
										
						f_CSE_DMR_UPD_007(int18, m_createScheduleBase, v_updateRequest, v_primitiveContentRetrieveResource);//Schedule
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.schedule_update_invalid)) {
							   if(v_primitiveContentRetrieveResource.schedule_update_invalid.creationTime == v_creationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_007_PCH_CT() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_creationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid};
						v_updateRequest.primitiveContent.pollingChannel_update_invalid.creationTime := v_creationTime;
							
						f_CSE_DMR_UPD_007(int15, m_createPollingChannelBase, v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.pollingChannel_update_invalid)) {
							   if(v_primitiveContentRetrieveResource.pollingChannel_update_invalid.creationTime == v_creationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_007_SUB_CT() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_creationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid};
						v_updateRequest.primitiveContent.subscription_update_invalid.creationTime := v_creationTime;
								
						f_CSE_DMR_UPD_007(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.subscription_update_invalid)) {
							   if(v_primitiveContentRetrieveResource.subscription_update_invalid.creationTime == v_creationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated")
					}
							}
						}
					}
					
					function f_CSE_DMR_UPD_007(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int4000))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) );
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Updating RO attribute from resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
									
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    					    				
					}//end f_CSE_DMR_UPD_007
    				
				} // end g_CSE_DMR_UPD_007			
				
				group g_CSE_DMR_UPD_008{
					
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to delete a mandatory RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource
					 * 
					 */
					testcase TC_CSE_DMR_UPD_008_CNT_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var AttributeAux_list v_nullFields;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_nullFields := {{"expirationTime", omit}};

						v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime;
						
						f_CSE_DMR_UPD_008(int3, m_createContainerBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Container
						if(getverdict == pass){
							  //Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.expirationTime == v_expirationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated")
					}
							}
						}
					}

					testcase TC_CSE_DMR_UPD_008_GRP_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var AttributeAux_list v_nullFields;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_nullFields := {{"expirationTime", omit}};
						
						v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime;
						
						f_CSE_DMR_UPD_008(int9, m_createGroupBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Group
						if(getverdict == pass){
							  //Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							   if(v_primitiveContentRetrieveResource.group_.expirationTime == v_expirationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_008_ACP_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var AttributeAux_list v_nullFields;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_nullFields := {{"expirationTime", omit}};
						
						v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime;
								
						f_CSE_DMR_UPD_008(int1, m_createAcpBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//AccessControlPolicy
						if(getverdict == pass){
							  //Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							   if(v_primitiveContentRetrieveResource.accessControlPolicy.expirationTime == v_expirationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated")
					}
							}
						}
					}
				
					testcase TC_CSE_DMR_UPD_008_SCH_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
						var AttributeAux_list v_nullFields;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_nullFields := {{"expirationTime", omit}};
						
						v_updateRequest.primitiveContent.schedule.expirationTime := v_expirationTime;
										
						f_CSE_DMR_UPD_008(int18, m_createScheduleBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Schedule
						if(getverdict == pass){
							  //Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.schedule)) {
							   if(v_primitiveContentRetrieveResource.schedule.expirationTime == v_expirationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_008_PCH_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
						var AttributeAux_list v_nullFields;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_nullFields := {{"expirationTime", omit}};
						
						v_updateRequest.primitiveContent.pollingChannel.expirationTime := v_expirationTime;
							
						f_CSE_DMR_UPD_008(int15, m_createPollingChannelBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//PollingChannel
						if(getverdict == pass){
							  //Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
							   if(v_primitiveContentRetrieveResource.pollingChannel.expirationTime == v_expirationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated")
					}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_008_SUB_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var AttributeAux_list v_nullFields;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_nullFields := {{"expirationTime", omit}};
						
						v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime;
								
						f_CSE_DMR_UPD_008(int23, m_createSubscriptionBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Subscription
						if(getverdict == pass){
							  //Check that the resource has NOT been udpated
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.expirationTime == v_expirationTime){
								 setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated")
					}
						   }
						}
					}
					
					function f_CSE_DMR_UPD_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester {
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int4000))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) );
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Deleting a mandatory RW attribute from resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
    								
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
									
						// Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
    					    				
					}//end f_CSE_DMR_UPD_008
    				
				} // end g_CSE_DMR_UPD_008				

				group g_CSE_DMR_UPD_010{

					/**
					 * @desc Check that the stateTag attribute of a container resource is increased when an update operation has been performed on its child resource
					 * 
					 */
					testcase TC_CSE_DMR_UPD_010() runs on CseTester system CseSystem {
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
						var Labels v_labels_1:= {"VALUE_1"};
						v_updateRequest.primitiveContent.container.labels := v_labels_1;
				   
						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
		
						// Test Body
						if(ispresent(vc_resourcesList[v_containerIndex].resource.container.stateTag)) { 
		
							v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest);
							f_cse_updateResource(v_updateRequest);

							mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));

							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 1) { //(Create and Delete)
										setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");	
									}
									else{
										setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
									}
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
								}
							}	
				
						}//end if
						else{
							setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
						}
		
						// Postamble
						f_cse_postamble_deleteResources();

						// Tear down
						f_cf01Down();
			
					}//end TC_CSE_DMR_UPD_010
					
				} // end group g_CSE_DMR_UPD_010
				
				group g_CSE_DMR_UPD_011{

					/**
					 * @desc Check that the IUT rejects the UPDATE Request of an existing contentInstance resource with error “OPERATION_NOT_ALLOWED”
					 * 
					 */
					testcase TC_CSE_DMR_UPD_011() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex := -1; 
						var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase;
						var Labels v_labels:= {"LABEL"};
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.contentInstance.labels := v_labels;
								   
						// Test control
            
						// Test component configuration
						f_cf01Up();
            
						// Test adapter configuration
            
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
						
						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); 
						
						//Test Body
						v_request := f_getUpdateRequestPrimitive(int4, v_contentInstanceIndex, v_updateRequest);
	
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
							   tc_ac.stop;
							   setverdict(pass, __SCOPE__ & ": Not allowed to update a contentInstance with error OPERATION_NOT_ALLOWED");
						   }
						   [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							   tc_ac.stop;
							   setverdict(fail, __SCOPE__ & ": Wrong response status code");
						   }
						   [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							   tc_ac.stop;
							   setverdict(fail, __SCOPE__ & ": Accepted update of contentInstance");
						   }
						   [] tc_ac.timeout {
							   setverdict(fail, __SCOPE__ & ": No answer while updating contentInstance");
						   }
						}	
				
						v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex);
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
								if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) {
								 if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){
								   setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
							  }
						   }
						}
				
						// Postamble
						f_cse_postamble_deleteResources();
	
						// Tear down
						f_cf01Down();

					}//end TC_CSE_DMR_UPD_011
	
				} // end group g_CSE_DMR_UPD_011
				
				group g_CSE_DMR_UPD_012{

					/**
					 * @desc Check that the IUT rejects the UPDATE Request of a latest resource as a direct child of a <container> resource with error “OPERATION_NOT_ALLOWED”
					 * 
					 */
				  	testcase TC_CSE_DMR_UPD_012() runs on CseTester system CseSystem {
					  	// Local variables
					  	var MsgIn v_response;
					  	var RequestPrimitive v_request;
					  	var integer v_aeIndex := -1;
					  	var integer v_containerIndex := -1;
					  	var integer v_contentInstanceIndex := -1; 
					  	var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase;
					  	var Labels v_labels := {"LABEL"};					  	
						var PrimitiveContent v_primitiveContentRetrieveResource;					  	
		
					  	v_updateRequest.primitiveContent.contentInstance.labels := v_labels;
				   
					  	// Test control

					  	// Test component configuration
					  	f_cf01Up();

					  	// Test adapter configuration

					  	// Preamble
					  	v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
					  	v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
		
					  	v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); 
		
					  	//Test Body
					  	v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest);
					  	
					  	v_request.to_ := v_request.to_ & "/" & c_resourceShortNameLatest;		//<latest>

					  	mcaPort.send(m_request(v_request));
					  	tc_ac.start;
					  	alt {
						  	[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
							 	tc_ac.stop;
							 	setverdict(pass, __SCOPE__ & ": Not allowed to update a latest resource with error OPERATION_NOT_ALLOWED");
						 	}
						 	[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							 	tc_ac.stop;
							 	setverdict(fail, __SCOPE__ & ": Wrong response status code");
						 	}
						 	[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							 	tc_ac.stop;
							 	setverdict(fail, __SCOPE__ & ": Accepted update of a latest resource");
						 	}
						 	[] tc_ac.timeout {
							 	setverdict(fail, __SCOPE__ & ": No answer while updating a latest resource");
						 	}
					  	}	

						v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex);
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
								if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) {
								 if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){
								   setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
							  }
						   }
						}	

					  	// Postamble
					  	f_cse_postamble_deleteResources();

					  	// Tear down
					  	f_cf01Down();

				  	}//end TC_CSE_DMR_UPD_012

			  	} // end group g_CSE_DMR_UPD_012
			  	
				group g_CSE_DMR_UPD_013{

					/**
					 * @desc Check that the IUT rejects the UPDATE Request of an oldest resource as a direct child of a <container> resource with error “OPERATION_NOT_ALLOWED”
					 * 
					 */
				  	testcase TC_CSE_DMR_UPD_013() runs on CseTester system CseSystem {
					  	// Local variables
					  	var MsgIn v_response;
					  	var RequestPrimitive v_request;
					  	var integer v_aeIndex := -1;
					  	var integer v_containerIndex := -1;
					  	var integer v_contentInstanceIndex := -1; 
					  	var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase;
					  	var Labels v_labels:= {"LABEL"};
						var PrimitiveContent v_primitiveContentRetrieveResource;

					  	v_updateRequest.primitiveContent.contentInstance.labels := v_labels;
   
					  	// Test control

					  	// Test component configuration
					  	f_cf01Up();

					  	// Test adapter configuration

					  	// Preamble
					  	v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

					  	v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 

					  	v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); 

					  	//Test Body
					  	v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest);
					  	
						v_request.to_ := v_request.to_ & "/" & c_resourceShortNameOldest;		//<oldest>

					  	mcaPort.send(m_request(v_request));
					  	tc_ac.start;
					  	alt {
						  	[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
							  	tc_ac.stop;
							  	setverdict(pass, __SCOPE__ & ": Not allowed to update an oldest resource with error OPERATION_NOT_ALLOWED");
						  	}
						  	[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							  	tc_ac.stop;
							  	setverdict(fail, __SCOPE__ & ": Wrong response status code");
						  	}
						  	[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							  	tc_ac.stop;
							  	setverdict(fail, __SCOPE__ & ": Accepted update of an oldest resource");
						  	}
						  	[] tc_ac.timeout {
							  	setverdict(fail, __SCOPE__ & ": No answer while updating an oldest resource");
						  	}
					  	}	

						v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex);
						if(getverdict == pass){
							//Check that the resource has NOT been udpated
								if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) {
								 if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){
								   setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated")
							  }
						   }
						}	
					  	// Postamble
					  	f_cse_postamble_deleteResources();

					  	// Tear down
					  	f_cf01Down();

				  	}//end TC_CSE_DMR_UPD_013

			  	} // end group g_CSE_DMR_UPD_013
			  	
				group g_CSE_DMR_UPD_014 {
					
					/**
					 * @desc Check that the IUT updates successfully the value of the optional attribute OPTIONAL_ATTRIBUTE of the RESOURCE_TYPE resource. 
					 * 
					 */
					testcase TC_CSE_DMR_UPD_014_ACP_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime_1 := "20301231T012345";
						var Timestamp v_expirationTime_2 := "20401020T012345";
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime_1;
						v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.expirationTime != v_expirationTime_2){
										setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly")
									}
								}
							}
						}

					}
										
					testcase TC_CSE_DMR_UPD_014_ACP_LBL() runs on CseTester system CseSystem {
						// 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.accessControlPolicy.labels := v_labels_1;
						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP
	
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_2){
										setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
									}
								}
							}
						}
	
					}
					
					testcase TC_CSE_DMR_UPD_014_ACP_PV() runs on CseTester system CseSystem {
						// Local variables
						var SetOfAcrs v_privileges_1;
						var SetOfAcrs v_privileges_2;
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;

						v_privileges_1.accessControlRule_list[0].accessControlOperations := int31;
						v_privileges_2.accessControlRule_list[0].accessControlOperations := int63;
	
						v_createRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1;
						v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges != v_privileges_2){
										setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_ACP_PVS() runs on CseTester system CseSystem {
						// Local variables
						var SetOfAcrs v_selfPrivileges_1;
						var SetOfAcrs v_selfPrivileges_2;
						var template RequestPrimitive v_createRequest := m_createAcpBase;
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;

						v_selfPrivileges_1.accessControlRule_list[0].accessControlOperations := int31;
						v_selfPrivileges_2.accessControlRule_list[0].accessControlOperations := int63;
						
						v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfPrivileges_1;
						v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfPrivileges_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges != v_selfPrivileges_2){
										setverdict(fail, __SCOPE__ & ": Error: SelfPrivileges attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_CNT_ACPI() runs on CseTester system CseSystem {
						// Local variables
						var AcpType v_accessControlPolicyIDs_1 := {"NotInitialized_1"};
						var AcpType v_accessControlPolicyIDs_2 := {"NotInitialized_2"};
						var ResponsePrimitive v_responsePrimitive;

						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;

						v_createRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_1;
						v_updateRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container


						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.accessControlPolicyIDs != v_accessControlPolicyIDs_2){
										setverdict(fail, __SCOPE__ & ": Error: AccessControlPolicyIDs attribute not updated correctly")
									}
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_014_CNT_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime_1 := "20301231T012345";
						var Timestamp v_expirationTime_2 := "20401020T012345";
						var ResponsePrimitive v_responsePrimitive;

						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;

						v_createRequest.primitiveContent.container.expirationTime := v_expirationTime_1;
						v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container


						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.expirationTime != v_expirationTime_2){
										setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly")
									}
								}
							}
						}
					}
										
					testcase TC_CSE_DMR_UPD_014_CNT_LBL() runs on CseTester system CseSystem {
						// 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.container.labels := v_labels_1;
						v_updateRequest.primitiveContent.container.labels := v_labels_2;
		
						v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container
		
		
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.labels != v_labels_2){
										setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
									}
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_014_CNT_MBS() runs on CseTester system CseSystem {
						// Local variables
						var XSD.NonNegativeInteger v_maxByteSize_1 := 256;
						var XSD.NonNegativeInteger v_maxByteSize_2 := 512;
						var ResponsePrimitive v_responsePrimitive;
	
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
	
						v_createRequest.primitiveContent.container.maxByteSize := v_maxByteSize_1;
						v_updateRequest.primitiveContent.container.maxByteSize := v_maxByteSize_2;
	
						v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container
	
	
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.maxByteSize != v_maxByteSize_2){
										setverdict(fail, __SCOPE__ & ": Error: MaxByteSize attribute not updated correctly")
									}
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_014_CNT_MIA() runs on CseTester system CseSystem {
						// Local variables
						var XSD.NonNegativeInteger v_maxInstanceAge_1 := 60;
						var XSD.NonNegativeInteger v_maxInstanceAge_2 := 120;
						var ResponsePrimitive v_responsePrimitive;

						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;

						v_createRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge_1;
						v_updateRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container


						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.maxInstanceAge != v_maxInstanceAge_2){
										setverdict(fail, __SCOPE__ & ": Error: MaxInstanceAge attribute not updated correctly")
									}
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_014_CNT_MNI() runs on CseTester system CseSystem {
						// Local variables
						var XSD.NonNegativeInteger v_maxNrOfInstances_1 := 1;
						var XSD.NonNegativeInteger v_maxNrOfInstances_2 := 2;
						var ResponsePrimitive v_responsePrimitive;
	
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
	
						v_createRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances_1;
						v_updateRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances_2;
	
						v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container
	
	
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != v_maxNrOfInstances_2){
										setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly")
									}
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_014_CNT_OR() runs on CseTester system CseSystem {
						// Local variables
						var XSD.AnyURI v_ontologyRef_1 := "MyOntologyRef_1";
						var XSD.AnyURI v_ontologyRef_2 := "MyOntologyRef_2";
						var ResponsePrimitive v_responsePrimitive;
	
						var template RequestPrimitive v_createRequest := m_createContainerBase;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
	
						v_createRequest.primitiveContent.container.ontologyRef := v_ontologyRef_1;
						v_updateRequest.primitiveContent.container.ontologyRef := v_ontologyRef_2;
	
						v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container
	
	
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.ontologyRef != v_ontologyRef_2){
										setverdict(fail, __SCOPE__ & ": Error: OntologyRef attribute not updated correctly")
									}
								}
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_ACPI() runs on CseTester system CseSystem {
						// Local variables
						var AcpType v_accessControlPolicyIDs_1 := {"NotInitialized_1"};
						var AcpType v_accessControlPolicyIDs_2 := {"NotInitialized_2"};
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_1;
						v_updateRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.accessControlPolicyIDs != v_accessControlPolicyIDs_2){
										setverdict(fail, __SCOPE__ & ": Error: AccessControlPolicyIDs attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_BN() runs on CseTester system CseSystem {
						// Local variables
						var BatchNotify v_batchNotify_1 := {1, "PT1S"};
						var BatchNotify v_batchNotify_2 := {2, "PT1S"};
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.batchNotify := v_batchNotify_1;
						v_updateRequest.primitiveContent.subscription.batchNotify := v_batchNotify_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.batchNotify != v_batchNotify_2){
										setverdict(fail, __SCOPE__ & ": Error: EventNotificationCriteria attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_ENC() runs on CseTester system CseSystem {
						// Local variables
						var EventNotificationCriteria v_eventNotificationCriteria_1 := valueof(m_eventNotificationCriteria({int1}, -));
						var EventNotificationCriteria v_eventNotificationCriteria_2 := valueof(m_eventNotificationCriteria({int2}, -));
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.eventNotificationCriteria := v_eventNotificationCriteria_1;
						v_updateRequest.primitiveContent.subscription.eventNotificationCriteria := v_eventNotificationCriteria_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.eventNotificationCriteria != v_eventNotificationCriteria_2){
										setverdict(fail, __SCOPE__ & ": Error: EventNotificationCriteria attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_ET() runs on CseTester system CseSystem {
						// Local variables
						var Timestamp v_expirationTime_1 := "20301231T012345";
						var Timestamp v_expirationTime_2 := "20401020T012345";
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.expirationTime := v_expirationTime_1;
						v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.expirationTime != v_expirationTime_2){
										setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_EXC() runs on CseTester system CseSystem {
						// Local variables
						var XSD.PositiveInteger v_expirationCounter_1 := 10;
						var XSD.PositiveInteger v_expirationCounter_2 := 20;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.expirationCounter := v_expirationCounter_1;
						v_updateRequest.primitiveContent.subscription.expirationCounter := v_expirationCounter_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.expirationCounter != v_expirationCounter_2){
										setverdict(fail, __SCOPE__ & ": Error: ExpirationCounter attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_GPI() runs on CseTester system CseSystem {
						// Local variables
						var XSD.AnyURI v_groupID_1 := "MyGroupID_1";
						var XSD.AnyURI v_groupID_2 := "MyGroupID_2";
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.groupID := v_groupID_1;
						v_updateRequest.primitiveContent.subscription.groupID := v_groupID_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.groupID != v_groupID_2){
										setverdict(fail, __SCOPE__ & ": Error: GroupID attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_LBL() runs on CseTester system CseSystem {
						// 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.subscription.labels := v_labels_1;
						v_updateRequest.primitiveContent.subscription.labels := v_labels_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription
	
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_2){
										setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_LN() runs on CseTester system CseSystem {
						// Local variables
						var XSD.Boolean v_latestNotify_1 := true;
						var XSD.Boolean v_latestNotify_2 := false;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.latestNotify := v_latestNotify_1;
						v_updateRequest.primitiveContent.subscription.latestNotify := v_latestNotify_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.latestNotify != v_latestNotify_2){
										setverdict(fail, __SCOPE__ & ": Error: LatestNotify attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_NCT() runs on CseTester system CseSystem {
						// Local variables
						var NotificationContentType v_notificationContentType_1 := int1;
						var NotificationContentType v_notificationContentType_2 := int2;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType_1;
						v_updateRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.notificationContentType != v_notificationContentType_2){
										setverdict(fail, __SCOPE__ & ": Error: NotificationContentType attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_NEC() runs on CseTester system CseSystem {
						// Local variables
						var EventCat v_notificationEventCat_1 := {alt_1 := 100};
						var EventCat v_notificationEventCat_2 := {alt_1 := 101};
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.notificationEventCat := v_notificationEventCat_1;
						v_updateRequest.primitiveContent.subscription.notificationEventCat := v_notificationEventCat_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.notificationEventCat != v_notificationEventCat_2){
										setverdict(fail, __SCOPE__ & ": Error: NotificationEventCat attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_NFU() runs on CseTester system CseSystem {
						// Local variables
						var XSD.AnyURI v_notificationForwardingURI_1 := "MyForwardingURI_1";
						var XSD.AnyURI v_notificationForwardingURI_2 := "MyForwardingURI_2";
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.notificationForwardingURI := v_notificationForwardingURI_1;
						v_updateRequest.primitiveContent.subscription.notificationForwardingURI := v_notificationForwardingURI_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.notificationForwardingURI != v_notificationForwardingURI_2){
										setverdict(fail, __SCOPE__ & ": Error: NotificationForwardingURI attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_NSP() runs on CseTester system CseSystem {
						// Local variables
						var XSD.PositiveInteger v_notificationStoragePriority_1 := 1;
						var XSD.PositiveInteger v_notificationStoragePriority_2 := 2;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.notificationStoragePriority := v_notificationStoragePriority_1;
						v_updateRequest.primitiveContent.subscription.notificationStoragePriority := v_notificationStoragePriority_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.notificationStoragePriority != v_notificationStoragePriority_2){
										setverdict(fail, __SCOPE__ & ": Error: NotificationStoragePriority attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_PN() runs on CseTester system CseSystem {
						// Local variables
						var PendingNotification v_pendingNotification_1 := int1;
						var PendingNotification v_pendingNotification_2 := int2;
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.pendingNotification := v_pendingNotification_1;
						v_updateRequest.primitiveContent.subscription.pendingNotification := v_pendingNotification_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.pendingNotification != v_pendingNotification_2){
										setverdict(fail, __SCOPE__ & ": Error: PendingNotification attribute not updated correctly")
									}
								}
							}
						}

					}
					
					testcase TC_CSE_DMR_UPD_014_SUB_RL() runs on CseTester system CseSystem {
						// Local variables
						var RateLimit v_rateLimit_1 := {0, omit};
						var RateLimit v_rateLimit_2 := {1, omit};
						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;

						v_createRequest.primitiveContent.subscription.rateLimit := v_rateLimit_1;
						v_updateRequest.primitiveContent.subscription.rateLimit := v_rateLimit_2;

						v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription

						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.rateLimit != v_rateLimit_2){
										setverdict(fail, __SCOPE__ & ": Error: RateLimit attribute not updated correctly")
									}
								}
							}
						}

					}
	
					function f_CSE_DMR_UPD_014(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester return ResponsePrimitive{
	
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
							   
						// Test control
	
						// Test component configuration
						f_cf01Up();
	
						// Test adapter configuration
	
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
		
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
		
						v_resourceIndex := f_cse_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(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
					
						// Postamble
						f_cse_postamble_deleteResources();
		
						// Tear down
						f_cf01Down();
		
						return v_response.primitive.responsePrimitive;
		    				
					}//end f_CSE_DMR_UPD_014
	
				} // end g_CSE_DMR_UPD_014

			  	group g_CSE_DMR_UPD_017{
			  		
					/**
					 * @desc Check that the IUT updates successfully the value of the optional attribute OPTIONAL_ATTRIBUTE of the RESOURCE_TYPE resource under CSEBase
					 */
					testcase TC_CSE_DMR_UPD_017_CSR_LBL() runs on CseTester system CseSystem {
					   var AcpType v_acpType;
					   var Labels v_labels := {"MyLabel"};
					   var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
					   var ResponsePrimitive v_responsePrimitive;
					   var PrimitiveContent v_primitiveContentRetrieveResource;
	
					   v_updateRequest.primitiveContent.remoteCSE.labels := v_labels;
	
					   v_responsePrimitive := f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Remote CSE
					   if(getverdict == pass){
						   //Check attribute 1
						   if(ispresent(v_responsePrimitive.primitiveContent)) {
							   if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) {
								   if(v_responsePrimitive.primitiveContent.remoteCSE.labels != v_labels){
									   setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly")
								   }
							   }
						   }
						   
							//Check that the resource has been udpated correctly
						    if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) {
							 if(v_primitiveContentRetrieveResource.remoteCSE.labels != v_labels){
							  setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
							}
						  }
					   }
					}
					
					testcase TC_CSE_DMR_UPD_017_CSR_POA() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"};
					   	var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
					   	var ResponsePrimitive v_responsePrimitive;
					   	var PrimitiveContent v_primitiveContentRetrieveResource;

					   	v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := v_poaList;

						v_responsePrimitive := f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Remote CSE
					   	if(getverdict == pass){
						  //Check attribute 1
						  if(ispresent(v_responsePrimitive.primitiveContent)) {
							  if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) {
								  if(v_responsePrimitive.primitiveContent.remoteCSE.pointOfAccess != v_poaList){
									  setverdict(fail, __SCOPE__, ": Error: Point of access attribute not updated correctly")
								  }
							  }
						  }
						  
						  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) {
						   if(v_primitiveContentRetrieveResource.remoteCSE.pointOfAccess != v_poaList){
							setverdict(fail, __SCOPE__ & ": Error: Point of access attribute not updated correctly")
						  }
						}
					  }
					}
					
					testcase TC_CSE_DMR_UPD_017_CSR_NL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.AnyURI v_nodeLink := "MyNodeId";
					   	var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
					   	var ResponsePrimitive v_responsePrimitive;
					   	var PrimitiveContent v_primitiveContentRetrieveResource;

					   	v_updateRequest.primitiveContent.remoteCSE.nodeLink := v_nodeLink;

					   v_responsePrimitive := f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Remote CSE
					   if(getverdict == pass){
						 //Check attribute 1
						 if(ispresent(v_responsePrimitive.primitiveContent)) {
							 if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) {
								 if(v_responsePrimitive.primitiveContent.remoteCSE.nodeLink != v_nodeLink){
									 setverdict(fail, __SCOPE__, ": Error: Node link attribute not updated correctly")
								 }
							 }
						 }
						 
						//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) {
							 if(v_primitiveContentRetrieveResource.remoteCSE.nodeLink != v_nodeLink){
							  setverdict(fail, __SCOPE__ & ": Error: Node link attribute not updated correctly")
							}
						  }
					  }
					}
			  		
					testcase TC_CSE_DMR_UPD_017_NOD_LBL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var Labels v_labels := {"MyLabel"};
						var template RequestPrimitive v_updateRequest := m_updateNodeBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.node.labels := v_labels;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Node
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.node)) {
									 if(v_responsePrimitive.primitiveContent.node.labels != v_labels){
										 setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly")
									 }
								 }
							 }
							 
							//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.node)) {
							   if(v_primitiveContentRetrieveResource.node.labels != v_labels){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_NOD_ACPI() runs on CseTester system CseSystem {
						var AcpType v_acpType := {"NotInitialized"};
						var template RequestPrimitive v_updateRequest := m_updateNodeBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType, true);//Node
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.node)) {
									 if(v_responsePrimitive.primitiveContent.node.accessControlPolicyIDs != valueof(v_acpType)){
										 setverdict(fail, __SCOPE__, ": Error: Access Control Policy attribute not updated correctly")
									 }
								 }
							 }
	 
							//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.node)) {
							   if(v_primitiveContentRetrieveResource.node.accessControlPolicyIDs != valueof(v_acpType)){
								setverdict(fail, __SCOPE__ & ": Error: Access Control Policy attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_NOD_HCL() runs on CseTester system CseSystem {
						
						/* TO BE DONE */
					}
					
					testcase TC_CSE_DMR_UPD_017_AE_LBL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var Labels v_labels := {"MyLabel"};
						var template RequestPrimitive v_updateRequest := m_updateAE;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.aE.labels := v_labels;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//AE
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.aE)) {
									 if(v_responsePrimitive.primitiveContent.aE.labels != v_labels){
										 setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.aE)) {
							   if(v_primitiveContentRetrieveResource.aE.labels != v_labels){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_AE_ACPI() runs on CseTester system CseSystem {
						var AcpType v_acpType := {"NotInitialized"};
						var template RequestPrimitive v_updateRequest := m_updateAE;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource, v_acpType, true);//AE
						
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.aE)) {
									 if(v_responsePrimitive.primitiveContent.aE.accessControlPolicyIDs != valueof(v_acpType)){
										 setverdict(fail, __SCOPE__, ": Error: Access control policy IDs attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.aE)) {
							   if(v_primitiveContentRetrieveResource.aE.accessControlPolicyIDs != valueof(v_acpType)){
								setverdict(fail, __SCOPE__ & ": Error: Access control policy IDs attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_AE_APN() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.String v_appName := "MyAppName";
						var template RequestPrimitive v_updateRequest := m_updateAE;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.aE.appName := v_appName;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//AE
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.aE)) {
									 if(v_responsePrimitive.primitiveContent.aE.appName != v_appName){
										 setverdict(fail, __SCOPE__, ": Error: AppName attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.aE)) {
							   if(v_primitiveContentRetrieveResource.aE.appName != v_appName){
								setverdict(fail, __SCOPE__ & ": Error: AppName attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_AE_POA() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"};
						var template RequestPrimitive v_updateRequest := m_updateAE;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.aE.pointOfAccess := v_poaList;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//AE
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.aE)) {
									 if(v_responsePrimitive.primitiveContent.aE.pointOfAccess != v_poaList){
										 setverdict(fail, __SCOPE__, ": Error: Point of Access attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.aE)) {
							   if(v_primitiveContentRetrieveResource.aE.pointOfAccess != v_poaList){
								setverdict(fail, __SCOPE__ & ": Error: Point of Access attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_AE_OR() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.AnyURI v_ontoLogyRef := "MyOntologyRef";
						var template RequestPrimitive v_updateRequest := m_updateAE;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.aE.ontologyRef := v_ontoLogyRef;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//AE
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.aE)) {
									 if(v_responsePrimitive.primitiveContent.aE.ontologyRef != v_ontoLogyRef){
										 setverdict(fail, __SCOPE__, ": Error: Ontology Ref attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.aE)) {
							   if(v_primitiveContentRetrieveResource.aE.ontologyRef != v_ontoLogyRef){
								setverdict(fail, __SCOPE__ & ": Error: Ontology Ref attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_CNT_LBL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var Labels v_labels := {"MyLabel"};
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.container.labels := v_labels;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Container
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									 if(v_responsePrimitive.primitiveContent.container.labels != v_labels){
										 setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.labels != v_labels){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
							  }
							}
						 }				
					}
					
					testcase TC_CSE_DMR_UPD_017_CNT_ACPI() runs on CseTester system CseSystem {
						var  AcpType v_acpType := {"NotInitialized"};
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType, true);//Container
						
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									 if(v_responsePrimitive.primitiveContent.container.accessControlPolicyIDs != valueof(v_acpType)){
										 setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.accessControlPolicyIDs != valueof(v_acpType)){
								setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_CNT_MNI() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.NonNegativeInteger v_maxNrOfInstances := 5;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Container
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									 if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != v_maxNrOfInstances){
										 setverdict(fail, __SCOPE__, ": Error: Maximum number of instances attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.maxNrOfInstances != v_maxNrOfInstances){
								setverdict(fail, __SCOPE__ & ": Error: Maximum number of instances attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_CNT_MBS() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.NonNegativeInteger v_maxByteSize := 512;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.container.maxByteSize := v_maxByteSize;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Container
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									 if(v_responsePrimitive.primitiveContent.container.maxByteSize != v_maxByteSize){
										 setverdict(fail, __SCOPE__, ": Error: Maximum Byte size attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.maxByteSize != v_maxByteSize){
								setverdict(fail, __SCOPE__ & ": Error: Maximum Byte Size attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_CNT_MIA() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.NonNegativeInteger v_maxInstanceAge := 1;
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Container
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									 if(v_responsePrimitive.primitiveContent.container.maxInstanceAge != v_maxInstanceAge){
										 setverdict(fail, __SCOPE__, ": Error: Maximum Instance age attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.maxInstanceAge != v_maxInstanceAge){
								setverdict(fail, __SCOPE__ & ": Error: Maximum Instance age attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_CNT_OR() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.AnyURI v_ontoLogyRef := "MyOntologyRef";
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.container.ontologyRef := v_ontoLogyRef;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Container
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									 if(v_responsePrimitive.primitiveContent.container.ontologyRef != v_ontoLogyRef){
										 setverdict(fail, __SCOPE__, ": Error: Ontology Ref attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.ontologyRef != v_ontoLogyRef){
								setverdict(fail, __SCOPE__ & ": Error: Ontology Ref attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_CNT_LI() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.AnyURI v_locationID := "MyLocationID";
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.container.locationID := v_locationID;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Container
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									 if(v_responsePrimitive.primitiveContent.container.locationID != v_locationID){
										 setverdict(fail, __SCOPE__, ": Error: Location ID attribute not updated correctly")
									 }
								 }
							 }
	 
													  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							   if(v_primitiveContentRetrieveResource.container.locationID != v_locationID){
								setverdict(fail, __SCOPE__ & ": Error: Location ID attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_ACP_LBL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var Labels v_labels := {"MyLabel"};
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//AccessControlPolicy
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									 if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels){
										 setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly")
									 }
								 }
							 }
 
																		  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							   if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_ACPI() runs on CseTester system CseSystem {
						var AcpType v_acpType := {"NotInitialized"};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType, true);//Subscription
						
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.accessControlPolicyIDs != valueof(v_acpType)){
										 setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.accessControlPolicyIDs != valueof(v_acpType)){
								setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_LBL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var Labels v_labels := {"MyLabel"};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.labels := v_labels;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels){
										 setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.labels != v_labels){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_ENC() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var EventNotificationCriteria v_eventNotificationCriteria:= valueof(m_eventNotificationCriteria({int3}, -));
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.eventNotificationCriteria:=v_eventNotificationCriteria ;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.eventNotificationCriteria != v_eventNotificationCriteria){
										 setverdict(fail, __SCOPE__, ": Error: Event Notification Criteria attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.eventNotificationCriteria != v_eventNotificationCriteria){
								setverdict(fail, __SCOPE__ & ": Error: Event Notofication Criteria attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_EXC() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.PositiveInteger v_expirationCounter:=10;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.expirationCounter:=v_expirationCounter;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.expirationCounter != v_expirationCounter){
										 setverdict(fail, __SCOPE__, ": Error: Expiration Counter attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.expirationCounter != v_expirationCounter){
								setverdict(fail, __SCOPE__ & ": Error: Expiration Counter attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_GPI() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.AnyURI v_groupID := "MyGroupID";
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.groupID:=v_groupID;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.groupID != v_groupID){
										 setverdict(fail, __SCOPE__, ": Error: Group ID attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.groupID != v_groupID){
								setverdict(fail, __SCOPE__ & ": Error: Group ID attribute not updated correctly")
							  }
							}
						 } 
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_NFU() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.AnyURI v_notificationForwardingURI:= "MyNotificationForwardingURI";
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.notificationForwardingURI:=v_notificationForwardingURI;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.notificationForwardingURI != v_notificationForwardingURI){
										 setverdict(fail, __SCOPE__, ": Error: Notification Forwarding URI attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.notificationForwardingURI != v_notificationForwardingURI){
								setverdict(fail, __SCOPE__ & ": Error: Notification Forwarding URI attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_BN() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var BatchNotify v_batchNotify:= {1, "PT1S"};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.batchNotify:=v_batchNotify;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.batchNotify != v_batchNotify){
										 setverdict(fail, __SCOPE__, ": Error: Batch Notify attribute not updated correctly")
									 }
								 }
							 }
 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.batchNotify != v_batchNotify){
								setverdict(fail, __SCOPE__ & ": Error: Batch Notify attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_RL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var RateLimit v_rateLimit:= {2, "PT1S"};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.rateLimit:=v_rateLimit;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.rateLimit != v_rateLimit){
										 setverdict(fail, __SCOPE__, ": Error: Rate Limit attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.rateLimit != v_rateLimit){
								setverdict(fail, __SCOPE__ & ": Error: Rate Limit attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_PN() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var PendingNotification v_pendingNotification:=int2;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.pendingNotification:=v_pendingNotification;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.pendingNotification != v_pendingNotification){
										 setverdict(fail, __SCOPE__, ": Error: Pending Notification attribute not updated correctly")
									 }
								 }
							 }
 
							//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.pendingNotification != v_pendingNotification){
								setverdict(fail, __SCOPE__ & ": Error: Pending Notification attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_NSP() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.PositiveInteger v_notificationStoragePriority:=10;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.notificationStoragePriority:=v_notificationStoragePriority;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.notificationStoragePriority != v_notificationStoragePriority){
										 setverdict(fail, __SCOPE__, ": Error: Notification Storage priority attribute not updated correctly")
									 }
								 }
							 }
	 
														//Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.notificationStoragePriority != v_notificationStoragePriority){
								setverdict(fail, __SCOPE__ & ": Error: Notification Storage priority attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_LN() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.Boolean v_latestNotify:=true;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.latestNotify:=v_latestNotify;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.latestNotify != v_latestNotify){
										 setverdict(fail, __SCOPE__, ": Error: Latest Notify priority attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.latestNotify != v_latestNotify){
								setverdict(fail, __SCOPE__ & ": Error: Latest Notify attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_SUB_NEC() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var EventCat v_eventCat:= {alt_1:= 300};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.notificationEventCat:=v_eventCat;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Subscription
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									 if(v_responsePrimitive.primitiveContent.subscription.notificationEventCat != v_eventCat){
										 setverdict(fail, __SCOPE__, ": Error: Notification Event Cat attribute not updated correctly")
									 }
								 }
							 }
	 
													  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							   if(v_primitiveContentRetrieveResource.subscription.notificationEventCat != v_eventCat){
								setverdict(fail, __SCOPE__ & ": Error: Notification Event Cat attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_GRP_LBL() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var Labels v_labels := {"MyLabel"};
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
					    var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.group_.labels := v_labels;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Group
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									 if(v_responsePrimitive.primitiveContent.group_.labels != v_labels){
										 setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							   if(v_primitiveContentRetrieveResource.group_.labels != v_labels){
								setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_GRP_ACPI() runs on CseTester system CseSystem {
						var AcpType v_acpType := {"NotInitialized"};
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType, true);//Group
						
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									 if(v_responsePrimitive.primitiveContent.group_.accessControlPolicyIDs != valueof(v_acpType)){
										 setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly")
									 }
								 }
							 }
 
												  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							   if(v_primitiveContentRetrieveResource.group_.accessControlPolicyIDs != valueof(v_acpType)){
								setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_GRP_MACP() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var ListOfURIs v_membersAccessControlPolicyIDs := {"NotInitialized"};
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.group_.membersAccessControlPolicyIDs := v_membersAccessControlPolicyIDs;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Group
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									 if(v_responsePrimitive.primitiveContent.group_.membersAccessControlPolicyIDs != v_membersAccessControlPolicyIDs){
										 setverdict(fail, __SCOPE__, ": Error: Members Access Control Policy IDs attribute not updated correctly")
									 }
								 }
							 }
	 
							   //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							   if(v_primitiveContentRetrieveResource.group_.membersAccessControlPolicyIDs != v_membersAccessControlPolicyIDs){
								setverdict(fail, __SCOPE__ & ": Error: Members Access Control Policy IDs attribute not updated correctly")
							  }
							}
						 }
					}
					
					testcase TC_CSE_DMR_UPD_017_GRP_GN() runs on CseTester system CseSystem {
						var AcpType v_acpType;
						var XSD.String v_groupName:="MyGroupName";
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.group_.groupName := v_groupName;
						v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource, v_acpType);//Group
						if(getverdict == pass){
							 //Check attribute 1
							 if(ispresent(v_responsePrimitive.primitiveContent)) {
								 if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									 if(v_responsePrimitive.primitiveContent.group_.groupName != v_groupName){
										 setverdict(fail, __SCOPE__, ": Error: Group name attribute not updated correctly")
									 }
								 }
							 }
	 
							  //Check that the resource has been udpated correctly
							  if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							   if(v_primitiveContentRetrieveResource.group_.groupName != v_groupName){
								setverdict(fail, __SCOPE__ & ": Error: Group name attribute not updated correctly")
							  }
							}
						 }
					}
					
					function f_CSE_DMR_UPD_017(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource, out AcpType p_acpi, boolean p_secondAcp := false) runs on CseTester return ResponsePrimitive {
						//Local variables
					   	var MsgIn v_response;
					   	var RequestPrimitive v_request;
					   	var integer v_aeIndex := -1;
					   	var integer v_resourceIndex := -1;
					   	var CseTester v_notifyHandler;
					   	var integer v_ae2Index := -1;
					   	var integer v_acpAuxIndex := -1;
					   	var integer v_acpIndex := -1;
   
					   	// Test control

						// Test component configuration
					   	f_cf02Up();

					   	// Test adapter configuration

					   	// Preamble
					   	v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					   	
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if(p_secondAcp) {//A second ACP is required
							v_acpIndex := f_cse_createResource(int1, m_createAcpBase);
							
							p_acpi := {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID};
							
							p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive, p_acpi);
							
						}
 
					  	if (p_resourceType!=int16){	//ResourceType != RemoteCSE
	
					   		f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);

					   		v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource
					  	} else {	//ResourceType = RemoteCSE
							v_resourceIndex := f_cse_registerRemoteCse(p_createRequestPrimitive);	
					  	}
					 
					  	//Test Body
					  	v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
 
					  	mcaPort.send(m_request(v_request)); //CSEBase
					 	tc_ac.start;
					  	alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
							 	setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
						  	}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, ": Wrong response status code");
							}
						  	[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
							  	setverdict(fail, __SCOPE__, ": Error while updating optional attribute");
						  	}
						  	[] tc_ac.timeout {
							  	setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
						  	}
					  	}
					  
					  	p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);

					  	//Postamble
					  	f_cse_postamble_deleteResources();

					  	// Tear down
					  	f_cf02Down();
					  
					  	return v_response.primitive.responsePrimitive;
					} // end function f_CSE_DMR_UPD_017
			  		
			  	} // end group g_CSE_DMR_UPD_017
			  	
			  	group g_CSE_DMR_UPD_018 {
			  		
					/**
					 * @desc Check that the IUT updates successfully the value of the attribute MANDATORY_ATTRIBUTE of the RESOURCE_TYPE resource under CSEBase
					*/
					testcase TC_CSE_DMR_UPD_018_CSR_ET() runs on CseTester system CseSystem {
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.remoteCSE.expirationTime := v_expirationTime;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource);//Remote CSE
						
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) {
									if(v_responsePrimitive.primitiveContent.remoteCSE.expirationTime != v_expirationTime){
										setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly")
									}
								}
							}
							
		 				  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) {
							if(v_primitiveContentRetrieveResource.remoteCSE.expirationTime != v_expirationTime){
							  setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly")
							}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_CSR_RR() runs on CseTester system CseSystem {
						var XSD.Boolean v_requestReachability := true;
						var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.remoteCSE.requestReachability := v_requestReachability;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource);//Remote CSE
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) {
									if(v_responsePrimitive.primitiveContent.remoteCSE.requestReachability != v_requestReachability){
										setverdict(fail, __SCOPE__, ": Error: Request Reachability attribute not updated correctly")
									}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) {
							  if(v_primitiveContentRetrieveResource.remoteCSE.requestReachability != v_requestReachability){
								setverdict(fail, __SCOPE__ & ": Error: Request Reachability attribute not updated correctly")
							  }
							}	
						}
					}
			  		
					testcase TC_CSE_DMR_UPD_018_NOD_ET() runs on CseTester system CseSystem {
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateNodeBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.node.expirationTime := v_expirationTime;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource);//Node
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.node)) {
									if(v_responsePrimitive.primitiveContent.node.expirationTime != v_expirationTime){
										setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly")
									}
								}
							}
							
						  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.node)) {
							if(v_primitiveContentRetrieveResource.node.expirationTime != v_expirationTime){
							  setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly")
							}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_NOD_NI() runs on CseTester system CseSystem {
						var template RequestPrimitive v_updateRequest := m_updateNodeBase;
						var XSD.Token v_targetId := "TARGET-ID";
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.node.nodeID := v_targetId;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource);//Node
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.node)) {
									if(v_responsePrimitive.primitiveContent.node.nodeID != v_targetId){
										setverdict(fail, __SCOPE__, ": Error: NodeID attribute not updated correctly")
									}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.node)) {
							  if(v_primitiveContentRetrieveResource.node.nodeID != v_targetId){
								setverdict(fail, __SCOPE__ & ": Error: NodeID attribute not updated correctly")
							  }
							}	
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_AE_ET() runs on CseTester system CseSystem {
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateAE;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.aE.expirationTime := v_expirationTime;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.aE)) {
									if(v_responsePrimitive.primitiveContent.aE.expirationTime != v_expirationTime){
										setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly")
									}
								}
							}
							
						 //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.aE)) {
							if(v_primitiveContentRetrieveResource.aE.expirationTime != v_expirationTime){
							  setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly")
							}
						  }	
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_AE_RR() runs on CseTester system CseSystem {
						var XSD.Boolean v_requestReachability := true;
						var template RequestPrimitive v_updateRequest := m_updateAE;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;

						v_updateRequest.primitiveContent.aE.requestReachability := v_requestReachability;

						v_responsePrimitive := f_CSE_DMR_UPD_018(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.aE)) {
									if(v_responsePrimitive.primitiveContent.aE.requestReachability != v_requestReachability){
										setverdict(fail, __SCOPE__, ": Error: Request Reachability attribute not updated correctly")
									}
								}
							}
							
						   //Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.aE)) {
							  if(v_primitiveContentRetrieveResource.aE.requestReachability != v_requestReachability){
								setverdict(fail, __SCOPE__ & ": Error: Request Reachability attribute not updated correctly")
							  }
							}	
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_CNT_ET() runs on CseTester system CseSystem {
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.container)) {
									if(v_responsePrimitive.primitiveContent.container.expirationTime != v_expirationTime){
										setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly")
									}
								}
							}
							
						  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.container)) {
							if(v_primitiveContentRetrieveResource.container.expirationTime != v_expirationTime){
							  setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly")
							}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_ACP_ET() runs on CseTester system CseSystem {
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.expirationTime != v_expirationTime){
										setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly")
									}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							  if(v_primitiveContentRetrieveResource.accessControlPolicy.expirationTime != v_expirationTime){
								setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly")
							  }
							}	
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_ACP_PV() runs on CseTester system CseSystem {
						var SetOfAcrs v_privileges_1 := { accessControlRule_list := {valueof(m_createAcr({PX_SUPER_AE_ID}, int61))}};
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1;
						v_responsePrimitive := f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges != v_privileges_1){
										setverdict(fail, __SCOPE__, ": Error: Privileges attribute not updated correctly")
									}
								}
							}
							
						 //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							if(v_primitiveContentRetrieveResource.accessControlPolicy.privileges != v_privileges_1){
							  setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly")
							}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_ACP_PVS() runs on CseTester system CseSystem {
						var SetOfAcrs v_privileges_1 := { accessControlRule_list := {valueof(m_createAcr({PX_SUPER_AE_ID}, int61))}};
						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_privileges_1;
						v_responsePrimitive := f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) {
									if(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges != v_privileges_1){
										setverdict(fail, __SCOPE__, ": Error: Self Privileges attribute not updated correctly")
									}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) {
							  if(v_primitiveContentRetrieveResource.accessControlPolicy.selfPrivileges != v_privileges_1){
								setverdict(fail, __SCOPE__ & ": Error: Self Privileges attribute not updated correctly")
							  }
							}	
						}
				    }
				    
					testcase TC_CSE_DMR_UPD_018_SUB_ET() runs on CseTester system CseSystem {
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.expirationTime != v_expirationTime){
										setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly")
									}
								}
							}
							
						  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							if(v_primitiveContentRetrieveResource.subscription.expirationTime != v_expirationTime){
							  setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly")
							}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_SUB_NU() runs on CseTester system CseSystem {
						var ListOfURIs v_notificationURI := {"NotReachableNotificationURI"};
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
											
						v_updateRequest.primitiveContent.subscription.notificationURI := v_notificationURI;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.notificationURI != v_notificationURI){
										setverdict(fail, __SCOPE__, ": Error: Notification URI attribute not updated correctly")
									}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							  if(v_primitiveContentRetrieveResource.subscription.notificationURI != v_notificationURI){
								setverdict(fail, __SCOPE__ & ": Error: Notification URI attribute not updated correctly")
							  }
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_SUB_NCT() runs on CseTester system CseSystem {
						var NotificationContentType v_notificationContentType := int2;
						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.subscription)) {
									if(v_responsePrimitive.primitiveContent.subscription.notificationContentType != v_notificationContentType){
										setverdict(fail, __SCOPE__, ": Error: Notification Content Type attribute not updated correctly")
									}
								}
							}
							
						  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.subscription)) {
							if(v_primitiveContentRetrieveResource.subscription.notificationContentType != v_notificationContentType){
							  setverdict(fail, __SCOPE__ & ": Error: Notification Content Type attribute not updated correctly")
							}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_GRP_ET() runs on CseTester system CseSystem {
						var Timestamp v_expirationTime := "20001231T012345";
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									if(v_responsePrimitive.primitiveContent.group_.expirationTime != v_expirationTime){
										setverdict(fail, __SCOPE__, ": Error: Expiration Time attribute not updated correctly")
									}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							  if(v_primitiveContentRetrieveResource.group_.expirationTime != v_expirationTime){
								setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly")
							  }
							}
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_GRP_MNM() runs on CseTester system CseSystem {
						var XSD.PositiveInteger v_maxNrOfMembers := 10;
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.group_.maxNrOfMembers := v_maxNrOfMembers;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									if(v_responsePrimitive.primitiveContent.group_.maxNrOfMembers != v_maxNrOfMembers){
										setverdict(fail, __SCOPE__, ": Error: Maximum Number of Members attribute not updated correctly")
									}
								}
							}
							
						  //Check that the resource has been udpated correctly
						  if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							if(v_primitiveContentRetrieveResource.group_.maxNrOfMembers != v_maxNrOfMembers){
							  setverdict(fail, __SCOPE__ & ": Error: Maximum Number of Members attribute not updated correctly")
							}
						  }
						}
					}
					
					testcase TC_CSE_DMR_UPD_018_GRP_MID() runs on CseTester system CseSystem {
						var ListOfURIs v_memberIDs := {"NotInitialized"};
						var template RequestPrimitive v_updateRequest := m_updateGroupBase;
						var ResponsePrimitive v_responsePrimitive;
						var PrimitiveContent v_primitiveContentRetrieveResource;
						
						v_updateRequest.primitiveContent.group_.memberIDs := v_memberIDs;
						
						v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group
						if(getverdict == pass){
							//Check attribute 1
							if(ispresent(v_responsePrimitive.primitiveContent)) {
								if(ischosen(v_responsePrimitive.primitiveContent.group_)) {
									if(v_responsePrimitive.primitiveContent.group_.memberIDs != v_memberIDs){
										setverdict(fail, __SCOPE__, ": Error: Member IDs attribute not updated correctly")
									}
								}
							}
							
							//Check that the resource has been udpated correctly
							if(ischosen(v_primitiveContentRetrieveResource.group_)) {
							  if(v_primitiveContentRetrieveResource.group_.memberIDs != v_memberIDs){
								setverdict(fail, __SCOPE__ & ": Error: Member IDs attribute not updated correctly")
							  }
							}
						}
					}
					
					function f_CSE_DMR_UPD_018(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive {
						 //Local variables
						 var MsgIn v_response;
						 var RequestPrimitive v_request;
						 var integer v_aeIndex := -1;
						 var integer v_resourceIndex := -1;
						 var CseTester v_notifyHandler;
						 var integer v_ae2Index := -1;
						 var integer v_acpAuxIndex := -1;
						   
						 // Test control

						 // Test component configuration
						 f_cf02Up();

						 // Test adapter configuration

						 // Preamble
						 v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						 
						if(p_resourceType != int1) {
							
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
						
							p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if (p_resourceType!=int16){	//ResourceType != RemoteCSE
							
						 	f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);

						 	v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource
						} else {	//ResourceType = RemoteCSE
							v_resourceIndex := f_cse_registerRemoteCse(p_createRequestPrimitive);	
						}
											 
						//Test Body
						v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
						
						mcaPort.send(m_request(v_request)); //CSEBase
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, ": Error while updating mandatory attribute");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
							}
						}
						
						p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);
						
						//Postamble
 					    f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf02Down();
						
						return v_response.primitive.responsePrimitive;	
					} //end function f_CSE_DMR_UPD_018
			  	
			  	} // end group g_CSE_DMR_UPD_018

			}//end group Update
			
			group Delete {
			
				group g_CSE_DMR_DEL_001{

					/**
					 * @desc Check that the IUT accepts the deletion of a RESOURCE_TYPE resource
					 * 
					 */
                	testcase TC_CSE_DMR_DEL_001_CNT() runs on CseTester system CseSystem {
                		// Local variables
                		
						f_CSE_DMR_DEL_001(int3, m_createContainerBase);//Container
                		
                		if(getverdict == pass){
                			//check if "MyRessource" container resource isn't present in the IUT (for exemple attempt to update the resource)
                		};
                	};
                
                	testcase TC_CSE_DMR_DEL_001_GRP() runs on CseTester system CseSystem {
                		// Local variables
                		
						f_CSE_DMR_DEL_001(int9, m_createGroupBase);//Group
                	};
                
                	testcase TC_CSE_DMR_DEL_001_ACP() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_001(int1, m_createAcpBase);//AccessControlPolicy
                	};
                
                	testcase TC_CSE_DMR_DEL_001_SCH() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_001(int18, m_createScheduleBase);//Schedule
                	};
                
                	testcase TC_CSE_DMR_DEL_001_PCH() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_001(int15, m_createPollingChannelBase);//PollingChannel
                	};
                
                	testcase TC_CSE_DMR_DEL_001_SUB() runs on CseTester system CseSystem {
                			// Local variables
                
						f_CSE_DMR_DEL_001(int23, m_createSubscriptionBase);//Subscription
                	};	
                
					testcase TC_CSE_DMR_DEL_001_CIN() runs on CseTester system CseSystem {
							// Local variables
                
						f_CSE_DMR_DEL_001(int4, m_createContentInstanceBase);//ContentInstance
					};	
                
                	function f_CSE_DMR_DEL_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on CseTester {
                		// Local variables
                		var MsgIn v_response;
                		var RequestPrimitive v_request;
                		var integer v_aeIndex := -1;
						var integer v_parentIndex := -1;
						var integer v_containerIndex := -1;
                		var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
                							   
                		// Test control
                
                		// Test component configuration
                		f_cf01Up();
                
                		// Test adapter configuration
                
                		// Preamble
                		v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi)
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
                		
						if(p_resourceType == int4) {
							v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
							v_parentIndex := v_containerIndex;
						}else{
							v_parentIndex := v_aeIndex;
						}
                												
                		v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex); 				
                												
                		// Test Body
                		v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
                		
                		mcaPort.send(m_request(v_request));
                		tc_ac.start;
                		alt {
                			[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
                				tc_ac.stop;
                				setverdict(pass, __SCOPE__ & ": Resource" & int2str(enum2int(p_resourceType)) & " deleted successfully");
                			}
                			[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
                				tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
                			}
                			[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                				tc_ac.stop;
                				setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(p_resourceType)));
                			}
                			[] tc_ac.timeout {
                				setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType)));
                			}
                		}	
                		
						f_checkCseTesterStatus();
    								
						//Check to see if the resource is present or not
						if (f_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){
							setverdict(pass, __SCOPE__ & ":INFO: Resource deleted");
						} else {
							setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted");
						}
                					
                		// Postamble
                		f_cse_postamble_deleteResources();
                		
                		// Tear down
                		f_cf01Down();
                							
                	};//end f_CSE_DMR_DEL_001
                
                };//end of group g_CSE_DMR_DEL_001
                
                group g_CSE_DMR_DEL_002{
                
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to delete the resource TARGET_RESOURCE_ADDRESS without having privileges for the DELETE operation
					 * 
					 */
                	testcase TC_CSE_DMR_DEL_002_CNT() runs on CseTester system CseSystem {
                		// Local variables
                		
						f_CSE_DMR_DEL_002(int3, m_createContainerBase);//Container
                	};
                
                	testcase TC_CSE_DMR_DEL_002_GRP() runs on CseTester system CseSystem {
                		// Local variables
                		
						f_CSE_DMR_DEL_002(int9, m_createGroupBase);//Group
                	};
                
                	testcase TC_CSE_DMR_DEL_002_ACP() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_002(int1, m_createAcpBase);//AccessControlPolicy
                	};
                
                	testcase TC_CSE_DMR_DEL_002_SCH() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_002(int18, m_createScheduleBase);//Schedule
                	};
                
                	testcase TC_CSE_DMR_DEL_002_PCH() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_002(int15, m_createPollingChannelBase);//PollingChannel
                	};
                
                	testcase TC_CSE_DMR_DEL_002_SUB() runs on CseTester system CseSystem {
                			// Local variables
                
						f_CSE_DMR_DEL_002(int23, m_createSubscriptionBase);//Subscription
                	};
                
                
                	function f_CSE_DMR_DEL_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on CseTester {
                		// Local variables
                		var MsgIn v_response;
                		var RequestPrimitive v_request;
						var RequestPrimitive v_updateRequest;
						var integer v_acpAuxIndex := -1;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
						var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63));
						var AccessControlRule v_accessControlRule_2;
						var SetOfAcrs v_setOfArcs;
                							   
                		// Test control
						if(not(PICS_ACP_SUPPORT)) {
							setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
							stop;
						}
                
                		// Test component configuration
                		f_cf01Up();
                
                		// Test adapter configuration
                
                		// Preamble
						v_acpAuxIndex := f_cse_preamble_createAcpAux(-,-);//c_CRDNDi);
                		v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRUNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
                		
						//Update ACP Aux to remove DELETE operation rights to AE, keeping rights of SUPER USER to run postamble
						v_accessControlRule_2 := valueof(m_createAcr({f_getResourceId(vc_resourcesList[v_aeIndex].resource)}, int55));
                		
            			v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2};
						v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -));
						v_updateRequest := f_getUpdateRequestPrimitive(int1, vc_acpAuxIndex, v_updateRequest);
						f_cse_updateResource(v_updateRequest);
						
                		//Adjustments for ACP resource type
                		if(p_resourceType == int1) {
							p_createRequestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_2};//{v_accessControlRule_1,v_accessControlRule_2};
                		} else {
							p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});
                		}
                		
                		//Creation of resource
                		v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); 				
                												
                		// Test Body
                		v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
                		v_request.from_ := f_getOriginator(v_aeIndex);
                		
                		mcaPort.send(m_request(v_request));
                		tc_ac.start;
                		alt {
                			[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
                				tc_ac.stop;
                				setverdict(pass, __SCOPE__ & ": Access denied to delete the resource " & int2str(enum2int(p_resourceType)));
                			}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}                			
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
                				tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error resource deleted without having privileges");
                			}
                			[] tc_ac.timeout {
                				setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType)));
                			}
                		}	
                					
                		f_checkCseTesterStatus();
                		
                		//Check if the resource has been deleted or not
                		if(f_isResourcePresent(v_resourceIndex)) {
                			setverdict(pass, __SCOPE__ & ":INFO: Resource not deleted");
                		} else {
							setverdict(fail, __SCOPE__ & ":INFO: Resource deleted");
                		}
                					
                		// Postamble
						// We are forced to delete the Ae because the delete request in the postamble_deleteResources is sent by Ae itself, witch doesn't have privileges
						f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE
						
						f_cse_postamble_deleteResources();
                		
                		// Tear down
                		f_cf01Down();
                							
                	};//end f_CSE_DMR_DEL_002
                	
                };//end of group g_CSE_DMR_DEL_002
                
                group g_CSE_DMR_DEL_003{
                	
					/**
					 * @desc Check that the IUT responds with an error when the AE tries to delete the resource TARGET_RESOURCE_ADDRESS which does not exist
					 * 
					 */
                	testcase TC_CSE_DMR_DEL_003() runs on CseTester system CseSystem {
                	
                		// Local variables
                		var MsgIn v_response;
                		var RequestPrimitive v_request;
                		var integer v_aeIndex := -1;
                		var charstring v_resourceIdOrName := "NotExistingResource";
                							   
                		// Test control
                
                		// Test component configuration
                		f_cf01Up();
                
                		// Test adapter configuration
                
                		// Preamble
                		v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 				
                												
                		// Test Body
						if(vc_addressingMethod == e_nonHierarchical and (vc_primitiveScope == e_cseRelative)) {
							v_request := valueof(m_delete(v_resourceIdOrName, f_getOriginator(v_aeIndex)));
						} else {
							v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex) & "/" & v_resourceIdOrName, f_getOriginator(v_aeIndex)));
						}
                		
                		mcaPort.send(m_request(v_request));
                		tc_ac.start;
                		alt {
                			[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
                				tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Unexisting resource cannot be deleted");
                			}
                			[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                				tc_ac.stop;
                				setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource");
                			}
                			[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
                				tc_ac.stop;
                				setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource");
                			}
                			[] tc_ac.timeout {
                				setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
                			}
                		}		
                					
                		// Postamble
                		f_cse_postamble_deleteResources();
                		
                		// Tear down
                		f_cf01Down();
                							
                	};//end f_CSE_DMR_DEL003
                };//end of group g_CSE_DMR_DEL_003
                
                group g_CSE_DMR_DEL_004{
                	
					/**
					 * @desc Check that the IUT responds with an error when AE tries to delete a child resource of a RESOURCE_TYPE resource when this resource has been already deleted
					 * 
					 */
                	testcase TC_CSE_DMR_DEL_004_CNT() runs on CseTester system CseSystem {
                		// Local variables
                		
						f_CSE_DMR_DEL_004(int3, m_createContainerBase, int3, m_createContainerBase);//Container
                	};
                
                	testcase TC_CSE_DMR_DEL_004_GRP() runs on CseTester system CseSystem {
                		// Local variables
                		
						f_CSE_DMR_DEL_004(int9, m_createGroupBase, int23, m_createSubscriptionBase);//Group
                	};
                
                	testcase TC_CSE_DMR_DEL_004_ACP() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_004(int1, m_createAcpBase, int23, m_createSubscriptionBase);//AccessControlPolicy
                	};
                
                	testcase TC_CSE_DMR_DEL_004_SCH() runs on CseTester system CseSystem {
                		// Local variables
                
						f_CSE_DMR_DEL_004(int18, m_createScheduleBase, int23, m_createSubscriptionBase);//Schedule
                	};
                
                	testcase TC_CSE_DMR_DEL_004_PCH() runs on CseTester system CseSystem {
                		// Local variables
                		// don't exist pollingChannel's child resource
                		//f_CSE_DMR_DEL_004(int15, m_createPollingChannelBase, int23, m_createSubscriptionBase);//PollingChannel  TODO ResourceType needed is PollingChannelURI
                	};
                
                	testcase TC_CSE_DMR_DEL_004_SUB() runs on CseTester system CseSystem {
                			// Local variables
                
						f_CSE_DMR_DEL_004(int23, m_createSubscriptionBase, int18, m_createScheduleBase);//Subscription
                	};	
                
                
                	function f_CSE_DMR_DEL_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_createRequestPrimitiveChildResource) runs on CseTester {
                		// Local variables
                		var MsgIn v_response;
                		var integer v_aeIndex := -1;
                		var integer v_resourceIndex := -1;
                		var integer v_childResourceIndex := -1;
						var CseTester v_notifyHandler;
						var integer v_ae2Index := -1;
                							   
                		// Test control
                
                		// Test component configuration
                		f_cf01Up();
                
                		// Test adapter configuration
                
                		// Preamble
                		v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
						
                		v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); 
                
                		v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); 
                												
                		f_cse_deleteResource(v_resourceIndex);
                		
                		// Test Body
                		mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex))));
                
                		tc_ac.start;
                		alt {
                			[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
                				tc_ac.stop;
                				setverdict(pass, __SCOPE__ & ": Error while deleting non existing resource");
                			}
                			[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                				tc_ac.stop;
                				setverdict(fail, __SCOPE__ & ": Wrong response status code");
                			}
                			[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
                				tc_ac.stop;
                				setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource");
                			}
                			[] tc_ac.timeout {
                				setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
                			}
                		}		
                					
                		// Postamble
                		f_cse_postamble_deleteResources();
                		
                		// Tear down
                		f_cf01Down();
                						
                	};//end f_CSE_DMR_DEL_004
				};//end of group g_CSE_DMR_DEL_004

				group g_CSE_DMR_DEL_005{

					/**
					 * @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted
					 * 
					 */
            		testcase TC_CSE_DMR_DEL_005() runs on CseTester system CseSystem {
            			// Local variables
            			var MsgIn v_response;
            			var RequestPrimitive v_request;
            			var integer v_aeIndex := -1;
            			var integer v_resourceIndex := -1;
            			var integer v_childResourceIndex := -1; 
            			const ResourceType c_containerResourceType := int3;          			
            					   
            			// Test control
            
            			// Test component configuration
            			f_cf01Up();
            
            			// Test adapter configuration
            
            			// Preamble
            			v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
            			v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); 
            			
            			if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) {
            				
            				v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); 
            				
            				// Test Body
            				v_request := valueof(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)));
            	
            				mcaPort.send(m_request(v_request));
            				tc_ac.start;
            				alt {
            					[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
            						tc_ac.stop;
            						setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully");
            					}
            					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
            						tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
            					}
            					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
            						tc_ac.stop;
            						setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
            					}
            					[] tc_ac.timeout {
            						setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
            					}
            				}
            	
            	
            	
            				mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
            
            				tc_ac.start;
            				alt {
            					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
            						tc_ac.stop;
            						if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete)
            							setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");	
            						}
            						else{
            							setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
            						}
            					}
            					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
            						tc_ac.stop;
            						setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
            					}
            					[] tc_ac.timeout {
            						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
            					}
            				}	
            					
            			}//end if
            			else{
            				setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
            			}
            			
            			// Postamble
            			f_cse_postamble_deleteResources();
            
            			// Tear down
            			f_cf01Down();
            				
            		}//end f_CSE_DMR_DEL_005
            	} // end group g_CSE_DMR_DEL_005
            	
				group g_CSE_DMR_DEL_006{

					/**
					 * @desc Check that the IUT decreases the field value of attribute currentNrOfInstances and currentByteSize of parent container when a latest contentInstance resource is deleted successfully
					 * 
					 */
					testcase TC_CSE_DMR_DEL_006() runs on CseTester system CseSystem {
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex := -1; 
						var PrimitiveContent v_attributesContainer, v_attributesContainer_afterDeletion;
								   
						// Test control
            
						// Test component configuration
						f_cf01Up();
            
						// Test adapter configuration
            
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
						
						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); 
						
						v_attributesContainer := f_cse_retrieveResource(v_containerIndex);
            			
						if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) {
							setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty");
							f_checkCseTesterStatus();
						}
							
						// Test Body
						f_cse_deleteResource(v_contentInstanceIndex);
					
						v_attributesContainer_afterDeletion := f_cse_retrieveResource(v_containerIndex);
						
						if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) {
							setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty");
							f_checkCseTesterStatus();
						}
						
						if((v_attributesContainer.container.currentNrOfInstances > v_attributesContainer_afterDeletion.container.currentNrOfInstances) and
							(v_attributesContainer.container.currentByteSize > v_attributesContainer_afterDeletion.container.currentByteSize)) {
							setverdict(pass, __SCOPE__ & ": The currentNrOfInstances and currentByteSize attributes are decreased");
						} else {
							setverdict(fail, __SCOPE__ & ": currentNrOfInstances and/or currentByteSize attributes are not decreased");
						}
							
						// Postamble
						f_cse_postamble_deleteResources();
            
						// Tear down
						f_cf01Down();
            				
					}//end f_CSE_DMR_DEL_006
				} // end group g_CSE_DMR_DEL_006
				
				group g_CSE_DMR_DEL_007{

					/**
					 * @desc Check that the IUT accepts the DELETE Request of the latest contentInstance resource target to a container resource
					 * 
					 */
					testcase TC_CSE_DMR_DEL_007() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex_1 := -1;
						var integer v_contentInstanceIndex_2 := -1; 
						const ResourceType c_containerResourceType := int3;
								   
						// Test control
            
						// Test component configuration
						f_cf01Up();
            
						// Test adapter configuration
            
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
						
						v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); 
						v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex);
							
						// Test Body
						v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)));
            	
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
							}
						}
						
						f_checkCseTesterStatus();
			       		            	
						mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_2)), f_getOriginator(v_contentInstanceIndex_2))));
					            
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has already been deleted");	
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Error while retrieving resource attributes as" & int2str(enum2int(c_containerResourceType)) & " has been deleted");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
							}
						}
					    
						// Postamble
						f_cse_postamble_deleteResources();
            
						// Tear down
						f_cf01Down();
            				
					}//end f_CSE_DMR_DEL_007
				} // end group g_CSE_DMR_DEL_007
				
				group g_CSE_DMR_DEL_008{

					/**
					 * @desc Check that the IUT rejects the DELETE  request of a latest resource in a container resource that has no direct child contentInstance resources.
					 * 
					 */
					testcase TC_CSE_DMR_DEL_008() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						const ResourceType c_containerResourceType := int4; 
						
								   
						// Test control
            
						// Test component configuration
						f_cf01Up();
            
						// Test adapter configuration
            
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
							
						// Test Body
						v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)));
						mcaPort.send(m_request(v_request));
					    tc_ac.start;
						alt {
						    	[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Resource type  " & int2str(enum2int(c_containerResourceType)) & " NOT FOUND");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Resource type  " & int2str(enum2int(c_containerResourceType)) & " has not been created");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
								}
							}					    
						
						// Postamble
						f_cse_postamble_deleteResources();
            
						// Tear down
						f_cf01Down();
            				
					}//end f_CSE_DMR_DEL_008
				} // end group g_CSE_DMR_DEL_008
				
				group g_CSE_DMR_DEL_009{

					/**
					 * @desc Check that the IUT accepts the DELETE Request of the oldest contentInstance resource target to a container resource
					 * 
					 */
					testcase TC_CSE_DMR_DEL_009() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						var integer v_contentInstanceIndex_1 := -1;
						var integer v_contentInstanceIndex_2 := -1; 
						const ResourceType c_containerResourceType := int3;
								   
						// Test control
            
						// Test component configuration
						f_cf01Up();
            
						// Test adapter configuration
            
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
						
						v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); 
						v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex);
							
						// Test Body
						v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)));
            	
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
						  	    [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								    tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
								}
						   }
						   
						f_checkCseTesterStatus();
						   
						mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_1)), f_getOriginator(v_contentInstanceIndex_1))));
					            
						tc_ac.start;
						alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
						 		   tc_ac.stop;
								   setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has already been deleted");	
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								   tc_ac.stop;
							 	   setverdict(pass, __SCOPE__ & ": Error while retrieving resource attributes as " & int2str(enum2int(c_containerResourceType)) & " has been deleted");
								}
								[] tc_ac.timeout {
								   setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
								}
							}
							
						// Postamble
						f_cse_postamble_deleteResources();
            
						// Tear down
						f_cf01Down();
            				
					}//end f_CSE_DMR_DEL_009
				} // end group g_CSE_DMR_DEL_009
				
				group g_CSE_DMR_DEL_010{

					/**
					 * @desc Check that the IUT rejects the DELETE  request of a oldest resource in a container resource that has no direct child contentInstance resources.
					 * 
					 */
					testcase TC_CSE_DMR_DEL_010() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_containerIndex := -1;
						const ResourceType c_containerResourceType := int4; 
						
								   
						// Test control
            
						// Test component configuration
						f_cf01Up();
            
						// Test adapter configuration
            
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						
						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
							
						// Test Body
						v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)));
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " NOT FOUND");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
							    [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has not been created");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
								}
							}					    
						
						// Postamble
						f_cse_postamble_deleteResources();
            
						// Tear down
						f_cf01Down();	
					}//end f_CSE_DMR_DEL_010
				} // end group g_CSE_DMR_DEL_010
				
			}//end group Delete
			
		}//end group Data_Management_and_Repository
		
		group Location {
		  		    
		  	group g_CSE_LOC_BV_001{  		    
		    
     	     testcase TC_CSE_LOC_BV_001() runs on CseTester system CseSystem {
     	    	
     	    	var integer v_aeIndex := -1;	
     	     	var RequestPrimitive v_request;
     	     	var MsgIn v_response;
     	     	var LocationSource v_locationSource := int1;//Network-based
     	     	
     	     	//Test component configuration
     	     	f_cf01Up();
     	     	
     	     	//Preamble
     	     	v_aeIndex := f_cse_preamble_registerAe();
     	     	     	     	
     	     	//Set requestPrimitive
     	     	v_request	 := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, omit, omit, omit), v_aeIndex);
     	     	
     	     	//Test Body
     	     	mcaPort.send(m_request(v_request));
     	    	tc_ac.start;
     	    	alt{
     	    	  [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { //BAD REQUEST
     	    	    tc_ac.stop;
     	    	    setverdict(pass, __SCOPE__ & "Resource <locationPolicy> create request is rejected due to invalid request body message!!");     	    	    
     	    	  }
     	    	  [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
     	    	    tc_ac.stop;
    				setverdict(fail, __SCOPE__ & ": Wrong response status code");     	    	    
     	    	  }
     	    	   [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
     	    	    tc_ac.stop;
    				setverdict(fail, __SCOPE__ & ": Created a locationPolicy resource for an invalid create request with response status code:" & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));     	    	    
     	    	  } 
     	    	  [] tc_ac.timeout {
    					setverdict(fail, __SCOPE__ & ": Timeout due to no response received from requested server!");
    			  }   	    	  
     	    	      	    	  
     	    	}
     	    	
				f_checkCseTesterStatus();
    					
				//Check to see if the resource is NOT present
				if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
				  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
				} else {
				  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
				}
				
     	    	// Postamble
    			f_cse_postamble_deleteResources();	
    			
				// Tear down
				f_cf01Down();
     	    
     	    }// end testcase TC_CSE_LOC_BV_001
		}//end group g_CSE_LOC_BV_001
			
			
		group g_CSE_LOC_BV_002{  	    
		    testcase TC_CSE_LOC_BV_002() runs on CseTester system CseSystem {
				
				var integer v_aeAuxIndex 				:= -1;				
				var LocationSource v_locationSource		:= int1;//Network-based	
				var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};  
				var XSD.Token locationTargetID			:= PX_LOCATION_TARGET_ID;
				var XSD.AnyURI locationServerAddress	:= PX_LOCATION_SERVER_ADDRESS;
				var RequestPrimitive v_request;
				var MsgIn v_response;
				var integer v_resourceIndex := -1;
     	     	
     	     	//Test component configuration
     	     	f_cf01Up();
     	     	
     	     	//Preamble
     	     	v_aeAuxIndex := f_cse_preamble_registerAe();
     	     	     	     	
     	     	//Set requestPrimitive
     	     	v_request	 := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeAuxIndex);
     	     	    									
    			// Test Body					
    			mcaPort.send(m_request(v_request));
    			tc_ac.start;
    			alt {
    				[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
    					tc_ac.stop;
    					setverdict(pass, __SCOPE__ & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!");
						v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex);
    				}
    				[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
    					tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
    				}
    				[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
    					tc_ac.stop;
    					setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!");
    				}
    				[] tc_ac.timeout {
    					setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!");
    				}
    			}	
    								
				f_checkCseTesterStatus();
    						
				//Check to see if the resource is present or not
				if(f_isResourcePresent(v_resourceIndex)) {
					setverdict(pass, __SCOPE__ & ":INFO: Resource created");
				} else {
					setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
				}
    								
    			// Postamble
    			f_cse_postamble_deleteResources();	
    			
				// Tear down
				f_cf01Down();                        
				
			 }// end testcase TC_CSE_LOC_BV_002	
			
	    }//end group g_CSE_LOC_BV_002
	
			  
		  group g_CSE_LOC_BO_003{
		    
		    testcase TC_CSE_LOC_BO_003() runs on CseTester system CseSystem {//the originator has no privileges to create a locationPolicy resource!!
		      	
		      	var integer v_aeIndex 				:= -1;
		      	var integer v_acpAuxIndex 				:= -1;
		      	var LocationSource v_locationSource		:= int1;//Network-based
				var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};      
				var XSD.Token locationTargetID			:= PX_LOCATION_TARGET_ID;
				var XSD.AnyURI locationServerAddress	:= PX_LOCATION_SERVER_ADDRESS;
				var RequestPrimitive v_request;	
				var MsgIn v_response;
				
				// Test control
                if(not(PICS_ACP_SUPPORT)) {
                	setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
                	stop;
                }
				     	     	
     	     	//Test component configuration
     	     	f_cf01Up();
     	     	
     	     	//Preamble
				v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) //No resource creation privilege
							
				v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);
						     	     	
     	     	//Set requestPrimitive
     	     	v_request				:= f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource,omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeIndex);
     	        									
    			// Test Body					
    			mcaPort.send(m_request(v_request));
    			tc_ac.start;
    			alt {
    				[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
    					tc_ac.stop;
    					setverdict(pass, __SCOPE__ & ": Access denied to create a resource including locationPolicy!");
    				}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
    				[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
    					tc_ac.stop;
    					setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to check the access privilege of originator!");
    				}
    				[] tc_ac.timeout {
    					setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!");
    				}
    			}
    								
				f_checkCseTesterStatus();
    					
				//Check to see if the resource is NOT present
				if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
				  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
				} else {
				  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
				}
    								
    			// Postamble
    			f_cse_postamble_deleteResources();	
    			
				// Tear down
				f_cf01Down();				
		      
		      
		    } // end testcase TC_CSE_LOC_BO_003
		    
		}//end group g_CSE_LOC_BO_003
		    
		group g_CSE_LOC_BO_004{  	
		    testcase TC_CSE_LOC_BO_004() runs on CseTester system CseSystem {
		      	
		      	var integer v_aeIndex 				:= -1;
		      	var LocationSource v_locationSource		:= int1;//Netwok-based		        
				var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};   
				var XSD.Token locationTargetID			:= PX_LOCATION_TARGET_ID;
				var XSD.AnyURI locationServerAddress	:= PX_LOCATION_SERVER_ADDRESS;
				var RequestPrimitive v_request;
				var MsgIn v_response;
								    				
    			//Test component configuration
     	     	f_cf01Up();
     	     	
     	     	//Preamble
     	     	v_aeIndex 	:= f_cse_preamble_registerAe();
     	     	
     	     	//Set requestPrimitive
     	     	v_request		:= f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeIndex);
     	    							
    			// Test Body					
    			mcaPort.send(m_request(v_request));
    			tc_ac.start;
    			alt {
    				[] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response {
    					tc_ac.stop;
    					setverdict(pass, __SCOPE__ & ": The targeted resource is not found!!");
    				}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
    				[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
    					tc_ac.stop;
    					setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT created a locationPolicy resource under a non-existed parent resource!");
    				}
    				[] tc_ac.timeout {
    					setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!");
    				}
    			}	
    								
				f_checkCseTesterStatus();
    					
				//Check to see if the resource is NOT present
				if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
				  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
				} else {
				  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
				}				
    			// Postamble
    			f_cse_postamble_deleteResources();	
    			
				// Tear down
				f_cf01Down();
				
		    }// end testcase TC_CSE_LOC_BO_004
		    
		  }//end group g_CSE_LOC_BO_004
		
		  
		  group g_CSE_LOC_BI_005{
		    
		    testcase TC_CSE_LOC_BI_005() runs on CseTester system CseSystem {//reject an invalid update request with invalid attribtue locationUpdatePeriod
		      
		      	var integer v_aeAuxIndex 						:= -1;
		      	var integer v_locPolicyResourceIndex			:= -1;
		      	var LocationSource v_locationSource				:= int1;//Netwok-based	
				var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};    	      	
				var XSD.Duration locationUpdatePeriod_invalid 	:= c_invalid_location_update_period;				 
				var XSD.Token locationTargetID					:= PX_LOCATION_TARGET_ID;
				var XSD.AnyURI locationServerAddress			:= PX_LOCATION_SERVER_ADDRESS;
				var RequestPrimitive v_request;
				var RequestPrimitive v_locpolicy_request_preamble;
				var MsgIn v_response;
								    				
    			//Test component configuration
     	     	f_cf01Up();
     	     	
     	     	//Preamble - register AE
     	     	v_aeAuxIndex 				:= f_cse_preamble_registerAe();
     	     	//Preamble - create a valid locationPolicy resource for later update use
     	     	v_locpolicy_request_preamble:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress));
     	     	v_locPolicyResourceIndex	:= f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);     	     	
     	     	
     	     	//Set requestPrimitive
     	     	v_request					:= f_getUpdateRequestPrimitive(int10, v_locPolicyResourceIndex, m_updateLocationPolicy(f_getResourceAddress(v_locPolicyResourceIndex), omit, locationUpdatePeriod_invalid));
     	     	    									
    			// Test Body					
    			mcaPort.send(m_request(v_request));
    			tc_ac.start;
    			alt {
    				[] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response {
    					tc_ac.stop;
    					setverdict(pass, __SCOPE__ & ": Update locationPolicy resource is rejected!!");
    				}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
    				[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
    					tc_ac.stop;
    					setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to handle an invalid locationPolicy update request");
    				}
    				[] tc_ac.timeout {
    					setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!");
    				}
    			}	
    								
				f_checkCseTesterStatus();
    						
				//TODO: Check to see if the resource has been updated or not
				
    			// Postamble
    			f_cse_postamble_deleteResources();	 
    			
				// Tear down
				f_cf01Down();      
		      
		    }//end testcase TC_CSE_LOC_BI_005
		    
		  }//end group g_CSE_LOC_BI_005
		  
		  group g_CSE_LOC_BV_006 {
		  
		    testcase TC_CSE_LOC_BV_006() runs on CseTester system CseSystem{
		      //TO RETRIEVE a <container> resource that has created in cse and linked with a <locationPolicy> resource (network-based case)
		     
		      var integer v_aeAuxIndex				    :=	-1;
		      var integer v_locPolicyResourceIndex	    := 	-1;
		      var integer v_locContainerResourceIndex	:= 	-1;
			  var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};  
			  var XSD.Token locationTargetID			:= PX_LOCATION_TARGET_ID;
			  var XSD.AnyURI locationServerAddress	    := PX_LOCATION_SERVER_ADDRESS;
		      var RequestPrimitive v_loc_request_preamble;
		      var RequestPrimitive v_container_request_preamble;
		      var MsgIn v_response;
		      var LocationSource v_locationSource := int1;//Network-based      
		      
		 	  //Test component configuration
		 	  f_cf01Up();
		 	  
		 	  //Preamble - register AE
		 	  v_aeAuxIndex				:= f_cse_preamble_registerAe();
		 	  //Preamble - create a valid locationPolicy resource for later container resource creation
		 	  v_loc_request_preamble		:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress));
		 	  v_container_request_preamble	:= valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided?
		      v_locPolicyResourceIndex	:= f_cse_createResource(int10, v_loc_request_preamble, v_aeAuxIndex);//created locationpolicy index
			  v_locContainerResourceIndex	:= f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index
			  			  	
			  //Test Body - retrieve the created container resource
		      mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex), f_getOriginator(v_locContainerResourceIndex))))); 
		      tc_ac.start;
		      alt{
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{
		          tc_ac.stop;
		          if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.locationID)){		            
		            	setverdict(fail, __SCOPE__ & "No locationID is included in the response!");
		          }else{
		            	setverdict(pass, __SCOPE__ & "Container resource associated with locationPolicy resource is successfully retrieved with locationID included in the response!");		            
		          }		          
		          
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{
		          		tc_ac.stop;
		          		setverdict(fail, __SCOPE__ & "Requested container resource is not found!");
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource!");
				}
				[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!");
				}
		        
		      }
		      
			  f_checkCseTesterStatus();
    									  
		      // Postamble
    			f_cse_postamble_deleteResources();	 
    			
				// Tear down
				f_cf01Down(); 		      
		      
		    }//end testcase TC_CSE_LOC_BV_006 		    
		    
		  }//end group g_CSE_LOC_BV_006
		  		 
		  group g_CSE_LOC_BV_007 {
		    
		    testcase TC_CSE_LOC_BV_007() runs on CseTester system CseSystem{
		      //TO create a <locationPolicy> resource with locationSource set to Device-based
		     
		       var integer v_aeAuxIndex 					:= -1;	
			   var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};  
				var RequestPrimitive v_request;
				var MsgIn v_response;
     	     	var LocationSource v_locationSource		:= int2;//Device-based
				var integer v_resourceIndex := -1;
     	     	//Test component configuration
     	     	f_cf01Up();
     	     	
     	     	
     	     	if(PX_IUT_IS_ASN_CSE){
     	     	  
     	     	    //Preamble
     	     		v_aeAuxIndex := f_cse_preamble_registerAe();
     	     		//Set requestPrimitive
     	     		v_request	  := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, omit, omit), v_aeAuxIndex);
				   									
          			// Test Body					
          			mcaPort.send(m_request(v_request));
          			tc_ac.start;
          			alt {
          				[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
          					tc_ac.stop;
          					setverdict(pass, __SCOPE__ & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!");
							v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex);
          				}
          				[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
          					tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
          				}
          				[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
          					tc_ac.stop;
          					setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!");
          				}
          				[] tc_ac.timeout {
          					setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!");
          				}
          			}	
      		      
					f_checkCseTesterStatus();
    						
					//Check to see if the resource is present or not
					if(f_isResourcePresent(v_resourceIndex)) {
						setverdict(pass, __SCOPE__ & ":INFO: Resource created");
					} else {
						setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
					}
      		      
      		      // Postamble
          			f_cse_postamble_deleteResources();	 
    				
     	     	} 
				// Tear down
				f_cf01Down(); 		      
		      
		    }//end testcase TC_CSE_LOC_BV_007
		    
		  }//end group g_CSE_LOC_BV_007
		  		
		 group g_CSE_LOC_BV_008 {
		    
		    testcase TC_CSE_LOC_BV_008() runs on CseTester system CseSystem{
		      //TO create a <locationPolicy> resource with locationSource set to Share-based
		     
		       var integer v_aeAuxIndex 				:= -1;	 
		       var LocationSource v_locationSource		:= int3;//Share-based
				var RequestPrimitive v_request;
				var MsgIn v_response;
				var integer v_resourceIndex := -1;
     	     	
     	     	//Test component configuration
     	     	f_cf01Up();
     	     	
     	     	
     	     	if(PX_IUT_IS_MN_CSE){
     	     	      	     	    
     	     	    //Preamble
     	     		v_aeAuxIndex := f_cse_preamble_registerAe();
     	     		//Set requestPrimitive
     	     		v_request	  := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, omit, omit, omit), v_aeAuxIndex);
				  									
        			// Test Body					
        			mcaPort.send(m_request(v_request));
        			tc_ac.start;
        			alt {
        				[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
        					tc_ac.stop;
        					setverdict(pass, __SCOPE__ & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!");
							v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex);
        				}
        				[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
        					tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
        				}
        				[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
        					tc_ac.stop;
        					setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!");
        				}
        				[] tc_ac.timeout {
        					setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!");
        				}
        			}	
    		      
					f_checkCseTesterStatus();
    						
					//Check to see if the resource is present or not
					if(f_isResourcePresent(v_resourceIndex)) {
						setverdict(pass, __SCOPE__ & ":INFO: Resource created");
					} else {
						setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
					}
    		      
    		      // Postamble
        			f_cse_postamble_deleteResources();	 
    				
     	     	}  
				// Tear down
				f_cf01Down(); 		      
		      
		    }//end testcase TC_CSE_LOC_BV_008
		    
		  }//end group g_CSE_LOC_BV_008
		 		 		
		 group g_CSE_LOC_BV_009 {
		    
		    testcase TC_CSE_LOC_BV_009_01() runs on CseTester system CseSystem{
		      //TO NOTIFY a location information 
		     
		      var integer v_aeAuxIndex					:=	-1;
		      var integer v_locPolicyResourceIndex		:= 	-1;
		      var integer v_locContainerResourceIndex	:=	-1;
		      var integer v_subscriptionResourceIndex	:= 	-1;
		      var LocationSource v_locationSource	:= int1;//Netwok-based
			  var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};  
			  var XSD.Token locationTargetID			:= PX_LOCATION_TARGET_ID;
			  var XSD.AnyURI locationServerAddress	    := PX_LOCATION_SERVER_ADDRESS;
		      var RequestPrimitive v_locpolicy_request_preamble;
		      var RequestPrimitive v_container_request_preamble;
		      var RequestPrimitive v_subscription_request_preamble;
		      var MsgIn v_response;
		      		      
		 	  //Test component configuration
		 	  f_cf01Up();
		 	  
		 	  //Preamble - register AE
				v_aeAuxIndex						:= f_cse_preamble_registerAe();
		 	  //Preamble - create a valid locationPolicy resource 
		 	  	v_locpolicy_request_preamble		:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress));
		 	  	v_container_request_preamble		:= valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided?
		 	  	
		 	  	v_locPolicyResourceIndex			:= f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index
			  	v_locContainerResourceIndex		:= f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index
			    v_subscription_request_preamble	:= valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -));
				v_subscriptionResourceIndex		:= f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex);
				
			  //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource
			  mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex)))));
		      tc_ac.start;
		      alt{
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{
		          tc_ac.stop;
		          if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){		            
		            	setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!");
		          }else{
		            	setverdict(pass, __SCOPE__ & "Location information is successfully sent!");		            
		          }		          
		          
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{
		          		tc_ac.stop;
		          		setverdict(fail, __SCOPE__ & "Requested container resource is not found!");
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource!");
				}
				[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!");
				}		        
		      }
		      
		      // Postamble
    		  f_cse_postamble_deleteResources();	 
    			
			  // Tear down
			  f_cf01Down(); 		      
		      
		    }//end testcase TC_CSE_LOC_BV_009_01
		    
		    testcase TC_CSE_LOC_BV_009_02() runs on CseTester system CseSystem{
		      //TO NOTIFY a location information 
		     
		      var integer v_aeAuxIndex					:=	-1;
		      var integer v_locPolicyResourceIndex		:= 	-1;
		      var integer v_locContainerResourceIndex	:=	-1;
		      var integer v_subscriptionResourceIndex	:= 	-1;
		      var LocationSource v_locationSource	    := int2;//Device-based
			  var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};  
		      var RequestPrimitive v_locpolicy_request_preamble;
		      var RequestPrimitive v_container_request_preamble;
		      var RequestPrimitive v_subscription_request_preamble;
		      var MsgIn v_response;
		      		      
		 	  //Test component configuration
		 	  f_cf01Up();
		 	  
		 	  //Preamble - register AE
				v_aeAuxIndex						:= f_cse_preamble_registerAe();
		 	  //Preamble - create a valid locationPolicy resource
		 	  	 
		 	  	v_locpolicy_request_preamble		:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, omit, omit));
		 	  	v_container_request_preamble		:= valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided?
		 	  	
		 	  	v_locPolicyResourceIndex			:= f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index
			  	v_locContainerResourceIndex		:= f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index
			    v_subscription_request_preamble	:= valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -));
				v_subscriptionResourceIndex		:= f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex);
				
			  //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource
			  mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex)))));
		      tc_ac.start;
		      alt{
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{
		          tc_ac.stop;
		          if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){		            
		            	setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!");
		          }else{
		            	setverdict(pass, __SCOPE__ & "Location information is successfully sent!");		            
		          }		          
		          
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{
		          		tc_ac.stop;
		          		setverdict(fail, __SCOPE__ & "Requested container resource is not found!");
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource!");
				}
				[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!");
				}		        
		      }
		      
		      // Postamble
    		  f_cse_postamble_deleteResources();	 
    			
			  // Tear down
			  f_cf01Down(); 		      
		      
		    }//end testcase TC_CSE_LOC_BV_009_02 		    
		    
		    testcase TC_CSE_LOC_BV_009_03() runs on CseTester system CseSystem{
		      //TO NOTIFY a location information 
		     
		      var integer v_aeAuxIndex					:=	-1;
		      var integer v_locPolicyResourceIndex		:= 	-1;
		      var integer v_locContainerResourceIndex	:=	-1;
		      var integer v_subscriptionResourceIndex	:= 	-1;
		      var LocationSource v_locationSource	:= int3;//Sharing-based
		      var RequestPrimitive v_locpolicy_request_preamble;
		      var RequestPrimitive v_container_request_preamble;
		      var RequestPrimitive v_subscription_request_preamble;
		      var MsgIn v_response;
		      		      
		 	  //Test component configuration
		 	  f_cf01Up();
		 	  
		 	  //Preamble - register AE
				v_aeAuxIndex						:= f_cse_preamble_registerAe();
		 	  //Preamble - create a valid locationPolicy resource
		 	  	 
		 	  	v_locpolicy_request_preamble		:= valueof(m_createLocationPolicy(v_locationSource, omit, omit, omit, omit));
		 	  	v_container_request_preamble		:= valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided?
		 	  	
		 	  	v_locPolicyResourceIndex			:= f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index
			  	v_locContainerResourceIndex		:= f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index
			    v_subscription_request_preamble	:= valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -));
				v_subscriptionResourceIndex		:= f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex);
				
			  //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource
			  mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex)))));
		      tc_ac.start;
		      alt{
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{
		          tc_ac.stop;
		          if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){		            
		            	setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!");
		          }else{
		            	setverdict(pass, __SCOPE__ & "Location information is successfully sent!");		            
		          }		          
		          
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{
		          		tc_ac.stop;
		          		setverdict(fail, __SCOPE__ & "Requested container resource is not found!");
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource!");
				}
				[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!");
				}		        
		      }
		      
		      // Postamble
    		  f_cse_postamble_deleteResources();	 
    			
			  // Tear down
			  f_cf01Down(); 		      
		      
		    }//end testcase TC_CSE_LOC_BV_009_03 
		  }//end group g_CSE_LOC_BV_009
		  
		  /*group g_CSE_LOC_BV_007 {
    		  testcase TC_CSE_LOC_BV_007() runs on CseTester system CseSystem{		    
    		    //TODO
    		  }//end testcase TC_CSE_LOC_BV_007
		  }//end group g_CSE_LOC_BV_007
		  
		  group g_CSE_LOC_BV_008 {
    		  testcase TC_CSE_LOC_BV_008() runs on CseTester system CseSystem{		    
    		    //TODO
    		  }//end testcase TC_CSE_LOC_BV_008
		  }//end group g_CSE_LOC_BV_008
		  */

		  group g_CSE_LOC_BV_012 {
    		  testcase TC_CSE_LOC_BV_012() runs on CseTester system CseSystem{		    
    		    //To CREATE a <subscription> resource as a child resource of the created <container> 
    		    
        		  var integer v_aeAuxIndex					:=	-1;
    		      var integer v_locPolicyResourceIndex		:= 	-1;
    		      var integer v_locContainerResourceIndex	:=	-1;
    		      var LocationSource v_locationSource		:= int1;//Netwok-based
				  var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};  
			 	  var XSD.Token locationTargetID			:= PX_LOCATION_TARGET_ID;
			      var XSD.AnyURI locationServerAddress	    := PX_LOCATION_SERVER_ADDRESS;
    		      var RequestPrimitive v_locpolicy_request_preamble;
    		      var RequestPrimitive v_container_request_preamble;
    		      var RequestPrimitive v_subscription_request_preamble;
    		      var MsgIn v_response;
    		      		      
    		 	  //Test component configuration
    		 	  f_cf01Up();
    		 	  
    		 	  //Preamble - register AE
    				v_aeAuxIndex						:= f_cse_preamble_registerAe();
    		 	  //Preamble - create a valid locationPolicy resource 
    		 	  	v_locpolicy_request_preamble		:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress));
    		 	  	v_container_request_preamble		:= valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided?
    		 	  	
    		 	  	v_locPolicyResourceIndex			:= f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index
    			  	v_locContainerResourceIndex		:= f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index
    			    v_subscription_request_preamble	:= valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -));
    				    				
    			  //Test Body
    		      mcaPort.send(m_request(valueof(f_getCreateRequestPrimitive(int23, v_subscription_request_preamble, v_locContainerResourceIndex)))); 
    		      tc_ac.start;
    		      alt{
    		        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{
    		          tc_ac.stop;    		         
    		          setverdict(pass, __SCOPE__ & "Subscription resource is successfully!");
    		        }
    		        [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{
    		          tc_ac.stop;    		         
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
    		        }
    		        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response{
    		          		tc_ac.stop;
    		          		setverdict(fail, __SCOPE__ & "Requested container resource is not found!");
    		        }    		        
    				[] tc_ac.timeout {
    						setverdict(fail, __SCOPE__ & ": No answer while creating subscription resource!");
    				}		        
    		      }
    		      
    		      // Postamble
        		  f_cse_postamble_deleteResources();	 
        			
    			  // Tear down
    			  f_cf01Down(); 		
    		    
    		  }//end testcase TC_CSE_LOC_BV_012
		  }//end group g_CSE_LOC_BV_012
		
		  group g_CSE_LOC_BV_013 {
		    
		    testcase TC_CSE_LOC_BV_013() runs on CseTester system CseSystem{
		      //TO RETRIEVE a <locationPolicy> resource that has created in cse
		     
		      var integer v_aeAuxIndex				:=	-1;
		      var integer v_locPolicyResourceIndex	:= 	-1;
		      var RequestPrimitive v_locpolicy_request_preamble;
		      var MsgIn v_response;
		      var LocationSource v_locationSource	:= int1;//Netwok-based
			  var ListOfDuration locationUpdatePeriod 	:= {PX_LOCATION_UPDATE_PERIOD};  
			  var XSD.Token locationTargetID		:= PX_LOCATION_TARGET_ID;
		      var XSD.AnyURI locationServerAddress	:= PX_LOCATION_SERVER_ADDRESS;
		      
		      
		 	  //Test component configuration
		 	  f_cf01Up();
		 	  
		 	  //Preamble - register AE
		 	  v_aeAuxIndex				:= f_cse_preamble_registerAe();
		 	  //Preamble - create a valid locationPolicy resource for later container resource creation
		 	  v_locpolicy_request_preamble		:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress));
		      v_locPolicyResourceIndex	:= f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index
				
			  //Test Body - retrieve the created locationpolicy resource
		      mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locPolicyResourceIndex), f_getOriginator(v_locPolicyResourceIndex))))); 
		      tc_ac.start;
		      alt{
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{
		          tc_ac.stop;
		          if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.locationPolicy.locationContainerID)){		            
		            	setverdict(fail, __SCOPE__ & "No locationContainerID is included in the response!");
		          }else{
		            	setverdict(pass, __SCOPE__ & "LocationPolicy resource is successfully retrieved with locationContainerID included in the response!");		            
		          }		          
		          
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{
		          		tc_ac.stop;
		          		setverdict(fail, __SCOPE__ & "Requested locationPolicy is not found!");
		        }
		        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource!");
				}
				[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!");
				}
		        
		      }
		      
		      // Postamble
    		  f_cse_postamble_deleteResources();	 
    			
			  // Tear down
			  f_cf01Down(); 		      
		      
		    }//end testcase TC_CSE_LOC_BV_013 		    
		    
		  }//end group g_CSE_LOC_BV_013
		  
		  
		}//end group Location
		
        group Group_Managment {
        
            group Create {
                
                /**
                 * @desc Check that the IUT rejects the creation of the group resource when member ID exceed max number of members. 
                 * 
                 */
                testcase TC_CSE_GMG_CRE_001() runs on CseTester system CseSystem {
					// Local constants
					const XSD.NonNegativeInteger c_maxNrOfMembers := 1;
					
                    // Local variables
                    var MsgIn v_response;
                    var integer v_aeIndex := -1;
                    var integer v_containerIndex_1, v_containerIndex_2 := -1;
					var RequestPrimitive v_request;
					var ListOfURIs v_memberIDs;             
                    var template RequestPrimitive v_createRequest;
 
                    //  Test control
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                                        
                    // Preamble
                    v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
                    
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					
					v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
					
					v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, v_memberIDs, omit, int3));
                                
                    // Test Body
					v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);
                
                                                                         
                    mcaPort.send(m_request(v_request));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": Creation failed because member ID exceed max number of member");
                        }
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                            tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Wrong response status code");
                        }
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error resource created while member ID exceed max number of member");
						}
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while creating resource");
                        }
                    }
                                    
					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}
					
                                    
                    // Postamble
                    f_cse_postamble_deleteResources();
                    
					// Tear down
					f_cf01Down();
                    
                }
            
 				/**
				 * @desc Check that the IUT rejects the creation of the group resource when the memberType cannot be retrieved due to lack of privilege.
				 * 
				 */
				testcase TC_CSE_GMG_CRE_002() runs on CseTester system CseSystem {
                	// Local variables
                	var MsgIn v_response;
                	var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
                	var integer v_acpIndex := -1;
					var RequestPrimitive v_request;
					var template RequestPrimitive v_containerCreateRequest := m_createContainerBase;
                	var template RequestPrimitive v_createRequest;
                	var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, int61); //c_CUDNDi
                	
                	// Test control
					if(not(PICS_ACP_SUPPORT)) {
						setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
						stop;
					}
                	
                	// Test component configuration
                	f_cf01Up();
                	
                	// Test adapter configuration
                						
                	// Preamble
					
                	v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
					v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource
					v_containerCreateRequest.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
					v_containerIndex := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource
					
					v_createRequest := m_createGroup(1, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int3);
					v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);	// creating group
                	                		   
                	// Test Body
                	
                	mcaPort.send(m_request(v_request));
                	tc_ac.start;
                	alt {
                		[] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response {
                			tc_ac.stop;
                			setverdict(pass, __SCOPE__ & ": creation failed due to lack of privilege");                            
                		}
                		[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                			tc_ac.stop;
                			setverdict(fail, __SCOPE__ & ": Wrong response status code");
                		}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error creation successful while doesn't have privileges for retrieving resource");
						}
                		[] tc_ac.timeout {
                			setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
                		}
                	}
                					
					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}
									
                	// Postamble
                	f_cse_postamble_deleteResources();
                	
                	// Tear down
                	f_cf01Down();        
                }
                
                /**
                 * @desc 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. 
                 *
                 */
                testcase TC_CSE_GMG_CRE_003() runs on CseTester system CseSystem {                    
                    // Local variables
                    var MsgIn v_response;
                    var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
                    var RequestPrimitive v_createRequest;
                    var XSD.AnyURI v_memberID;
                    
                    // Test control
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                                        
                    // Preamble
                    v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi.
					v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource
					v_memberID :=  f_getResourceId(vc_resourcesList[v_containerIndex].resource);
					v_createRequest := valueof(m_createGroup(2, {v_memberID, v_memberID}, omit, int3));
					v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);
            		
					// Test Body                                              
                    mcaPort.send(m_request(v_createRequest));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": Resource created successfully");
						
                            if(not match({v_memberID}, v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){
								setverdict(fail, __SCOPE__, ": Error, presence of duplicate member IDs ");
                            }
							if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) {
							   setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute");      
							} 
                        }
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                            tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Error while creating resource");
                        }
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while creating resource");
                        }
                    }
                                    
                    // Postamble
                    f_cse_postamble_deleteResources();
                    
					// Tear down
					f_cf01Down();
                    
                }
            				
				/**
				 * @desc Check that the IUT validates the resource type during the creation of the  <group> resource when memberType attribute is not ‘mixed’. 
				 */
	            testcase TC_CSE_GMG_CRE_004() runs on CseTester system CseSystem {
					// Local variables
                    var MsgIn v_response;
					var RequestPrimitive v_createRequest;
                    var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
                
                    // Test control
                    
                    // Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                                        
                    // Preamble
                    v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource
					v_createRequest := valueof(m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int3)); //Member type is set to Container
					v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);
                	
                	// Test Body       
                    mcaPort.send(m_request(v_createRequest));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": Resource created successfully");
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){
                                setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided");
                            }
                            else {
                                if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){
                                    setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct");
                                }
                            }     
                        }
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                            tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Error while creating resource");
                        }
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while creating resource" );
                        }
                    }
                                    
                    // Postamble
                    f_cse_postamble_deleteResources();
                    
					// Tear down
					f_cf01Down();
                                        
                }
            
               /**
                * @desc 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.
                * 
                */
                testcase TC_CSE_GMG_CRE_005() runs on CseTester system CseSystem {
					//Local variables
					var MsgIn v_response;
					var RequestPrimitive v_createRequest;
					var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
                
					// Test control
                    
					// Test component configuration
					f_cf01Up();
                    
					// Test adapter configuration
                                        
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource
					v_createRequest := valueof(m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int2, int3)); //Member type is set to AE and consistencyStrategy is set to MIXED
					v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);                                                            
                    
                    // Test Body
                    mcaPort.send(m_request(v_createRequest));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": Resource created successfully");
							
                            // check for memberTypeValidated
                            if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){
                                setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided");
                            }
                            else {
                                if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){
                                    setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct");
                                }
                            }
                            // check for memberType (MIXED)
                            if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType)){
                                setverdict(fail, __SCOPE__, ": Error, memberType attribute not provided");
                            } 
                            else {
                                if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0){ 
                                    setverdict(fail, __SCOPE__, ": Error, memberType attribute not correct");
                                }
                            }
                        }
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                            tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Error while creating resource");
                        }
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while creating resource");
                        }
                    }
                                    
                    // Postamble
                    f_cse_postamble_deleteResources();
                    
					// Tear down
					f_cf01Down();                   
                    
                }
                
               /**
                * @desc 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,.
                * 
                */
                testcase TC_CSE_GMG_CRE_006() runs on CseTester system CseSystem {
					//Local variables
					var MsgIn v_response;
					var RequestPrimitive v_createRequest;
					var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
					var integer v_groupIndex := -1;
					var ListOfURIs v_memberIDs;
                
					// Test control
                    
					// Test component configuration
					f_cf01Up();
                    
					// Test adapter configuration
                                        
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex);
					v_groupIndex :=  f_cse_createResource(int9, m_createGroupBase, v_aeIndex);
					v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)};
					v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, -, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON MEMBER (default value)
					v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);                                                       
                    
					// Test Body               
                    mcaPort.send(m_request(v_createRequest));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": Resource created successfully");
							
							// check for memberTypeValidated
                            if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){
                                setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided");
                            } else {
                                if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){
                                    setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct");
                                }
                            }
                            // check for membersId
                            if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){
                                setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided");
                            } 
                            else {
                                if(not match({f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){
                                    setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct");
                                }
                            }
                        }
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
                            tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Error while creating resource");
                        }
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while creating resource");
                        }
                    }
                                    
                    // Postamble
                    f_cse_postamble_deleteResources();
                    
					// Tear down
					f_cf01Down();                    
                    
                }

                
				/**
				 * @desc 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.
				 * 
				 */
				testcase TC_CSE_GMG_CRE_007() runs on CseTester system CseSystem {
					//Local variables
					var MsgIn v_response;
					var RequestPrimitive v_createRequest;
					var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
					var integer v_groupIndex := -1;
					var ListOfURIs v_memberIDs;

					// Test control
    
					// Test component configuration
					f_cf01Up();
    
					// Test adapter configuration
                        
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex);
					v_groupIndex :=  f_cse_createResource(int9, m_createGroupBase, v_aeIndex);
					v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)};
					v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, int2, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON GROUP
					v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);                                                       
                    
					// Test Body
					mcaPort.send(m_request(v_createRequest));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": unsuccessful validation of the resource type during the creation of the group");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error create succesfull while the operation should be aborted");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}
                    
					// Postamble
					f_cse_postamble_deleteResources();
                    
					// Tear down
					f_cf01Down();
					
				}
				
				group g_CSE_GMG_CRE_008 {
	            	
					/**
					 * @desc Check that IUT generates a request primitive for each resource in memberIDs with no relative address appended to it.
					 * 
					 */
					testcase TC_CSE_GMG_CRE_008_CRE() runs on CseTester system CseSystem { //Create
						var template PrimitiveContent v_contentResponse;
						v_contentResponse.container := mw_contentContainer_rc1;
						
						f_CSE_GMG_CRE_008(m_createContainerBase, v_contentResponse, int2001);
					}//end TC_CSE_GMG_CRE_008_CRE
	
					testcase TC_CSE_GMG_CRE_008_UPD() runs on CseTester system CseSystem { //Update
						var template RequestPrimitive v_updateRequest := m_updateAeBase;
						var template PrimitiveContent v_contentResponse;
						var Labels v_labels_1:= {"VALUE_1"};
	    				v_contentResponse.aE := m_contentAe_allOmit;
						v_contentResponse.aE.labels := ?;
						v_updateRequest.primitiveContent.aE.labels := v_labels_1;
						
						f_CSE_GMG_CRE_008(v_updateRequest, v_contentResponse, int2004);
					}//end TC_CSE_GMG_CRE_008_UPD
	
					testcase TC_CSE_GMG_CRE_008_RET() runs on CseTester system CseSystem { //Retrieve
						var template PrimitiveContent v_contentResponse;
						v_contentResponse.aE := mw_contentAeBase;
						
						f_CSE_GMG_CRE_008(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000);
					}//end TC_CSE_GMG_CRE_008_RET
	
					testcase TC_CSE_GMG_CRE_008_DEL() runs on CseTester system CseSystem { //Delete
						var template PrimitiveContent v_contentResponse;
						v_contentResponse.aE := mw_contentAeBase;// TODO see with wath should it be matched
						
						f_CSE_GMG_CRE_008(m_delete("Temporary", "Temporary"), v_contentResponse, int2002);	
					}//end TC_CSE_GMG_CRE_008_DEL
	
					function f_CSE_GMG_CRE_008(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on CseTester {
						//Local constants
						const integer c_numberOfResponsePrimitive := 2;
						
					   // Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_containerIndex_1 := -1;
						var integer v_containerIndex_2 := -1;
						var integer v_groupIndex := -1;
						var ListOfURIs v_memberIDs;
						var integer i;
						
						// Test control
	
						// Test component configuration
						f_cf01Up();
	
						// Test adapter configuration
	
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
						v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
						v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, -), v_aeIndex); // AE child resource
						   
						p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt";
						p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); 
	
						// Test Body
	
						mcaPort.send(m_request(valueof(p_requestPrimitive)));
						tc_ac.start;
					  	alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource");
	                            
								if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){
									setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided");
								}
								else{
									if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){
										setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid");
									}
									else{
	        							for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){
	        								if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){
	        									setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected");
	        								}
	        							}
									}
								}                            
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}
	
						// Postamble
						f_cse_postamble_deleteResources();
	
						// Tear down
						f_cf01Down();                    
	
					} // end f_CSE_GMG_CRE_008
	
				} // end group g_CSE_GMG_CRE_008
			
            	
				/**
				 * @desc Check that IUT generates a request primitive for each resource in memberIDs with a relative address appended to it.
				 * 
				 */
				testcase TC_CSE_GMG_CRE_009() runs on CseTester system CseSystem {
					//Local constants
					const integer c_numberOfResponsePrimitive := 2;
		
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex := -1;
					var integer i;
					var ListOfURIs v_memberIDs;
					var ListOfURIs v_membersAcpIds;
					var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1"));
					var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -);
					var template PrimitiveContent v_contentResponse;
					
					v_contentResponse.contentInstance := mw_contentContentInstanceBase;
					
					// Test control
					if(not(PICS_ACP_SUPPORT)) {
						setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
						stop;
					}

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
					v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred
					v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource
					v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource
					v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)};
					v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -);
   
					v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName;
					v_createRequest.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN

					// Test Body

					mcaPort.send(m_request(v_createRequest));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource");
                
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){
								setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided");
							}
							else{
								if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){
									setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid");
								}
								else{
									for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){
										if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){
											setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected");
										}
									}
								}
							}                            
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}
		
					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf01Down();                    

				} // end TC_CSE_GMG_CRE_009
                                    
			} // end group Create
			
			group Retrieve {
            	
				/**
				 * @desc Check that the IUT generates a request primitive for each resource in memberIDs with a relative address appended to fanOutPoint that includes a virtual resource.
				 * 
				 */
				testcase TC_CSE_GMG_RET_001() runs on CseTester system CseSystem {
					//Local constants
					const integer c_numberOfResponsePrimitive := 2;

					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex, v_contentInstanceIndex_1, v_contentInstanceIndex_2 := -1;
					var integer i;
					var ListOfURIs v_memberIDs;
					var ListOfURIs v_membersAcpIds;
					var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -);
					var template PrimitiveContent v_contentResponse;
					var XSD.AnyURI v_fanoutPointAddress;
		
					v_contentResponse.container := mw_contentContainerBase;
		
					// Test control
					if(not(PICS_ACP_SUPPORT)) {
						setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
						stop;
					}

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
					v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred
					v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource
					v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource
					v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_1); // Container_1 child resource
					v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_2); // Container_2 child resource
					v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)};
					v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds), -1);
   
					v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName & "/" & c_resourceShortNameLatest;
					
					// Test Body
					mcaPort.send(m_request(m_retrieveResource(v_fanoutPointAddress, f_getOriginator(v_aeIndex_1)))); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource");
    
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){
								setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided");
							}
							else{
								if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){
									setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid");
								}
								else{
									for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){
										if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){
											setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected");
										}
									}
								}
							}                            
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}

					// Postamble
					f_cse_postamble_deleteResources();

					// Tear down
					f_cf01Down();                    

				} // end TC_CSE_GMG_RET_001

			} // end group Retrieve

            group Update {
            	
               /**
                * @desc Check that the IUT rejects the update of the  group resource when the memberType cannot be retrieved due to lack of privilege.
                * 
                */
                testcase TC_CSE_GMG_UPD_001() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_containerIndex_1 := -1;
					var integer v_containerIndex_2 := -1;
					var integer v_acpIndex := -1;
					var integer v_groupIndex := -1;
					var RequestPrimitive v_request;
					var template RequestPrimitive v_containerCreateRequest := m_createContainer_noResourceName;
					var template RequestPrimitive v_updateRequest := m_updateGroupBase;
					var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyAcp", -, int61); //c_CUDNDi
                
					// Test control
					if(not(PICS_ACP_SUPPORT)) {
						setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
						stop;
					}
                	
					// Test component configuration
					f_cf01Up();
                	
					// Test adapter configuration
                			
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
					v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource
					v_containerCreateRequest.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_containerIndex_2 := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, - , -), v_aeIndex);
					
					v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
					v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);	// creating group
                	    
					// Test Body
                	
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege");                            
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error update successful while doesn't have privileges for retrieving resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while updating resource");
						}
					}
                					
					// Postamble
					f_cse_postamble_deleteResources();
                	
					// Tear down
					f_cf01Down();             
                }

			   
			   /**
			    * @desc Check that the IUT detects the presence of duplicate member IDs during an update of the  <group> resource and removes the duplicate member IDs prior to updating the <group> resource. 
			    *  
			    */
			  testcase TC_CSE_GMG_UPD_002() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_containerIndex_1 := -1;
					var integer v_containerIndex_2 := -1;
					var integer v_groupIndex := -1;
					var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase);
					var XSD.AnyURI v_memberId_1;
					var XSD.AnyURI v_memberId_2;
				    var PrimitiveContent v_primitiveContentRetrievedResource;
					
					// Test control
                    
					// Test component configuration
					f_cf01Up();
                
					// Test adapter configuration
                    
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_memberId_1 :=  f_getResourceId(vc_resourcesList[v_containerIndex_1].resource);
					v_memberId_2 :=  f_getResourceId(vc_resourcesList[v_containerIndex_2].resource);
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1, v_memberId_2}, omit, int3, -, -, -), v_aeIndex); // AE child resource
					
					v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_2}; 
					v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
					
					//Test Body
					mcaPort.send(m_request(v_updateRequest));
					tc_ac.start;
					alt {
						 [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
							 tc_ac.stop;
							 setverdict(pass, __SCOPE__ & ": update successful"); 
     
							// check for membersId
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){
								setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided");
							} 
							else {
								if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) {
								   setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute");      
								}                               
								if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] != v_memberId_2){
									setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct");
								}
							}
						 }
						 [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						 }
						 [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							 tc_ac.stop;
							 setverdict(fail, __SCOPE__ & ": Error while updating resource");
						 }
						 [] tc_ac.timeout {
							 setverdict(fail, __SCOPE__ & ": No answer while updating resource");
						 }
					 }
                    
				     v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex);
				     if(getverdict == pass){
					     if(ischosen(v_primitiveContentRetrievedResource.group_)){
					     	if(v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_2){
								setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not updated");
					     	}
					      }
				     }
                    
					//Postamble
					f_cse_postamble_deleteResources();
    
					// Tear down
					f_cf01Down();
				}
                
                /**
                 * @desc Check that the IUT validates the resource type during an UPDATE of the  <group> resource when memberType attribute is not ‘mixed’. 
                 * 
                 */
                testcase TC_CSE_GMG_UPD_003() runs on CseTester system CseSystem {
                    // Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_containerIndex_1 := -1;
					var integer v_containerIndex_2 := -1;
					var integer v_groupIndex := -1;
					var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase);
					var PrimitiveContent v_primitiveContentRetrievedResource;
					
					// Test control
                    
					// Test component configuration
					f_cf01Up();
                
					// Test adapter configuration
                    
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, -, -), v_aeIndex);
					
					v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
					v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
					
                    // Test Body
                    mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": update successful"); 
                             
                             if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) {
                                setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided");    
                             } 
                             else {
                                if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false) {
                                    setverdict(fail, __SCOPE__, ": Error, memberTypeValidated wrong value");  
                                }
                             }
                        }
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
						   tc_ac.stop;
						   setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                            tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Error while updating resource");
                        }
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while updating resource");
                        }
                     }
        
					v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex);
					if(getverdict == pass){
						 if(ischosen(v_primitiveContentRetrievedResource.group_)){
							if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){
								setverdict(fail, __SCOPE__, ": Error,  memberTypeValidated attribute not updated");
							}
						  }
					 } 
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
              
               /**
                * @desc Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. 
                * 
                */
                testcase TC_CSE_GMG_UPD_004() runs on CseTester system CseSystem {
                    // Local variables
                    var MsgIn v_response;
					var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase);
					var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
					var integer v_groupIndex := -1;
					var integer v_subGroupIndex := -1;
					var XSD.AnyURI v_memberId_1;
					var XSD.AnyURI v_memberId_2;
					var PrimitiveContent v_primitiveContentRetrievedResource;
                
                    // Test control
        
                    // Test component configuration
                    f_cf01Up();
    
                    // Test adapter configuration
        
                    // Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex);
					v_subGroupIndex :=  f_cse_createResource(int9, m_createGroupBase, v_aeIndex);
					v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource);
					v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource);
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int3, -, -), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to MIXED (int3)
                	
					v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_1, v_memberId_2};
					v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
					
       				// Test Body
                    mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
                  			tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": update successful");                              
                             
							//memberTypeValidated attribute set to FALSE
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) {
                            	setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided");    
                            }
							else {
								if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != false) {
									setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be FALSE");
								}
							}
                                
							//memberType attribute set to MIXED
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType)) {
								setverdict(fail, __SCOPE__, ": Error, memberType attribute not provided");    
							}
							else {
								if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0) { //Mixed is int0 in release 2 and int24 in release 1
									setverdict(fail, __SCOPE__, ": Error, memberType was not set to MIXED");
								}
							}
                                
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
						   tc_ac.stop;
						   setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
						}
					}
        
					v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex);
					if(getverdict == pass){
						 if(ischosen(v_primitiveContentRetrievedResource.group_)){
							if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){
								setverdict(fail, __SCOPE__, ": Error,  memberTypeValidated attribute not updated");
							}
							
							if(v_primitiveContentRetrievedResource.group_.memberType != int0){
								setverdict(fail, __SCOPE__, ": Error,  memberType attribute not set to MIXED");
							}
						  }
					 }
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
      
                /**
                 * @desc Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_MEMBER.
                 * 
                 */
                testcase TC_CSE_GMG_UPD_005() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase);
					var integer v_aeIndex := -1;
					var integer v_containerIndex := -1;
					var integer v_groupIndex := -1;
					var integer v_subGroupIndex := -1;
					var XSD.AnyURI v_memberId_1;
					var XSD.AnyURI v_memberId_2;
					var PrimitiveContent v_primitiveContentRetrievedResource;
                
					// Test control
        
					// Test component configuration
					f_cf01Up();
    
				 	// Test adapter configuration
        
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex);
					v_subGroupIndex :=  f_cse_createResource(int9, m_createGroupBase, v_aeIndex);
					v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource);
					v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource);
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, omit), v_aeIndex);  //Member type is set to Container (int3) and consistencyStrategy is set to ABANDON MEMBER (default value)
                	
					v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_1};
					v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
					
                    //Test Body
                    
                    mcaPort.send(m_request(v_updateRequest));
                    tc_ac.start;
                    alt {
                    	[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
                      		tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": update successful"); 
                                                          
							//memberTypeValidated attribute set to TRUE
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) {
								setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided");    
							} 
							else {
								if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != true) {
									setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be TRUE");
								}
							}

                            //memberIDs attribute set to v_memberID1
							if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){
								setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided");
							}
							else {                               
								if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) {
								   setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute");      
								}                               
								if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] != v_memberId_1){
									setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct");
								}
							}                                   
                        }
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
						   tc_ac.stop;
						   setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                            tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Error while updating resource");
                        }
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while updating resource");
                        }
                     }
        
					v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex);
					if(getverdict == pass){
						 if(ischosen(v_primitiveContentRetrievedResource.group_)){
							if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){
								setverdict(fail, __SCOPE__, ": Error,  memberTypeValidated attribute not updated");
							}
		
							if(v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_1){
								setverdict(fail, __SCOPE__, ": Error,  memberIDs attribute not correct");
							}
						  }
					 }
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
                
                /**
                 * @desc 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.
                 * 
                 */
                testcase TC_CSE_GMG_UPD_006() runs on CseTester system CseSystem {
					// Local variables
                	var MsgIn v_response;
                	var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase);
                	var integer v_aeIndex := -1;
                	var integer v_containerIndex := -1;
                	var integer v_groupIndex := -1;
					var integer v_subGroupIndex := -1;
                	var XSD.AnyURI v_memberId_1;
                	var XSD.AnyURI v_memberId_2;
                                
                	// Test control
                        
                	// Test component configuration
                	f_cf01Up();
                    
                	// Test adapter configuration
                        
                	// Preamble
					v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
					v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex);
					v_subGroupIndex :=  f_cse_createResource(int9, m_createGroupBase, v_aeIndex);
					v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource);
					v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource);
                	v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int2), v_aeIndex);  //Member type is set to Container(int3) and consistencyStrategy is set to ABANDON GROUP (default value)
                                	
                	v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_1};
                	v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
                					
                    //Test Body
					mcaPort.send(m_request(v_updateRequest));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": unsuccessful validation of the resource type during the creation of the group");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error create succesfull while the operation should be aborted");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
               
               /**
                * @desc Check that the IUT detects when the number of memberIDs exceeds the limitation of maxNrOfMembers.
                *  
                */
                testcase TC_CSE_GMG_UPD_007() runs on CseTester system CseSystem
                {
                    //Local constants
                    const integer c_maxNrOfMembers := 2;
                    
                    // Local variables
                    var MsgIn v_response;
                    var RequestPrimitive v_request;
                    var integer v_aeIndex := -1;
                    var integer v_groupIndex, v_containerIndex_1, v_containerIndex_2, v_containerIndex_3 := -1;
                    var ListOfURIs v_memberIDs;
                    var template RequestPrimitive v_createRequest;
					var PrimitiveContent v_primitiveContentRetrievedResource;
                    
                    var template RequestPrimitive v_updateRequest := m_updateGroupBase;
         
                    // Test control
        
                    // Test component configuration
                    f_cf01Up();
    
                    // Test adapter configuration
        
                    // Preamble
                    v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
                    
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_containerIndex_3 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					
					v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
					
					v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, v_memberIDs, omit, int3));
					
					v_groupIndex :=  f_cse_createResource(int9, v_createRequest, v_aeIndex);
    
                    //Test Body
                    v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
					v_memberIDs := v_memberIDs & {f_getResourceId(vc_resourcesList[v_containerIndex_3].resource)};
                    v_request.primitiveContent.group_.memberIDs := v_memberIDs;
        
                    mcaPort.send(m_request(v_request));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": operation is not allowed");                             
                        }
                        [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                        	tc_ac.stop;
                            setverdict(fail, __SCOPE__ & ": Wrong response status code");
                        }
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error update successful while maxNrOfMembers has exceeded");
						}
                        [] tc_ac.timeout {
                            setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
                        }
                     }
        
					v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex);
					if(getverdict == pass){
						//Check that the resource has NOT been udpated
						  if(ischosen(v_primitiveContentRetrievedResource.group_)) {
						   if(v_primitiveContentRetrievedResource.group_.memberIDs == v_memberIDs){
							setverdict(fail, __SCOPE__ & ": Error: MemberIDs attribute updated")
						  }
						}
					}
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
               
				/**
				* @desc Check that the IUT detects when the value provided for maxNrOfMembers attribute is less than the value of the currentNrOfMembers attribute.
				*  
				*/
				testcase TC_CSE_GMG_UPD_008() runs on CseTester system CseSystem {
                    // Local variables
					var MsgIn v_response;
					var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase);
					var integer v_aeIndex := -1;
					var integer v_containerIndex_1 := -1;
					var integer v_containerIndex_2 := -1;
					var integer v_groupIndex := -1;
					var ListOfURIs v_memberIDs;
					var XSD.PositiveInteger v_maxNrOfMembers:= 1;
					var PrimitiveContent v_primitiveContentRetrievedResource;
					
					v_updateRequest.primitiveContent.group_.maxNrOfMembers := v_maxNrOfMembers;
					
					// Test control
                    
					// Test component configuration
					f_cf01Up();
                    
					// Test adapter configuration
                                        
					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
					v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
					v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
					v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex);
					
					v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
					
                    //Test Body
                    mcaPort.send(m_request(v_updateRequest));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response {
                            tc_ac.stop;
                            setverdict(pass, __SCOPE__ & ": max number of member exceeded");                             
                        }
                         [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                             tc_ac.stop;
                             setverdict(fail, __SCOPE__ & ": Wrong response status code");
                         }
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							 tc_ac.stop;
							 setverdict(fail, __SCOPE__ & ": Error update successful while operation is not allowed");
						 }
                         [] tc_ac.timeout {
                             setverdict(fail, __SCOPE__ & ": No answer while updating resource");
                         }
                     }
        
					v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex);
					if(getverdict == pass){
						//Check that the resource has NOT been udpated
						  if(ischosen(v_primitiveContentRetrievedResource.group_)) {
						   if(v_primitiveContentRetrievedResource.group_.maxNrOfMembers == v_maxNrOfMembers){
							setverdict(fail, __SCOPE__ & ": Error: maxNrOfMembers attribute updated")
						  }
						}
					}
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
              
               /**
                 * @desc Check that the IUT handles validation of the resource type during an UPDATE of the <group> resource when memberIDs contains a sub-group on a temporarily unreachable Hosting CSE.
                 * 
                 */
                testcase TC_CSE_GMG_UPD_009() runs on CseTester system CseSystem
                {
                    //Local constants
                    const ResourceType c_ResourceTypeGroup := int9;  
                    const ResourceType c_ResourceType1 := int4; 
                    const MemberType   c_memberType1   := int4;     // should be set same type as c_ResourceType1
                    const XSD.String c_primitiveContent := "primitive_contet";
                    const ConsistencyStrategy c_consistentcyStrategy := int1;   // ABANDOND_MEMBER
//                    const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS";
                    const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1";
                    const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2";
    
                    // Local variables
                    var MsgIn v_response;
                    var RequestPrimitive v_request;
                    var integer v_aeIndex := -1;
                    var integer v_groupIndex := -1;
                    var integer v_contentInstanceIndex := -1;
            
                    var template RequestPrimitive v_createRequest := m_createGroupBase;
                    var template RequestPrimitive v_updateRequest := m_updateGroupBase;
                    var template RequestPrimitive v_createMember;
					var PrimitiveContent v_primitiveContentRetrievedResource;
         
                    // Test control
        
                    // Test component configuration
                    f_cf01Up();
    
                    // Test adapter configuration
        
                    // Preamble
                    v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
//                  TODO: -> register IUT to the remoteCSE
        
                    v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex);
                    v_createRequest.primitiveContent.group_ := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit);
                    v_createRequest.primitiveContent.group_.memberType := c_memberType1;
                    v_createRequest.primitiveContent.group_.memberTypeValidated := true;
                    v_createRequest.primitiveContent.group_.consistencyStrategy := c_consistentcyStrategy;
                    v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex);
        
                    // TODO: -> do the resources actually need to be created?
                    // TODO: choose the right template for member resource
                    v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1");
                    v_contentInstanceIndex := f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex);
                    
                    // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE
                    // TODO: set onlineStatus to false on remoteCSE
        
    
                    //Test Body
                    v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest);
//                    v_request.to_ := c_targetResourceAddress;
                    v_createRequest.primitiveContent.group_ := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit);
        
                    mcaPort.send(m_request(v_request));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
                            tc_ac.stop;
                            
                            if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) {
                                setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided");    
                             } else {
                                if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false) {
                                    if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 2) {
                                        setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); 
                                    } else {
                                        if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] == c_memberResourceAddress1 and v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[1] == c_memberResourceAddress2) {
                                            setverdict(pass, __SCOPE__ & ": update successful");       
                                        } else {
                                            setverdict(fail, __SCOPE__, ": Error, wrong memberIDs");   
                                        }
                                    }
                                } else {
                                    setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be set to FALSE");  
                                }   
                            }                            
                        }
                         [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                             tc_ac.stop;
                             setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
                         }
                         [] tc_ac.timeout {
                             setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
                         }
                     }
        
					v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex);
					if(getverdict == pass){
						 if(ischosen(v_primitiveContentRetrievedResource.group_)){
							if(v_primitiveContentRetrievedResource.group_.memberTypeValidated != false){
								setverdict(fail, __SCOPE__, ": Error,  memberTypeValidated attribute not updated");
							}

							if((v_primitiveContentRetrievedResource.group_.memberIDs[0] != c_memberResourceAddress1) and (v_primitiveContentRetrievedResource.group_.memberIDs[1] != c_memberResourceAddress2)){
								setverdict(fail, __SCOPE__, ": Error,  memberIDs attribute not correct");
							}
						  }
					 }
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
              
              /**
                * @desc Check that the IUT handles validation of the resource type during an UPDATE of the group resource when memberIDs contains a sub-group on a  a previously unreachable Hosting CSE that has become reachable
                * @verdict 
                */
                testcase TC_CSE_GMG_UPD_010() runs on CseTester system CseSystem
                {
                    //Local constants
                    const ResourceType c_ResourceTypeGroup := int9;  
                    const ResourceType c_ResourceType1 := int4; 
                    const MemberType   c_memberType1   := int4;     // should be set same type as c_ResourceType1
                    const XSD.String c_primitiveContent := "primitive_contet";
                    const ConsistencyStrategy c_consistentcyStrategy := int1;   // ABANDOND_MEMBER
//                    const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS";
                    const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1";
                    const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2";
    
                    // Local variables
                    var MsgIn v_response;
                    var RequestPrimitive v_request;
                    var integer v_aeIndex := -1;
                    var integer v_remoteCSEIndex := -1;
                    var integer v_groupIndex := -1;
                    var integer v_contentInstanceIndex := -1;
            
                    var template RequestPrimitive v_createRequest := m_createGroupBase;
                    var template RequestPrimitive v_updateRequest := m_updateGroupBase;
                    var template RequestPrimitive v_createMember;
         
                    // Test control
        
                    // Test component configuration
                    f_cf01Up();
    
                    // Test adapter configuration
        
                    // Preamble
                    v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi
//                  TODO: -> register IUT to the remoteCSE
                    //v_remoteCSEIndex := ...
        
                    v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex);
                    v_createRequest.primitiveContent.group_ := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit);
                    v_createRequest.primitiveContent.group_.memberType := c_memberType1;
                    v_createRequest.primitiveContent.group_.memberTypeValidated := false;
                    v_createRequest.primitiveContent.group_.consistencyStrategy := c_consistentcyStrategy;
                    v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex);
        
                    // TODO: -> the AE having a subscription to c_targetResourceAddress 
        
                    // TODO: -> do the resources actually need to be created?
                    // TODO: choose the right template for member resource
                    v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1");
                    v_contentInstanceIndex := f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex);
                    
                    // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE
                    // TODO: set onlineStatus to false on remoteCSE
        
    
                    //Test Body
                    v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest);
                    //v_request.from_ := CSE-ID
                    v_request.to_ := f_getResourceAddress(v_remoteCSEIndex);
                    //Content set to <remoteCSE> resource containing onlineStatus := false;
        
                    mcaPort.send(m_request(v_request));
                    tc_ac.start;
                    alt {
                        [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
                            tc_ac.stop;
                            
                                
                        }
                         [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
                             tc_ac.stop;
                             setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
                         }
                         [] tc_ac.timeout {
                             setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
                         }
                     }
        
                    //Postamble
                    f_cse_postamble_deleteResources();
    
                    // Tear down
                    f_cf01Down();
                }
            } // end group Update
            
            

            

			
			group Basic_Operations {
			
				group g_CSE_GMG_001 {
	            	
					/**
					 * @desc Check that the IUT allows a <group>/fanoutPoint OPERATION when the Originator has OPERATION_PERMISSION specified in membersAccessControlPolicyIDs attribute in the group resource.
					 * 
					 */
					testcase TC_CSE_GMG_001_CRE() runs on CseTester system CseSystem { //Create
						f_CSE_GMG_001(m_createContainerBase, int2001);
					}//end TC_CSE_GMG_001_CRE
	
					testcase TC_CSE_GMG_001_UPD() runs on CseTester system CseSystem { //Update
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var Labels v_labels_1:= {"VALUE_1"};
						v_updateRequest.primitiveContent.container.labels := v_labels_1;
						f_CSE_GMG_001(v_updateRequest, int2004);
					}//end TC_CSE_GMG_001_UPD
	
					testcase TC_CSE_GMG_001_RET() runs on CseTester system CseSystem { //Retrieve
						f_CSE_GMG_001(m_retrieveResource("Temporary", "Temporary"), int2000);
					}//end TC_CSE_GMG_001_RET
	
					testcase TC_CSE_GMG_001_DEL() runs on CseTester system CseSystem { //Delete
						f_CSE_GMG_001(m_delete("Temporary", "Temporary"), int2002);	
					}//end TC_CSE_GMG_001_DEL
	
					function f_CSE_GMG_001(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester {
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex := -1;
						var integer v_containerIndex_1 := -1;
						var integer v_containerIndex_2 := -1;
						var integer v_groupIndex := -1;
						var integer i;
						var ListOfURIs v_memberIDs;
						var AcpType v_acpIDs;
						var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -);
			
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
							stop;
						}
	
						// Test component configuration
						f_cf01Up();
	
						// Test adapter configuration
	
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
						v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource
						v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
						v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
						v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource
	       
						p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt";
						p_requestPrimitive.from_ := f_getOriginator(v_groupIndex);
	
						// Test Body
	
						mcaPort.send(m_request(valueof(p_requestPrimitive)));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource");
	                
								if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){
									setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided");
								}
								else {
									for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){
										if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){
											setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful");
										}
									}
								}                       
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}
			
						// Postamble
						f_cse_postamble_deleteResources();
	
						// Tear down
						f_cf01Down();                    
	
					} // end f_CSE_GMG_001
	
				} // end group g_CSE_GMG_001
			
				group g_CSE_GMG_002 {
	            	
					/**
					 * @desc Check that IUT denies a <group>/fanOutPoint OPERATION when the Originator does not have OPERATION_PERMISSION specified in membersAccessControlPolicyIDs in the group resource.
					 * 
					 */
					testcase TC_CSE_GMG_002_CRE() runs on CseTester system CseSystem { //Create
						f_CSE_GMG_002(m_createContainerBase, int62);	//c_RUDNDi
					}//end TC_CSE_GMG_002_CRE
	
					testcase TC_CSE_GMG_002_UPD() runs on CseTester system CseSystem { //Update
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var Labels v_labels_1:= {"VALUE_1"};
						v_updateRequest.primitiveContent.container.labels := v_labels_1;
						f_CSE_GMG_002(v_updateRequest, int59);//c_CRDNDi
					}//end TC_CSE_GMG_002_UPD
	
					testcase TC_CSE_GMG_002_RET() runs on CseTester system CseSystem { //Retrieve
						f_CSE_GMG_002(m_retrieveResource("Temporary", "Temporary"), int61);//c_CUDNDi
					}//end TC_CSE_GMG_002_RET
	
					testcase TC_CSE_GMG_002_DEL() runs on CseTester system CseSystem { //Delete
						f_CSE_GMG_002(m_delete("Temporary", "Temporary"), int55); //c_CRUNDi	
					}//end TC_CSE_GMG_002_DEL
		
					function f_CSE_GMG_002(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on CseTester {
					   // Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex := -1;
						var integer v_containerIndex_1 := -1;
						var integer v_containerIndex_2 := -1;
						var integer v_groupIndex := -1;
						var ListOfURIs v_memberIDs;
						var ListOfURIs v_membersAcpIds;
						var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations);
	
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
							stop;
						}
	
						// Test component configuration
						f_cf01Up();
	
						// Test adapter configuration
	                	
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
						v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource
						v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
						v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
						v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource
	   
						p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt";
						p_requestPrimitive.from_ := f_getOriginator(v_groupIndex);
	
						// Test Body
	
						mcaPort.send(m_request(valueof(p_requestPrimitive)));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while executing operation");
							}
						}
	        
						// Postamble
						f_cse_postamble_deleteResources();
	
						// Tear down
						f_cf01Down();                    
	
					} // end f_CSE_GMG_002
	
				} // end group g_CSE_GMG_002			
			
				group g_CSE_GMG_003 {
	            	
					/**
					 * @desc Check that the IUT allows a <group>/fanoutPoint OPERATION when the Originator has OPERATION_PERMISSION specified in accessControlPolicyIDs and the membersAccessControlPolicyIDs is empty in the <group> resource.
					 * @verdict 
					 */
					testcase TC_CSE_GMG_003_CRE() runs on CseTester system CseSystem { //Create
						f_CSE_GMG_003(m_createContainerBase, int2001);
					}//end TC_CSE_GMG_003_CRE
	
					testcase TC_CSE_GMG_003_UPD() runs on CseTester system CseSystem { //Update
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var Labels v_labels_1:= {"VALUE_1"};
						v_updateRequest.primitiveContent.container.labels := v_labels_1;
						f_CSE_GMG_003(v_updateRequest, int2004);
					}//end TC_CSE_GMG_003_UPD
	
					testcase TC_CSE_GMG_003_RET() runs on CseTester system CseSystem { //Retrieve
						f_CSE_GMG_003(m_retrieveResource("Temporary", "Temporary"), int2000);
					}//end TC_CSE_GMG_003_RET
	
					testcase TC_CSE_GMG_003_DEL() runs on CseTester system CseSystem { //Delete
						f_CSE_GMG_003(m_delete("Temporary", "Temporary"), int2002);	
					}//end TC_CSE_GMG_003_DEL
	
					function f_CSE_GMG_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester {
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex := -1;
						var integer v_containerIndex_1 := -1;
						var integer v_containerIndex_2 := -1;
						var integer v_groupIndex := -1;
						var integer i;
						var ListOfURIs v_memberIDs;
						var ListOfURIs v_membersAcpIds;
						var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -);
						
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
							stop;
						}
	
						// Test component configuration
						f_cf01Up();
	
						// Test adapter configuration
	
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
						v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource
						v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
						v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
						v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource
						
						p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt";
						p_requestPrimitive.from_ := f_getOriginator(v_groupIndex);
	
						// Test Body
	
						mcaPort.send(m_request(valueof(p_requestPrimitive)));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource");
	    
								if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){
									setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided");
								}
								else {
									for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){
										if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){
											setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful");
										}
									}
								}                       
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}
	
						// Postamble
						f_cse_postamble_deleteResources();
	
						// Tear down
						f_cf01Down();                    
	
					} // end f_CSE_GMG_003
	
				} // end group g_CSE_GMG_003			
			
				group g_CSE_GMG_004 {
	            	
					/**
					 * @desc Check that IUT rejects a <group>/fanOutPoint OPERATION when the Originator does not have OPERATION_PERMISSION specified in accessControlPolicyIDs and the membersAccessControlPolicyIDs is empty in the group resource.
					 * 
					 */
					testcase TC_CSE_GMG_004_CRE() runs on CseTester system CseSystem { //Create
						f_CSE_GMG_004(m_createContainerBase, int62);	//c_RUDNDi
					}//end TC_CSE_GMG_004_CRE
	
					testcase TC_CSE_GMG_004_UPD() runs on CseTester system CseSystem { //Update
						var template RequestPrimitive v_updateRequest := m_updateContainerBase;
						var Labels v_labels_1:= {"VALUE_1"};
						v_updateRequest.primitiveContent.container.labels := v_labels_1;
						f_CSE_GMG_004(v_updateRequest, int59);//c_CRDNDi
					}//end TC_CSE_GMG_004_UPD
	
					testcase TC_CSE_GMG_004_RET() runs on CseTester system CseSystem { //Retrieve
						f_CSE_GMG_004(m_retrieveResource("Temporary", "Temporary"), int61);//c_CUDNDi
					}//end TC_CSE_GMG_004_RET
	
					testcase TC_CSE_GMG_004_DEL() runs on CseTester system CseSystem { //Delete
						f_CSE_GMG_004(m_delete("Temporary", "Temporary"), int55); //c_CRUNDi	
					}//end TC_CSE_GMG_004_DEL
	
					function f_CSE_GMG_004(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on CseTester {
					   // Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex := -1;
						var integer v_containerIndex_1 := -1;
						var integer v_containerIndex_2 := -1;
						var integer v_groupIndex := -1;
						var ListOfURIs v_memberIDs;
						var AcpType v_acpIDs;
						var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations);
	
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
							stop;
						}
	
						// Test component configuration
						f_cf01Up();
	
						// Test adapter configuration
	    	
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
						v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource
						v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource
						v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
						v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
						v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource
	   
						p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt";
						p_requestPrimitive.from_ := f_getOriginator(v_groupIndex);
	
						// Test Body
	
						mcaPort.send(m_request(valueof(p_requestPrimitive)));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while executing operation");
							}
						}
	
						// Postamble
						f_cse_postamble_deleteResources();
	
						// Tear down
						f_cf01Down();                    
	
					} // end f_CSE_GMG_004
	
				} // end group g_CSE_GMG_004
				
			}// End of Basic_Operations
            
        } // end group Group_Managment
		
        group Discovery {
        	
			/**
			 * @desc Check that the IUT returns successfully a list all discovered resource addresses
			 * 
			 */
			testcase TC_CSE_DIS_001() runs on CseTester system CseSystem {
				// Local variables
				var integer v_aeIndex := -1;
				var integer v_resourceIndex := -1;
				var RequestPrimitive v_request;
				var integer v_childResourceIndex := -1;
				const ResourceType c_containerResourceType := int3; 
				
				// Test control
	
				// Test component configuration
				f_cf01Up();
	
				// Test adapter configuration
	
				// Preamble
				v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
				
				v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
				v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
				v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responseDiscovery)){
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": URI List Representation available");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
					}
				 }	
								
				// Postamble
				f_cse_postamble_deleteResources();
				
				// Tear down
				f_cf01Down();
			} // end TC_CSE_DIS_001
			        		
			/**
			 * @desc Check that the IUT returns the empty address list when no result matching with filter criteria is discovered
			 * 
			 */
			testcase TC_CSE_DIS_003() runs on CseTester system CseSystem {
				// Local variables
				var MsgIn v_response;
				var integer v_aeIndex := -1;
				var integer v_resourceIndex := -1;
				var RequestPrimitive v_request;
				var integer v_childResourceIndex := -1;
				const ResourceType c_containerResourceType := int3; 
			
				// Test control
	
				// Test component configuration
				f_cf01Up();
	
				// Test adapter configuration
	
				// Preamble
				v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
			
				v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
				v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
				v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
						tc_ac.stop;
						if(sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList) == 0){
						  setverdict(pass, __SCOPE__ & ": No Content is present");	
						}
						else
						{
						  setverdict(fail, __SCOPE__ & ": Wrong content available in URIList element");
						}
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
					}
				 }	
							
				// Postamble
				f_cse_postamble_deleteResources();
			
				// Tear down
				f_cf01Down();
			} // end TC_CSE_DIS_003
		
			/**
			 * @desc Check that the IUT returns successfully a list of discovered resource addresses with Non-hierarchical addressing form when the Discovery Result Type is provided in the request
			 *  
			 */
			testcase TC_CSE_DIS_004() runs on CseTester system CseSystem {
				// Local variables
				var MsgIn v_response;
				var integer v_aeIndex := -1;
				var integer v_resourceIndex := -1;
				var RequestPrimitive v_request;
				var integer v_childResourceIndex := -1;
				const ResourceType c_containerResourceType := int3; 
				
				// Test control
	
				// Test component configuration
				f_cf01Up();
	
				// Test adapter configuration
	
				// Preamble
				v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
				
				v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
				v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
				v_request := valueof(m_retrieveResourceDiscResTypeFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int2, int1));
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
						tc_ac.stop;
						if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) {
						  setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList element");
						} else {
						  setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList representation"); 
						}
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
					}
				 }	
								
				// Postamble
				f_cse_postamble_deleteResources();
				
				// Tear down
				f_cf01Down();
			} // end TC_CSE_DIS_004
							
			/**
			 * @desc Check that the IUT rejects the discovery requests to the resource TARGET_RESOURCE_ADDRESS when AE has no privilege to perform the discovery request for the resource TARGET_RESOURCE_ADDRESS
			 * 
			 */
			testcase TC_CSE_DIS_005() runs on CseTester system CseSystem {
				// Local variables
				var integer v_aeIndex := -1;
				var integer v_resourceIndex := -1;
				var RequestPrimitive v_request;
				var integer v_childResourceIndex := -1;
				var integer v_acpAuxIndex := -1;
				const ResourceType c_containerResourceType := int3; 
				
				// Test control
				if(not(PICS_ACP_SUPPORT)) {
					log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case");
					stop;
				}
	
				// Test component configuration
				f_cf01Up();
	
				// Test adapter configuration
	
				// Preamble
				v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int31);//c_CRUDN)
				
				v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//AE1 is registred;
				
				v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
				v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
				v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Access denied to discovery operation for resource " & f_getResourceAddress(v_resourceIndex));
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Discovering " & f_getResourceAddress(v_resourceIndex) & " without having privileges");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while discovering resource");
					}
				 }	
								
				// Postamble
				f_cse_postamble_deleteResources();
				
				// Tear down
				f_cf01Down();
			} // end TC_CSE_DIS_005
        							
			/**
			 * @desc Check that the IUT responds with an error when the AE sends requests to discover the resource TARGET_RESOURCE_ADDRESS which does not exist in the Hosting CSE
			 * 
			 */
			testcase TC_CSE_DIS_006() runs on CseTester system CseSystem {
				// Local variables
				var MsgIn v_response;
				var integer v_aeIndex := -1;
				var integer v_resourceIndex := -1;
				var RequestPrimitive v_request;
				var XSD.ID v_resourceId := "nonexisting";
			
				// Test control

				// Test component configuration
				f_cf01Up();

				// Test adapter configuration

				// Preamble
				v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
				
				if(PX_ADDRESSING_METHOD == e_nonHierarchical and (PX_PRIMITIVE_SCOPE == e_cseRelative)) {
					v_request := valueof(m_retrieveResourceFilterUsageOption(v_resourceId, f_getOriginator(v_aeIndex), int1));
				} else {
					v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId, f_getOriginator(v_resourceIndex), int1));
				}
			
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
				
					[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Resource not found");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response while retrieving resource");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
					}
				 }	
							
				// Postamble
				f_cse_postamble_deleteResources();
			
				// Tear down
				f_cf01Down();
			} // end TC_CSE_DIS_006
		
			/**
			 * @desc Check that the IUT responds the originator with an error when the originator sends a request including an invalid format of filter criteria to discover the resource TARGET_RESOURCE_ADDRESS 
			 * 
			 */
			testcase TC_CSE_DIS_007() runs on CseTester system CseSystem {
				// Local variables
				var MsgIn v_response;
				var integer v_aeIndex := -1;
				var integer v_resourceIndex := -1;
				var RequestPrimitive v_request;
				var integer v_childResourceIndex := -1;
				const ResourceType c_containerResourceType := int3; 
			
				// Test control

				// Test component configuration
				f_cf01Up();

				// Test adapter configuration

				// Preamble
				v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
			    
				v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
				v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); 
				v_request := valueof(m_retrieveResourceInvalidFormatOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
				
					[] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) -> value v_response {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Contents Unacceptable");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code while retrieving resource");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response while retrieving resource");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
					}
				 }	
							
				// Postamble
				f_cse_postamble_deleteResources();
			
				// Tear down
				f_cf01Down();
			} // end TC_CSE_DIS_007	
				
        } //end group Group Discovery
		
		group Subscription_And_Notification {
	
			group Create {
				
				/**
				 * @desc Check that the IUT rejects the creation of the <subscription> resource when the target subscribed-to RESOURCE_TYPE resource is not subscribable. 
				 *  
				 */
				testcase TC_CSE_SUB_CRE_001_SUB() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
									
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred;
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription resource is created			

					v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_resourceIndex);
			
					// Test Body
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": <Subscription> Resource not subscribable");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Subsciption successful whereas <Subscription> resource is not subscribable");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}	

					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}
					
					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_CRE_001_SUB
				
				testcase TC_CSE_SUB_CRE_001_CIN() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_containerResourceIndex := -1;
					var integer v_contentInstanceResourceIndex := -1;
					var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
					var RequestPrimitive v_request;
					
					v_createRequest.primitiveContent.subscription.resourceName := omit;
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);

					v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container 				

					v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_containerResourceIndex);//ContentInstance

					v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_contentInstanceResourceIndex);
					
					// Test Body
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": <Subscription> Resource not subscribable");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Subsciption successful whereas <Subscription> resource is not subscribable");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}

					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_CRE_001_CIN
								
				/**
				 * @desc Check that the IUT rejects the creation of the <subscription> resource when the originator does not have privileges for retrieving the subscribed-to resource.
				 * 
				 */
				testcase TC_CSE_SUB_CRE_002() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_acpAuxIndex := -1;
					var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
					var RequestPrimitive v_request;
						
					// Test control
					if(not(PICS_ACP_SUPPORT)) {
						setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
						stop;
					}

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int61);//c_CUDNDi)
						
					v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi);
				
					v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription 
					
					// Test Body
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": No privilege for subscribing to the resource");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Subsciption successful whereas it doesn't have privilege");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}
			
					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}
			
					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_CRE_002
								
				/**
				 * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT cannot send the Notify request to the notificationURI
				 * 
				 */
				testcase TC_CSE_SUB_CRE_003() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
					var RequestPrimitive v_request;
			
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);		
					
					v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription 
					v_request.primitiveContent.subscription.notificationURI := {"NotReachableNotificationURI"};
					
					// Test Body
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": OK : Subscription verification initiation failed");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Subsciption successful whereas subsciption verification failed");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}

					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_CRE_003
				
				/**
				 * @desc Check that the IUT stores Originator ID in the notification creator attribute when a <SUBSCRIPTION> creation request which needs verification is received and the notificationURI is not the Originator.
				 * 
				 */
				testcase TC_CSE_SUB_CRE_004() runs on CseTester system CseSystem {
					//Local variables
					 var template RequestPrimitive v_request := m_createSubscriptionBase;
					 var integer v_aeIndex := -1;
					 var CseTester v_notifyHandler;
					 var integer v_ae2Index := -1;
					   
					 // Test control
	
					 // Test component configuration
					 f_cf01Up();
	
					 // Test adapter configuration
	
					 // Preamble
					 v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 
	
					 f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_request, int23);
				
					 // Test Body
					v_request := f_getCreateRequestPrimitive(int23, m_createSubscriptionBase, v_aeIndex);
	
					 mcaPort.send(m_request(valueof(v_request)));
					
					 f_is_component_done(v_notifyHandler);
					 
					 // Postamble
					 f_cse_postamble_deleteResources();
	
					 // Tear down
					 f_cf01Down();					
				
				} // end TC_CSE_SUB_CRE_004
				
				/**
				 * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Create_of_Direct_Child_Resource"  and an create operation has been performed on the subscribed-to resource
				 * 
				 */
				testcase TC_CSE_SUB_CRE_005() runs on CseTester system CseSystem {
					
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit; 
					var template PrimitiveContent v_contentNotification := {container := mw_contentContainer_rc1};// all attributes expected   
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
			
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int3}, -)); 
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);

					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription 				
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};
	
					// Test Body
					v_request:= f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex);
					
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentNotification)); // check if the notification is well received and if its content matchs
					
					mcaPort.send(m_request(v_request));
    				tc_ac.start;
    				alt {
    					[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
    						tc_ac.stop;
    						setverdict(pass, __SCOPE__ & ": Resource type int3 (Container) created successfully");
    					}
    					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
    						tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
    					}
    					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
    						tc_ac.stop;
    						setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)");
    					}
    					[] tc_ac.timeout {
    						setverdict(fail, __SCOPE__ & ": No answer while creating resource type int3 (Container)");
    					}
    				}
    				
					f_is_component_done(v_notifyHandler);
    							
					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();
				} // end TC_CSE_SUB_CRE_005
	
			}//end group Create
			
			group Notify{
				
				/**
				 * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT have received the Notify response containing Response Status Code indicating SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE 
				 * 
				 */
				testcase TC_CSE_SUB_NTF_001() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
						
					// Test control

					// Test component configuration
					f_cf01Up();
										
					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23, int4101);
						
					// Test Body
					v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription 
					
					mcaPort.send(m_request(v_request));
					
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4101))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE 
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Subsciption successful whereas subsciption creator has no privilege");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}

					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_NTF_001
				
				/**
				 * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT have received the Notify response containing Response Status Code indicating SUBSCRIPTION_HOST_HAS_NO_PRIVILEGE
				 * 
				 */
				testcase TC_CSE_SUB_NTF_002() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
						
					// Test control

					// Test component configuration
					f_cf01Up();
										
					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23, int5205);
						
					// Test Body
					v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription 
					
					mcaPort.send(m_request(v_request));
					
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int5205))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE 
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Subsciption successful whereas subsciption creator has no privilege");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource");
						}
					}

					f_checkCseTesterStatus();
    					
					//Check to see if the resource is NOT present
					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
					} else {
					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
					}

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_NTF_002
				
    			/**
    			 * @desc Check that the IUT sends aggregated notification to the subscriber resource when the duration value of the batchNotify attribute is set to TIME_LIMIT and when this timer expires
    			 * 
    			 */
    			testcase TC_CSE_SUB_NTF_003() runs on CseTester system CseSystem {
					// Local variables
					const integer numberOfAggregatedNotification := 3;
					var Labels v_labels_1:= {"VALUE_1"};
					var Labels v_labels_2:= {"VALUE_2"};
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit;
					var template PrimitiveContent v_contentResponse;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
					
					v_contentResponse.aE := mw_contentAeBase; // all attributes expected   

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration

					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};

					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, 2)); // check that no notification is received

					v_updateRequest.primitiveContent.aE.labels := v_labels_1;
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1
					f_cse_updateResource(v_request);
					
					v_updateRequest.primitiveContent.aE.labels := v_labels_2; 
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2
					f_cse_updateResource(v_request);

					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();
    
    			} // end TC_CSE_SUB_NTF_003

			}//end group Notify
			
			group Update {
				
				/**
				 * @desc Check that the IUT sends Notify request to the subscriber resource when an update operation has been performed on the subscribed-to resource
				 * 
				 */
				testcase TC_CSE_SUB_UPD_001() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var Labels v_labels_1:= {"VALUE_1"};
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := m_createSubscriptionBase; 
					var template PrimitiveContent v_contentResponse;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;   

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription

					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};
					
					// Test Body
					v_contentResponse.aE := mw_contentAeBase; // all attributes expected
					
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs
					
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request
					v_updateRequest.primitiveContent.aE.labels := v_labels_1; 

					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae)");
						}
					};
					
					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_001
				
				/**
				 * @desc Check that the IUT sends a Notify request to the subscriber resource when the notificationContentType attribute is set to “modified attributes” and an update operation has been performed on the subscribed-to resource
				 * 
				 */
				testcase TC_CSE_SUB_UPD_002() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var Labels v_labels_1:= {"VALUE_1"};
					var template PrimitiveContent v_contentResponse := {aE := m_contentAe_allOmit};
					var template RequestPrimitive v_createRequest := omit;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
			
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int2); //notificationContentType ="modified attributes"
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); //Subscription
			
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};
			
					// Test Body
					//TODO Use f_getTemplateFromPrimitiveContent() which needs to be modified to receive the template in which the output template will be built upon
					v_contentResponse.aE.labels := ?;// only modified attribute expected
					
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs
			
					v_updateRequest.primitiveContent.aE.labels := v_labels_1; 
			
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest);
					
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae)");
						}
					}	

					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_002
						
				/**
				 * @desc Check that the IUT sends a Notify request to the subscriber resource when the notificationContentType attribute is set to “ResourceID” and an update operation has been performed on the subscribed-to resource
				 *  
				 */
				testcase TC_CSE_SUB_UPD_003() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var Labels v_labels_1:= {"VALUE_1"};
					var template RequestPrimitive v_createRequest := omit;
					var template PrimitiveContent v_contentResponse;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
					
					v_updateRequest.primitiveContent.aE.labels := v_labels_1; 
					v_contentResponse.aE := m_contentAe_allOmit; // only modified attribute expected  
					v_contentResponse.aE.resourceID := ?;

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int3); // notificationContentType ="ResourceID"
					
					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription

					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest);

					f_is_component_done(v_notifyHandler);
			
					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs
					
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received");
						}
					}	

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_003
					
				/**
				 * @desc Check that the IUT decreases the expirationCounter attribute of a subscription resource when the Hosting CSE of the subscribed-to resource successfully sends the notification request to subscriber resource(s)
				 *  
				 */
				testcase TC_CSE_SUB_UPD_004() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var Labels v_labels_1:= {"VALUE_1"};
					var template PrimitiveContent v_contentResponse;
					var template RequestPrimitive v_createRequest := omit;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var template PrimitiveContent v_retrieveContentResponse;
        			var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;

					v_updateRequest.primitiveContent.aE.labels := v_labels_1; 
					v_contentResponse.aE := mw_contentAeBase; // all attributes expected  
					v_retrieveContentResponse.subscription := mw_contentSubscription_rc1;

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 3);  //expirationCounter set to 3
					
					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};
					
					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs

					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request
					f_cse_updateResource(v_request); // AE update
					
					//TODO See if we keep this f_is_component_done, it assure that the retrieve operation is executed after having sent and received the Notification
					f_is_component_done(v_notifyHandler);
					
					mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
	
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retrieveContentResponse))) -> value v_response {
							tc_ac.stop;
							if(v_response.primitive.responsePrimitive.primitiveContent.subscription.expirationCounter == 2 ){
								setverdict(pass, __SCOPE__ & ": expirationCounter has been successfully decreased by one");
							}
							else{
								setverdict(fail, __SCOPE__ & ": Error expirationCounter hasn't been decreased by one");
							}
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
						}
					}
					
					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_004
						
				/**
				 * @desc Check that the IUT deletes the subscription resource when the the expirationCounter meets zero
				 * 
				 */
				testcase TC_CSE_SUB_UPD_005() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var Labels v_labels_1:= {"VALUE_1"};
					var template PrimitiveContent v_contentResponse;
					var template RequestPrimitive v_createRequest := omit;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
					
					v_updateRequest.primitiveContent.aE.labels := v_labels_1; 
					v_contentResponse.aE := mw_contentAeBase; // all attributes expected  

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 1);  //expirationCounter set to 1
					
					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);// Subscription

					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};
	
					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request
					f_cse_updateResource(v_request); // AE update
					
					//TODO See if we keep this f_is_component_done, it assure that the retrieve operation is executed after having sent and received the Notification
					f_is_component_done(v_notifyHandler);

					mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));

					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Subscription Resource have been successfully deleted");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error Subscription Resource has not been deleted");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while retrieving Subscription Resource");
						}
					}
					
					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_005
				
				/**
				 * @desc Check that the IUT doesn’t send a Notify request to the subscriber resource when the “attribute” condition tag of eventNotificationCriteria attribute is set to LIST_OF_ATTRIBUTE and doesn’t contain the ATTRIBUTE_NAME attribute updated.
				 * 
				 */
				testcase TC_CSE_SUB_UPD_006() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var Labels v_labels_1:= {"VALUE_1"};
					var AttributeList_1 v_attributeList := {"appName"};
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;

					v_updateRequest.primitiveContent.aE.labels := v_labels_1;

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList));

					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription

					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request

					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};

					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_noNotificationHandler()); // check that no notification is received
		
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received");
						}
					}	

					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_006
				
				/**
				 * @desc Check that the IUT sends aggregated notification to the subscriber resource when the number value of the batchNotify attribute is set to GROUP_LIMIT and when this number have been reached
				 * 
				 */
				testcase TC_CSE_SUB_UPD_007() runs on CseTester system CseSystem {
					// Local variables
					const integer numberOfAggregatedNotification := 3;
					var Labels v_labels_1:= {"VALUE_1"};
					var Labels v_labels_2:= {"VALUE_2"};
					var Labels v_labels_3:= {"VALUE_3"};
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit;
					var template PrimitiveContent v_contentResponse;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
					
					v_contentResponse.aE := mw_contentAeBase; // all attributes expected   

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration

					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};

					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, numberOfAggregatedNotification)); // check that no notification is received
					
					v_updateRequest.primitiveContent.aE.labels := v_labels_1;
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1
					f_cse_updateResource(v_request);
					
					v_updateRequest.primitiveContent.aE.labels := v_labels_2; 
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2
					f_cse_updateResource(v_request);
					
					v_updateRequest.primitiveContent.aE.labels := v_labels_3; 
					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3
					f_cse_updateResource(v_request);

					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_007
					
            	/**
            	 * @desc Check that the IUT sends the latest notification to the subscriber resource when latestNotify is set to TRUE, the number value of the batchNotify attribute is set to GROUP_LIMIT and when this number have been reached
            	 * 
            	 */
            	testcase TC_CSE_SUB_UPD_008() runs on CseTester system CseSystem {
            		// Local variables
            		const integer numberOfAggregatedNotification := 3;
            		var Labels v_labels_1:= {"VALUE_1"};
            		var Labels v_labels_2:= {"VALUE_2"};
            		var Labels v_labels_3:= {"VALUE_3"};
            		var integer v_aeIndex := -1;
            		var integer v_resourceIndex := -1;
            		var template RequestPrimitive v_createRequest := omit;
            		var template PrimitiveContent v_contentResponse;
            		var template RequestPrimitive v_updateRequest := m_updateAeBase;
            		var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
            
            		v_contentResponse.aE := mw_contentAeBase; // all attributes expected   
            
            		// Test control
            
            		// Test component configuration
            		f_cf01Up();
            
            		// Test adapter configuration
            
            		// Preamble
            		v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
						
            		v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification), true);// TODO fix the duration
            		
            		//TODO We Need to check if the IUT send a notification only for the latest update operation
            		// like we match a Notification we have to verify if it is the first (unvalid behavior) or the last (valid behavior)
            		// maybe we need to synchronise our components
            		
            		v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
            					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};
					
					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs
            					
            		v_updateRequest.primitiveContent.aE.labels := v_labels_1; 
            		v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1
					f_cse_updateResource(v_request);
            					
            		v_updateRequest.primitiveContent.aE.labels := v_labels_2; 
            		v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2
					f_cse_updateResource(v_request);
            					
            		v_updateRequest.primitiveContent.aE.labels := v_labels_3; 
            		v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3
					f_cse_updateResource(v_request);
					
					f_is_component_done(v_notifyHandler);
					
            		//Postamble
            		f_cse_postamble_deleteResources();
            
            		//Tear down
            		f_cf01Down();
            
            	} // end TC_CSE_SUB_UPD_008

				/**
				 * @desc Check that the IUT sends a Notify request to the subscriber resource when the “attribute” condition tag of eventNotificationCriteria attribute is set to ATTRIBUTE_NAME and an update operation has been performed on the subscribed-to resource
				 * 
				 */
				testcase TC_CSE_SUB_UPD_009() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var Labels v_labels_1:= {"VALUE_1"};
					var AttributeList_1 v_attributeList := {"labels"};
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit;
					var template PrimitiveContent v_contentResponse;
					var template RequestPrimitive v_updateRequest := m_updateAeBase;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
					
					v_updateRequest.primitiveContent.aE.labels := v_labels_1; 
					v_contentResponse.aE := mw_contentAeBase; // all attributes expected   

					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList));

					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription

					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};
			
					// Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs
					
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received");
						}
					}	
					
					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_UPD_009



			}//end group Update
			
			group Delete {
				
				/**
				 * @desc Check that the IUT sends a Notify request to the AE2_RESOURCE_ADDRESS of the subscriberURI attribute when the SUBSCRIPTION_RESOURCE_ADDRESS <subscription> resource is deleted
				 * 
				 */
				testcase TC_CSE_SUB_DEL_001() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_resourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit;
					var RequestPrimitive v_request;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
					
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit,f_getResourceAddress(v_ae2Index)); // SubscriberURI ="ResourceID"
	
					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subsciption
					
					v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); // Subscription resource deletion request
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};

					// Test Body
					v_notifyHandler.start(f_CSE_SUB_DEL_001(f_getResourceAddress(v_resourceIndex))); // check that no notification is received
					
					mcaPort.send(m_request(v_request));
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Subscription resource deleted successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while deleting resource type int23 (Subscription)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int23 (Subscription)");
						}
					}	
					
					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_DEL_001
				
        		function f_CSE_SUB_DEL_001(in XSD.AnyURI p_subscriptionReference) runs on CseTester {
        			// Local variables
        			var MsgIn v_response;
        			var template Notification v_notificationRequest := mw_contentNotificationBase;
        			
        			v_notificationRequest.subscriptionDeletion := true;
        			v_notificationRequest.subscriptionReference := p_subscriptionReference;
        			
        
        			map(self:mcaPort, system:mcaPort);
        			map(self:acPort, system:acPort);
        
        			tc_ac.start;
        			alt {
        				[] mcaPort.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_response {
        					tc_ac.stop;
        					setverdict(pass, __SCOPE__ & ": Notification received");
        				}
        				[] mcaPort.receive{
        					tc_ac.stop;
        					setverdict(fail, __SCOPE__ & ": Error, unexpected message received");
        				}
        				[] tc_ac.timeout {
        					setverdict(fail, __SCOPE__ & ": No notification received");
        				}
        			}
        
        			unmap(self:mcaPort, system:mcaPort);
        			unmap(self:acPort, system:acPort); 
        
        		} //end f_CSE_SUB_DEL_001

				
				/**
				 * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Delete_of_Resource"  and an delete operation has been performed the subscribed-to resource
				 * 
				 */
				testcase TC_CSE_SUB_DEL_002() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_subscriptionResourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit; 
					var template PrimitiveContent v_contentNotification := {aE:= mw_contentAeBase}; // all attributes expected;
					var RequestPrimitive v_deleteRequest;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;
				
					// Test control

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int2}, -));
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
								
					v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex );//Subscription
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};

					//Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_subscriptionDeletionHandler(v_contentNotification)); // check if the notification is well received and if its content matchs
					
					v_deleteRequest:= valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); // Ae delete request
					
					mcaPort.send(m_request(v_deleteRequest));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
							tc_ac.stop;
							//Update vc_resourcesIndexToBeDeleted 
							f_removeElementFromList (vc_resourcesIndexToBeDeleted, v_aeIndex);
							setverdict(pass, __SCOPE__ & ": resource type int2 (AE) deleted successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while deleting resource type int2 (AE)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int2 (AE)");
						}
					}
					
					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_DEL_002
									
				/**
				 * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Delete_of_Direct_Child_Resource"  and an delete operation has been performed on a child resource of the subscribed-to resource
				 *  
				 */
				testcase TC_CSE_SUB_DEL_003() runs on CseTester system CseSystem {
					// Local variables
					var MsgIn v_response;
					var integer v_aeIndex := -1;
					var integer v_subscriptionResourceIndex := -1;
					var integer v_containerResourceIndex := -1;
					var template RequestPrimitive v_createRequest := omit;
					var RequestPrimitive v_deleteRequest;
					var template PrimitiveContent v_contentNotification := {container := mw_contentContainer_rc1}; // all attributes expected in notification;
					var CseTester v_notifyHandler;
					var integer v_ae2Index := -1;

					// Test component configuration
					f_cf01Up();

					// Test adapter configuration

					// Preamble
					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi;

					v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container
					
					v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int4}, -));
					
					f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);
					
					v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription (with name attribute omitted) 									
					
					if(v_notifyHandler.running) {
						v_notifyHandler.stop;
					};

					//Test Body
					v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentNotification)); // check if the notification is well received and if its content matchs
					
					v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerResourceIndex), f_getOriginator(v_containerResourceIndex)));// Container deletion request
					
					mcaPort.send(m_request(v_deleteRequest));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Container resource deleted successfully");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while deleting resource type int3 (Container)");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int3 (Container)");
						}
					}	

					f_is_component_done(v_notifyHandler);

					//Postamble
					f_cse_postamble_deleteResources();

					//Tear down
					f_cf01Down();

				} // end TC_CSE_SUB_DEL_003
				
			}//end group Delete
			
		}//end group Subscription_And_Notification
		
		group Security {
	
			group Access_Control_Policy {
				
				group Create {
	
					/**
					 * @desc Check that the IUT accepts the creation of a accessControlPolicy resource with privileges attribute having multiple access control rules
					 * 
					 */
					testcase TC_CSE_SEC_ACP_CRE_001() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex := -1;
						var template PrimitiveContent v_contentResponse;
						var RequestPrimitive v_createRequest := valueof(m_createAcpBase);
						var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63));
						var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"Temporary"}, int55));
						const ResourceType c_accessControlPolicyType := int1;

						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble
						v_aeIndex := f_cse_preamble_registerAe(-, -); // Use for setting the ACR_2's accessControlOriginators attribute to AE_ID

						v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};
						v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)};

						v_contentResponse.accessControlPolicy := mw_contentAcp_rc1;
						v_contentResponse.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};// TODO To handle reverse order of acrs
						v_contentResponse.accessControlPolicy.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)};

						// Test Body
						v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, v_aeIndex);
						
						mcaPort.send(m_request(v_createRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully");
								v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1);
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}							
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType)));
							}
						}

						f_checkCseTesterStatus();
    						
						//Check to see if the resource is present or not
						if(f_isResourcePresent(v_acpIndex)) {
							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
						} else {
							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
						}

						//Postamble
						f_cse_postamble_deleteResources();

						//Tear down
						f_cf01Down();

					}//end TC_CSE_SEC_ACP_CRE_001
							
					/**
				 	* @desc Check that the IUT accepts the creation of a  accessControlPolicy resource with selfPrivileges attribute having multiple access control rules
				 	*/
					testcase TC_CSE_SEC_ACP_CRE_002() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex := -1;
						var template PrimitiveContent v_contentResponse;
						var RequestPrimitive v_createRequest := valueof(m_createAcpBase);
						var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63));
						var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"Temporary"}, int55));
						const ResourceType c_accessControlPolicyType := int1;

						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble
						v_aeIndex := f_cse_preamble_registerAe(-, -); // Only use for setting the ACR_2's accessControlOriginators attribute to AE_ID

						v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};
						v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)};

						v_contentResponse.accessControlPolicy := mw_contentAcp_rc1;
						v_contentResponse.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};//TODO To handle reverse order of acrs
						v_contentResponse.accessControlPolicy.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)};

						// Test Body
						v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, v_aeIndex);// CSE child resource
						
						mcaPort.send(m_request(v_createRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully");
								v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, c_accessControlPolicyType);
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType)));
							}
						}

						f_checkCseTesterStatus();
    						
						//Check to see if the resource is present or not
						if(f_isResourcePresent(v_acpIndex)) {
							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
						} else {
							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
						}

						//Postamble
						f_cse_postamble_deleteResources();

						//Tear down
						f_cf01Down();

					}//end TC_CSE_SEC_ACP_CRE_002
				
				}// end of group Create
			
				group Update {
				
					/**
					 * @desc Check that the IUT updates successfully the accessControlPolicyIDs attribute of the <AE> resource when the AE has privileges for UPDATE operation in any selfPrivileges of the <accessControlPolicy> resources which this attribute originally indicates.
					 * 
					 */
					testcase TC_CSE_SEC_ACP_UPD_001() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex1 := -1;
						var integer v_acpIndex2 := -1;
						var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit));
						var RequestPrimitive v_updateRequest := valueof(m_updateAeBase);
						var AccessControlRule v_accessControlRule_1;
						var AccessControlRule v_accessControlRule_2;
						var SetOfAcrs v_setOfArcs_1;
						var SetOfAcrs v_setOfArcs_2;
						var PrimitiveContent v_primitiveContentRetrievedResource;

						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble
						v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource
						
						v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource
						
						v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource)}, -);

						v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int59)); // c_CRUDNDi
						v_accessControlRule_2 := valueof(m_createAcr({PX_SUPER_AE_ID, f_getOriginator(v_aeIndex)}, int63)); // c_CRDNDi 
						v_setOfArcs_1.accessControlRule_list := {v_accessControlRule_1};
						v_setOfArcs_2.accessControlRule_list := {v_accessControlRule_2};
						v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs_1, v_setOfArcs_2));
						v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest);
						f_cse_updateResource(v_updateRequest);
						
						// Test Body
						v_updateRequest.primitiveContent.aE.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)};
						v_updateRequest := f_getUpdateRequestPrimitive(int1, v_aeIndex, v_updateRequest);
						
						mcaPort.send(m_request(v_updateRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Successful Update operation on resource type int2 (Ae)");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while Update operation on resource type int2 (Ae)");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while executing update operation on resource type int2 (Ae)");
							}
						}

						v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_aeIndex);
						if(getverdict == pass){
							if(ischosen(v_primitiveContentRetrievedResource.aE)) {
								 if(not match (v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.aE.accessControlPolicyIDs))){
									  setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute not updated correctly")
							}
						  }
						}

						//Postamble
						f_cse_postamble_deleteResources();

						//Tear down
						f_cf01Down();
						
					}//end TC_CSE_SEC_ACP_UPD_001

					/**
					 * @desc Check that the IUT responds with an error when the AE tries an UPDATE operation on the accessControlPolicyIDs attribute without having privileges for such operation in any selfPrivileges of the <accessControlPolicy> resources which this attribute originally indicates.
					 * 
					 */
					testcase TC_CSE_SEC_ACP_UPD_002() runs on CseTester system CseSystem {
						// Local variables
						var MsgIn v_response;
						var integer v_aeIndex := -1;
						var integer v_acpIndex1 := -1;
						var integer v_acpIndex2 := -1;
						var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit));
						var RequestPrimitive v_updateRequest := valueof(m_updateAeBase);
						var AccessControlRule v_accessControlRule_1;
						var AccessControlRule v_accessControlRule_2;
						var SetOfAcrs v_setOfArcs_1;
						var SetOfAcrs v_setOfArcs_2;
						var PrimitiveContent v_primitiveContentRetrievedResource;

						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble
						v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource
						
						v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource
						
						v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource)}, -);

						v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int63)); // c_CRDNDi
						v_accessControlRule_2 := valueof(m_createAcr({PX_SUPER_AE_ID, f_getOriginator(v_aeIndex)}, int59)); // c_CRUDNDi 
						v_setOfArcs_1.accessControlRule_list := {v_accessControlRule_1};
						v_setOfArcs_2.accessControlRule_list := {v_accessControlRule_2};
						v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs_1, v_setOfArcs_2));
						v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest);
						f_cse_updateResource(v_updateRequest);
						
						// Test Body
						v_updateRequest.primitiveContent.aE.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)};
						v_updateRequest := f_getUpdateRequestPrimitive(int1, v_aeIndex, v_updateRequest);

						mcaPort.send(m_request(v_updateRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)");
							}
						}

						v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_aeIndex);
						if(getverdict == pass){
							if(ischosen(v_primitiveContentRetrievedResource.aE)) {
								 if(match(v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.aE.accessControlPolicyIDs))){
									  setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute updated")
							}
						  }
						}

						//Postamble
						f_cse_postamble_deleteResources();

						//Tear down
						f_cf01Down();
						
					}//end TC_CSE_SEC_ACP_UPD_002
					
				}// end of group Update
				
				group Basic_Operations {
				
					group g_CSE_SEC_ACP_001{
						
						/**
						 * @desc Check that the IUT responds with an error when an ORIGINATOR tries an OPERATION without having privileges for performing the OPERATION on the TARGET_RESOURCE_TYPE resource.
						 * 
						 */
						testcase TC_CSE_SEC_ACP_001_CRE() runs on CseTester system CseSystem { //Create
							f_CSE_SEC_ACP_001(m_createContainerBase);	
						}//end TC_CSE_SEC_ACP_001_CRE
	
						testcase TC_CSE_SEC_ACP_001_UPD() runs on CseTester system CseSystem { //Update
							var template RequestPrimitive v_updateRequest := m_updateAeBase;
							var Labels v_labels_1:= {"VALUE_1"};
							v_updateRequest.primitiveContent.aE.labels := v_labels_1;
							f_CSE_SEC_ACP_001(v_updateRequest);	
						}//end TC_CSE_SEC_ACP_001_UPD
	
						testcase TC_CSE_SEC_ACP_001_RET() runs on CseTester system CseSystem { //Retrieve
							f_CSE_SEC_ACP_001(m_retrieveResource("Temporary", "Temporary"));	
						}//end TC_CSE_SEC_ACP_001_RET
	
						testcase TC_CSE_SEC_ACP_001_DEL() runs on CseTester system CseSystem { //Delete
							f_CSE_SEC_ACP_001(m_delete("Temporary", "Temporary"));	
						}//end TC_CSE_SEC_ACP_001_DEL
	
						function f_CSE_SEC_ACP_001(template RequestPrimitive p_requestPrimitive) runs on CseTester {
							// Local variables
							var MsgIn v_response;
							var integer v_aeIndex := -1;
							var integer v_acpIndex := -1;
							var RequestPrimitive v_createRequest := valueof(m_createAcpBase);
							var RequestPrimitive v_updateRequest;
							var AccessControlRule v_accessControlRule_1;
							var SetOfAcrs v_setOfArcs;
	
							// Test control
	
							// Test component configuration
							f_cf01Up();
	
							// Test adapter configuration
	
							// Preamble
							v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -);
			
							v_accessControlRule_1 := valueof(m_createAcr({ f_getOriginator(v_aeIndex), PX_SUPER_AE_ID}, int63));
							v_setOfArcs.accessControlRule_list := {v_accessControlRule_1};
							v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs));
							v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest);
							f_cse_updateResource(v_updateRequest);
			
							// Test Body
							p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
							p_requestPrimitive.from_ := "UnknowOriginator";
	
							mcaPort.send(m_request(valueof(p_requestPrimitive)));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)");
								}
							}
	
							//Postamble
							f_cse_postamble_deleteResources();
	
							//Tear down
							f_cf01Down();
	
						} //end f_CSE_SEC_ACP_001
	
					} //end g_CSE_SEC_ACP_001
					
					group g_CSE_SEC_ACP_002{
						
						/**
						 * @desc Check that the IUT responds successfully when the AE tries an OPERATION on its <AE> resource which has multiple accessControlPolicyID attribute
						 * 
						 */
						testcase TC_CSE_SEC_ACP_002_CRE() runs on CseTester system CseSystem { //Create
							f_CSE_SEC_ACP_002(m_createContainerBase, int2001);	
						}//end TC_CSE_SEC_ACP_002_CRE
	
						testcase TC_CSE_SEC_ACP_002_UPD() runs on CseTester system CseSystem { //Update
							var template RequestPrimitive v_updateRequest := m_updateAeBase;
							var Labels v_labels_1:= {"VALUE_1"};
							v_updateRequest.primitiveContent.aE.labels := v_labels_1;
							f_CSE_SEC_ACP_002(v_updateRequest, int2004);	
						}//end TC_CSE_SEC_ACP_002_UPD
	
						testcase TC_CSE_SEC_ACP_002_RET() runs on CseTester system CseSystem { //Retrieve
							f_CSE_SEC_ACP_002(m_retrieveResource("Temporary", "Temporary"), int2000);	
						}//end TC_CSE_SEC_ACP_002_RET
	
						testcase TC_CSE_SEC_ACP_002_DEL() runs on CseTester system CseSystem { //Delete
							f_CSE_SEC_ACP_002(m_delete("Temporary", "Temporary"), int2002);	
						}//end TC_CSE_SEC_ACP_002_DEL
	
						function f_CSE_SEC_ACP_002(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester {
							// Local variables
							var MsgIn v_response;
							var integer v_aeIndex := -1;
							var integer v_acpIndex1 := -1;
							var integer v_acpIndex2 := -1;
							var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit));
							var RequestPrimitive v_updateRequest;
							var AccessControlRule v_accessControlRule_1;
							var SetOfAcrs v_setOfArcs;
	
							// Test control
	
							// Test component configuration
							f_cf01Up();
	
							// Test adapter configuration
	
							// Preamble
							v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource
							v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource
							
							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource), f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}, -);
			
							v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int3)); // c_CR 
							v_setOfArcs.accessControlRule_list := {v_accessControlRule_1};
							v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -));
							v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest);
							f_cse_updateResource(v_updateRequest);
							
							v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int60)); // c_UDNDi  
							v_setOfArcs.accessControlRule_list := {v_accessControlRule_1};
							v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -));
							v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex2, v_updateRequest);
							f_cse_updateResource(v_updateRequest);
	
							// Test Body
							p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
							p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
	
							mcaPort.send(m_request(valueof(p_requestPrimitive)));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)");
								}
							}
	
							//Postamble
							f_cse_postamble_deleteResources();
	
							//Tear down
							f_cf01Down();
	
						} //end f_CSE_SEC_ACP_002
						
					} //end g_CSE_SEC_ACP_002
					
				
					
					group g_CSE_SEC_ACP_003 {
						 
						/**
						 * @desc Check that the IUT responds successfully when an allowed DOMAIN tries an OPERATION on a AE_RESOURCE_TYPE resource.
						 * 
						 */
						testcase TC_CSE_SEC_ACP_003_CRE() runs on CseTester system CseSystem { //Create
							f_CSE_SEC_ACP_003(m_createContainerBase, int2001);	
						}//end TC_CSE_SEC_ACP_003_CRE
						
						testcase TC_CSE_SEC_ACP_003_UPD() runs on CseTester system CseSystem { //Update
							var template RequestPrimitive v_updateRequest := m_updateAeBase;
							var Labels v_labels_1:= {"VALUE_1"};
							v_updateRequest.primitiveContent.aE.labels := v_labels_1;
							f_CSE_SEC_ACP_003(v_updateRequest, int2004);	
						}//end TC_CSE_SEC_ACP_003_02
						
						testcase TC_CSE_SEC_ACP_003_RET() runs on CseTester system CseSystem { //Retrieve
							f_CSE_SEC_ACP_003(m_retrieveResource("Temporary", "Temporary"), int2000);	
						}//end TC_CSE_SEC_ACP_003_03
						
						testcase TC_CSE_SEC_ACP_003_DEL() runs on CseTester system CseSystem { //Delete
							f_CSE_SEC_ACP_003(m_delete("Temporary", "Temporary"), int2002);	
						}//end TC_CSE_SEC_ACP_003_04
		
						function f_CSE_SEC_ACP_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester{
							// Local variables
							var MsgIn v_response;
							var integer v_aeIndex := -1;
							var integer v_acpIndex := -1;
							var RequestPrimitive v_createRequest;
							var AccessControlRule v_accessControlRule_1;
							var RequestPrimitive v_updateRequest;
							var SetOfAcrs v_setOfArcs;
							
							// Test control
	
							// Test component configuration
							f_cf01Up();
	
							// Test adapter configuration
	
							// Preamble
							v_createRequest := valueof(m_createAcp(f_getResourceAddress(), -, {"testDomain"}));
							v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
							
							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -);
							
							// Test Body
							p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
							p_requestPrimitive.from_ := "testDomain";
							
							mcaPort.send(m_request(valueof(p_requestPrimitive)));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)");
								}
							}
	
							//Postamble
							v_accessControlRule_1 := valueof(m_createAcr({"*"}, int63));
							v_setOfArcs.accessControlRule_list := {v_accessControlRule_1};
							v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs));
							v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest);
							v_updateRequest.from_ := "testDomain";
							mcaPort.send(m_request(v_updateRequest));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									log(__SCOPE__ & ":INFO:  Attribute of resource type ACP updated successfully");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									log(__SCOPE__ & ":INFO:  Error while updating resource type ACP");
								}
								[] tc_ac.timeout {
									log(__SCOPE__ & ":INFO:  No answer while updating resource type ACP");
								}
							}
							
							f_cse_postamble_deleteResources();
	
							//Tear down
							f_cf01Down();
	
						}//end f_CSE_SEC_ACP_003
			
					}//end g_CSE_SEC_ACP_003
					
					group g_CSE_SEC_ACP_004 {
						
						/**
						 * @desc Check that the IUT responds successfully when any ORIGINATOR tries an OPERATION on a AE_RESOURCE_TYPE resource for which all originators are allowed
						 * 
						 */
						testcase TC_CSE_SEC_ACP_004_CRE() runs on CseTester system CseSystem { //Create
							f_CSE_SEC_ACP_004(m_createContainerBase, int2001);	
						}//end TC_CSE_SEC_ACP_004_CRE
		
						testcase TC_CSE_SEC_ACP_004_UPD() runs on CseTester system CseSystem { //Update
							var template RequestPrimitive v_updateRequest := m_updateAeBase;
							var Labels v_labels_1:= {"VALUE_1"};
							v_updateRequest.primitiveContent.aE.labels := v_labels_1;
							f_CSE_SEC_ACP_004(v_updateRequest, int2004);	
						}//end TC_CSE_SEC_ACP_004_UPD
		
						testcase TC_CSE_SEC_ACP_004_RET() runs on CseTester system CseSystem { //Retrieve
							f_CSE_SEC_ACP_004(m_retrieveResource("Temporary", "Temporary"), int2000);	
						}//end TC_CSE_SEC_ACP_004_RET
		
						testcase TC_CSE_SEC_ACP_004_DEL() runs on CseTester system CseSystem { //Delete
							f_CSE_SEC_ACP_004(m_delete("Temporary", "Temporary"), int2002);	
						}//end TC_CSE_SEC_ACP_004_DEL
	
						function f_CSE_SEC_ACP_004(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester{
							// Local variables
							var MsgIn v_response;
							var integer v_aeIndex := -1;
							var integer v_acpIndex := -1;
							var RequestPrimitive v_createRequest;
			
							// Test control
	
							// Test component configuration
							f_cf01Up();
	
							// Test adapter configuration
	
							// Preamble
							v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1);
							v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
							
							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -);
			
							// Test Body
							p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
							p_requestPrimitive.from_ := "UnknowOriginator";
			
							mcaPort.send(m_request(valueof(p_requestPrimitive)));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)");
								}
							}
	
	
							//Postamble
							f_cse_postamble_deleteResources();
	
							//Tear down
							f_cf01Down();
	
						}//end f_CSE_SEC_ACP_004
	
					}//end g_CSE_SEC_ACP_004
					
					group g_CSE_SEC_ACP_011 {
						
						/**
						 * @desc Check that the IUT responds successfully when the AE tries an OPERATION on its child <container> resource whose accessControlPolicyID attribute is not set and  AE has privileges for such OPERATION on its associated accessControlPolicy resource
						 * 
						 */
						testcase TC_CSE_SEC_ACP_011_CRE() runs on CseTester system CseSystem { //Create
							f_CSE_SEC_ACP_011(m_createContainerBase, int2001);	
						}//end TC_CSE_SEC_ACP_011_CRE
	
						testcase TC_CSE_SEC_ACP_011_UPD() runs on CseTester system CseSystem { //Update
							var template RequestPrimitive v_updateRequest := m_updateContainerBase;
							var Labels v_labels_1:= {"VALUE_1"};
							v_updateRequest.primitiveContent.container.labels := v_labels_1;
							f_CSE_SEC_ACP_011(v_updateRequest, int2004);	
						}//end TC_CSE_SEC_ACP_011_UPD
	
						testcase TC_CSE_SEC_ACP_011_RET() runs on CseTester system CseSystem { //Retrieve
							f_CSE_SEC_ACP_011(m_retrieveResource("Temporary", "Temporary"), int2000);	
						}//end TC_CSE_SEC_ACP_011_RET
	
						testcase TC_CSE_SEC_ACP_011_DEL() runs on CseTester system CseSystem { //Delete
							f_CSE_SEC_ACP_011(m_delete("Temporary", "Temporary"), int2002);	
						}//end TC_CSE_SEC_ACP_011_DEL
	
						function f_CSE_SEC_ACP_011(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester {
							// Local variables
							var MsgIn v_response;
							var integer v_aeIndex := -1;
							var integer v_containerIndex := -1;
	
							// Test control
	
							// Test component configuration
							f_cf01Up();
	
							// Test adapter configuration
	
							// Preamble
							v_aeIndex := f_cse_preamble_registerAe(-, -);
							v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
							
							// Test Body
							p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex);
							p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
	
							mcaPort.send(m_request(valueof(p_requestPrimitive)));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Successful operation on resource type int3 (Container)");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error while operation on resource type int3 (Container)");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)");
								}
							}
	
							//Postamble
							f_cse_postamble_deleteResources();
	
							//Tear down
							f_cf01Down();
	
						} //end f_CSE_SEC_ACP_011
	
					} //end g_CSE_SEC_ACP_011
					
					group g_CSE_SEC_ACP_012 {
						
						/**
						 * @desc Check that the IUT responds with an error when an ORIGINATOR tries an OPERATION on a <Container>  resource with no accessControlPolicyID associated and such ORIGINATOR having no privileges for performing the OPERATION on the <Container> resource.
						 * 
						 */
						testcase TC_CSE_SEC_ACP_012_CRE() runs on CseTester system CseSystem { //Create
							f_CSE_SEC_ACP_012(m_createContainerBase, int62);	
						}//end TC_CSE_SEC_ACP_012_CRE
	
						testcase TC_CSE_SEC_ACP_012_UPD() runs on CseTester system CseSystem { //Update
							var template RequestPrimitive v_updateRequest := m_updateContainerBase;
							var Labels v_labels_1:= {"VALUE_1"};
							v_updateRequest.primitiveContent.container.labels := v_labels_1;
							f_CSE_SEC_ACP_012(v_updateRequest, int62);	//TODO Fix p_acor
						}//end TC_CSE_SEC_ACP_012_UPD
	
						testcase TC_CSE_SEC_ACP_012_RET() runs on CseTester system CseSystem { //Retrieve
							f_CSE_SEC_ACP_012(m_retrieveResource("Temporary", "Temporary"), int62);	//TODO Fix p_acor
						}//end TC_CSE_SEC_ACP_012_RET
	
						testcase TC_CSE_SEC_ACP_012_DEL() runs on CseTester system CseSystem { //Delete
							f_CSE_SEC_ACP_012(m_delete("Temporary", "Temporary"), int62);	//TODO Fix p_acor
						}//end TC_CSE_SEC_ACP_012_DEL
	
						function f_CSE_SEC_ACP_012(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_acor) runs on CseTester {
							// Local variables
							var MsgIn v_response;
							var integer v_aeIndex := -1;
							var integer v_containerIndex := -1;
							var integer v_acpIndex := -1;
							var RequestPrimitive v_request; 
							var RequestPrimitive v_createRequest := valueof(m_createAcpBase);
							var RequestPrimitive v_updateRequest;
							var AccessControlRule v_accessControlRule_1, v_accessControlRule_2;
							var SetOfAcrs v_setOfArcs;
	
							// Test control
	
							// Test component configuration
							f_cf01Up();
	
							// Test adapter configuration
	
							// Preamble
							v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -);
							v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
							
							v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63));
							v_accessControlRule_2 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, p_acor));
							v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2};
							v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -));
							v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest);
							f_cse_updateResource(v_updateRequest);
							
							// Test Body
							v_request := f_getCreateRequestPrimitive(int3, p_requestPrimitive, v_containerIndex);
							
							mcaPort.send(m_request(valueof(v_request)));
							tc_ac.start;
							alt {
								[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
									tc_ac.stop;
									setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
								}
								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges");
								}
								[] tc_ac.timeout {
									setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)");
								}
							}
	
							//Postamble
							f_cse_postamble_deleteResources();
	
							//Tear down
							f_cf01Down();
	
						} //end f_CSE_SEC_ACP_012
	
					} //end g_CSE_SEC_ACP_012
					
				}// end of Basic_Operations
				
			}//end group AccessControlPolicy
			
		}//end group Security
	
	}//end group CSE

	
}