From 0778c746452e56aaf18fbfe7b380e8f512d18715 Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Wed, 22 Aug 2018 12:39:36 +0200
Subject: [PATCH] Overall cleanup and reordering

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 LibOneM2M/OneM2M_Functions.ttcn     | 2577 +++++++++++++--------------
 OneM2M_PermutationFunctions.ttcn    |   30 +-
 OneM2M_Testcases_CSE_Release_1.ttcn |   42 +-
 OneM2M_Testcases_CSE_Release_2.ttcn |   18 +-
 4 files changed, 1328 insertions(+), 1339 deletions(-)

diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn
index bd250dd..bb0c6e0 100644
--- a/LibOneM2M/OneM2M_Functions.ttcn
+++ b/LibOneM2M/OneM2M_Functions.ttcn
@@ -321,181 +321,187 @@ module OneM2M_Functions {
 			// Disconnect
 			disconnect(self:infoPort, p_tester:infoPort);		
 		} 
-	
-		/**
-		 * @desc Getting last responsePrimitive saved in a component
-		 * @param p_tester Given component
-		 */
-		function f_getResponsePrimitive(in Tester p_component) runs on Tester return ResponsePrimitive {
-			var ResponsePrimitive v_response;
-			
-			f_connectInfoPort(p_component);
-	
-			p_component.start(f_sendResponsePrimitive());
-			alt {
-				[]infoPort.receive(mw_responsePrimitiveforInfoPort) -> value v_response {
-				}
-			}
-			
-			p_component.done;
-			f_disconnectInfoPort(p_component);
-				
-			return v_response;
+		
+		group getFunctions {
+			/**
+			 * @desc Getting last responsePrimitive saved in a component
+			 * @param p_tester Given component
+			 */
+			function f_getResponsePrimitive(in Tester p_component) runs on Tester return ResponsePrimitive {
+				var ResponsePrimitive v_response;
 				
-		}
+				f_connectInfoPort(p_component);
 		
-		/**
-		 * @desc Getting last requestPrimitive saved in an AeSimu component
-		 * @param p_tester Given component
-		 */
-		function f_getRequestPrimitive(in Tester p_component) runs on Tester return RequestPrimitive {
-			var RequestPrimitive v_request;
-
-			f_connectInfoPort(p_component);
-
-			p_component.start(f_sendRequestPrimitive());
-			alt {
-				[]infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request {
+				p_component.start(f_sendResponsePrimitive());
+				alt {
+					[]infoPort.receive(mw_responsePrimitiveforInfoPort) -> value v_response {
+					}
 				}
+				
+				p_component.done;
+				f_disconnectInfoPort(p_component);
+					
+				return v_response;
+					
 			}
-
-			p_component.done;
-			f_disconnectInfoPort(p_component);
-	
-			return v_request;
-	
-		}
-							
-		/**
-		 * @desc Getting primitiveContent retrieved in an AeSimu component
-		 * @param p_tester AeSimu component
-		 */
-		function f_getPrimitiveContentRetrievedResource(in AeSimu p_ae) runs on Tester return PrimitiveContent {
-			var PrimitiveContent v_primitiveContent;
 			
-			f_connectInfoPort(p_ae);
+			/**
+			 * @desc Getting last requestPrimitive saved in an AeSimu component
+			 * @param p_tester Given component
+			 */
+			function f_getRequestPrimitive(in Tester p_component) runs on Tester return RequestPrimitive {
+				var RequestPrimitive v_request;
+	
+				f_connectInfoPort(p_component);
 	
-			p_ae.start(f_sendPrimitiveContentRetrievedResource());
-			alt {
-				[]infoPort.receive(mw_primitiveContent) -> value v_primitiveContent {
+				p_component.start(f_sendRequestPrimitive());
+				alt {
+					[]infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request {
+					}
 				}
-			}
 	
-			p_ae.done;
-			f_disconnectInfoPort(p_ae);
-				
-			return v_primitiveContent;
+				p_component.done;
+				f_disconnectInfoPort(p_component);
+		
+				return v_request;
+		
+			}
+								
+			/**
+			 * @desc Getting primitiveContent retrieved in an AeSimu component
+			 * @param p_tester AeSimu component
+			 */
+			function f_getPrimitiveContentRetrievedResource(in AeSimu p_ae) runs on Tester return PrimitiveContent {
+				var PrimitiveContent v_primitiveContent;
 				
-		}
+				f_connectInfoPort(p_ae);
 		
-		/**
-		 * @desc Getting remoteCSE resource from a CseSimu component
-		 * @param p_tester CseSimu component
-		 */
-		function f_getRemoteCseResource(in CseSimu p_cse) runs on Tester return integer {
-			var MyResource v_resource;
-			var integer v_resourceIndex := -1;
-			
-			f_connectInfoPort(p_cse);
-	
-			p_cse.start(f_sendRemoteCseResource());
-			alt {
-				[]infoPort.receive(mw_resource) -> value v_resource {
-					v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
+				p_ae.start(f_sendPrimitiveContentRetrievedResource());
+				alt {
+					[]infoPort.receive(mw_primitiveContent) -> value v_primitiveContent {
+					}
 				}
+		
+				p_ae.done;
+				f_disconnectInfoPort(p_ae);
+					
+				return v_primitiveContent;
+					
 			}
-	
-			p_cse.done;
-			f_disconnectInfoPort(p_cse);
-				
-			return v_resourceIndex;
+			
+			/**
+			 * @desc Getting remoteCSE resource from a CseSimu component
+			 * @param p_tester CseSimu component
+			 */
+			function f_getRemoteCseResource(in CseSimu p_cse) runs on Tester return integer {
+				var MyResource v_resource;
+				var integer v_resourceIndex := -1;
 				
-		}
-		
-		/**
-		 * @desc Getting a specific resource from an AeSimu component
-		 * @param p_tester AeSimu component
-		 * @param p_resourceIndex Index of resource to be retrieved
-		 */
-		function f_getResource(in Tester p_component, in integer p_resourceIndex := -1) runs on Tester return integer {
-			var MyResource v_resource;
-			var integer v_resourceIndex := -1;
+				f_connectInfoPort(p_cse);
 		
-			f_connectInfoPort(p_component);
-
-			p_component.start(f_sendResource(p_resourceIndex));
-			alt {
-				[]infoPort.receive(mw_resource) -> value v_resource {
-					v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
+				p_cse.start(f_sendRemoteCseResource());
+				alt {
+					[]infoPort.receive(mw_resource) -> value v_resource {
+						v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
+					}
 				}
+		
+				p_cse.done;
+				f_disconnectInfoPort(p_cse);
+					
+				return v_resourceIndex;
+					
 			}
-
-			p_component.done;
-			f_disconnectInfoPort(p_component);
 			
-			return v_resourceIndex;
+			/**
+			 * @desc Getting a specific resource from an AeSimu component
+			 * @param p_tester AeSimu component
+			 * @param p_resourceIndex Index of resource to be retrieved
+			 */
+			function f_getResource(in Tester p_component, in integer p_resourceIndex := -1) runs on Tester return integer {
+				var MyResource v_resource;
+				var integer v_resourceIndex := -1;
 			
-		}		
-
-		/**
-		 * @desc Sending of last responsePrimitive (vc_response) through InfoPort
-		 */	
-		function f_sendResponsePrimitive() runs on Tester {
-	
-			infoPort.send(vc_response.primitive.responsePrimitive);
-				
-		} 
-
-		/**
-		 * @desc Sending of last requestPrimitive (vc_request) through InfoPort
-		 */			
-		function f_sendRequestPrimitive() runs on Tester {
-	
-			infoPort.send(vc_request.primitive.requestPrimitive);
+				f_connectInfoPort(p_component);
 	
-		} 
-		
-		/**
-		 * @desc Sending of last primitiveContent retrieved (vc_primitiveContentRetrievedResource) through InfoPort
-		 */	
-		function f_sendPrimitiveContentRetrievedResource() runs on AeSimu {
+				p_component.start(f_sendResource(p_resourceIndex));
+				alt {
+					[]infoPort.receive(mw_resource) -> value v_resource {
+						v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false);
+					}
+				}
 	
-			infoPort.send(vc_primitiveContentRetrievedResource);
+				p_component.done;
+				f_disconnectInfoPort(p_component);
 				
-		} 	
-		
-		/**
-		 * @desc Sending of remoteCSE resource through InfoPort
-		 */	
-		function f_sendRemoteCseResource() runs on CseSimu {
-	
-			infoPort.send(vc_resourcesList[vc_remoteCseIndex]);
+				return v_resourceIndex;
 				
-		} 
+			}	
+			
+		}//end of group getFunctions
 		
-		/**
-		 * @desc Sending of Ae resource through InfoPort
-		 */	
-		function f_sendAeResource() runs on AeSimu {
+		group sendFunctions {	
 	
-			infoPort.send(vc_resourcesList[vc_aeAuxIndex]);
-				
-		} 		
+			/**
+			 * @desc Sending of last responsePrimitive (vc_response) through InfoPort
+			 */	
+			function f_sendResponsePrimitive() runs on Tester {
 		
-		/**
-		 * @desc Sending of a specific resource through InfoPort
-		 * @param p_resourceIndex Index of resource to be sent
-		 */	
-		function f_sendResource(in integer p_resourceIndex) runs on Tester {
-	
-			if(p_resourceIndex == -1) {
-				infoPort.send(vc_resourcesList[vc_aeAuxIndex]);  //TODO To send Ae or RemoteCSE depending on the component type
-			} else {
-				infoPort.send(vc_resourcesList[p_resourceIndex]);
-			}
-				
-		} 	
+				infoPort.send(vc_response.primitive.responsePrimitive);
+					
+			} 
 	
+			/**
+			 * @desc Sending of last requestPrimitive (vc_request) through InfoPort
+			 */			
+			function f_sendRequestPrimitive() runs on Tester {
+		
+				infoPort.send(vc_request.primitive.requestPrimitive);
+		
+			} 
+			
+			/**
+			 * @desc Sending of last primitiveContent retrieved (vc_primitiveContentRetrievedResource) through InfoPort
+			 */	
+			function f_sendPrimitiveContentRetrievedResource() runs on AeSimu {
+		
+				infoPort.send(vc_primitiveContentRetrievedResource);
+					
+			} 	
+			
+			/**
+			 * @desc Sending of remoteCSE resource through InfoPort
+			 */	
+			function f_sendRemoteCseResource() runs on CseSimu {
+		
+				infoPort.send(vc_resourcesList[vc_remoteCseIndex]);
+					
+			} 
+			
+			/**
+			 * @desc Sending of Ae resource through InfoPort
+			 */	
+			function f_sendAeResource() runs on AeSimu {
+		
+				infoPort.send(vc_resourcesList[vc_aeAuxIndex]);
+					
+			} 		
+			
+			/**
+			 * @desc Sending of a specific resource through InfoPort
+			 * @param p_resourceIndex Index of resource to be sent
+			 */	
+			function f_sendResource(in integer p_resourceIndex) runs on Tester {
+		
+				if(p_resourceIndex == -1) {
+					infoPort.send(vc_resourcesList[vc_aeAuxIndex]);  //TODO To send Ae or RemoteCSE depending on the component type
+				} else {
+					infoPort.send(vc_resourcesList[p_resourceIndex]);
+				}
+					
+			} 	
+		}//end of group sendFunctions
+			
 	}// end of gropu InfoPortCommunication	
 	
 	group CseFunctions {
@@ -693,7 +699,7 @@ module OneM2M_Functions {
 					vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, int63));
 					f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
 					
-					vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred
+					vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getCompletePoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred
 					f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
 					
 					p_ae2Index := f_getResource(vc_ae2);
@@ -855,7 +861,7 @@ module OneM2M_Functions {
 					if(not(v_deregistrationPerformed)) {
 						if(vc_localRemoteCseIndex != -1) {
 							//1) Deregistration by Registrar (Test System)
-							v_childResourceRefs := f_cse_retrieveChildResourceRefs({int16}, -, f_getOriginator(vc_remoteCseIndex));
+							v_childResourceRefs := f_cse_retrieveChildResourceRefs_cseSimu({int16}, -, f_getOriginator(vc_remoteCseIndex));
 							
 							if(v_childResourceRefs != {}) {
 								//v_request := valueof(m_delete(v_childResourceRefs[0], f_getOriginator(vc_remoteCseIndex)));
@@ -1168,7 +1174,7 @@ module OneM2M_Functions {
 			 * @param p_resourceIndex Resource index of the resource to be checked
 			 * @return boolean
 			 */
-			function f_isResourcePresent (integer p_resourceIndex) runs on AeSimu return boolean {
+			function f_cse_isResourcePresent (integer p_resourceIndex) runs on AeSimu return boolean {
 			
 				//Check to see if the resource is present or not
 				mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))));
@@ -1203,7 +1209,7 @@ module OneM2M_Functions {
 			 * @param p_resourceName Resource name (Hierarchical method is used) of the resource to be checked
 			 * @return boolean
 			 */
-			function f_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on AeSimu return boolean {
+			function f_cse_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on AeSimu return boolean {
 			
 				log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource");
 				
@@ -1264,183 +1270,93 @@ module OneM2M_Functions {
 				
 				f_checkAeSimuStatus();
 			}   
-			
-		
-    		
+						
 			/**
-			 * @desc Checking of returned important attributed (in response) in order to save properly internally
-			 * @param p_resourceType ResourceType of the resource to be checked
-			 * @param p_request Request primitive used for the CRU operation
-			 * @param p_response Response primitive received
+			 * @desc Sending a request primitive on mcaPort on AeSimu
+			 * @param p_resourceType Resource type of the resource to be created
+			 * @param p_requestPrimitive CREATE request primitive for the resource to be created
+			 * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
+			 * @return Internal resource index of the created resource
 			 * @verdict 
 			 */
-			 //Note: This function will be continously extended with necessary attributes/resources
-			function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) {
-				select (p_resourceType) {
-					case (int1) {
-						if(isvalue(p_response.primitiveContent.accessControlPolicy) and
-								not(ispresent(p_response.primitiveContent.accessControlPolicy.resourceName))) {
-							p_response.primitiveContent.accessControlPolicy.resourceName :=  p_request.primitiveContent.accessControlPolicy.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.accessControlPolicy.resourceName)
-						}
+			function f_cse_sendCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu{
+
+				var integer v_resourceIndex := -1;
+	
+				vc_request.primitive.requestPrimitive := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex);
+
+				mcaPort.send(f_getMsgOutPrimitive(m_request(vc_request.primitive.requestPrimitive)));
+
+			}
+			
+			/**
+			 * @desc   Receive response from the IUT
+			 * @param  p_requestPrimtive	Received request primitive
+			 */
+			function f_cse_receiveResponse(in RequestPrimitive p_request) runs on AeSimu {
+				
+				var integer v_resourceIndex := -1;
+				
+				//Activate defaults when running on a PTC
+			    f_cse_activateDefaults_ae(); 
+			    
+				tc_ac.start;
+				alt {
+					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
+						tc_ac.stop;
+						setverdict(pass, __SCOPE__&":INFO: Response received with positive response status code");
+						f_checkAttributesToBeSaved(p_request.resourceType, p_request, vc_response.primitive.responsePrimitive);
+						v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_request.resourceType);
 					}
-					case (int2) {
-						if(isvalue(p_response.primitiveContent.aE) and
-								not(ispresent(p_response.primitiveContent.aE.resourceName))) {
-							p_response.primitiveContent.aE.resourceName :=  p_request.primitiveContent.aE.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.aE.resourceName)
-						}
+					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
+						tc_ac.stop;
+						setverdict(pass, __SCOPE__&":INFO: Response received with negative response status code");
 					}
-					case (int3) {
-						if(isvalue(p_response.primitiveContent.container) and
-								not(ispresent(p_response.primitiveContent.container.resourceName))) {
-							p_response.primitiveContent.container.resourceName :=  p_request.primitiveContent.container.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.container.resourceName)
-						}
+					[] tc_ac.timeout {
+						setverdict(inconc, __SCOPE__&":INFO: No response received");
 					}
-					case (int4) {
-						if(isvalue(p_response.primitiveContent.contentInstance) and
-								not(ispresent(p_response.primitiveContent.contentInstance.resourceName))) {
-							p_response.primitiveContent.contentInstance.resourceName :=  p_request.primitiveContent.contentInstance.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.contentInstance.resourceName)
+				}	
+				
+			}
+
+			
+		}//end group AeSimu
+			
+		group CseSimuFunctions {
+
+			group NotificationFunctions { 
+				
+				/**
+				 * @desc Handling message exchange for the subscription verification
+				 * @param p_responseStatusCode Response Status Code to be used for the response to the verification request
+				 * @verdict 
+				 */
+				function f_cse_notifyProcedure_subscriptionVerificationHandler(in ResponseStatusCode p_responseStatusCode := int2000) runs on AeSimu {
+					// Local variables
+					var ResponsePrimitive v_responsePrimitive;
+					var template Notification v_notificationRequest := mw_contentNotificationVerification;
+					
+					//Activate defaults when running on a PTC
+					f_cse_activateDefaults_ae();		
+					
+					//Preparation of expected Notification verification
+					//TODO To add checks for creator and subscription reference
+					//v_notificationRequest.creator := p_creator; TODO To check what address format is to be expected
+					//Some participants use SP relative UNSTRUCTURED
+					//v_notificationRequest.subscriptionReference := "I Don't know which URI is expected"; // TODO mandatory parameter 
+    			
+					//Preparation of Notification response to be sent
+					v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit));
+    	
+					tc_ac.start;
+					alt {
+						[] mcaPortIn.receive(mw_request(mw_notifyNotification(v_notificationRequest))) -> value vc_request {
+							tc_ac.stop;
+							setverdict(pass, __SCOPE__ & ":INFO: Notification received");
 						}
-					}
-					case (int15) {
-						if (isvalue(p_response.primitiveContent.pollingChannel) and
-								not(ispresent(p_response.primitiveContent.pollingChannel.resourceName))) {
-							p_response.primitiveContent.pollingChannel.resourceName :=  p_request.primitiveContent.pollingChannel.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.pollingChannel.resourceName)
-						}
-					}
-					case (int16) {
-						if (isvalue(p_response.primitiveContent.remoteCSE) and
-								not(ispresent(p_response.primitiveContent.remoteCSE.resourceName))) {
-							p_response.primitiveContent.remoteCSE.resourceName :=  p_request.primitiveContent.remoteCSE.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.remoteCSE.resourceName)
-						}
-					}
-					case (int18) {
-						if (isvalue(p_response.primitiveContent.schedule) and
-								not(ispresent(p_response.primitiveContent.schedule.resourceName))) {
-							p_response.primitiveContent.schedule.resourceName :=  p_request.primitiveContent.schedule.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.schedule.resourceName)
-						}
-					}
-					case (int23) {
-						if (isvalue(p_response.primitiveContent.subscription) and
-								not(ispresent(p_response.primitiveContent.subscription.resourceName))) {
-							p_response.primitiveContent.subscription.resourceName :=  p_request.primitiveContent.subscription.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.subscription.resourceName)
-						}
-					}
-					case (int9) {
-						if (isvalue(p_response.primitiveContent.group_) and
-								not(ispresent(p_response.primitiveContent.group_.resourceName))) {
-							p_response.primitiveContent.group_.resourceName :=  p_request.primitiveContent.group_.resourceName;
-							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.group_.resourceName)
-						}
-					}
-					case else {
-						log(__SCOPE__&":WARNING: Resource Type "&int2str(enum2int(p_resourceType))&" not implemented");
-					}
-				}
-    
-				// TODO test that if the resource name is returned is the same resource name as used in the create message
-			}
-		
-			/**
-			 * @desc Comparison of two URIs
-			 * @param p_expectedURIIndex Resource index of the resource for which its URI is to be compared
-			 * @param p_receivedURI URI to be compared
-			 * @param p_response Response primitive received
-			 * @verdict 
-			 */
-			function f_compareURIs(in integer p_expectedURIIndex, in XSD.ID p_receivedURI) runs on Tester return boolean{
-				// Local variables
-				var boolean v_matchResult := false;
-				var AddressingMethod v_addressingMethod;
-				var PrimitiveScope v_primitiveScope;
-    			
-				if (f_isNonHierarchical(p_receivedURI)) {
-					v_addressingMethod := e_nonHierarchical;
-				} else if (f_isHierarchical(p_receivedURI)) {
-					v_addressingMethod := e_hierarchical;
-				}
-				if (f_isScopeCseRelative(p_receivedURI)) {
-					v_primitiveScope := e_cseRelative;
-				}
-				if (f_isScopeSpRelative(p_receivedURI)) {
-					v_primitiveScope := e_spRelative;
-				}
-				if (f_isScopeAbsolute(p_receivedURI)) {
-					v_primitiveScope := e_absolute;
-				}
-    			
-				if(match(f_getResourceAddress(p_expectedURIIndex, v_addressingMethod, v_primitiveScope), p_receivedURI)) {
-					v_matchResult := true;
-				} else {
-					v_matchResult := false;
-				}
-							
-				return v_matchResult;
-    
-			} //end f_compareURIs	
-			
-			/**
-			 * @desc Sending a request primitive on mcaPort on AeSimu
-			 * @param p_resourceType Resource type of the resource to be created
-			 * @param p_requestPrimitive CREATE request primitive for the resource to be created
-			 * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
-			 * @return Internal resource index of the created resource
-			 * @verdict 
-			 */
-			function f_cse_sendCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu{
-
-				var integer v_resourceIndex := -1;
-	
-				vc_request.primitive.requestPrimitive := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex);
-
-				mcaPort.send(f_getMsgOutPrimitive(m_request(vc_request.primitive.requestPrimitive)));
-
-			}
-			
-		}//end group AeSimu
-			
-		group CseSimuFunctions {
-
-			group NotificationFunctions { 
-				
-				/**
-				 * @desc Handling message exchange for the subscription verification
-				 * @param p_responseStatusCode Response Status Code to be used for the response to the verification request
-				 * @verdict 
-				 */
-				function f_cse_notifyProcedure_subscriptionVerificationHandler(in ResponseStatusCode p_responseStatusCode := int2000) runs on AeSimu {
-					// Local variables
-					var ResponsePrimitive v_responsePrimitive;
-					var template Notification v_notificationRequest := mw_contentNotificationVerification;
-					
-					//Activate defaults when running on a PTC
-					f_cse_activateDefaults_ae();		
-					
-					//Preparation of expected Notification verification
-					//TODO To add checks for creator and subscription reference
-					//v_notificationRequest.creator := p_creator; TODO To check what address format is to be expected
-					//Some participants use SP relative UNSTRUCTURED
-					//v_notificationRequest.subscriptionReference := "I Don't know which URI is expected"; // TODO mandatory parameter 
-    			
-					//Preparation of Notification response to be sent
-					v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit));
-    	
-					tc_ac.start;
-					alt {
-						[] mcaPortIn.receive(mw_request(mw_notifyNotification(v_notificationRequest))) -> value vc_request {
-							tc_ac.stop;
-							setverdict(pass, __SCOPE__ & ":INFO: Notification received");
-						}
-						[] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request {
-							tc_ac.stop;
-							setverdict(fail, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE");							
+						[] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request {
+							tc_ac.stop;
+							setverdict(fail, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE");							
 						}
 						[] mcaPortIn.receive{
 							tc_ac.stop;
@@ -1656,62 +1572,6 @@ module OneM2M_Functions {
 		
 				} //end f_cse_notifyProcedure_noNotification Handler
 				
-				/**
-				 * @desc Checking of notification primitiveContent
-				 * @param p_requestPrimitive Received Notification request
-				 * @param p_primitiveContent Expected primitiveContent in the notification
-				 * @verdict 
-				 */
-				function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on Tester return boolean{
-					// Local variables
-					var boolean v_matchResult := false;
-					var integer i;
-					var integer v_numberOfAggregatedNotification;
-    	
-					if (ischosen(p_primitiveContent.aE)){
-						log("Representation contains AE resource representation");
-						if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE)) {
-							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE, p_primitiveContent.aE);
-							log("Expected primitiveContent");
-						}
-						else if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE)) {
-							v_matchResult :=match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE);
-						}
-						else if (isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list)) {
-							v_matchResult := true;
-							v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list);
-							for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){
-								if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE)) {
-									if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE, p_primitiveContent.aE))){
-										v_matchResult := false;
-									}
-								}
-								else if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE)) {
-									if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE))){
-										v_matchResult := false;
-									}
-								}						
-							}
-							if (i == 0){
-								v_matchResult := false;
-							}
-						}
-    
-					}
-    	
-					if (ischosen(p_primitiveContent.container)){
-						if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container)) {
-							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container, p_primitiveContent.container)
-						}
-						else if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container)) {
-							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container, p_primitiveContent.container)
-						}
-					}
-    	
-					return v_matchResult;
-    
-				} //end f_check_notificationContent
-				
 			}// end of group NotificationFunctions 	
 			
 			group AnnouncementFunctions {
@@ -1853,7 +1713,7 @@ module OneM2M_Functions {
 			 * @return PrimitiveContent parameter of the RETRIEVE response
 			 * @verdict 
 			 */
-			function f_cse_retrieveChildResourceRefs(template(omit) ResourceTypeList p_resourceTypeList := omit, integer p_targetResourceIndex := -1, XSD.ID p_originator := PX_SUPER_CSE_ID) runs on CseSimu return URIList {
+			function f_cse_retrieveChildResourceRefs_cseSimu(template(omit) ResourceTypeList p_resourceTypeList := omit, integer p_targetResourceIndex := -1, XSD.ID p_originator := PX_SUPER_CSE_ID) runs on CseSimu return URIList {
 				var RequestPrimitive v_requestPrimitive;
 				var URIList v_uriList := {};
 				v_requestPrimitive := valueof(m_retrieveChildResourceRefs(f_getResourceAddress(p_targetResourceIndex), p_originator));
@@ -1883,7 +1743,7 @@ module OneM2M_Functions {
 			 * @param p_resourceIndex Resource index 
 			 * @return boolean
 			 */
-			function f_cse_isResourcePresent (integer p_resourceIndex) runs on CseSimu return boolean {
+			function f_cse_isResourcePresent_cseSimu (integer p_resourceIndex) runs on CseSimu return boolean {
 
 				//Check to see if the resource is present or not
 				mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))));
@@ -1918,7 +1778,7 @@ module OneM2M_Functions {
 			 * @param p_resourceName Resource name (Hierarchical method is used) of the resource to be checked
 			 * @return boolean
 			 */
-			function f_cse_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on CseSimu return boolean {
+			function f_cse_isResourceNotPresent_cseSimu (integer p_parentIndex, XSD.String p_resourceName) runs on CseSimu return boolean {
 			
 				log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource");
 				
@@ -2055,7 +1915,7 @@ module OneM2M_Functions {
 			 * @desc Receive a request from the CSE IUT to the Test System (simulating a CSE) 
 			 * @param p_requestPrimitive Expected CREATE request primitive
 			 */
-			function f_cse_receiveCreateRequest(in template RequestPrimitive p_requestPrimitive := ?) runs on CseSimu {
+			function f_cse_receiveCreateRequest_cseSimu(in template RequestPrimitive p_requestPrimitive := ?) runs on CseSimu {
 				var ResponsePrimitive v_responsePrimitive;
     			
     			//Activate defaults when running on a PTC
@@ -2110,7 +1970,7 @@ module OneM2M_Functions {
 					v_myResource.cSEBase.lastModifiedTime := v_myResource.cSEBase.creationTime;		
 					v_myResource.cSEBase.cSE_ID := PX_CSE1_ID;
 					v_myResource.cSEBase.supportedResourceType := PX_CSE1_SRT;
-					v_myResource.cSEBase.pointOfAccess := {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING_CSE1, PX_CSE1_ADDRESS, "")};
+					v_myResource.cSEBase.pointOfAccess := {f_getCompletePoA(PX_PROTOCOL_BINDING_CSE1, PX_CSE1_ADDRESS, "")};
 					v_myResource.cSEBase.cseType := vc_cseType;
 					    
 				}else if(p_resourceType == int16 and ispresent(p_resource)) {			//RemoteCSE
@@ -2327,7 +2187,7 @@ module OneM2M_Functions {
 			 * @desc   Send response to the IUT (Test System simulating a CSE)
 			 * @param  p_requestPrimtive	Received request primitive
 			 */
-			function f_cse_sendResponse(in MsgIn p_requestPrimitive) runs on CseSimu {
+			function f_cse_sendResponse_cseSimu(in MsgIn p_requestPrimitive) runs on CseSimu {
 				
 				
 				f_processCreateRequestPrimitive(p_requestPrimitive.primitive.requestPrimitive);
@@ -2335,37 +2195,7 @@ module OneM2M_Functions {
 				mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
 			
 			}
-			
-			/**
-			 * @desc   Receive response from the IUT
-			 * @param  p_requestPrimtive	Received request primitive
-			 */
-			function f_cse_receiveResponse(in RequestPrimitive p_request) runs on AeSimu {
-				
-				var integer v_resourceIndex := -1;
-				
-				//Activate defaults when running on a PTC
-			    f_cse_activateDefaults_ae(); 
-			    
-				tc_ac.start;
-				alt {
-					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
-						tc_ac.stop;
-						setverdict(pass, __SCOPE__&":INFO: Response received with positive response status code");
-						f_checkAttributesToBeSaved(p_request.resourceType, p_request, vc_response.primitive.responsePrimitive);
-						v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_request.resourceType);
-					}
-					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
-						tc_ac.stop;
-						setverdict(pass, __SCOPE__&":INFO: Response received with negative response status code");
-					}
-					[] tc_ac.timeout {
-						setverdict(inconc, __SCOPE__&":INFO: No response received");
-					}
-				}	
-				
-			}
-						
+									
 		}//end group CseSimuFunctions
 		
 		group CseAltstepFunctions {
@@ -2526,81 +2356,58 @@ module OneM2M_Functions {
 					log(__SCOPE__&": WARNING: Unexpected message received");
 					repeat;
 				}
-			 }	
-
+			 }
+			
 			/**
-			  * @desc	Altstep for AeSimu
+			  * @desc	Activation of the corresponding default altstep depending on config for CseSimu
 			  */
-			 altstep a_ae_cseSimu() runs on CseSimu {
+			function f_cse_activateDefaults_cse1() runs on CseSimu {
+				if(not(self == mtc)) {
+					activate(a_default());
+					if(vc_config == e_cf02) {
+						activate(a_cse_cf02_cse1());
+						log(__SCOPE__&": INFO: Default cf02_cse1 activated");
+					} else if(vc_config == e_cf04) {
+						activate(a_cse_cf04());
+						log(__SCOPE__&": INFO: Default cf04 activated");
+					}
+				}	
+			}
+	
+			/**
+			  * @desc	Activation of the corresponding default altstep depending on config for AeSimu
+			  */
+			function f_cse_activateDefaults_ae() runs on AeSimu {
+				if(not(self == mtc)) {
+					activate(a_default());
+					if(vc_config == e_cf01) {
+						activate(a_cse_cf01());
+						log(__SCOPE__&": INFO: Default cf01 and cf01_ae2 activated");
+					} else if(vc_config == e_cf02CseSimuMaster) {
+						activate(a_cse_cf02_ae1());
+						log(__SCOPE__&": INFO: Default cf02_ae1 activated");
+					}
+				}	
+			}
+		}//end group CseAltstepFunctions
+		
+	}//end cseFunctions
+	
+	group AeFunctions {
+		
+		group preambleFunctions {
+		
+			/**
+			 * @desc	Waits for AE registration request and process it
+			 * @param 	p_utRequest UpperTester request primitive to be sent to the IUT		
+			 * @return 	Internal resource index of AE or -1 in case of failure		
+			 * @verdict	inconc if no AE registration request is received 
+			 */
+	 		function f_ae_preamble_registerAe(template UtTriggerPrimitive p_utRequest := m_utCreateAe) runs on CseSimu return integer {
+    		
 				var MsgIn v_request;
-				var ResponsePrimitive v_response;
-				
-				[] mcaPortIn.receive(mw_request(mw_notify)) -> value v_request {
-					tc_ac.stop;
-					log(__SCOPE__&": WARNING: Unexpected NOTIFY message received");
-
-					//Send response in any case
-					v_response := valueof(m_responseNotification(int2000, omit));
-					v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
-					mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
-					tc_ac.start(10.0);
-					repeat;
-				}
-				[] mcaPortIn.receive {
-					log(__SCOPE__&": WARNING: Unexpected message received");
-					repeat;
-				}
-				[] mcaPort.receive {
-					log(__SCOPE__&": WARNING: Unexpected message received");
-					repeat;
-				}
-			 }
-			 
-		}//end group altstepFunctions
-		
-		function f_cse_activateDefaults_cse1() runs on CseSimu {
-			if(not(self == mtc)) {
-				activate(a_default());
-				if(vc_config == e_cf02) {
-					activate(a_cse_cf02_cse1());
-					log(__SCOPE__&": INFO: Default cf02_cse1 activated");
-				} else if(vc_config == e_cf04) {
-					activate(a_cse_cf04());
-					log(__SCOPE__&": INFO: Default cf04 activated");
-				}
-			}	
-		}
-		
-		function f_cse_activateDefaults_ae() runs on AeSimu {
-			if(not(self == mtc)) {
-				activate(a_default());
-				if(vc_config == e_cf01) {
-					activate(a_cse_cf01());
-					log(__SCOPE__&": INFO: Default cf01 and cf01_ae2 activated");
-				} else if(vc_config == e_cf02CseSimuMaster) {
-					activate(a_cse_cf02_ae1());
-					log(__SCOPE__&": INFO: Default cf02_ae1 activated");
-				}
-			}	
-		}
-		
-	}//end cseFunctions
-	
-	group AeFunctions {
-		
-		group preambleFunctions {
-		
-			/**
-			 * @desc	Waits for AE registration request and process it
-			 * @param 	p_utRequest UpperTester request primitive to be sent to the IUT		
-			 * @return 	Internal resource index of AE or -1 in case of failure		
-			 * @verdict	inconc if no AE registration request is received 
-			 */
-	 		function f_ae_preamble_registerAe(template UtTriggerPrimitive p_utRequest := m_utCreateAe) runs on CseSimu return integer {
-    		
-				var MsgIn v_request;
-				var integer v_localResourceIndex, v_parentIndex;
-				var charstring v_action := "Please, register the AE on the Tester";
+				var integer v_localResourceIndex, v_parentIndex;
+				var charstring v_action := "Please, register the AE on the Tester";
 				
 				p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-,-,-);
 				if(not(ispresent(p_utRequest.requestPrimitive.primitiveContent))) {
@@ -2684,31 +2491,8 @@ module OneM2M_Functions {
 						
 		} // end preambleFunctions
 		
-		group helpingFunctions {
-
-		} // end helpingFunctions
-		
-		group altstepFunctions {
+		group AeAltstepFunctions {
     
-			/**
-			  * @desc	Ae altstep
-			  */
-			 altstep a_ae_default() runs on CseSimu {
-
-				var MsgIn v_request; 
-				
-				[] mcaPort.receive(mw_request(?)) -> value v_request {
-					log(__SCOPE__ & ":WARNING: Unexpected request received");
-					mcaPort.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))));
-					repeat;
-				}
-				    		
-				[] mcaPort.receive {
-					log(__SCOPE__ & ":WARNING: Unexpected message received");
-					repeat;
-				}
-			 }		
-			 
 			/**
 			 * @desc    Waits for CREATE request, stores resource and replies to request 
 			 * @remark  This altstep includes a_ae_default
@@ -2716,39 +2500,59 @@ module OneM2M_Functions {
 			 */
 			altstep a_ae_cf03() runs on CseSimu {
 				
+				[] a_ae_cseSimu();				
+			}
+			
+			/**
+			  * @desc	Altstep for AeSimu
+			  */
+			 altstep a_ae_cseSimu() runs on CseSimu {
+				var ResponsePrimitive v_response;
 				var MsgIn v_request;			
-				var PrimitiveContent v_modifiedResource;
-				var integer v_resourceIndex, v_parentIndex;
-				var RequestPrimitive v_rp;
-				
+				var integer v_localResourceIndex := -1;
+								
+				[] mcaPortIn.receive(mw_request(mw_notify)) -> value v_request {
+					tc_ac.stop;
+					log(__SCOPE__&": WARNING: Unexpected NOTIFY message received");
+
+					//Send response in any case
+					v_response := valueof(m_responseNotification(int2000, omit));
+					v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
+					mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
+					tc_ac.start(10.0);
+					repeat;
+				}
 				[] mcaPortIn.receive(mw_request(mw_create)) -> value v_request {	
-					v_rp := v_request.primitive.requestPrimitive;		
-					v_parentIndex := f_getResourceIndex(v_rp.to_);
-					v_modifiedResource := f_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType);
-					v_resourceIndex := f_setLocalResource(v_modifiedResource, v_rp.resourceType, v_parentIndex);
-					if(v_resourceIndex != -1) {
-						mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource))));
-					}
-					else {
-						mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))));
-					}					
-					repeat;	
+					
+					v_localResourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);
+	
+					mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
+					tc_ac.start(10.0);
+					repeat;
 				}
-				
-				[] a_ae_default();				
-			}
-    		 
-		}//end group altstepFunctions
-		
-		function f_ae_activateDefaults() runs on CseSimu {
-			if(not(self == mtc)) {
-				activate(a_default());
-				if(vc_config == e_cf03) {
-					activate(a_ae_cf03());
-					log(__SCOPE__&": INFO: Default cf03 activated");
+				[] mcaPortIn.receive {
+					log(__SCOPE__&": WARNING: Unexpected message received");
+					repeat;
 				}
-			}	
-		}
+				[] mcaPort.receive {
+					log(__SCOPE__&": WARNING: Unexpected message received");
+					repeat;
+				}
+			 }
+ 
+ 			/**
+			  * @desc	Activation of the corresponding default altstep depending on config for CseSimu
+			  */  		 		
+			function f_ae_activateDefaults_cse1() runs on CseSimu {
+				if(not(self == mtc)) {
+					activate(a_default());
+					if(vc_config == e_cf03) {
+						activate(a_ae_cf03());
+						log(__SCOPE__&": INFO: Default cf03 activated");
+					}
+				}	
+			}
+		}//end group AeAltstepFunctions
 		
 	}//end of aeFunctions
 
@@ -2756,79 +2560,347 @@ module OneM2M_Functions {
 	group GetSetFunctions {
 	
 		/**
-		 * @desc Creation of a CREATE request primitive from a template request primitive
-		 * @param p_resourceType Type of resource to be created
-		 * @param p_request Template request primitive 
-		 * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
-		 * @return Created CREATE request primitive
-		 * @verdict 
+		* @desc Get MsgOut primitive
+		* @param MsgOut MsgOut primitive
 		 */
-		function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on Tester return RequestPrimitive {
-			var template ListOfURIs v_defaultListOfURIs := {"NotInitialized"};
-			var template AcpType v_defaultAcpIDs := {"NotInitialized"};
 
-			p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000);
+		function f_getMsgOutPrimitive(MsgOut p_msgOut) runs on Tester return MsgOut {
+			p_msgOut.protocolBinding := vc_protocolBinding;
+			return p_msgOut; 
+		}
+		
+		/**
+		 * @desc Build a reception template from the primitiveContent sent in previous request primitive
+		 * @param p_primitiveContent PrimitiveContent from previous request primitive
+		 * @return Built reception template
+		 * @verdict 
+		 */
+		function f_getTemplateFromPrimitiveContent (in template PrimitiveContent p_primitiveContent) return template PrimitiveContent{
+			var template PrimitiveContent v_primitiveContent := omit;
 			
-			if((p_resourceType != int2) and (p_resourceType != int10002)) {
-				if(p_resourceType == int16) {
-					p_request.from_ := PX_CSE1_ID;
-				} else {	
-					p_request.from_ := f_getOriginator(p_parentIndex, vc_testSystemRole);
+			if(ischosen(p_primitiveContent.container)){ // Container
+				v_primitiveContent := {container := mw_contentContainerBase};
+				
+				if(ispresent(p_primitiveContent.container.labels)){
+					v_primitiveContent.container.labels := ?;
+				}
+				if(ispresent(p_primitiveContent.container.accessControlPolicyIDs)){
+					v_primitiveContent.container.accessControlPolicyIDs := ?;
+				}
+				if(ispresent(p_primitiveContent.container.announceTo)){
+					v_primitiveContent.container.announceTo := ?;
+				}
+				if(ispresent(p_primitiveContent.container.announcedAttribute)){
+					v_primitiveContent.container.announcedAttribute := ?;
+				}
+				if(ispresent(p_primitiveContent.container.creator)){
+					v_primitiveContent.container.creator := ?;
+				}
+				if(ispresent(p_primitiveContent.container.maxNrOfInstances)){
+					v_primitiveContent.container.maxNrOfInstances := ?;
+				}
+				if(ispresent(p_primitiveContent.container.maxByteSize)){
+					v_primitiveContent.container.maxByteSize := ?;
+				}
+				if(ispresent(p_primitiveContent.container.maxInstanceAge)){
+					v_primitiveContent.container.maxInstanceAge := ?;
+				}
+				if(ispresent(p_primitiveContent.container.locationID)){
+					v_primitiveContent.container.locationID := ?;
+				}
+				if(ispresent(p_primitiveContent.container.ontologyRef)){
+					v_primitiveContent.container.ontologyRef := ?;
 				}
 			}
 			
-			p_request.to_ := f_getResourceAddress(p_parentIndex);
-
-			if (p_resourceType == int1) {//AccessControlPolicy
+			else if(ischosen(p_primitiveContent.aE)){ // AE
+				v_primitiveContent := {aE := mw_contentAeBase};
 				
-			} 
-			
-			if (p_resourceType == int9) {//group
-				if(match(valueof(p_request.primitiveContent.group_.memberIDs), v_defaultListOfURIs )){
-					if ((p_parentIndex == -1) and (isbound(vc_aeAuxIndex))){
-						p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[vc_aeAuxIndex].resource)};
-					}else{
-						p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[p_parentIndex].resource)};
-					}
+				if(ispresent(p_primitiveContent.aE.labels)){
+					v_primitiveContent.aE.labels := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.accessControlPolicyIDs)){
+					v_primitiveContent.aE.accessControlPolicyIDs := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.announceTo)){
+					v_primitiveContent.aE.announceTo := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.announcedAttribute)){
+					v_primitiveContent.aE.announcedAttribute := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.appName)){
+					v_primitiveContent.aE.appName := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.pointOfAccess)){
+					v_primitiveContent.aE.pointOfAccess := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.ontologyRef)){
+					v_primitiveContent.aE.ontologyRef := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.nodeLink)){
+					v_primitiveContent.aE.nodeLink := ?;
+				}
+				if(ispresent(p_primitiveContent.aE.contentSerialization)){
+					v_primitiveContent.aE.contentSerialization := ?;
 				}
 			}
 			
-			if(p_resourceType == int3){//container
-				//when a container is created by hosting cse for storing location information, the container is seen as a location container
-				if(PX_IS_LOC_CONTAINER){
-					p_request.primitiveContent.container.locationID := f_getResourceId(vc_resourcesList[p_parentIndex].resource);//resourceID of the locationPolicy
-				}	
-				if(ispresent(p_request.primitiveContent.container.accessControlPolicyIDs)) {
-					if((match(valueof(p_request.primitiveContent.container.accessControlPolicyIDs), v_defaultAcpIDs )) and (isbound(vc_acpAuxIndex))){
-						p_request.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)};
-					}	
-				}  
-			}
-			
-			if (p_resourceType == int15) {//pollingChannel
-				if(ischosen(vc_resourcesList[p_parentIndex].resource.aE)) {	
-					p_request.from_ := vc_resourcesList[p_parentIndex].resource.aE.aE_ID;
+			else if(ischosen(p_primitiveContent.accessControlPolicy)){ // ACP
+				v_primitiveContent := {accessControlPolicy := mw_contentAcpBase};
+	
+				if(ispresent(p_primitiveContent.accessControlPolicy.labels)){
+					v_primitiveContent.accessControlPolicy.labels := ?;
 				}
-			} 
+				if(ispresent(p_primitiveContent.accessControlPolicy.announceTo)){
+					v_primitiveContent.accessControlPolicy.announceTo := ?;
+				}
+			}
 			
-			if (p_resourceType == int18) {//schedule
-			} 
+			else if(ischosen(p_primitiveContent.contentInstance)){ // ContentInstance
+				v_primitiveContent := {contentInstance := mw_contentContentInstanceBase};
 
-			if (p_resourceType == int23) {//subscription
-				//notificationURI
-				if(match(valueof(p_request.primitiveContent.subscription.notificationURI), v_defaultListOfURIs )){
-					p_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_parentIndex)};
+				if(ispresent(p_primitiveContent.contentInstance.labels)){
+					v_primitiveContent.contentInstance.labels := ?;
 				}
-				//subscriberURI
-				if(ispresent(p_request.primitiveContent.subscription.subscriberURI)) {
-					if(match(valueof(p_request.primitiveContent.subscription.subscriberURI), "NotInitialized" )){
-						p_request.primitiveContent.subscription.subscriberURI := f_getResourceAddress(vc_aeAuxIndex);
-					}
+				if(ispresent(p_primitiveContent.contentInstance.announceTo)){
+					v_primitiveContent.contentInstance.announceTo := ?;
 				}
-				//accessControlPolicyIds
-				if(ispresent(p_request.primitiveContent.subscription.accessControlPolicyIDs)) {
-					if(match(valueof(p_request.primitiveContent.subscription.accessControlPolicyIDs), v_defaultAcpIDs )){
-						p_request.primitiveContent.subscription.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)};
+				if(ispresent(p_primitiveContent.contentInstance.announcedAttribute)){
+					v_primitiveContent.contentInstance.announcedAttribute := ?;
+				}
+				if(ispresent(p_primitiveContent.contentInstance.creator)){
+					v_primitiveContent.contentInstance.creator := ?;
+				}
+				if(ispresent(p_primitiveContent.contentInstance.contentInfo)){
+					v_primitiveContent.contentInstance.contentInfo := ?;
+				}
+				if(ispresent(p_primitiveContent.contentInstance.ontologyRef)){
+					v_primitiveContent.contentInstance.ontologyRef := ?;
+				}
+			}
+			
+			else if(ischosen(p_primitiveContent.group_)){ // Group
+				v_primitiveContent := {group_ := mw_contentGroupBase};
+
+				if(ispresent(p_primitiveContent.group_.labels)){
+					v_primitiveContent.group_.labels := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.accessControlPolicyIDs)){
+					v_primitiveContent.group_.accessControlPolicyIDs := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.announceTo)){
+					v_primitiveContent.group_.announceTo := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.announcedAttribute)){
+					v_primitiveContent.group_.announcedAttribute := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.creator)){
+					v_primitiveContent.group_.creator := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.membersAccessControlPolicyIDs)){
+					v_primitiveContent.group_.membersAccessControlPolicyIDs := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.memberTypeValidated)){
+					v_primitiveContent.group_.memberTypeValidated := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.consistencyStrategy)){
+					v_primitiveContent.group_.consistencyStrategy := ?;
+				}
+				if(ispresent(p_primitiveContent.group_.groupName)){
+					v_primitiveContent.group_.groupName := ?;
+				}
+			}
+			
+			else if(ischosen(p_primitiveContent.pollingChannel)){ // PollingChannel
+				v_primitiveContent := {pollingChannel := mw_contentPollingChannelBase};
+
+				if(ispresent(p_primitiveContent.pollingChannel.labels)){
+					v_primitiveContent.pollingChannel.labels := ?;
+				}
+			}
+			
+			else if(ischosen(p_primitiveContent.schedule)){ // Schedule
+				v_primitiveContent := {schedule := mw_contentScheduleBase};
+
+				if(ispresent(p_primitiveContent.schedule.labels)){
+					v_primitiveContent.schedule.labels := ?;
+				}
+				if(ispresent(p_primitiveContent.schedule.announceTo)){
+					v_primitiveContent.schedule.announceTo := ?;
+				}
+				if(ispresent(p_primitiveContent.schedule.announcedAttribute)){
+					v_primitiveContent.schedule.announcedAttribute := ?;
+				}
+			}
+			
+			else if(ischosen(p_primitiveContent.subscription)){ // Subscription
+				v_primitiveContent := {subscription := mw_contentSubscriptionBase};
+
+				if(ispresent(p_primitiveContent.subscription.labels)){
+					v_primitiveContent.subscription.labels := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.accessControlPolicyIDs)){
+					v_primitiveContent.subscription.accessControlPolicyIDs := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.creator)){
+					v_primitiveContent.subscription.creator := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.eventNotificationCriteria)){
+					v_primitiveContent.subscription.eventNotificationCriteria := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.expirationCounter)){
+					v_primitiveContent.subscription.expirationCounter := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.groupID)){
+					v_primitiveContent.subscription.groupID := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.notificationForwardingURI)){
+					v_primitiveContent.subscription.notificationForwardingURI := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.batchNotify)){
+					v_primitiveContent.subscription.batchNotify := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.rateLimit)){
+					v_primitiveContent.subscription.rateLimit := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.preSubscriptionNotify)){
+					v_primitiveContent.subscription.preSubscriptionNotify := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.pendingNotification)){
+					v_primitiveContent.subscription.pendingNotification := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.notificationStoragePriority)){
+					v_primitiveContent.subscription.notificationStoragePriority := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.latestNotify)){
+					v_primitiveContent.subscription.latestNotify := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.notificationContentType)){
+					v_primitiveContent.subscription.notificationContentType := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.notificationEventCat)){
+					v_primitiveContent.subscription.notificationEventCat := ?;
+				}
+				if(ispresent(p_primitiveContent.subscription.subscriberURI)){
+					v_primitiveContent.subscription.subscriberURI := ?;
+				}
+			}
+			else if(ischosen(p_primitiveContent.remoteCSE)){ //remoteCSE
+				v_primitiveContent := {remoteCSE := mw_contentRemoteCSEBase};
+				  
+				if(ispresent(p_primitiveContent.remoteCSE.labels)){
+					v_primitiveContent.remoteCSE.labels := ?;			    
+				}
+				  
+				if(ispresent(p_primitiveContent.remoteCSE.accessControlPolicyIDs)){
+					v_primitiveContent.remoteCSE.accessControlPolicyIDs := ?;			    
+				}
+				 				
+				if(ispresent(p_primitiveContent.remoteCSE.announceTo)){
+					v_primitiveContent.remoteCSE.announceTo := ?;			    
+				}
+				 
+				if(ispresent(p_primitiveContent.remoteCSE.announcedAttribute)){
+					v_primitiveContent.remoteCSE.announcedAttribute := ?;			    
+				}
+				
+				if(ispresent(p_primitiveContent.remoteCSE.cseType)){
+					v_primitiveContent.remoteCSE.cseType := ?;			    
+				}
+				  
+				if(ispresent(p_primitiveContent.remoteCSE.pointOfAccess)){
+					v_primitiveContent.remoteCSE.pointOfAccess := ?;			    
+				}
+				  
+				if(ispresent(p_primitiveContent.remoteCSE.m2M_Ext_ID)){
+					v_primitiveContent.remoteCSE.m2M_Ext_ID := ?;			    
+				}
+				  
+				if(ispresent(p_primitiveContent.remoteCSE.trigger_Recipient_ID)){
+					v_primitiveContent.remoteCSE.trigger_Recipient_ID := ?;			    
+				}
+				  
+				if(ispresent(p_primitiveContent.remoteCSE.nodeLink)){
+					v_primitiveContent.remoteCSE.nodeLink := ?;			    
+				}
+			}			
+			return v_primitiveContent;
+		}
+
+		/**
+		 * @desc Creation of a CREATE request primitive from a template request primitive
+		 * @param p_resourceType Type of resource to be created
+		 * @param p_request Template request primitive 
+		 * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
+		 * @return Created CREATE request primitive
+		 * @verdict 
+		 */
+		function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on Tester return RequestPrimitive {
+			var template ListOfURIs v_defaultListOfURIs := {"NotInitialized"};
+			var template AcpType v_defaultAcpIDs := {"NotInitialized"};
+
+			p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000);
+			
+			if((p_resourceType != int2) and (p_resourceType != int10002)) {
+				if(p_resourceType == int16) {
+					p_request.from_ := PX_CSE1_ID;
+				} else {	
+					p_request.from_ := f_getOriginator(p_parentIndex, vc_testSystemRole);
+				}
+			}
+			
+			p_request.to_ := f_getResourceAddress(p_parentIndex);
+
+			if (p_resourceType == int1) {//AccessControlPolicy
+				
+			} 
+			
+			if (p_resourceType == int9) {//group
+				if(match(valueof(p_request.primitiveContent.group_.memberIDs), v_defaultListOfURIs )){
+					if ((p_parentIndex == -1) and (isbound(vc_aeAuxIndex))){
+						p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[vc_aeAuxIndex].resource)};
+					}else{
+						p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[p_parentIndex].resource)};
+					}
+				}
+			}
+			
+			if(p_resourceType == int3){//container
+				//when a container is created by hosting cse for storing location information, the container is seen as a location container
+				if(PX_IS_LOC_CONTAINER){
+					p_request.primitiveContent.container.locationID := f_getResourceId(vc_resourcesList[p_parentIndex].resource);//resourceID of the locationPolicy
+				}	
+				if(ispresent(p_request.primitiveContent.container.accessControlPolicyIDs)) {
+					if((match(valueof(p_request.primitiveContent.container.accessControlPolicyIDs), v_defaultAcpIDs )) and (isbound(vc_acpAuxIndex))){
+						p_request.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)};
+					}	
+				}  
+			}
+			
+			if (p_resourceType == int15) {//pollingChannel
+				if(ischosen(vc_resourcesList[p_parentIndex].resource.aE)) {	
+					p_request.from_ := vc_resourcesList[p_parentIndex].resource.aE.aE_ID;
+				}
+			} 
+			
+			if (p_resourceType == int18) {//schedule
+			} 
+
+			if (p_resourceType == int23) {//subscription
+				//notificationURI
+				if(match(valueof(p_request.primitiveContent.subscription.notificationURI), v_defaultListOfURIs )){
+					p_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_parentIndex)};
+				}
+				//subscriberURI
+				if(ispresent(p_request.primitiveContent.subscription.subscriberURI)) {
+					if(match(valueof(p_request.primitiveContent.subscription.subscriberURI), "NotInitialized" )){
+						p_request.primitiveContent.subscription.subscriberURI := f_getResourceAddress(vc_aeAuxIndex);
+					}
+				}
+				//accessControlPolicyIds
+				if(ispresent(p_request.primitiveContent.subscription.accessControlPolicyIDs)) {
+					if(match(valueof(p_request.primitiveContent.subscription.accessControlPolicyIDs), v_defaultAcpIDs )){
+						p_request.primitiveContent.subscription.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)};
 					}	
 				}  
 			}
