From a372e23fa241285d1c801b23c73526bc624b11fc Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Mon, 10 Oct 2016 15:55:05 +0200
Subject: [PATCH] New DEL and SUB (notification) test cases

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 LibOneM2M/OneM2M_Templates.ttcn |  33 -----
 OneM2M_Testcases.ttcn           | 242 +-------------------------------
 2 files changed, 1 insertion(+), 274 deletions(-)

diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn
index 8c7b809..368ef33 100644
--- a/LibOneM2M/OneM2M_Templates.ttcn
+++ b/LibOneM2M/OneM2M_Templates.ttcn
@@ -258,17 +258,6 @@ module OneM2M_Templates {
 				}
 			};
 			
-			/**
-			 * @desc Base UPDATE request primitive for AE resource
-			 */  
-			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
-				from_ := PX_AE_ID_STEM,
-				requestIdentifier := "m_updateAe" & f_rnd(1, 1000000),
-				primitiveContent:= {
-							any_1 := {{AE_optional := m_contentUpdateAe}}
-				}
-			};
-			
 			/**
 			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
 			 */        				
@@ -2001,28 +1990,6 @@ module OneM2M_Templates {
 			locationID := omit,
 			ontologyRef := omit
 		};		
-		
-		template (value) EventNotificationCriteria m_eventNotificationCriteria (in NotificationEventType p_notificationEventType) := {
-			createdBefore := omit,
-			createdAfter := omit,
-			modifiedSince := omit,
-			unmodifiedSince := omit,
-			stateTagSmaller := omit,
-			stateTagBigger := omit,
-			expireBefore := omit,
-			expireAfter := omit,
-			sizeAbove := omit,
-			sizeBelow := omit,
-			operationMonitor_list := {},
-			attribute_list := {}, // TODO this list should be able to be omited see 9.6.8 
-			notificationEventType_list := {p_notificationEventType},// TODO this list should be able to be omited see 9.6.8 
-			missingData := omit
-		}
-		
-		template (value) BatchNotify m_batchNotifyNumber3Duration1 := {
-			number := 3,
-			duration := " " //TODO duration has to be set to 1s and match to the Duration regex
-		}//normaly duration can be omited 6.3.5.6 (TS0004)
 				
 	}//end group SpecialContents
 	
diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn
index 52a71c7..9e45fe8 100644
--- a/OneM2M_Testcases.ttcn
+++ b/OneM2M_Testcases.ttcn
@@ -4272,246 +4272,6 @@ module OneM2M_Testcases {
 			
 		}//end group Data_Management_and_Repository
 		
