From 536ed7d2443a0d76d99dbd49d5598f0050106fc4 Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Thu, 26 Jul 2018 11:26:53 +0200
Subject: [PATCH] Testcases running on Tester - some were still running on a
 different component

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 OneM2M_Testcases_CSE_Release_1.ttcn | 2354 ++++++++++++++-------------
 OneM2M_Testcases_CSE_Release_2.ttcn |    2 +-
 2 files changed, 1237 insertions(+), 1119 deletions(-)

diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn
index 78b14e1..803130d 100644
--- a/OneM2M_Testcases_CSE_Release_1.ttcn
+++ b/OneM2M_Testcases_CSE_Release_1.ttcn
@@ -1959,7 +1959,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						v_cse1.done;
 					}
 					
-					testcase TC_CSE_REG_CRE_026_ET() runs on CseSimu system CseSystem {
+					testcase TC_CSE_REG_CRE_026_ET() runs on Tester system CseSystem {
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
 						var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
 						var template RequestPrimitive v_request := mw_createRemoteCSE;
@@ -1972,7 +1972,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						v_cse1.done;
 					}
 					
-					testcase TC_CSE_REG_CRE_026_LBL() runs on CseSimu system CseSystem {
+					testcase TC_CSE_REG_CRE_026_LBL() runs on Tester system CseSystem {
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
 						var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
 						var template RequestPrimitive v_request := mw_createRemoteCSE;
@@ -1985,7 +1985,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						v_cse1.done;
 					}
 					
-					testcase TC_CSE_REG_CRE_026_POA() runs on CseSimu system CseSystem {
+					testcase TC_CSE_REG_CRE_026_POA() runs on Tester system CseSystem {
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
 						var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
 						var template RequestPrimitive v_request := mw_createRemoteCSE;
@@ -1998,7 +1998,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						v_cse1.done;
 					}
 					
-					testcase TC_CSE_REG_CRE_026_NL() runs on CseSimu system CseSystem {
+					testcase TC_CSE_REG_CRE_026_NL() runs on Tester system CseSystem {
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
 						var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
 						var template RequestPrimitive v_request := mw_createRemoteCSE;
@@ -2011,7 +2011,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						v_cse1.done;
 					}
 					
-					testcase TC_CSE_REG_CRE_026_CST() runs on CseSimu system CseSystem {
+					testcase TC_CSE_REG_CRE_026_CST() runs on Tester system CseSystem {
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
 						var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
 						var template RequestPrimitive v_request := mw_createRemoteCSE;
@@ -4001,379 +4001,418 @@ module OneM2M_Testcases_CSE_Release_1 {
 				
 				}// 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 AeSimu system CseSystem {
-						// Local variables
-						var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
-						var template RequestPrimitive v_createRequestContentInstance := m_createContentInstanceBase;
-						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_maxNumberOfInstances := 1;				   
-						// Test control
-				
-						// Test component configuration
-						f_cf01Up();
+				/**
+				 * @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 Tester system CseSystem {
 				
-						// Test adapter configuration
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+								
+					v_ae1.start(f_CSE_DMR_CRE_007());
+					  	  	
+					v_ae1.done;
+					  	  		
+				}
 				
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-						
-						v_createRequestContainer.primitiveContent.container.maxNrOfInstances := c_maxNumberOfInstances;
-												
-						v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex);		//Container
-						
-						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);	//ContentInstance
+				function f_CSE_DMR_CRE_007() runs on AeSimu system CseSystem {
+					// Local variables
+					var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
+					var template RequestPrimitive v_createRequestContentInstance := m_createContentInstanceBase;
+					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_maxNumberOfInstances := 1;				   
+					// Test control
+			
+					// Test component configuration
+					f_cf01Up();
+			
+					// Test adapter configuration
+			
+					// Preamble
+					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
 					
-						// Test Body
-						
-						v_createRequestContentInstance.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2";	//ContentInstance 2
-						v_request := f_getCreateRequestPrimitive(int4, v_createRequestContentInstance, v_containerIndex);
+					v_createRequestContainer.primitiveContent.container.maxNrOfInstances := c_maxNumberOfInstances;
+											
+					v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex);		//Container
 					
-						mcaPort.send(f_getMsgOutPrimitive(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 created");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Error while creating resource type contentInstance");
-								
-							}
-							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while creating resource type contentInstance");
-							}
-						}	
-								
-						f_checkAeSimuStatus();
-    					
-						//Check to see if the resource is NOT present
-						if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){
-						  setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance");
-						} else {
-						  setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance");
-						}
-												
-						// Postamble
-						f_cse_postamble_deleteResources();
-						
-						// Tear down
-						f_cf01Down();
-					    				
-					}//end TC_CSE_DMR_CRE_007
-						
-				}// end group g_CSE_DMR_CRE_007		
+					v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);	//ContentInstance
 				
-				group g_CSE_DMR_CRE_008 {
+					// Test Body
 					
-					/**
-					 * @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 AeSimu system CseSystem {
-						//Local variables
-						var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
-						var template RequestPrimitive v_createRequestContentInstance := m_createContentInstanceBase;
-						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 := 10;	
-						const XSD.String c_primitiveContent1 := "Content1";
-						const XSD.String c_primitiveContent2 := "Content2";			   
-						// Test control
-	
-						// Test component configuration
-						f_cf01Up();
-	
-						// Test adapter configuration
-	
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-	
-						v_createRequestContainer.primitiveContent.container.maxByteSize := c_maxByteSize;
+					v_createRequestContentInstance.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2";	//ContentInstance 2
+					v_request := f_getCreateRequestPrimitive(int4, v_createRequestContentInstance, v_containerIndex);
+				
+					mcaPort.send(f_getMsgOutPrimitive(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 created");
+						}
+						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+							tc_ac.stop;
+							setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
+						}
+						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+							tc_ac.stop;
+							setverdict(fail, __SCOPE__ & ": Error while creating resource type contentInstance");
 							
-						v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex);		//Container
-	
-						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), c_primitiveContent1), v_containerIndex);//ContentInstance
-	
-						// Test Body
-	
-						v_createRequestContentInstance.primitiveContent.contentInstance.content := c_primitiveContent2;	//ContentInstance 2
-						v_createRequestContentInstance.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2";
-						v_request := f_getCreateRequestPrimitive(int4, v_createRequestContentInstance, v_containerIndex);
-	
-						mcaPort.send(f_getMsgOutPrimitive(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 created");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Error while creating resource type contentInstance");
-			
-							}
-							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while creating resource type contentInstance");
-							}
-						}	
-			
-						f_checkAeSimuStatus();
-	
-						//Check to see if the resource is NOT present
-						if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){
-						  setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance");
-						} else {
-						  setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance");
 						}
+						[] tc_ac.timeout {
+							setverdict(fail, __SCOPE__ & ": No answer while creating resource type contentInstance");
+						}
+					}	
 							
-						// 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 AeSimu 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;
+					f_checkAeSimuStatus();
 					
-						// 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);
+					//Check to see if the resource is NOT present
+					if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){
+					  setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance");
+					} else {
+					  setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance");
+					}
+											
+					// Postamble
+					f_cse_postamble_deleteResources();
 					
-						// Test Body
-						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))));
-						
-						v_contentResponse.container := mw_contentContainerBase;
+					// Tear down
+					f_cf01Down();
+				    				
+				}//end f_CSE_DMR_CRE_007
 						
-						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");
-							}
-						}	
+				/**
+				 * @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 Tester system CseSystem {
+				
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
 								
-						// Postamble
-						f_cse_postamble_deleteResources();
+					v_ae1.start(f_CSE_DMR_CRE_008());
+					  	  	
+					v_ae1.done;
+					  	  		
+				}		
+				function f_CSE_DMR_CRE_008() runs on AeSimu system CseSystem {
+					//Local variables
+					var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
+					var template RequestPrimitive v_createRequestContentInstance := m_createContentInstanceBase;
+					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 := 10;	
+					const XSD.String c_primitiveContent1 := "Content1";
+					const XSD.String c_primitiveContent2 := "Content2";			   
+					// Test control
+
+					// Test component configuration
+					f_cf01Up();
+
+					// Test adapter configuration
+
+					// Preamble
+					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+
+					v_createRequestContainer.primitiveContent.container.maxByteSize := c_maxByteSize;
 						
-						// Tear down
-						f_cf01Down();
-					    				
-					}//end TC_CSE_DMR_CRE_009
+					v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex);		//Container
+
+					v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), c_primitiveContent1), v_containerIndex);//ContentInstance
+
+					// Test Body
+
+					v_createRequestContentInstance.primitiveContent.contentInstance.content := c_primitiveContent2;	//ContentInstance 2
+					v_createRequestContentInstance.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2";
+					v_request := f_getCreateRequestPrimitive(int4, v_createRequestContentInstance, v_containerIndex);
+
+					mcaPort.send(f_getMsgOutPrimitive(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 created");
+						}
+						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+							tc_ac.stop;
+							setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
+						}
+						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+							tc_ac.stop;
+							setverdict(fail, __SCOPE__ & ": Error while creating resource type contentInstance");
+		
+						}
+						[] tc_ac.timeout {
+							setverdict(fail, __SCOPE__ & ": No answer while creating resource type contentInstance");
+						}
+					}	
+		
+					f_checkAeSimuStatus();
+
+					//Check to see if the resource is NOT present
+					if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){
+					  setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance");
+					} else {
+					  setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance");
+					}
 						
-				}// 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 AeSimu 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;
+					// Postamble
+					f_cse_postamble_deleteResources();
+
+					// Tear down
+					f_cf01Down();
+				    				
+				}//end f_CSE_DMR_CRE_008
 						
-						// Test control
+				/**
+				 * @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 Tester system CseSystem {
 				
-						// Test component configuration
-						f_cf01Up();
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+								
+					v_ae1.start(f_CSE_DMR_CRE_009());
+					  	  	
+					v_ae1.done;
+					  	  		
+				}
 				
-						// Test adapter configuration
+				function f_CSE_DMR_CRE_009() runs on AeSimu 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;
 				
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-						
-						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
+					// Test control
+			
+					// Test component configuration
+					f_cf01Up();
+			
+					// Test adapter configuration
+			
+					// Preamble
+					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
 					
-						// Test Body
-						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest;
-						
-						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
+					v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
 					
-						mcaPort.send(f_getMsgOutPrimitive(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");
+					v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);
+				
+					// Test Body
+					mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(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");
 							}
-						}	
-								
-						f_checkAeSimuStatus();
-    					
-						//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	
+						[] 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 f_CSE_DMR_CRE_009
+					
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_CRE_010());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}					
+				
+				function f_CSE_DMR_CRE_010() runs on AeSimu 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);
 				
-				group g_CSE_DMR_CRE_011 {
+					// Test Body
+					v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest;
 					
-					/**
-					 * @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 AeSimu 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;
+					v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
+				
+					mcaPort.send(f_getMsgOutPrimitive(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_checkAeSimuStatus();
+					
+					//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 f_CSE_DMR_CRE_010
 						
-						// Test control
-				
-						// Test component configuration
-						f_cf01Up();
+				/**
+				 * @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 Tester system CseSystem {
 				
-						// Test adapter configuration
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+								
+					v_ae1.start(f_CSE_DMR_CRE_011());
+					  	  	
+					v_ae1.done;
+					  	  		
+				}
 				
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-						
-						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
+				function f_CSE_DMR_CRE_011() runs on AeSimu 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 Body
-						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameOldest;
-						
-						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
+					// Test control
+			
+					// Test component configuration
+					f_cf01Up();
+			
+					// Test adapter configuration
+			
+					// Preamble
+					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
 					
-						mcaPort.send(f_getMsgOutPrimitive(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_checkAeSimuStatus();
-    					
-						//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");
+					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(f_getMsgOutPrimitive(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'");
+							
 						}
-								
-						// Postamble
-						f_cse_postamble_deleteResources();
-						
-						// Tear down
-						f_cf01Down();
-					    				
-					}//end TC_CSE_DMR_CRE_011
+						[] 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_checkAeSimuStatus();
+					
+					//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 f_CSE_DMR_CRE_011
 						
-				}// end group g_CSE_DMR_CRE_011
-
 				group g_CSE_DMR_CRE_012 {
 					
 					/**
@@ -4562,68 +4601,76 @@ module OneM2M_Testcases_CSE_Release_1 {
 					
 				}// end group g_CSE_DMR_CRE_012	
 
-				group g_CSE_DMR_CRE_013{
-					
-					/**
-					 * @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_013() runs on AeSimu 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 := 1;				   
-						// Test control
+				/**
+				 * @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_013() runs on Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_CRE_013());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				
+				function f_CSE_DMR_CRE_013() runs on AeSimu 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 := 1;				   
+					// Test control
 
-						// Test component configuration
-						f_cf01Up();
+					// Test component configuration
+					f_cf01Up();
 
-						// Test adapter configuration
+					// 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);
+					// Preamble
+					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
 	
-						mcaPort.send(f_getMsgOutPrimitive(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();
+					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(f_getMsgOutPrimitive(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");
+						}
 		
-						// Tear down
-						f_cf01Down();
-	    				
-					}//end TC_CSE_DMR_CRE_013
+						[] 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 f_CSE_DMR_CRE_013
 		
-				}// end group g_CSE_DMR_CRE_013	
-				
 				group g_CSE_DMR_CRE_014 {
 					
 					/**
@@ -4783,145 +4830,161 @@ module OneM2M_Testcases_CSE_Release_1 {
 				
 				} // end g_CSE_DMR_RET_003
 
-				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 AeSimu 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(f_getMsgOutPrimitive(m_request(m_retrieve(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
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_RET_010());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				
+				function f_CSE_DMR_RET_010() runs on AeSimu 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(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))));
 
-				} // end group g_CSE_DMR_RET_010
+					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");
+						}
+					}	
 								
-				group g_CSE_DMR_RET_012{
+					// Postamble
+					f_cse_postamble_deleteResources();
+					
+					// Tear down
+					f_cf01Down();
 
-					/**
-					 * @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 AeSimu 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);
-						
-						f_sleep(1.0);
-						
-						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(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))));
+				}//end f_CSE_DMR_RET_010
 
-						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();
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_RET_012());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+
+				function f_CSE_DMR_RET_012() runs on AeSimu 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);
+					
+					f_sleep(1.0);
+					
+					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(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))));
 
-					}//end TC_CSE_DMR_RET_012
+					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 group g_CSE_DMR_RET_012
+				}//end f_CSE_DMR_RET_012
 
 				group g_CSE_DMR_RET_013 {
 					
@@ -6349,344 +6412,372 @@ module OneM2M_Testcases_CSE_Release_1 {
 	
 						v_updateRequest.primitiveContent.group_update_invalid.expirationCounter := v_expirationCounter;
 	
-						v_ae1.start(f_CSE_DMR_UPD_009(int9, v_createRequest, v_updateRequest));//Group
-						v_ae1.done;
-					}
-
-					testcase TC_CSE_DMR_UPD_009_ACP_EXC() runs on Tester system CseSystem {
-						// Local variables
-						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
-						var XSD.PositiveInteger v_expirationCounter := 1;
-						var template RequestPrimitive v_createRequest := m_createAcpBase;
-						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
-						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
-						v_ae1.done;
-						v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid};
-	
-						v_updateRequest.primitiveContent.aCP_update_invalid.expirationCounter := v_expirationCounter;
-			
-						v_ae1.start(f_CSE_DMR_UPD_009(int1, v_createRequest, v_updateRequest));//AccessControlPolicy
-						v_ae1.done;
-					}
-
-					testcase TC_CSE_DMR_UPD_009_SUB_MNI() runs on Tester system CseSystem {
-						// Local variables
-						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
-						var XSD.NonNegativeInteger v_maxNrOfInstances := 5;
-						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
-						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
-						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
-						v_ae1.done;
-						v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid};
-	
-						v_updateRequest.primitiveContent.subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances;
-			
-						v_ae1.start(f_CSE_DMR_UPD_009(int23, v_createRequest, v_updateRequest));//Subscription
-						v_ae1.done;
-					}
-	
-				} // end g_CSE_DMR_UPD_009	
-				
-				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 AeSimu 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(f_getMsgOutPrimitive(m_request(m_retrieve(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 AeSimu 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(f_getMsgOutPrimitive(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();
+						v_ae1.start(f_CSE_DMR_UPD_009(int9, v_createRequest, v_updateRequest));//Group
+						v_ae1.done;
+					}
+
+					testcase TC_CSE_DMR_UPD_009_ACP_EXC() runs on Tester system CseSystem {
+						// Local variables
+						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+						var XSD.PositiveInteger v_expirationCounter := 1;
+						var template RequestPrimitive v_createRequest := m_createAcpBase;
+						var template RequestPrimitive v_updateRequest := m_updateAcpBase;
+						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+						v_ae1.done;
+						v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid};
 	
-						// Tear down
-						f_cf01Down();
+						v_updateRequest.primitiveContent.aCP_update_invalid.expirationCounter := v_expirationCounter;
+			
+						v_ae1.start(f_CSE_DMR_UPD_009(int1, v_createRequest, v_updateRequest));//AccessControlPolicy
+						v_ae1.done;
+					}
 
-					}//end TC_CSE_DMR_UPD_011
+					testcase TC_CSE_DMR_UPD_009_SUB_MNI() runs on Tester system CseSystem {
+						// Local variables
+						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+						var XSD.NonNegativeInteger v_maxNrOfInstances := 5;
+						var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
+						var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
+						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+						v_ae1.done;
+						v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid};
+	
+						v_updateRequest.primitiveContent.subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances;
+			
+						v_ae1.start(f_CSE_DMR_UPD_009(int23, v_createRequest, v_updateRequest));//Subscription
+						v_ae1.done;
+					}
 	
-				} // end group g_CSE_DMR_UPD_011
+				} // end g_CSE_DMR_UPD_009	
 				
-				group g_CSE_DMR_UPD_012{
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_UPD_010());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				function f_CSE_DMR_UPD_010() runs on AeSimu 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
 
-					/**
-					 * @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 AeSimu 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 component configuration
-						f_cf01Up();
+					// Test adapter configuration
 
-						// 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);
 
-						// 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(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))));
 
-						mcaPort.send(f_getMsgOutPrimitive(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 {
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
 								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Wrong response status code");
+								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_responsePrimitiveOK)) -> value v_response {
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
 								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Accepted update of a latest resource");
+								setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
 							}
 							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while updating a latest resource");
+								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();
 
-						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")
-							  }
-						   }
-						}	
+					// Tear down
+					f_cf01Down();
+		
+				}//end f_CSE_DMR_UPD_010
+					
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_UPD_011());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				function f_CSE_DMR_UPD_011() runs on AeSimu 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);
 
-						// Postamble
-						f_cse_postamble_deleteResources();
+					mcaPort.send(f_getMsgOutPrimitive(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();
+					// Tear down
+					f_cf01Down();
 
-					}//end TC_CSE_DMR_UPD_012
+				}//end f_CSE_DMR_UPD_011
+				
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_UPD_012());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				function f_CSE_DMR_UPD_012() runs on AeSimu 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
 
-				} // end group g_CSE_DMR_UPD_012
-			  	
-				group g_CSE_DMR_UPD_013{
+					// Test component configuration
+					f_cf01Up();
 
-					/**
-					 * @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 AeSimu 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;
+					// 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(f_getMsgOutPrimitive(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 f_CSE_DMR_UPD_012
+			  	
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_UPD_013());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				function f_CSE_DMR_UPD_013() runs on AeSimu 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;
+					v_updateRequest.primitiveContent.contentInstance.labels := v_labels;
    
 						// Test control
 
-						// Test component configuration
-						f_cf01Up();
-
-						// Test adapter configuration
+					// Test component configuration
+					f_cf01Up();
 
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+					// Test adapter configuration
 
-						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
+					// Preamble
+					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
 
-						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); 
+					v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
 
-						//Test Body
-						v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest);
-					  	
-						v_request.to_ := v_request.to_ & "/" & c_resourceShortNameOldest;		//<oldest>
+					v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); 
 
-						mcaPort.send(f_getMsgOutPrimitive(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");
-							}
-						}	
+					//Test Body
+					v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest);
+				  	
+					v_request.to_ := v_request.to_ & "/" & c_resourceShortNameOldest;		//<oldest>
 
-						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();
+					mcaPort.send(f_getMsgOutPrimitive(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");
+						}
+					}	
 
-						// Tear down
-						f_cf01Down();
+					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 f_CSE_DMR_UPD_013
 
-				} // end group g_CSE_DMR_UPD_013
-			  	
 				group g_CSE_DMR_UPD_014 {
 					
 					testcase TC_CSE_DMR_UPD_014_ACP_LBL() runs on Tester system CseSystem {
@@ -8210,264 +8301,27 @@ module OneM2M_Testcases_CSE_Release_1 {
 						v_ae1.done;
                 
 						v_ae1.start(f_CSE_DMR_DEL_002(int23, m_createSubscriptionBase));//Subscription
-						v_ae1.done;
-					};
-                
-                
-				};//end of group g_CSE_DMR_DEL_002
-
-				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 AeSimu 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
-							mcaPort.send(f_getMsgOutPrimitive(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))));
-							            	
-							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(f_getMsgOutPrimitive(m_request(m_retrieve(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 AeSimu 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_checkAeSimuStatus();
-						}
-							
-						// 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_checkAeSimuStatus();
-						}
-						
-						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 AeSimu 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); 
-						
-						f_sleep(1.0);
-						
-						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(f_getMsgOutPrimitive(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_checkAeSimuStatus();
-			       		            	
-						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve((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_009{
+						v_ae1.done;
+					};
+                
+                
+				};//end of group g_CSE_DMR_DEL_002
+
+				group g_CSE_DMR_DEL_005{
 
 					/**
-					 * @desc Check that the IUT accepts the DELETE Request of the oldest contentInstance resource target to a container resource
+					 * @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted
 					 * 
 					 */
-					testcase TC_CSE_DMR_DEL_009() runs on AeSimu system CseSystem {
+					testcase TC_CSE_DMR_DEL_005() runs on AeSimu 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;
-								   
+						var integer v_resourceIndex := -1;
+						var integer v_childResourceIndex := -1; 
+						const ResourceType c_containerResourceType := int3;          			
+            					   
 						// Test control
             
 						// Test component configuration
@@ -8478,23 +8332,20 @@ module OneM2M_Testcases_CSE_Release_1 {
 						// 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); 
-						
-						f_sleep(1.0);
-												
-						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(f_getMsgOutPrimitive(m_request(v_request)));
-						tc_ac.start;
-						alt {
+						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
+							mcaPort.send(f_getMsgOutPrimitive(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))));
+							            	
+							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");
+									setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully");
 								}
 								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
 									tc_ac.stop;
@@ -8507,35 +8358,302 @@ module OneM2M_Testcases_CSE_Release_1 {
 								[] tc_ac.timeout {
 									setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
 								}
-						   }
-						   
-						f_checkAeSimuStatus();
-						   
-						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve((f_getResourceAddress(v_contentInstanceIndex_1)), f_getOriginator(v_contentInstanceIndex_1)))));
-					            
-						tc_ac.start;
-						alt {
+							}
+            	
+            	
+            	
+							mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))));
+            
+							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");	
+									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(pass, __SCOPE__ & ": Error while retrieving resource attributes as " & int2str(enum2int(c_containerResourceType)) & " has been deleted");
+									tc_ac.stop;
+									setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
 								}
 								[] tc_ac.timeout {
-								   setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
+									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_009
-				} // end group g_CSE_DMR_DEL_009
+					}//end f_CSE_DMR_DEL_005
+				} // end group g_CSE_DMR_DEL_005
+                
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_DEL_006());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				
+				function f_CSE_DMR_DEL_006() runs on AeSimu 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_checkAeSimuStatus();
+					}
+						
+					// 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_checkAeSimuStatus();
+					}
+					
+					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
+
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_DEL_007());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+				
+				function f_CSE_DMR_DEL_007() runs on AeSimu 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); 
+					
+					f_sleep(1.0);
+					
+					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(f_getMsgOutPrimitive(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_checkAeSimuStatus();
+		       		            	
+					mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve((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
+
+				/**
+				 * @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 Tester system CseSystem {
+			
+					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
+					v_ae1.done;
+							
+					v_ae1.start(f_CSE_DMR_DEL_009());
+				  	  	
+					v_ae1.done;
+				  	  		
+				}
+
+				function f_CSE_DMR_DEL_009() runs on AeSimu 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); 
+					
+					f_sleep(1.0);
+											
+					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(f_getMsgOutPrimitive(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_checkAeSimuStatus();
+					   
+					mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve((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 Delete
 			
diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn
index 81e5e8a..8ea4023 100644
--- a/OneM2M_Testcases_CSE_Release_2.ttcn
+++ b/OneM2M_Testcases_CSE_Release_2.ttcn
@@ -2847,7 +2847,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 						v_ae1.done;
 					}
 										
-					testcase TC_CSE_DMR_RET_018_SUB_LBL() runs on AeSimu system CseSystem {
+					testcase TC_CSE_DMR_RET_018_SUB_LBL() runs on Tester system CseSystem {
 							// Local variables
 						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
 						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
-- 
GitLab