@@ -3140,7 +3212,7 @@ module OneM2M_Functions {
 		 * @param p_announcementTargetResource Announcement Target Resource
 		 * @return p_annoucementTargetPoA Announcemenet Target PoA
 		 */
-		function f_getAnnouncementTargetPoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING_CSE1, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "" ) return charstring {
+		function f_getCompletePoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING_CSE1, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "" ) return charstring {
 						
 			if(p_protocolBinding == "HTTP") {
 				return "http://" & p_announcementTargetAddress & "/" & p_announcementTargetResource;
@@ -3329,24 +3401,108 @@ module OneM2M_Functions {
 			}
 				
 		}
-		
-		
+
 		/**
-		 * @desc Saving of a resource and its parent index in the internal resource list
-		 * @param p_resource Resource to be saved
-		 * @param p_parentIndex Parent index of resource to be saved
-		 * @return Internal resource index of the saved resource
-		 * @verdict 
+		 * @desc Retrieve AE_ID for a given AE resource
+		 * @param p_targetResourceIndex Internal resource index of the given resource
+		 * @return AE_ID of the given resource
 		 */
-		function f_setResource(PrimitiveContent p_resource, ResourceType p_resourceType, integer  p_parentIndex := -1, in boolean p_resourceToBeDeleted := true) runs on Tester return integer {
-			var integer v_newIndex := -1;	
-			if(isbound(vc_resourcesList)) {
-				vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resourceType, p_resource};
-			} else {
-				vc_resourcesList[0] := {p_parentIndex, p_resourceType, p_resource};
-			}
+		function f_getAeId(integer  p_targetResourceIndex := -1) runs on Tester return XSD.ID {
 			
-			v_newIndex := lengthof(vc_resourcesList)-1;
+			if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.aE)) {
+				return vc_resourcesList[p_targetResourceIndex].resource.aE.aE_ID;
+			}
+			
+			log(__SCOPE__ & ":WARNING: p_targetResourceIndex does not refer to AE resource");
+			return "";
+			
+		} // end f_getAeId
+		
+		/**
+		 * @desc Retrieve Announced Resource Type from the given resource type
+		 * @param p_targetResourceIndex Internal resource index of the given resource
+		 * @return AE_ID of the given resource
+		 */
+		function f_getAnnouncedResourceType(in ResourceType p_resourceType) runs on Tester return ResourceType {
+			
+			if(p_resourceType == int2) {
+				return int10002;
+			}
+			
+			return p_resourceType;
+			
+		} // end f_getAnnouncedResourceType		
+		
+		/**
+		 * @desc Retrieve Year from a given timestamp
+		 * @param p_timestamp Given timestamp
+		 * @return Year
+		 */
+		function f_getYear(charstring p_timestamp) runs on Tester return charstring {
+			
+			var charstring v_year := "";
+			var integer i;
+			
+			for(i := 0; i <= 3; i := i+1){
+				v_year := v_year & p_timestamp[i];
+			}
+			return v_year;
+			
+		} // end f_getYear
+		
+		/**
+		 * @desc Retrieve Month from a given timestamp
+		 * @param p_timestamp Given timestamp
+		 * @return Year
+		 */
+		function f_getMonth(charstring p_timestamp) runs on Tester return charstring {
+			
+			var charstring v_month := "";
+			var integer i;
+			
+			for(i := 4; i <= 5; i := i+1){
+				if(p_timestamp[i] != "0") {
+					v_month := v_month & p_timestamp[i];
+				}
+			}
+			return v_month;
+			
+		} // end f_getYear
+		
+		/**
+		 * @desc Retrieve IP address from a given address which includes port information separated by :
+		 * @param p_addressPort Given address
+		 * @return IPv4 Address
+		 */
+		function f_getIpv4Address(charstring p_addressPort) runs on Tester return charstring {
+			
+			var charstring v_ipv4Address := "";
+			var integer i:= 0;
+			
+			while ((i < lengthof(p_addressPort)-1) and (p_addressPort[i] != ":")){
+				v_ipv4Address := v_ipv4Address & p_addressPort[i];
+				i := i + 1;
+			}
+			return v_ipv4Address;
+			
+		} // end f_getIpv4Address
+
+		/**
+		 * @desc Saving of a resource and its parent index in the internal resource list
+		 * @param p_resource Resource to be saved
+		 * @param p_parentIndex Parent index of resource to be saved
+		 * @return Internal resource index of the saved resource
+		 * @verdict 
+		 */
+		function f_setResource(PrimitiveContent p_resource, ResourceType p_resourceType, integer  p_parentIndex := -1, in boolean p_resourceToBeDeleted := true) runs on Tester return integer {
+			var integer v_newIndex := -1;	
+			if(isbound(vc_resourcesList)) {
+				vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resourceType, p_resource};
+			} else {
+				vc_resourcesList[0] := {p_parentIndex, p_resourceType, p_resource};
+			}
+			
+			v_newIndex := lengthof(vc_resourcesList)-1;
 			if(p_resourceToBeDeleted) {
 				if(p_resourceType == int2 or p_parentIndex == -1) {//If created resource is an AE or created under CSEBase, it needs to be added to the resourceToBeDeleted list
 					vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_newIndex};
@@ -3430,182 +3586,181 @@ module OneM2M_Functions {
 			}
 			return valueof(p_requestPrimitive);					
 		}
