Correction of TC_CSE_SUB_NTF_003 to use batchNotify/duration

Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent ac99d137
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment