From b59d10bb40571a5b8e67166fbc21f84af3fa48b8 Mon Sep 17 00:00:00 2001
From: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
Date: Thu, 27 Apr 2017 15:58:23 +0200
Subject: [PATCH] New test case added - TC_CSE_DMR_BV_006

Signed-off-by: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
---
 LibOneM2M/OneM2M_Templates.ttcn |  22 +++++-
 OneM2M_Testcases.ttcn           | 115 +++++++++++++++++++++++++++++++-
 2 files changed, 135 insertions(+), 2 deletions(-)

diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn
index 2a1974f..d57faa9 100644
--- a/LibOneM2M/OneM2M_Templates.ttcn
+++ b/LibOneM2M/OneM2M_Templates.ttcn
@@ -7,7 +7,7 @@
  *  
  *  @author     oneM2M
  *  @version    $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
- *              $Id: OneM2M_Templates.ttcn 251 2017-03-31 12:26:42Z reinaortega $
+ *              $Id: OneM2M_Templates.ttcn 253 2017-04-27 13:57:51Z reinaortega $
  *  @desc       Module containing templates for oneM2M
  *
  */
@@ -1872,6 +1872,10 @@ module OneM2M_Templates {
 		template AccessControlPolicy_optional mw_contentAcp_rc7 modifies mw_contentAcpBase := {
 			
 		}
+		
+		template AccessControlPolicy_optional mw_contentAcp_rc8 modifies m_contentAcp_allOmit := {
+			choice := {childResource_list := ?}	//O
+		}
     	
 		template Group_optional mw_contentGroupBase := {
 			resourceName := ?,//M
@@ -1995,6 +1999,10 @@ module OneM2M_Templates {
 		template Group_optional mw_contentGroup_rc7 modifies mw_contentGroupBase := {
 			
 		}
+		
+		template Group_optional mw_contentGroup_rc8 modifies m_contentGroup_allOmit := {
+			choice := {childResource_list := ?}	//O
+		}
     	
 		template PollingChannel_optional mw_contentPollingChannelBase := {
 			resourceName := ?,//M
@@ -2138,6 +2146,10 @@ module OneM2M_Templates {
 		template Schedule_optional mw_contentSchedule_rc7 modifies mw_contentScheduleBase := {
 			
 		}
+		
+		template Schedule_optional mw_contentSchedule_rc8 modifies m_contentSchedule_allOmit := {
+			choice := {childResource_list := ?}	//O
+		}
     	
 		template Subscription_optional mw_contentSubscriptionBase := {
 			resourceName := ?,//M
@@ -2275,6 +2287,10 @@ module OneM2M_Templates {
 		template Subscription_optional mw_contentSubscription_rc7 modifies mw_contentSubscriptionBase := {
 			
 		}
+		
+		template Subscription_optional mw_contentSubscription_rc8 modifies m_contentSubscription_allOmit := {
+			choice := {childResource_list := ?}	//O
+		}
     	
 		template ContentInstance_optional mw_contentContentInstanceBase := {
 			resourceName := ?,//M
@@ -2425,6 +2441,10 @@ module OneM2M_Templates {
 		
 		}
 		
+		template Container_optional mw_contentContainer_rc8 modifies m_contentContainer_allOmit := {
+			choice := {childResource_list := ?}	//O
+		}
+		
 		template Notification m_contentNotification_allOmit := {
 			notificationEvent:= omit,
 			verificationRequest := omit,
diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn
index 8b10cfe..2e91120 100644
--- a/OneM2M_Testcases.ttcn
+++ b/OneM2M_Testcases.ttcn
@@ -7,7 +7,7 @@
  *  
  *  @author     oneM2M
  *  @version    $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
- *              $Id: OneM2M_Testcases.ttcn 252 2017-04-27 13:53:37Z reinaortega $
+ *              $Id: OneM2M_Testcases.ttcn 253 2017-04-27 13:57:51Z reinaortega $
  *  @desc       Module containing test cases for oneM2M
  *
  */
@@ -1031,6 +1031,119 @@ module OneM2M_Testcases {
 				}//end f_CSE_DMR_BV_005
     				
 			} // end g_CSE_DMR_BV_005
+			
+			group g_CSE_DMR_BV_006 {
+					
+				testcase TC_CSE_DMR_BV_006_01() runs on CseTester system CseSystem {
+					// Local variables
+					var template PrimitiveContent v_contentResponse;
+					
+					v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc8;
+					                        
+					f_CSE_DMR_BV_006(int3, m_createContainerBase, v_contentResponse);//Container
+				}
+
+				testcase TC_CSE_DMR_BV_006_02() runs on CseTester system CseSystem {
+					// Local variables
+					var template PrimitiveContent v_contentResponse;
+					
+					v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc8;
+					
+					f_CSE_DMR_BV_006(int9, m_createGroupBase, v_contentResponse);//Group
+				}
+					
+				testcase TC_CSE_DMR_BV_006_03() runs on CseTester system CseSystem {
+					// Local variables
+					var template PrimitiveContent v_contentResponse;
+					
+					v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc8;
+						
+					f_CSE_DMR_BV_006(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy
+				}
+				
+				testcase TC_CSE_DMR_BV_006_04() runs on CseTester system CseSystem {
+					// Local variables
+					var template PrimitiveContent v_contentResponse;
+					
+					v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc8;
+						
+					f_CSE_DMR_BV_006(int18, m_createScheduleBase, v_contentResponse);//Schedule
+				}
+					
+				testcase TC_CSE_DMR_BV_006_05() runs on CseTester system CseSystem {
+					// Local variables
+					var template PrimitiveContent v_contentResponse;
+					
+					v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME
+						
+					f_CSE_DMR_BV_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel
+				}
+					
+				testcase TC_CSE_DMR_BV_006_06() runs on CseTester system CseSystem {
+					// Local variables
+					var template PrimitiveContent v_contentResponse;
+					
+					v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc8;
+
+					f_CSE_DMR_BV_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription
+				}
+				
+				function f_CSE_DMR_BV_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester {
+    				
+					// Local variables
+					var MsgIn v_response;
+					var RequestPrimitive v_request;
+					
+					var integer v_aeIndex := -1;
+					var integer v_resourceIndex := -1;
+					var integer v_childResourceIndex := -1;
+    										   
+					// Test control
+    				
+					// Test component configuration
+					f_cf01Up();
+    				
+					// Test adapter configuration
+    				
+					// Preamble
+					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+					
+					v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 				
+    				
+					v_childResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_resourceIndex);				
+    									
+					// Test Body
+					v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
+					v_request.resultContent := int6;//Child resource references
+					mcaPort.send(m_request(v_request));
+					tc_ac.start;
+					alt {
+						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
+							tc_ac.stop;
+							setverdict(pass, testcasename() & ": No child resources provided with RC set to 1");
+						}
+						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+							tc_ac.stop;
+							setverdict(fail, testcasename() & ": Child resources provided with RC set to 1");
+						}
+						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
+							tc_ac.stop;
+							setverdict(fail, testcasename() & ": Error while retrieving resource");
+						}
+						[] tc_ac.timeout {
+							setverdict(inconc, testcasename() & ": No answer while retrieving resource");
+						}
+					}	
+    								
+					// Postamble
+					f_cse_postamble_deleteResources();
+					
+					// Tear down
+					f_cf01Down();
+    				
+				}//end f_CSE_DMR_BV_006
+    				
+			} // end g_CSE_DMR_BV_006
 						
 			group Create {
 				
-- 
GitLab