-		
+
 		/**
-		 * @desc Retrieve AE_ID for a given AE resource
-		 * @param p_targetResourceIndex Internal resource index of the given resource
-		 * @return AE_ID of the given resource
+		 * @desc Sets the protocol binding to be used by a component
+		 * @param p_protocolBinding Protocol binding to be used
 		 */
-		function f_getAeId(integer  p_targetResourceIndex := -1) runs on Tester return XSD.ID {
-			
-			if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.aE)) {
-				return vc_resourcesList[p_targetResourceIndex].resource.aE.aE_ID;
+		function f_setProtocolBinding(charstring p_protocolBinding) runs on Tester {
+			vc_protocolBinding := p_protocolBinding;
+		}
+ 
+			/**
+		 * @desc Returns the protocol binding used by the component
+		 */
+		function f_getProtocolBinding() runs on Tester return charstring {
+			return vc_protocolBinding;			
+		}
+
+	}//end group getSetFunctions
+	
+	group CheckingFunctions {
+	
+		group ComponentStatus {
+		
+			/**
+			 * @desc Boolean to charstring
+			 * @param p_bool
+			 * @verdict 
+			 */
+			function f_checkAeSimuStatus() runs on AeSimu {
+				
+				if (getverdict != pass) {
+					 f_cse_postamble_deleteResources();
+					 
+					 // Tear down
+					 if(vc_config == e_cf01) {
+					 	f_cf01Down();
+					 } else if (vc_config ==e_cf02) {
+					 	f_cf02Down();
+					 }
+					 kill;
+				} else {
+					log(__SCOPE__, ":INFO: AeSimu status OK");
+				}
 			}
 			
-			log(__SCOPE__ & ":WARNING: p_targetResourceIndex does not refer to AE resource");
-			return "";
 			
-		} // end f_getAeId
+			/**
+			 * @desc Sending of an Adapter Control primitive
+			 * @param event Action to be performed by TA
+			 * @param data Corresponding information for the correct execution of the given action
+			 * @verdict 
+			 */
+			function f_checkCseSimuStatus() runs on CseSimu {
 		
-		/**
-		 * @desc Retrieve Announced Resource Type from the given resource type
-		 * @param p_targetResourceIndex Internal resource index of the given resource
-		 * @return AE_ID of the given resource
-		 */
-		function f_getAnnouncedResourceType(in ResourceType p_resourceType) runs on Tester return ResourceType {
-			
-			if(p_resourceType == int2) {
-				return int10002;
+				if (getverdict != pass) {
+					 //f_ae_postamble_deleteResources();
+					 // Tear down
+					 //f_cfAeTesterDown();
+					f_cse_postamble_deleteResourcesCSE();
+					//Tear down
+					if(vc_config == e_cf03) {
+					  f_cf03Down();
+					} else if (vc_config ==e_cf04) {
+					  f_cf04Down();
+					} else if (vc_config == e_cf02CseSimuMaster) {
+						f_cf02DownCseSimuMaster();
+					}
+					kill;
+				} else {
+					log(__SCOPE__, ":INFO: CseSimu status OK");
+				}
 			}
 			
-			return p_resourceType;
-			
-			
-		} // end f_getAnnouncedResourceType
-		
-		/**
-		 * @desc   Proccessing of the CREATE request primitive
-		 * @param  p_request          Request primitive to be processed
-		 * @return Local resource index
-		 */
-		function f_processCreateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer {			
-			var integer v_parentIndex := -1;
-			var integer v_localResourceIndex := -1;
-			var PrimitiveContent v_localResource;
+			/**
+			 * @desc Sending of an Adapter Control primitive
+			 * @param event Action to be performed by TA
+			 * @param data Corresponding information for the correct execution of the given action
+			 * @verdict 
+			 */
+			function f_aeSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on AeSimu {
 				
-			v_parentIndex := f_getResourceIndex(p_request.to_);
-			if(v_parentIndex == -1) {
-				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
-		
-			} else {
-				setverdict(pass, __SCOPE__&":INFO: Resource created successfuly");
-				v_localResource := f_generateLocalResource(p_request.primitiveContent, v_parentIndex, p_request.resourceType);
-				v_localResourceIndex := f_setLocalResource(v_localResource, p_request.resourceType, v_parentIndex);
+				var verdicttype v_verdict := none;
 	
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2001,p_request.requestIdentifier));
-				vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource;
-			}
-			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
-			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
+				tc_ac.start(15.0);
+				alt {
+					[] p_ae.done -> value v_verdict {
+						tc_ac.stop;
+					}
+					[] tc_ac.timeout {
+						setverdict(inconc, __SCOPE__ & "INFO: Component did not finish");
+					}
+				}			 
 				
-			return v_localResourceIndex;
-		}
+				if(v_verdict == pass) {         // Component was successfully completed and got stopped state
+					setverdict(pass);
+				} else {
+					setverdict(inconc);            // Component was not completed successfully 
+				}
+				
+				f_checkAeSimuStatus();
+			} 
+					
+			/**
+			 * @desc Sending of an Adapter Control primitive
+			 * @param event Action to be performed by TA
+			 * @param data Corresponding information for the correct execution of the given action
+			 * @verdict 
+			 */
+			function f_cseSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on CseSimu {
+				
+				var verdicttype v_verdict := none;
+	
+				tc_ac.start(15.0);
+				alt {
+					[] p_ae.done -> value v_verdict {
+						tc_ac.stop;
+					}
+					[] tc_ac.timeout {
+						setverdict(inconc, __SCOPE__ & "INFO: Component did not finish");
+					}
+				}			 
+				
+				if(v_verdict == pass) {         // Component was successfully completed and got stopped state
+					setverdict(pass);
+				} else {
+					setverdict(inconc);            // Component was not completed successfully 
+				}
+				
+				f_checkCseSimuStatus();
+			} 
+
+		}//end of group ComponentStatus
 		
 		/**
-		 * @desc   Proccessing of the UPDATE request primitive
-		 * @param  p_request          Request primitive to be processed
+		 * @desc It determines whether the addressing method of the given address is non-hierarchical. Not valid for CSE-Base as target
+		 * @param p_resourceAddress
+		 * @return boolean
 		 */
-		function f_processUpdateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu {			
-			var integer v_targetLocalResourceIndex := -1;
+		function f_isNonHierarchical(XSD.ID p_resourceAddress) runs on Tester return boolean {	
+			var integer i;
+			var integer v_nbOfSlashes:= 0;
+    			
+			for (i := 0; i < lengthof(p_resourceAddress); i:= i+1){
+				if(p_resourceAddress[i] == "/"){
+					v_nbOfSlashes:= v_nbOfSlashes+1;
+				}
+			}
 				
-			v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_);
-			if(v_targetLocalResourceIndex == -1) {
-				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
-		
+			if(f_isScopeCseRelative(p_resourceAddress)) {
+				if(v_nbOfSlashes == 0 ) {
+					return true;
+				} else {
+					return false;
+				}
+    				
+			} else if (f_isScopeSpRelative(p_resourceAddress)){	
+				if(v_nbOfSlashes == 2 ) {
+					return true;
+				} else {
+					return false;
+				}
+			} else if (f_isScopeAbsolute(p_resourceAddress)){
+				if(v_nbOfSlashes == 4 ) {
+					return true;
+				} else {
+					return false;
+				}
 			} else {
-				setverdict(pass, __SCOPE__&":INFO: Resource updated successfuly");
-				f_updateLocalResource(v_targetLocalResourceIndex, p_request.primitiveContent);
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2004,p_request.requestIdentifier));
-				vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource;
+			   return false;
 			}
-			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
-			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
-		
 		}