-		group Notification {
-			
-			group g_CSE_SUB_BV_001_1{
-				testcase TC_CSE_SUB_BV_001_1() runs on CseTester system CseSystem {
-					// Local variables
-					var MsgIn v_response;
-					var integer v_aeIndex := -1;
-					var integer v_resourceIndex := -1;
-					var integer v_childResourceIndex := -1;
-					var template RequestPrimitive v_createRequestOne := m_createSubscriptionBase;
-					var template RequestPrimitive v_createRequestTwo := m_createSubscriptionBase;
-					var ResponsePrimitive v_responsePrimitive;
-					var RequestPrimitive v_request;
-											
-					v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected   
-					// Test control
-
-					// Test component configuration
-					f_cf01Up();
-
-					// Test adapter configuration
-
-					// Preamble
-					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-
-					v_resourceIndex := f_cse_createResource(int23, v_createRequestOne, v_aeIndex);//Subscription 				
-		
-					v_request := f_getCreateRequestPrimitive(int23, v_createRequestOne, v_resourceIndex);
-					
-		
-					//Postamble
-					f_cse_postamble_deleteResources();
-
-					//Tear down
-					f_cf01Down();
-		
-				} // end TC_CSE_SUB_BV_001_1
-			}//end group g_CSE_SUB_BV_001_1
-			
-			group g_CSE_SUB_BV_001{
-				testcase TC_CSE_SUB_BV_001() runs on CseTester system CseSystem {
-					// Local variables
-					var MsgIn v_response;
-					var Labels v_labels_1:= {"VALUE_1"};
-					var integer v_aeIndex := -1;
-					var integer v_resourceIndex := -1;
-					var template RequestPrimitive v_createRequest := m_createSubscriptionAdvanced(); 
-					var template PrimitiveContent v_contentResponse;
-					var template RequestPrimitive v_updateRequest := m_updateAeBase;
-					var RequestPrimitive v_request;
-					
-					v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; 
-					v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected   
-					
-					// Test control
-
-					// Test component configuration
-					f_cf01Up();
-
-					// Test adapter configuration
-
-					// Preamble
-					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-
-					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
-					
-					v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest);
-					
-					mcaPort.send(m_request(v_request));
-					tc_ac.start;
-					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-							tc_ac.stop;
-							setverdict(pass, testcasename() & ": Attribute of resource type int2 (Ae) updated successfuly");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error while updating resource type int2 (Ae)");
-						}
-						[] tc_ac.timeout {
-							setverdict(inconc, testcasename() & ": No answer while updating resource type int2 (Ae)");
-						}
-					}	
-		
-					tc_ac.start;
-					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
-							tc_ac.stop;
-							setverdict(pass, testcasename() & ": Notification received");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error while sending notification");
-						}
-						[] tc_ac.timeout {
-							setverdict(inconc, testcasename() & ": None notification received");
-						}
-					}
-		
-					//Postamble
-					f_cse_postamble_deleteResources();
-
-					//Tear down
-					f_cf01Down();
-		
-				} // end TC_CSE_SUB_BV_001
-			}//end group g_CSE_SUB_BV_001
-			
-			group g_CSE_SUB_BV_003{
-				testcase TC_CSE_SUB_BV_003() runs on CseTester system CseSystem {
-					// Local variables
-					var MsgIn v_response;
-					var integer v_aeIndex := -1;
-					var integer v_resourceIndex := -1;
-					var integer v_childResourceIndex := -1;
-					var ListOfURIs v_notificationURI := {"Not Initialized"};
-					var template RequestPrimitive v_createRequest := m_createSubscriptionAdvanced(v_notificationURI, m_eventNotificationCriteria(int3)); 
-					var template PrimitiveContent v_contentResponse;
-					
-					v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected   
-					// Test control
-
-					// Test component configuration
-					f_cf01Up();
-
-					// Test adapter configuration
-
-					// Preamble
-					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-
-					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription 
-					
-					tc_ac.start;
-					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
-							tc_ac.stop;
-							setverdict(pass, testcasename() & ": Notification received");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error while sending notification");
-						}
-						[] tc_ac.timeout {
-							setverdict(inconc, testcasename() & ": None notification received");
-						}
-					}
-					
-					//Postamble
-    				f_cse_postamble_deleteResources();
-    
-    				//Tear down
-    				f_cf01Down();
-					
-				} // end TC_CSE_SUB_BV_003
-			}//end group g_CSE_SUB_BV_003
-			
-			group g_CSE_SUB_BV_004{
-				testcase TC_CSE_SUB_BV_004() runs on CseTester system CseSystem {
-					// Local variables
-					var MsgIn v_response;
-					var RequestPrimitive v_deleteRequest;
-					var integer v_aeIndex := -1;
-					var integer v_resourceIndex := -1;
-					var integer v_childResourceIndex := -1;
-					var ListOfURIs v_notificationURI := {"Not Initialized"};
-					var template RequestPrimitive v_createRequest := m_createSubscriptionAdvanced(v_notificationURI, m_eventNotificationCriteria(int4));
-					var template PrimitiveContent v_contentResponse;
-		
-					//v_createRequest.primitiveContent.any_1[0].Subscription_optional.resourceName := omit; // name's R1 =! of his child ressource R2 ? 
-					v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected in notification  
-					v_deleteRequest := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex)));
-					v_deleteRequest.resultContent := int0; //none content is expected because if the child ressource triggers a notification the second received message will have no content and the test shall fail
-					// Test control
-
-					// Test component configuration
-					f_cf01Up();
-
-					// Test adapter configuration
-
-					// Preamble
-					v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-
-					v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription 				
-		
-					v_childResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
-					
-					mcaPort.send(m_request(v_deleteRequest));
-					tc_ac.start;
-					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-							tc_ac.stop;
-							setverdict(pass, testcasename() & ": Resource deleted successfuly");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error while deleting resource ");
-						}
-						[] tc_ac.timeout {
-							setverdict(inconc, testcasename() & ": No answer while deleting resource type ");
-						}
-					}	
-					
-					tc_ac.start;
-					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
-							tc_ac.stop;
-							setverdict(pass, testcasename() & ": Notification received");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
-						}
-						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-							tc_ac.stop;
-							setverdict(fail, testcasename() & ": Error while sending notification");
-						}
-						[] tc_ac.timeout {
-							setverdict(inconc, testcasename() & ": None notification received");
-						}
-					}
-		
-					//Postamble
-					f_cse_postamble_deleteResources();
-
-					//Tear down
-					f_cf01Down();
-		
-				} // end TC_CSE_SUB_BV_004
-			}//end group g_CSE_SUB_BV_004
-						
-		}//end group Notification
-		
 		//@Martin
 		group Location {
 		  		    
@@ -4941,7 +4701,7 @@ module OneM2M_Testcases {
                     var integer v_resourceIndex := -1;
                                                
                     
-                    var template RequestPrimitive v_createRequest := m_createGroupBase;
+                    var RequestPrimitive v_createRequest := valueof(m_createGroupBase);
                 
                         
                     //v_createRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress; TODO <---------------------------------------
-- 
GitLab