From a56bc7e62ff2b0512b502310aad350aad8271714 Mon Sep 17 00:00:00 2001
From: pkulkarni <pkulkarni75@gmail.com>
Date: Fri, 20 Oct 2017 14:41:37 +0200
Subject: [PATCH] Incorporated code review comments for REG/RET/004 and
 REG/RET/007

Signed-off-by: pkulkarni <pkulkarni75@gmail.com>
---
 OneM2M_Testcases_CSE.ttcn | 57 +++++++++++++++++++++++++++++----------
 1 file changed, 43 insertions(+), 14 deletions(-)

diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn
index 29c337b..9c88163 100644
--- a/OneM2M_Testcases_CSE.ttcn
+++ b/OneM2M_Testcases_CSE.ttcn
@@ -2015,65 +2015,81 @@ module OneM2M_Testcases_CSE {
 					
 					testcase TC_CSE_REG_RET_004_LBL() runs on Tester system CseSystem {
 						// Local variables
+						var Labels v_labels_1 := {"VALUE_1"};
+						var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID);
 						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
 						var template PrimitiveContent v_contentResponse;
+						
+						v_createRequest.primitiveContent.aE.labels := v_labels_1;
 	
 						v_contentResponse.aE := mw_contentAeBase;
 						v_contentResponse.aE.labels := ?;
 		    
-						v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
+						v_ae1.start(f_CSE_REG_RET_004(v_createRequest, v_contentResponse));
 						v_ae1.done;
 					}
 	
 					testcase TC_CSE_REG_RET_004_APN() runs on Tester system CseSystem {
 						//Local variables
 						 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+						 var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID);
 						 var template PrimitiveContent v_contentResponse;
+						 
+						 v_createRequest.primitiveContent.aE.appName := "AeAppName";
 
 						 v_contentResponse.aE := mw_contentAeBase;
 						 v_contentResponse.aE.appName := ?;
 
-						 v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
+						 v_ae1.start(f_CSE_REG_RET_004(v_createRequest,v_contentResponse));
 						 v_ae1.done;
 					}
 					
 					testcase TC_CSE_REG_RET_004_POA() runs on Tester system CseSystem {
 						//Local variables
 						 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+						 var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID);
 						 var template PrimitiveContent v_contentResponse;
+						 
+						 v_createRequest.primitiveContent.aE.pointOfAccess := {PX_AE1_ADDRESS};
 
 						 v_contentResponse.aE := mw_contentAeBase;
 						 v_contentResponse.aE.pointOfAccess := ?;
 
-						 v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
+						 v_ae1.start(f_CSE_REG_RET_004(v_createRequest, v_contentResponse));
 						 v_ae1.done;
 					}
 					
 					testcase TC_CSE_REG_RET_004_NL() runs on Tester system CseSystem {
 						//Local variables
 						 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+						 var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID);
 						 var template PrimitiveContent v_contentResponse;
+						 
+						 v_createRequest.primitiveContent.aE.nodeLink := "http://127.0.0.1/";
 
 						 v_contentResponse.aE := mw_contentAeBase;
 						 v_contentResponse.aE.nodeLink := ?;
 
-						 v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
+						 v_ae1.start(f_CSE_REG_RET_004(v_createRequest,v_contentResponse));
 						 v_ae1.done;
 					}
 					
 					testcase TC_CSE_REG_RET_004_CSZ() runs on Tester system CseSystem {
 						//Local variables
 						 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+						 var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID);
 						 var template PrimitiveContent v_contentResponse;
+						 
+						 v_createRequest.primitiveContent.aE.contentSerialization := {applicationxml};
 
 						 v_contentResponse.aE := mw_contentAeBase;
 						 v_contentResponse.aE.contentSerialization := ?; 
 
-						 v_ae1.start(f_CSE_REG_RET_004(v_contentResponse));
+						 v_ae1.start(f_CSE_REG_RET_004(v_createRequest,v_contentResponse));
 						 v_ae1.done;
 					}
 	
-					function f_CSE_REG_RET_004(template PrimitiveContent p_contentResponse) runs on AeSimu {
+					function f_CSE_REG_RET_004(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu {
 						//Local variables
 						 var MsgIn v_response;
 						 var integer v_aeIndex := -1;
@@ -2086,7 +2102,7 @@ module OneM2M_Testcases_CSE {
 						 // Test adapter configuration
 
 						 // Preamble
-						 v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+						 v_aeIndex := f_cse_createResource(int2, p_createRequestPrimitive, -1);
 		 
 						 mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID
 						 tc_ac.start;
@@ -2279,52 +2295,65 @@ module OneM2M_Testcases_CSE {
 					testcase TC_CSE_REG_RET_007_LBL() runs on Tester system CseSystem {
 						// Local variables
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
+						var Labels v_labels_1 := {"VALUE_1"};
+						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;
 						var template PrimitiveContent v_contentResponse;
+						
+						v_createRequest.primitiveContent.remoteCSE.labels := v_labels_1;
 
 						v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
 						v_contentResponse.remoteCSE.labels := ?;
 
-						v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
+						v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse));
 						v_cse1.done;
 					}
 					
 					testcase TC_CSE_REG_RET_007_CST() runs on Tester system CseSystem {
 						// Local variables
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
+						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;
 						var template PrimitiveContent v_contentResponse;
+						
+						v_createRequest.primitiveContent.remoteCSE.cseType := int1;
 
 						v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
 						v_contentResponse.remoteCSE.cseType := ?;
 
-						v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
+						v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse));
 						v_cse1.done;
 					}
 					
 					testcase TC_CSE_REG_RET_007_POA() runs on Tester system CseSystem {
 						// Local variables
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
+						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;
 						var template PrimitiveContent v_contentResponse;
+						
+						v_createRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"};
 
 						v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
 						v_contentResponse.remoteCSE.pointOfAccess := ?;
 
-						v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
+						v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse));
 						v_cse1.done;
 					}
 					
 					testcase TC_CSE_REG_RET_007_NL() runs on Tester system CseSystem {
 						// Local variables
 						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
+						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;
 						var template PrimitiveContent v_contentResponse;
+						
+						v_createRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID;
 
 						v_contentResponse.remoteCSE := mw_contentRemoteCSEBase;
 						v_contentResponse.remoteCSE.nodeLink := ?;
 
-						v_cse1.start(f_CSE_REG_RET_007(v_contentResponse));
+						v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse));
 						v_cse1.done;
 					}
 					
-					function f_CSE_REG_RET_007(template PrimitiveContent p_contentResponse) runs on CseSimu {
+					function f_CSE_REG_RET_007(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on CseSimu {
 						var MsgIn v_response;
 						var RequestPrimitive v_request;
 						var ResourceType v_resourceType := int16;	//remoteCSE
@@ -2339,7 +2368,7 @@ module OneM2M_Testcases_CSE {
 
 						// Preamble
 						if(PICS_IN_CSE){
-							vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
+							vc_remoteCseIndex := f_cse_registerRemoteCse(p_createRequestPrimitive);
 							mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
 						    tc_ac.start;
 							alt {
@@ -2364,7 +2393,7 @@ module OneM2M_Testcases_CSE {
 								}
 							}
 						} else if (PICS_MN_CSE){
-							vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase);
+							vc_remoteCseIndex := f_cse_registrationRemoteCse(p_createRequestPrimitive);
 							mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex))));
 							tc_ac.start;
 							alt {
-- 
GitLab