-	
+			  		
 		/**
-		 * @desc   Proccessing of the RETRIEVE request primitive
-		 * @param  p_request          Request primitive to be processed
-		 */
-		function f_processRetrieveRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu {			
-			var integer v_targetLocalResourceIndex := -1;
-				
-			v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_);
-			if(v_targetLocalResourceIndex == -1) {
-				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
-		
-			} else {
-				setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly");
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2000,p_request.requestIdentifier));
-				vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource;
-			}
-			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
-			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
-		
-		}
-    				
-		/**
-		 * @desc   Proccessing of the DELETE request primitive
-		 * @param  p_request          Request primitive to be processed
-		 */
-		function f_processDeleteRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu {			
-			var integer v_targetLocalResourceIndex := -1;
-				
-			v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_);
-			if(v_targetLocalResourceIndex == -1) {
-				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
-		
-			} else {
-				setverdict(pass, __SCOPE__&":INFO: Resource deleted successfuly");
-				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2002,p_request.requestIdentifier));
-			}
-			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
-			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
-		
-		}
-
-	}//end group getSetFunctions
-	
-	group CheckingFunctions {
-	
-		/**
-		 * @desc It determines whether the addressing method of the given address is non-hierarchical. Not valid for CSE-Base as target
-		 * @param p_resourceAddress
-		 * @return boolean
-		 */
-		function f_isNonHierarchical(XSD.ID p_resourceAddress) runs on Tester return boolean {	
-			var integer i;
-			var integer v_nbOfSlashes:= 0;
-    			
-			for (i := 0; i < lengthof(p_resourceAddress); i:= i+1){
-				if(p_resourceAddress[i] == "/"){
-					v_nbOfSlashes:= v_nbOfSlashes+1;
-				}
-			}
-				
-			if(f_isScopeCseRelative(p_resourceAddress)) {
-				if(v_nbOfSlashes == 0 ) {
-					return true;
-				} else {
-					return false;
-				}
-    				
-			} else if (f_isScopeSpRelative(p_resourceAddress)){	
-				if(v_nbOfSlashes == 2 ) {
-					return true;
-				} else {
-					return false;
-				}
-			} else if (f_isScopeAbsolute(p_resourceAddress)){
-				if(v_nbOfSlashes == 4 ) {
-					return true;
-				} else {
-					return false;
-				}
-			} else {
-			   return false;
-			}
-		}
-			
-    		
-		/**
-		 * @desc It determines whether the addressing method of the given address is hierarchical. Not valid for CSE-Base as target
-		 * @param p_resourceAddress
-		 * @return boolean
+		 * @desc It determines whether the addressing method of the given address is hierarchical. Not valid for CSE-Base as target
+		 * @param p_resourceAddress
+		 * @return boolean
 		 */
 		 function f_isHierarchical(XSD.ID p_resourceAddress) runs on Tester return boolean {
 			if(f_isNonHierarchical(p_resourceAddress)) {
@@ -3654,208 +3809,186 @@ module OneM2M_Functions {
 			}
 		}
 	
-	
-	
-	}//end group CheckingFunctions
-	
-	group CommonFunctions {
-		
-
-		/**
-		 * @desc Boolean to charstring
-		 * @param p_bool
-		 * @verdict 
-		 */
-		function f_checkAeSimuStatus() runs on AeSimu {
-			
-			if (getverdict != pass) {
-				 f_cse_postamble_deleteResources();
-				 
-				 // Tear down
-				 if(vc_config == e_cf01) {
-				 	f_cf01Down();
-				 } else if (vc_config ==e_cf02) {
-				 	f_cf02Down();
-				 }
-				 kill;
-			} else {
-				log(__SCOPE__, ":INFO: AeSimu status OK");
-			}
-		}
-		
-		/**
-		 * @desc Sending of an Adapter Control primitive
-		 * @param event Action to be performed by TA
-		 * @param data Corresponding information for the correct execution of the given action
-		 * @verdict 
-		 */
-		function f_aeSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on AeSimu {
-			
-			var verdicttype v_verdict := none;
-
-			tc_ac.start(15.0);
-			alt {
-				[] p_ae.done -> value v_verdict {
-					tc_ac.stop;
-				}
-				[] tc_ac.timeout {
-					setverdict(inconc, __SCOPE__ & "INFO: Component did not finish");
-				}
-			}			 
-			
-			if(v_verdict == pass) {         // Component was successfully completed and got stopped state
-				setverdict(pass);
-			} else {
-				setverdict(inconc);            // Component was not completed successfully 
-			}
-			
-			f_checkAeSimuStatus();
-		} 
-		
-		/**
-		 * @desc Sets the protocol binding to be used by a component
-		 * @param p_protocolBinding Protocol binding to be used
-		 */
- 
-		function f_setProtocolBinding(charstring p_protocolBinding) runs on Tester {
-			vc_protocolBinding := p_protocolBinding;
-		}
- 
+    		
 			/**
-		 * @desc Returns the protocol binding used by the component
-		 */
-		function f_getProtocolBinding() runs on Tester return charstring {
-			return vc_protocolBinding;			
-		}
-		
-		/**
-		 * @desc Sending of an Adapter Control primitive
-		 * @param event Action to be performed by TA
-		 * @param data Corresponding information for the correct execution of the given action
-		 * @verdict 
-		 */
-		function f_cseSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on CseSimu {
-			
-			var verdicttype v_verdict := none;
-
-			tc_ac.start(15.0);
-			alt {
-				[] p_ae.done -> value v_verdict {
-					tc_ac.stop;
-				}
-				[] tc_ac.timeout {
-					setverdict(inconc, __SCOPE__ & "INFO: Component did not finish");
-				}
-			}			 
-			
-			if(v_verdict == pass) {         // Component was successfully completed and got stopped state
-				setverdict(pass);
-			} else {
-				setverdict(inconc);            // Component was not completed successfully 
-			}
-			
-			f_checkCseSimuStatus();
-		} 
-		
-		/**
-		 * @desc Sending of an Adapter Control primitive
-		 * @param event Action to be performed by TA
-		 * @param data Corresponding information for the correct execution of the given action
-		 * @verdict 
-		 */
-		function f_checkCseSimuStatus() runs on CseSimu {
-	
-			if (getverdict != pass) {
-				 //f_ae_postamble_deleteResources();
-				 // Tear down
-				 //f_cfAeTesterDown();
-				f_cse_postamble_deleteResourcesCSE();
-				//Tear down
-				if(vc_config == e_cf03) {
-				  f_cf03Down();
-				} else if (vc_config ==e_cf04) {
-				  f_cf04Down();
-				} else if (vc_config == e_cf02CseSimuMaster) {
-					f_cf02DownCseSimuMaster();
-				}
-				kill;
-			} else {
-				log(__SCOPE__, ":INFO: CseSimu status OK");
-			}
-		}
-		
-		/**
-		 * @desc Sending of an Adapter Control primitive
-		 * @param event Action to be performed by TA
-		 * @param data Corresponding information for the correct execution of the given action
-		 * @verdict 
-		 */
-		function f_sendAcPrimitive(in charstring p_event, in charstring p_data) runs on Tester {
-			
-
-			var charstring v_data := "" & p_data; // clear encoding rules (ttwb issue ?)
-			acPort.send(AcRequestPrimitive:{p_event, {charstring := v_data}});
-			
-		}
-		
-		/**
-		* @desc Get MsgOut primitive
-		* @param MsgOut MsgOut primitive
-		 */
-
-		function f_getMsgOutPrimitive(MsgOut p_msgOut) runs on Tester return MsgOut {
-			p_msgOut.protocolBinding := vc_protocolBinding;
-			return p_msgOut; 
-		}
-		
-		function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest, in universal charstring p_action) runs on Tester {
-			
-			if (PX_UT_IMPLEMENTED){
-				
-				p_utRequest.requestPrimitive.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000);
-
-				deactivate;
-				utPort.send(valueof(p_utRequest));
-
-				tc_wait.start;
-				alt{
-					[] utPort.receive(mw_utResponseOK) {
-						tc_wait.stop;
-						setverdict(pass, __SCOPE__ & " : Triggering message is successfully received!");
+			 * @desc Checking of returned important attributed (in response) in order to save properly internally
+			 * @param p_resourceType ResourceType of the resource to be checked
+			 * @param p_request Request primitive used for the CRU operation
+			 * @param p_response Response primitive received
+			 * @verdict 
+			 */
+			 //Note: This function will be continously extended with necessary attributes/resources
+			function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) {
+				select (p_resourceType) {
+					case (int1) {
+						if(isvalue(p_response.primitiveContent.accessControlPolicy) and
+								not(ispresent(p_response.primitiveContent.accessControlPolicy.resourceName))) {
+							p_response.primitiveContent.accessControlPolicy.resourceName :=  p_request.primitiveContent.accessControlPolicy.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.accessControlPolicy.resourceName)
+						}
 					}
-					[] utPort.receive(mw_utResponseKO) {
-						tc_wait.stop;
-						setverdict(inconc, __SCOPE__ & " : Error while receiving Triggering message!");
+					case (int2) {
+						if(isvalue(p_response.primitiveContent.aE) and
+								not(ispresent(p_response.primitiveContent.aE.resourceName))) {
+							p_response.primitiveContent.aE.resourceName :=  p_request.primitiveContent.aE.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.aE.resourceName)
+						}
 					}
-					[] tc_wait.timeout{
-						setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
+					case (int3) {
+						if(isvalue(p_response.primitiveContent.container) and
+								not(ispresent(p_response.primitiveContent.container.resourceName))) {
+							p_response.primitiveContent.container.resourceName :=  p_request.primitiveContent.container.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.container.resourceName)
+						}
 					}
-				}
-				
-				activate(a_default());
-				if(vc_config == e_cf01) {
-					vc_aeSimu := activate(a_cse_cf01());
-				} else if ((vc_config == e_cf02) or (vc_config == e_cf02CseSimuMaster)) {
-					if(vc_testSystemRole == e_ae) {
-						vc_aeSimu := activate(a_cse_cf02_ae1());
-					} else if (vc_testSystemRole == e_cse) {
-						vc_cseSimu := activate(a_cse_cf02_cse1());
+					case (int4) {
+						if(isvalue(p_response.primitiveContent.contentInstance) and
+								not(ispresent(p_response.primitiveContent.contentInstance.resourceName))) {
+							p_response.primitiveContent.contentInstance.resourceName :=  p_request.primitiveContent.contentInstance.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.contentInstance.resourceName)
+						}
+					}
+					case (int15) {
+						if (isvalue(p_response.primitiveContent.pollingChannel) and
+								not(ispresent(p_response.primitiveContent.pollingChannel.resourceName))) {
+							p_response.primitiveContent.pollingChannel.resourceName :=  p_request.primitiveContent.pollingChannel.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.pollingChannel.resourceName)
+						}
+					}
+					case (int16) {
+						if (isvalue(p_response.primitiveContent.remoteCSE) and
+								not(ispresent(p_response.primitiveContent.remoteCSE.resourceName))) {
+							p_response.primitiveContent.remoteCSE.resourceName :=  p_request.primitiveContent.remoteCSE.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.remoteCSE.resourceName)
+						}
+					}
+					case (int18) {
+						if (isvalue(p_response.primitiveContent.schedule) and
+								not(ispresent(p_response.primitiveContent.schedule.resourceName))) {
+							p_response.primitiveContent.schedule.resourceName :=  p_request.primitiveContent.schedule.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.schedule.resourceName)
+						}
+					}
+					case (int23) {
+						if (isvalue(p_response.primitiveContent.subscription) and
+								not(ispresent(p_response.primitiveContent.subscription.resourceName))) {
+							p_response.primitiveContent.subscription.resourceName :=  p_request.primitiveContent.subscription.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.subscription.resourceName)
+						}
+					}
+					case (int9) {
+						if (isvalue(p_response.primitiveContent.group_) and
+								not(ispresent(p_response.primitiveContent.group_.resourceName))) {
+							p_response.primitiveContent.group_.resourceName :=  p_request.primitiveContent.group_.resourceName;
+							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.group_.resourceName)
+						}
+					}
+					case else {
+						log(__SCOPE__&":WARNING: Resource Type "&int2str(enum2int(p_resourceType))&" not implemented");
 					}
-				} else if (vc_config == e_cf03) {
-					vc_cseSimu := activate(a_ae_cf03());
-				} else if (vc_config == e_cf04) {
-					vc_cseSimu := activate(a_cse_cf04());
 				}
