diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 05ba96a6c4738110fd2c3d29fff1d9f27018ec14..cab7b81204e2728d381f20bdc55bc3ce08fff8a2 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -1564,9 +1564,9 @@ module OneM2M_Templates { notificationEventType_list := p_notificationEventType_list// TODO this list should be able to be omited see 9.6.8 (TS0001) }; - template (value) BatchNotify m_batchNotify (in XSD.NonNegativeInteger p_number) := { + template (value) BatchNotify m_batchNotify (in XSD.NonNegativeInteger p_number, in XSD.Duration p_duration := "PT20S") := { number := p_number, - duration := "PT5S" //TODO duration has to be set to 1s and match to the Duration regex + duration := p_duration //TODO duration has to be set to 1s and match to the Duration regex }; //normaly duration can be omited diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index dc2becd8815958024423046cbb08aea306e4c821..2a9cf108028c045ab3ebfa3c77c58ff3b27d866d 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -18,6 +18,7 @@ module OneM2M_Testcases { import from OneM2M_Types all;//{type XSD.ID}; import from OneM2M_TypesAndValues all; import from OneM2M_Pixits all; + import from LibCommon_Time all; import from OneM2M_Pics all; import from OneM2M_Functions all; import from XSD all; @@ -18111,7 +18112,9 @@ module OneM2M_Testcases { */ testcase TC_CSE_SUB_NTF_003() runs on AeSimu system CseSystem { // Local variables - const integer numberOfAggregatedNotification := 2; + timer t_batchNotificationTimer := PX_TAC * 2.0; + var float v_elapsedTime; + const integer c_numberOfAggregatedNotification := 2; var Labels v_labels_1:= {"VALUE_1"}; var Labels v_labels_2:= {"VALUE_2"}; var integer v_aeIndex := -1; @@ -18136,7 +18139,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(numberOfAggregatedNotification), omit, omit, -, int2); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(c_numberOfAggregatedNotification + 1, "PT10S" ), omit, omit, -, int2);//batchNotify/number greater than number of notifications to be sent so that batchNotify/duration expires before v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription @@ -18145,18 +18148,26 @@ module OneM2M_Testcases { }; // Test Body - vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, 2)); // check that no notification is received + vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, c_numberOfAggregatedNotification)); v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 f_cse_updateResource(v_request); + t_batchNotificationTimer.start; v_updateRequest := m_updateAeBase; - v_updateRequest.requestIdentifier := "m_updateAe" & f_rnd(1, 1000000); v_updateRequest.primitiveContent.aE.appName := "MyAppName2"; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 f_cse_updateResource(v_request); + vc_ae2.done; + v_elapsedTime := t_batchNotificationTimer.read; + t_batchNotificationTimer.stop; + + if(v_elapsedTime < 10.0) { + setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired"); + } + f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble