From 5e6eda5eb4c694fa49ff22947a1d22e8e86246f5 Mon Sep 17 00:00:00 2001
From: acverdugo <acverdugo@at4wireless.com>
Date: Fri, 20 Oct 2017 15:49:38 +0200
Subject: [PATCH] Registration Create group

Signed-off-by: acverdugo <acverdugo@at4wireless.com>
---
 OneM2M_Testcases_CSE.ttcn | 99 ++++++++++++++++++++++++---------------
 1 file changed, 62 insertions(+), 37 deletions(-)

diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn
index e7967e7..58b0d1b 100644
--- a/OneM2M_Testcases_CSE.ttcn
+++ b/OneM2M_Testcases_CSE.ttcn
@@ -1476,51 +1476,76 @@ module OneM2M_Testcases_CSE {
 				 * @desc Check that the IUT rejects a create request of <AE> resource that doesn’t include the MANDATORY_ATTRIBUTE
 				 * 
 				 */
-				testcase TC_CSE_REG_CRE_021() runs on AeSimu system CseSystem {
+				group g_CSE_REG_CRE_021 {
+					testcase TC_CSE_REG_CRE_021_API() 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);
+						
+						v_createRequest.primitiveContent.aE.app_ID := omit;	//Mandatory app_ID field is being set empty
+	
+						v_ae1.start(f_CSE_REG_CRE_021(v_createRequest));
+						v_ae1.done;
+	
+					}//end TC_CSE_REG_CRE_021_API
+					testcase TC_CSE_REG_CRE_021_RR() 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);
+						
+						v_createRequest.primitiveContent.aE.requestReachability := omit;	//Mandatory requestReachability field is being set empty
+						
+						v_ae1.start(f_CSE_REG_CRE_021(v_createRequest));
+						v_ae1.done;
 
-					// Local variables
-					var RequestPrimitive v_request;
-					var integer v_cseBaseIndex := -1;
-					var ResourceType v_resourceType := int2;
-   
-					// Test control
+					}//end TC_CSE_REG_CRE_021_RR
+					
+					function f_CSE_REG_CRE_021(template RequestPrimitive p_createRequestPrimitive) runs on AeSimu {
+						
+						//Local variables
+						var ResourceType v_resourceType := int2;   
+						
+						// Test control
 
-					// Test component configuration
-					f_cf01Up();
+						// Test component configuration
+						f_cf01Up();
 
-					// Test adapter configuration
+						// Test adapter configuration
 
-					// Preamble
-kk
-					// Test Body
-					f_cse_createResource(int2, m_createAe(omit, omit, omit));		//Mandatory app_ID field is being set empty
+						// Preamble
 
-					tc_ac.start;
-					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST
-							tc_ac.stop;
-							setverdict(pass, __SCOPE__ & ": Request successfully rejected");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
-							tc_ac.stop;
-							setverdict(fail, __SCOPE__ & ": Wrong response status code");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){
-							tc_ac.stop;
-							setverdict(fail, __SCOPE__ & ": Error, AE has been registered");
-						}
-						[] tc_ac.timeout {
-							setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
-						}
-					}	
+						// Test Body
+						f_cse_createResource(v_resourceType, p_createRequestPrimitive);		
 
-					// Postamble
-					f_cse_postamble_deleteResources();
+						tc_ac.start;
+						alt {
+							 [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST
+								 tc_ac.stop;
+								 setverdict(pass, __SCOPE__ & ": Request successfully rejected");
+							 }
+							 [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
+								 tc_ac.stop;
+								 setverdict(fail, __SCOPE__ & ": Wrong response status code");
+							 }
+							 [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){
+								 tc_ac.stop;
+								 setverdict(fail, __SCOPE__ & ": Error, AE has been registered");
+							 }
+							 [] tc_ac.timeout {
+								 setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
+							 }
+						}	
 
-					// Tear down
-					f_cf01Down();
+						// Postamble
+						f_cse_postamble_deleteResources();
 
-				}//end TC_CSE_REG_CRE_027
+						// Tear down
+						f_cf01Down();
+						
+					}
+				}//end g_CSE_REG_CRE_021
 				
 				/**
 				 * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1. 
-- 
GitLab