-			}else{
-				
-				action(p_action);
-			
-			}
-			
-			
-
-		}
- 
+    
+				// TODO test that if the resource name is returned is the same resource name as used in the create message
+			}
+		
+			/**
+			 * @desc Comparison of two URIs
+			 * @param p_expectedURIIndex Resource index of the resource for which its URI is to be compared
+			 * @param p_receivedURI URI to be compared
+			 * @param p_response Response primitive received
+			 * @verdict 
+			 */
+			function f_compareURIs(in integer p_expectedURIIndex, in XSD.ID p_receivedURI) runs on Tester return boolean{
+				// Local variables
+				var boolean v_matchResult := false;
+				var AddressingMethod v_addressingMethod;
+				var PrimitiveScope v_primitiveScope;
+    			
+				if (f_isNonHierarchical(p_receivedURI)) {
+					v_addressingMethod := e_nonHierarchical;
+				} else if (f_isHierarchical(p_receivedURI)) {
+					v_addressingMethod := e_hierarchical;
+				}
+				if (f_isScopeCseRelative(p_receivedURI)) {
+					v_primitiveScope := e_cseRelative;
+				}
+				if (f_isScopeSpRelative(p_receivedURI)) {
+					v_primitiveScope := e_spRelative;
+				}
+				if (f_isScopeAbsolute(p_receivedURI)) {
+					v_primitiveScope := e_absolute;
+				}
+    			
+				if(match(f_getResourceAddress(p_expectedURIIndex, v_addressingMethod, v_primitiveScope), p_receivedURI)) {
+					v_matchResult := true;
+				} else {
+					v_matchResult := false;
+				}
+							
+				return v_matchResult;
+    
+			} //end f_compareURIs	
+	
+				
+				/**
+				 * @desc Checking of notification primitiveContent
+				 * @param p_requestPrimitive Received Notification request
+				 * @param p_primitiveContent Expected primitiveContent in the notification
+				 * @verdict 
+				 */
+				function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on Tester return boolean{
+					// Local variables
+					var boolean v_matchResult := false;
+					var integer i;
+					var integer v_numberOfAggregatedNotification;
+    	
+					if (ischosen(p_primitiveContent.aE)){
+						log("Representation contains AE resource representation");
+						if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE)) {
+							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE, p_primitiveContent.aE);
+							log("Expected primitiveContent");
+						}
+						else if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE)) {
+							v_matchResult :=match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE);
+						}
+						else if (isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list)) {
+							v_matchResult := true;
+							v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list);
+							for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){
+								if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE)) {
+									if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE, p_primitiveContent.aE))){
+										v_matchResult := false;
+									}
+								}
+								else if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE)) {
+									if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE))){
+										v_matchResult := false;
+									}
+								}						
+							}
+							if (i == 0){
+								v_matchResult := false;
+							}
+						}
+    
+					}
+    	
+					if (ischosen(p_primitiveContent.container)){
+						if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container)) {
+							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container, p_primitiveContent.container)
+						}
+						else if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container)) {
+							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container, p_primitiveContent.container)
+						}
+					}
+    	
+					return v_matchResult;
+    
+				} //end f_check_notificationContent
+	
+	}//end group CheckingFunctions
+	
+	group CommonFunctions {
 		
 		group AltstepFunctions {
 
@@ -3874,6 +4007,174 @@ module OneM2M_Functions {
 
 		}//end group altstepFunctions
 		
+		group AcFunctions {
+		
+			/**
+			 * @desc Sending of an Adapter Control primitive
+			 * @param event Action to be performed by TA
+			 * @param data Corresponding information for the correct execution of the given action
+			 * @verdict 
+			 */
+			function f_sendAcPrimitive(in charstring p_event, in charstring p_data) runs on Tester {
+				
+	
+				var charstring v_data := "" & p_data; // clear encoding rules (ttwb issue ?)
+				acPort.send(AcRequestPrimitive:{p_event, {charstring := v_data}});
+				
+			}
+		}//end of group AcFunctions
+		
+		group UtFunctions {
+		
+			/**
+			 * @desc Sending of an Upper Tester primitive
+			 * @param p_utRequest Action to be performed by IUT
+			 * @param p_action Description of the given action to be performed by the IUT
+			 * @verdict 
+			 */
+			function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest, in universal charstring p_action) runs on Tester {
+				
+				if (PX_UT_IMPLEMENTED){
+					
+					p_utRequest.requestPrimitive.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000);
+	
+					deactivate;
+					utPort.send(valueof(p_utRequest));
+	
+					tc_wait.start;
+					alt{
+						[] utPort.receive(mw_utResponseOK) {
+							tc_wait.stop;
+							setverdict(pass, __SCOPE__ & " : Triggering message is successfully received!");
+						}
+						[] utPort.receive(mw_utResponseKO) {
+							tc_wait.stop;
+							setverdict(inconc, __SCOPE__ & " : Error while receiving Triggering message!");
+						}
+						[] tc_wait.timeout{
+							setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
+						}
+					}
+					
+					activate(a_default());
+					if(vc_config == e_cf01) {
+						vc_aeSimu := activate(a_cse_cf01());
+					} else if ((vc_config == e_cf02) or (vc_config == e_cf02CseSimuMaster)) {
+						if(vc_testSystemRole == e_ae) {
+							vc_aeSimu := activate(a_cse_cf02_ae1());
+						} else if (vc_testSystemRole == e_cse) {
+							vc_cseSimu := activate(a_cse_cf02_cse1());
+						}
+					} else if (vc_config == e_cf03) {
+						vc_cseSimu := activate(a_ae_cf03());
+					} else if (vc_config == e_cf04) {
+						vc_cseSimu := activate(a_cse_cf04());
+					}
+				}else{
+					
+					action(p_action);
+				
+				}
+			}
+
+		}//end of group UtFunctions
+		
+		
+		/**
+		 * @desc   Proccessing of the CREATE request primitive
+		 * @param  p_request          Request primitive to be processed
+		 * @return Local resource index
+		 */
+		function f_processCreateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer {			
+			var integer v_parentIndex := -1;
+			var integer v_localResourceIndex := -1;
+			var PrimitiveContent v_localResource;
+				
+			v_parentIndex := f_getResourceIndex(p_request.to_);
+			if(v_parentIndex == -1) {
+				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
+		
+			} else {
+				setverdict(pass, __SCOPE__&":INFO: Resource created successfuly");
+				v_localResource := f_generateLocalResource(p_request.primitiveContent, v_parentIndex, p_request.resourceType);
+				v_localResourceIndex := f_setLocalResource(v_localResource, p_request.resourceType, v_parentIndex);
+	
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2001,p_request.requestIdentifier));
+				vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource;
+			}
+			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
+			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
+				
+			return v_localResourceIndex;
+		}
+		
+		/**
+		 * @desc   Proccessing of the UPDATE request primitive
+		 * @param  p_request          Request primitive to be processed
+		 */
+		function f_processUpdateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu {			
+			var integer v_targetLocalResourceIndex := -1;
+				
+			v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_);
+			if(v_targetLocalResourceIndex == -1) {
+				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
+		
+			} else {
+				setverdict(pass, __SCOPE__&":INFO: Resource updated successfuly");
+				f_updateLocalResource(v_targetLocalResourceIndex, p_request.primitiveContent);
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2004,p_request.requestIdentifier));
+				vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource;
+			}
+			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
+			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
+		
+		}
+	
+		/**
+		 * @desc   Proccessing of the RETRIEVE request primitive
+		 * @param  p_request          Request primitive to be processed
+		 */
+		function f_processRetrieveRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu {			
+			var integer v_targetLocalResourceIndex := -1;
+				
+			v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_);
+			if(v_targetLocalResourceIndex == -1) {
+				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
+		
+			} else {
+				setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly");
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2000,p_request.requestIdentifier));
+				vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource;
+			}
+			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
+			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
+		
+		}
+    				
+		/**
+		 * @desc   Proccessing of the DELETE request primitive
+		 * @param  p_request          Request primitive to be processed
+		 */
+		function f_processDeleteRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu {			
+			var integer v_targetLocalResourceIndex := -1;
+				
+			v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_);
+			if(v_targetLocalResourceIndex == -1) {
+				setverdict(inconc,__SCOPE__&": ERROR: Target resource not found");
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier));
+		
+			} else {
+				setverdict(pass, __SCOPE__&":INFO: Resource deleted successfuly");
+				vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2002,p_request.requestIdentifier));
+			}
+			vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID;
+			vc_response.primitive.responsePrimitive.to_ := p_request.from_;
+		
+		}
+		
 		/**
 		  * @desc	Get the Resource Identifier with Unstructured-CSE-relative -Resource-ID format
 		  * @return	Cleaned-up resourceID
@@ -3954,336 +4255,24 @@ module OneM2M_Functions {
 			}
 			p_list := result;
 		}
-		
+				
 		/**
-		 * @desc Build a reception template from the primitiveContent sent in previous request primitive
-		 * @param p_primitiveContent PrimitiveContent from previous request primitive
-		 * @return Built reception template
+		 * @desc Comparison of two primitiveContent parameters
+		 * @param p_responsePrimitiveContent Received primitiveContent
+		 * @param p_requestPrimitiveContent Sent primitiveContent
 		 * @verdict 
 		 */
-		function f_getTemplateFromPrimitiveContent (in template PrimitiveContent p_primitiveContent) return template PrimitiveContent{
-			var template PrimitiveContent v_primitiveContent := omit;
-			
-			if(ischosen(p_primitiveContent.container)){ // Container
-				v_primitiveContent := {container := mw_contentContainerBase};
+		function f_match2PrimitiveContent (in PrimitiveContent p_responsePrimitiveContent, in template PrimitiveContent p_requestPrimitiveContent) runs on Tester {
+			var template PrimitiveContent v_primitiveContent;
+			var PrimitiveContent v_response;
+			v_response := p_responsePrimitiveContent;
+			v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitiveContent);
+			if(not(match(v_response, v_primitiveContent))){
+				setverdict(inconc, __SCOPE__&":INFO: Resource incomplete, some attribute missing ");
+			}
+
+		}		
 				
-				if(ispresent(p_primitiveContent.container.labels)){
-					v_primitiveContent.container.labels := ?;
-				}
-				if(ispresent(p_primitiveContent.container.accessControlPolicyIDs)){
-					v_primitiveContent.container.accessControlPolicyIDs := ?;
-				}
-				if(ispresent(p_primitiveContent.container.announceTo)){
-					v_primitiveContent.container.announceTo := ?;
-				}
-				if(ispresent(p_primitiveContent.container.announcedAttribute)){
-					v_primitiveContent.container.announcedAttribute := ?;
-				}
-				if(ispresent(p_primitiveContent.container.creator)){
-					v_primitiveContent.container.creator := ?;
-				}
-				if(ispresent(p_primitiveContent.container.maxNrOfInstances)){
-					v_primitiveContent.container.maxNrOfInstances := ?;
-				}
-				if(ispresent(p_primitiveContent.container.maxByteSize)){
-					v_primitiveContent.container.maxByteSize := ?;
-				}
-				if(ispresent(p_primitiveContent.container.maxInstanceAge)){
-					v_primitiveContent.container.maxInstanceAge := ?;
-				}
-				if(ispresent(p_primitiveContent.container.locationID)){
-					v_primitiveContent.container.locationID := ?;
-				}
-				if(ispresent(p_primitiveContent.container.ontologyRef)){
-					v_primitiveContent.container.ontologyRef := ?;
-				}
-			}
-			
-			else if(ischosen(p_primitiveContent.aE)){ // AE
-				v_primitiveContent := {aE := mw_contentAeBase};
-				
-				if(ispresent(p_primitiveContent.aE.labels)){
-					v_primitiveContent.aE.labels := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.accessControlPolicyIDs)){
-					v_primitiveContent.aE.accessControlPolicyIDs := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.announceTo)){
-					v_primitiveContent.aE.announceTo := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.announcedAttribute)){
-					v_primitiveContent.aE.announcedAttribute := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.appName)){
-					v_primitiveContent.aE.appName := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.pointOfAccess)){
-					v_primitiveContent.aE.pointOfAccess := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.ontologyRef)){
-					v_primitiveContent.aE.ontologyRef := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.nodeLink)){
-					v_primitiveContent.aE.nodeLink := ?;
-				}
-				if(ispresent(p_primitiveContent.aE.contentSerialization)){
-					v_primitiveContent.aE.contentSerialization := ?;
-				}
-			}
-			
-			else if(ischosen(p_primitiveContent.accessControlPolicy)){ // ACP
-				v_primitiveContent := {accessControlPolicy := mw_contentAcpBase};
-	
-				if(ispresent(p_primitiveContent.accessControlPolicy.labels)){
-					v_primitiveContent.accessControlPolicy.labels := ?;
-				}
-				if(ispresent(p_primitiveContent.accessControlPolicy.announceTo)){
-					v_primitiveContent.accessControlPolicy.announceTo := ?;
-				}
-			}
-			
-			else if(ischosen(p_primitiveContent.contentInstance)){ // ContentInstance
-				v_primitiveContent := {contentInstance := mw_contentContentInstanceBase};
-
-				if(ispresent(p_primitiveContent.contentInstance.labels)){
-					v_primitiveContent.contentInstance.labels := ?;
-				}
-				if(ispresent(p_primitiveContent.contentInstance.announceTo)){
-					v_primitiveContent.contentInstance.announceTo := ?;
-				}
-				if(ispresent(p_primitiveContent.contentInstance.announcedAttribute)){
-					v_primitiveContent.contentInstance.announcedAttribute := ?;
-				}
-				if(ispresent(p_primitiveContent.contentInstance.creator)){
-					v_primitiveContent.contentInstance.creator := ?;
-				}
-				if(ispresent(p_primitiveContent.contentInstance.contentInfo)){
-					v_primitiveContent.contentInstance.contentInfo := ?;
-				}
-				if(ispresent(p_primitiveContent.contentInstance.ontologyRef)){
-					v_primitiveContent.contentInstance.ontologyRef := ?;
-				}
-			}
-			
-			else if(ischosen(p_primitiveContent.group_)){ // Group
-				v_primitiveContent := {group_ := mw_contentGroupBase};
-
-				if(ispresent(p_primitiveContent.group_.labels)){
-					v_primitiveContent.group_.labels := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.accessControlPolicyIDs)){
-					v_primitiveContent.group_.accessControlPolicyIDs := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.announceTo)){
-					v_primitiveContent.group_.announceTo := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.announcedAttribute)){
-					v_primitiveContent.group_.announcedAttribute := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.creator)){
-					v_primitiveContent.group_.creator := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.membersAccessControlPolicyIDs)){
-					v_primitiveContent.group_.membersAccessControlPolicyIDs := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.memberTypeValidated)){
-					v_primitiveContent.group_.memberTypeValidated := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.consistencyStrategy)){
-					v_primitiveContent.group_.consistencyStrategy := ?;
-				}
-				if(ispresent(p_primitiveContent.group_.groupName)){
-					v_primitiveContent.group_.groupName := ?;
-				}
-			}
-			
-			else if(ischosen(p_primitiveContent.pollingChannel)){ // PollingChannel
-				v_primitiveContent := {pollingChannel := mw_contentPollingChannelBase};
-
-				if(ispresent(p_primitiveContent.pollingChannel.labels)){
-					v_primitiveContent.pollingChannel.labels := ?;
-				}
-			}
-			
-			else if(ischosen(p_primitiveContent.schedule)){ // Schedule
-				v_primitiveContent := {schedule := mw_contentScheduleBase};
-
-				if(ispresent(p_primitiveContent.schedule.labels)){
-					v_primitiveContent.schedule.labels := ?;
-				}
-				if(ispresent(p_primitiveContent.schedule.announceTo)){
-					v_primitiveContent.schedule.announceTo := ?;
-				}
-				if(ispresent(p_primitiveContent.schedule.announcedAttribute)){
-					v_primitiveContent.schedule.announcedAttribute := ?;
-				}
-			}
-			
-			else if(ischosen(p_primitiveContent.subscription)){ // Subscription
-				v_primitiveContent := {subscription := mw_contentSubscriptionBase};
-
-				if(ispresent(p_primitiveContent.subscription.labels)){
-					v_primitiveContent.subscription.labels := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.accessControlPolicyIDs)){
-					v_primitiveContent.subscription.accessControlPolicyIDs := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.creator)){
-					v_primitiveContent.subscription.creator := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.eventNotificationCriteria)){
-					v_primitiveContent.subscription.eventNotificationCriteria := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.expirationCounter)){
-					v_primitiveContent.subscription.expirationCounter := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.groupID)){
-					v_primitiveContent.subscription.groupID := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.notificationForwardingURI)){
-					v_primitiveContent.subscription.notificationForwardingURI := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.batchNotify)){
-					v_primitiveContent.subscription.batchNotify := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.rateLimit)){
-					v_primitiveContent.subscription.rateLimit := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.preSubscriptionNotify)){
-					v_primitiveContent.subscription.preSubscriptionNotify := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.pendingNotification)){
-					v_primitiveContent.subscription.pendingNotification := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.notificationStoragePriority)){
-					v_primitiveContent.subscription.notificationStoragePriority := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.latestNotify)){
-					v_primitiveContent.subscription.latestNotify := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.notificationContentType)){
-					v_primitiveContent.subscription.notificationContentType := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.notificationEventCat)){
-					v_primitiveContent.subscription.notificationEventCat := ?;
-				}
-				if(ispresent(p_primitiveContent.subscription.subscriberURI)){
-					v_primitiveContent.subscription.subscriberURI := ?;
-				}
-			}
-			else if(ischosen(p_primitiveContent.remoteCSE)){ //remoteCSE
-				v_primitiveContent := {remoteCSE := mw_contentRemoteCSEBase};
-				  
-				if(ispresent(p_primitiveContent.remoteCSE.labels)){
-					v_primitiveContent.remoteCSE.labels := ?;			    
-				}
-				  
-				if(ispresent(p_primitiveContent.remoteCSE.accessControlPolicyIDs)){
-					v_primitiveContent.remoteCSE.accessControlPolicyIDs := ?;			    
-				}
-				 				
-				if(ispresent(p_primitiveContent.remoteCSE.announceTo)){
-					v_primitiveContent.remoteCSE.announceTo := ?;			    
-				}
-				 
-				if(ispresent(p_primitiveContent.remoteCSE.announcedAttribute)){
-					v_primitiveContent.remoteCSE.announcedAttribute := ?;			    
-				}
-				
-				if(ispresent(p_primitiveContent.remoteCSE.cseType)){
-					v_primitiveContent.remoteCSE.cseType := ?;			    
-				}
-				  
-				if(ispresent(p_primitiveContent.remoteCSE.pointOfAccess)){
-					v_primitiveContent.remoteCSE.pointOfAccess := ?;			    
-				}
-				  
-				if(ispresent(p_primitiveContent.remoteCSE.m2M_Ext_ID)){
-					v_primitiveContent.remoteCSE.m2M_Ext_ID := ?;			    
-				}
-				  
-				if(ispresent(p_primitiveContent.remoteCSE.trigger_Recipient_ID)){
-					v_primitiveContent.remoteCSE.trigger_Recipient_ID := ?;			    
-				}
-				  
-				if(ispresent(p_primitiveContent.remoteCSE.nodeLink)){
-					v_primitiveContent.remoteCSE.nodeLink := ?;			    
-				}
-			}			
-			return v_primitiveContent;
-		}
-		
-		/**
-		 * @desc Comparison of two primitiveContent parameters
-		 * @param p_responsePrimitiveContent Received primitiveContent
-		 * @param p_requestPrimitiveContent Sent primitiveContent
-		 * @verdict 
-		 */
-		function f_match2PrimitiveContent (in PrimitiveContent p_responsePrimitiveContent, in template PrimitiveContent p_requestPrimitiveContent) runs on Tester {
-			var template PrimitiveContent v_primitiveContent;
-			var PrimitiveContent v_response;
-			v_response := p_responsePrimitiveContent;
-			v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitiveContent);
-			if(not(match(v_response, v_primitiveContent))){
-				setverdict(inconc, __SCOPE__&":INFO: Resource incomplete, some attribute missing ");
-			}
-
-		}		
-		
-		/**
-		 * @desc Retrieve Year from a given timestamp
-		 * @param p_timestamp Given timestamp
-		 * @return Year
-		 */
-		function f_getYear(charstring p_timestamp) runs on Tester return charstring {
-			
-			var charstring v_year := "";
-			var integer i;
-			
-			for(i := 0; i <= 3; i := i+1){
-				v_year := v_year & p_timestamp[i];
-			}
-			return v_year;
-			
-		} // end f_getYear
-		
-		/**
-		 * @desc Retrieve Month from a given timestamp
-		 * @param p_timestamp Given timestamp
-		 * @return Year
-		 */
-		function f_getMonth(charstring p_timestamp) runs on Tester return charstring {
-			
-			var charstring v_month := "";
-			var integer i;
-			
-			for(i := 4; i <= 5; i := i+1){
-				if(p_timestamp[i] != "0") {
-					v_month := v_month & p_timestamp[i];
-				}
-			}
-			return v_month;
-			
-		} // end f_getYear
-		
-		/**
-		 * @desc Retrieve IP address from a given address which includes port information separated by :
-		 * @param p_addressPort Given address
-		 * @return IPv4 Address
-		 */
-		function f_getIpv4Address(charstring p_addressPort) runs on Tester return charstring {
-			
-			var charstring v_ipv4Address := "";
-			var integer i:= 0;
-			
-			while ((i < lengthof(p_addressPort)-1) and (p_addressPort[i] != ":")){
-				v_ipv4Address := v_ipv4Address & p_addressPort[i];
-				i := i + 1;
-			}
-			return v_ipv4Address;
-			
-		} // end f_getIpv4Address
-		
 	}//end of commonFunctions
 	
 	group externalFunctions {
diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn
index 04821bc..108f600 100644
--- a/OneM2M_PermutationFunctions.ttcn
+++ b/OneM2M_PermutationFunctions.ttcn
@@ -1449,7 +1449,7 @@ module OneM2M_PermutationFunctions {
 						vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse);
 						
 						//Check if the resource has been deleted or not
-						if(f_cse_isResourcePresent(vc_remoteCseIndex)) {
+						if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) {
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":INFO: Resource not created");
@@ -1821,7 +1821,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
     								
 						//Check to see if the resource is present or not
-						if (f_isResourcePresent(v_resourceIndex)){
+						if (f_cse_isResourcePresent(v_resourceIndex)){
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -1897,7 +1897,7 @@ module OneM2M_PermutationFunctions {
 							f_checkCseSimuStatus();
     								
 							//Check to see if the resource is present or not
-							if (f_cse_isResourcePresent(v_resourceIndex)){
+							if (f_cse_isResourcePresent_cseSimu(v_resourceIndex)){
 								setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 							} else {
 								setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -1962,7 +1962,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
 						
 						//Check to see if the resource is present or not
-						if(f_isResourcePresent(v_resourceIndex)){
+						if(f_cse_isResourcePresent(v_resourceIndex)){
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");	
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -2091,7 +2091,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
     					
 						//Check to see if the resource is NOT present
-						if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+						if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 						} else {
 						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -2148,7 +2148,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
 					
 						//Check to see if the resource is NOT present
-						if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+						if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 						} else {
 						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -2209,7 +2209,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
 						
 						//Check to see if the resource is present or not
-						if(f_isResourcePresent(v_resourceIndex)){
+						if(f_cse_isResourcePresent(v_resourceIndex)){
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -2302,7 +2302,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
 						
 						//Check to see if the resource is present or not
-						if(f_isResourcePresent(v_resourceIndex)) {
+						if(f_cse_isResourcePresent(v_resourceIndex)) {
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -2594,7 +2594,7 @@ module OneM2M_PermutationFunctions {
 						
 						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
 						
-						vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc));
+						vc_cse1.start(f_cse_receiveCreateRequest_cseSimu(p_requestAnnc));
 						vc_cse1.done;	
     								
 						// Postamble
@@ -2644,7 +2644,7 @@ module OneM2M_PermutationFunctions {
 						// Test Body
 						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
 						
-						vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc));						
+						vc_cse1.start(f_cse_receiveCreateRequest_cseSimu(p_requestAnnc));						
 						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
 						vc_cse1.done;	
     								
@@ -4678,7 +4678,7 @@ module OneM2M_PermutationFunctions {
 
 						 // Preamble
 						if(p_resourceType != int2) {
-						 	v_aeIndex := f_cse_preamble_registerAe(-, {f_getAnnouncementTargetPoA("HTTP", PX_AE1_ADDRESS, "")});//c_CRUDNDi);
+						 	v_aeIndex := f_cse_preamble_registerAe(-, {f_getCompletePoA("HTTP", PX_AE1_ADDRESS, "")});//c_CRUDNDi);
 						}
 						
 						if(p_resourceType != int1) {
@@ -4815,7 +4815,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
     								
 						//Check to see if the resource is present or not
-						if (f_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){
+						if (f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){
 							setverdict(pass, __SCOPE__ & ":INFO: Resource deleted");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted");
@@ -4903,7 +4903,7 @@ module OneM2M_PermutationFunctions {
 						f_checkAeSimuStatus();
                 		
 						//Check if the resource has been deleted or not
-						if(f_isResourcePresent(v_resourceIndex)) {
+						if(f_cse_isResourcePresent(v_resourceIndex)) {
 							setverdict(pass, __SCOPE__ & ":INFO: Resource not deleted");
 						} else {
 							setverdict(fail, __SCOPE__ & ":INFO: Resource deleted");
@@ -6095,7 +6095,7 @@ module OneM2M_PermutationFunctions {
 							v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
 							vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
 							
-							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)});
+							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getCompletePoA(-, PX_AE1_ADDRESS, -)});
 			
 							// Test Body
 							p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
@@ -6156,7 +6156,7 @@ module OneM2M_PermutationFunctions {
 							v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
 							vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
 							
-							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)});
+							v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getCompletePoA(-, PX_AE1_ADDRESS, -)});
 			
 							// Test Body
 							p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex);
diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn
index d06925e..a61c169 100644
--- a/OneM2M_Testcases_CSE_Release_1.ttcn
+++ b/OneM2M_Testcases_CSE_Release_1.ttcn
@@ -700,17 +700,17 @@ module OneM2M_Testcases_CSE_Release_1 {
 						[] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
-							f_cse_sendResponse(v_request);
+							f_cse_sendResponse_cseSimu(v_request);
 						}
 						[] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request {
 							tc_ac.stop;
 							setverdict(fail, __SCOPE__ & ": AE creation redirected but wrong parameters");
-							f_cse_sendResponse(v_request);
+							f_cse_sendResponse_cseSimu(v_request);
 						}
 						[] mccPortIn.receive(mw_request(?))-> value v_request {
 							tc_ac.stop;
 							setverdict(fail, __SCOPE__ & ": Unexpected message received");
-							f_cse_sendResponse(v_request);
+							f_cse_sendResponse_cseSimu(v_request);
 						}
 						[] tc_ac.timeout {
 							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
@@ -1712,7 +1712,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					}	
 					
 					//Check to see if the resource is present or not
-				  	if (f_isResourcePresent(vc_aeAuxIndex)){
+				  	if (f_cse_isResourcePresent(vc_aeAuxIndex)){
 					  	setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 				  	} else {
 					  	setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -2062,7 +2062,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					vc_remoteCseIndex := f_cse_registerRemoteCse(v_request, v_contentResponse);
 					
 					//Check if the resource has been deleted or not
-					if(f_cse_isResourcePresent(vc_remoteCseIndex)) {
+					if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) {
 						setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 					} else {
 						setverdict(fail, __SCOPE__ & ":INFO: Resource not created");
@@ -3164,7 +3164,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					}
 					
 //					Check if the resource has been deleted or not
-					if(f_cse_isResourcePresent(vc_remoteCseIndex)) {
+					if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) {
 						setverdict(fail, __SCOPE__ & ":INFO: Resource not deleted");
 					} else {
 						setverdict(pass, __SCOPE__ & ":INFO: Resource deleted");
@@ -4025,7 +4025,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
 					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){
+					if(f_cse_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");
@@ -4112,7 +4112,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
 
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){
+					if(f_cse_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");
@@ -4272,7 +4272,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
 					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -4352,7 +4352,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
 					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -5839,7 +5839,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						v_ae1.done;
 						v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;//Attribute 3
 						v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2; //Attribute 1
-						v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2
+						v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getCompletePoA()};//Attribute 2
 						v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;//Attribute 3
 						
 						v_nullFields := {{"labels", omit}};
@@ -8689,7 +8689,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -8764,7 +8764,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -8844,7 +8844,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -8918,7 +8918,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -9343,7 +9343,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						f_checkAeSimuStatus();
     						
 						//Check to see if the resource is present or not
-						if(f_isResourcePresent(v_acpIndex)) {
+						if(f_cse_isResourcePresent(v_acpIndex)) {
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -9428,7 +9428,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						f_checkAeSimuStatus();
     						
 						//Check to see if the resource is present or not
-						if(f_isResourcePresent(v_acpIndex)) {
+						if(f_cse_isResourcePresent(v_acpIndex)) {
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -9513,7 +9513,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						f_checkAeSimuStatus();
     						
 						//Check to see if the resource is present or not
-						if(f_isResourcePresent(v_acpIndex)) {
+						if(f_cse_isResourcePresent(v_acpIndex)) {
 							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -9588,7 +9588,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 						f_checkAeSimuStatus();
     						
 						//Check to see if the resource is present or not
-						if(f_isResourceNotPresent(-1, v_createRequest.primitiveContent.accessControlPolicy.resourceName)) {
+						if(f_cse_isResourceNotPresent(-1, v_createRequest.primitiveContent.accessControlPolicy.resourceName)) {
 							setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 						} else {
 							setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -11099,7 +11099,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -11187,7 +11187,7 @@ module OneM2M_Testcases_CSE_Release_1 {
 					f_checkAeSimuStatus();
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn
index 1170fd1..a3ff9c9 100644
--- a/OneM2M_Testcases_CSE_Release_2.ttcn
+++ b/OneM2M_Testcases_CSE_Release_2.ttcn
@@ -3671,7 +3671,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 						v_ae1.done;
 						v_createRequest.primitiveContent.schedule.scheduleElement := {{"0 0 0,1,2 1 1 *"}};//Attribute 1
 						v_updateRequest.primitiveContent.schedule.scheduleElement := {{"1 1 1,2 1 1 *"}}; //Attribute 1
-						v_updateRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2
+						v_updateRequest.primitiveContent.schedule.announceTo := {f_getCompletePoA()};//Attribute 2
 						v_updateRequest.primitiveContent.schedule.labels := v_labels_1;//Attribute 3
                 						
 						v_nullFields := {{"labels", omit}};
@@ -5485,7 +5485,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 				f_checkAeSimuStatus();
     					
 				//Check to see if the resource is NOT present
-				if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+				if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 				  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 				} else {
 				  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -5560,7 +5560,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 				f_checkAeSimuStatus();
     						
 				//Check to see if the resource is present or not
-				if(f_isResourcePresent(v_resourceIndex)) {
+				if(f_cse_isResourcePresent(v_resourceIndex)) {
 					setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 				} else {
 					setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -5643,7 +5643,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 				f_checkAeSimuStatus();
     					
 				//Check to see if the resource is NOT present
-				if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+				if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 				  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 				} else {
 				  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -5716,7 +5716,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 				f_checkAeSimuStatus();
     					
 				//Check to see if the resource is NOT present
-				if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+				if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 				  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 				} else {
 				  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -5948,7 +5948,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 				f_checkAeSimuStatus();
 						
 				//Check to see if the resource is present or not
-				if(f_isResourcePresent(v_resourceIndex)) {
+				if(f_cse_isResourcePresent(v_resourceIndex)) {
 					setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 				} else {
 					setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -6027,7 +6027,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 				f_checkAeSimuStatus();
 						
 				//Check to see if the resource is present or not
-				if(f_isResourcePresent(v_resourceIndex)) {
+				if(f_cse_isResourcePresent(v_resourceIndex)) {
 					setverdict(pass, __SCOPE__ & ":INFO: Resource created");
 				} else {
 					setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
@@ -6502,7 +6502,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 					f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
@@ -6579,7 +6579,7 @@ module OneM2M_Testcases_CSE_Release_2 {
 					f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
     					
 					//Check to see if the resource is NOT present
-					if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
+					if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
 					  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
 					} else {
 					  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
-- 
GitLab