Commit 785fd0c0e88e735d7ceec2b27d68357ec245f07f

Authored by Antonio Castillo Verdugo
1 parent 86769553

Updated f_check_notificationContent function for timeSeries

New templates: m_missingData, mw_contentTimeSeriesBase
Updated Resource_2 type for timeSeries
Updated identifier of timeSeries testcases
New testcases: TC_CSE_TS_003, TC_CSE_TS_004

Signed-off-by: acverdugo <acverdugo@at4wireless.com>
... ... @@ -1670,6 +1670,15 @@ module OneM2M_Functions {
1670 1670 v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container, p_primitiveContent.container)
1671 1671 }
1672 1672 }
  1673 +
  1674 + if (ischosen(p_primitiveContent.timeSeries)){
  1675 + if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.timeSeries)) {
  1676 + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.timeSeries, p_primitiveContent.timeSeries)
  1677 + }
  1678 + else if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.timeSeries)) {
  1679 + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.timeSeries, p_primitiveContent.timeSeries)
  1680 + }
  1681 + }
1673 1682  
1674 1683 return v_matchResult;
1675 1684  
... ...
... ... @@ -2505,6 +2505,11 @@ module OneM2M_Templates {
2505 2505 sequenceNr := omit,//O
2506 2506 contentSize := omit//NP
2507 2507 };
  2508 +
  2509 + template (value) MissingData m_missingData( in XSD.NonNegativeInteger p_number, in XSD.Duration p_duration) := {
  2510 + number := p_number,
  2511 + duration := p_duration
  2512 + };
2508 2513  
2509 2514 }//end group ContentCreate
2510 2515  
... ... @@ -3904,6 +3909,45 @@ module OneM2M_Templates {
3904 3909 template CSEBase_optional mw_contentCSEBase_rc1 modifies mw_contentCSEBaseBase := {
3905 3910 choice := omit //O
3906 3911 }
  3912 +
  3913 + template TimeSeries_optional mw_contentTimeSeriesBase := {
  3914 + resourceName := ?,//M
  3915 + resourceType := ?,//M
  3916 + resourceID := ?,//M
  3917 + parentID := ?,//M
  3918 + creationTime := ?,//M
  3919 + lastModifiedTime := ?,//M
  3920 + labels := *,//O
  3921 + accessControlPolicyIDs := *,//O
  3922 + expirationTime := ?,//M
  3923 + dynamicAuthorizationConsultationIDs := *,//O
  3924 + announceTo := *,//O
  3925 + announcedAttribute := *,//O
  3926 + stateTag := ?,//M
  3927 + creator := ?,//M
  3928 + maxNrOfInstances := *,//O
  3929 + maxByteSize := *,//O
  3930 + maxInstanceAge := *,//O
  3931 + currentNrOfInstances := ?,//M
  3932 + currentByteSize := ?,//M
  3933 + periodicInterval := *,//O
  3934 + missingDataDetect := *,//O
  3935 + missingDataMaxNr := *,//O
  3936 + missingDataList := *,//O
  3937 + missingDataCurrentNr := *,//O
  3938 + missingDataDetectTimer := *,//O
  3939 + ontologyRef := *,//O
  3940 + choice := *//O
  3941 + };
  3942 +
  3943 + template TimeSeries_optional mw_contentTimeSeries(in template MissingDataList p_missingDataList := *, in template XSD.NonNegativeInteger p_missingDataCurrentNr := *) modifies mw_contentTimeSeriesBase := {
  3944 + missingDataList := p_missingDataList,
  3945 + missingDataCurrentNr := p_missingDataCurrentNr
  3946 + }
  3947 +
  3948 + template TimeSeries_optional mw_contentTimeSeries_rc1 modifies mw_contentTimeSeriesBase := {
  3949 + choice := omit //O
  3950 + }
3907 3951  
3908 3952  
3909 3953 }//end group responseContent
... ...
... ... @@ -8646,7 +8646,8 @@ group OtherTypes {
8646 8646 StatsCollect_optional statsCollect,
8647 8647 M2mServiceSubscriptionProfile_optional m2mServiceSubscriptionProfile,
8648 8648 ServiceSubscribedAppRule_optional serviceSubscribedAppRule,
8649   - Subscription_optional subscription
  8649 + Subscription_optional subscription,
  8650 + TimeSeries_optional timeSeries
8650 8651 }
8651 8652 with {
8652 8653 variant "untagged";
... ...
... ... @@ -7205,17 +7205,17 @@ module OneM2M_Testcases_CSE_Release_2 {
7205 7205 * @desc Check that the IUT inserts the dataGenerationTime informantion of a missing data point and increases the missingDataCurrentNr attribute when a missing data point is detected
7206 7206 *
7207 7207 */
7208   - testcase TC_CSE_DMR_TS_001() runs on Tester system CseSystem {
  7208 + testcase TC_CSE_TS_001() runs on Tester system CseSystem {
7209 7209  
7210 7210 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7211 7211  
7212   - v_ae1.start(f_CSE_DMR_TS_001());
  7212 + v_ae1.start(f_CSE_TS_001());
7213 7213  
7214 7214 v_ae1.done;
7215 7215  
7216 7216 }
7217 7217  
7218   - function f_CSE_DMR_TS_001() runs on AeSimu return ResponsePrimitive {
  7218 + function f_CSE_TS_001() runs on AeSimu return ResponsePrimitive {
7219 7219  
7220 7220 // Local variables
7221 7221 var MsgIn v_response;
... ... @@ -7284,17 +7284,17 @@ module OneM2M_Testcases_CSE_Release_2 {
7284 7284 * @desc Check that the IUT removes the oldest element in MissingDataList when MissingDataCurrentNr reaches MissingDataMaxNr to enable insertion of a new missing data point
7285 7285 *
7286 7286 */
7287   - testcase TC_CSE_DMR_TS_002() runs on Tester system CseSystem {
  7287 + testcase TC_CSE_TS_002() runs on Tester system CseSystem {
7288 7288  
7289 7289 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7290 7290  
7291   - v_ae1.start(f_CSE_DMR_TS_002());
  7291 + v_ae1.start(f_CSE_TS_002());
7292 7292  
7293 7293 v_ae1.done;
7294 7294  
7295 7295 }
7296 7296  
7297   - function f_CSE_DMR_TS_002() runs on AeSimu return ResponsePrimitive {
  7297 + function f_CSE_TS_002() runs on AeSimu return ResponsePrimitive {
7298 7298  
7299 7299 // Local variables
7300 7300 var MsgIn v_response;
... ... @@ -7418,11 +7418,185 @@ module OneM2M_Testcases_CSE_Release_2 {
7418 7418 return vc_response.primitive.responsePrimitive;
7419 7419  
7420 7420 }//end f_CSE_DMR_TS_002
  7421 +
  7422 + /**
  7423 + * @desc Check that the IUT sends a notification with missing data points information when the number of missing data points detected becomes equal to the minimum specified missing number of the Time Series Data specified in missingData condition of the subscription resource
  7424 + *
  7425 + */
  7426 + testcase TC_CSE_TS_003() runs on Tester system CseSystem {
  7427 +
  7428 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7429 +
  7430 + v_ae1.start(f_CSE_TS_003());
  7431 +
  7432 + v_ae1.done;
  7433 +
  7434 + }
  7435 +
  7436 + function f_CSE_TS_003() runs on AeSimu {
  7437 + // Local variables
  7438 + var integer v_aeIndex := -1;
  7439 + var integer v_timeSeriesIndex := -1;
  7440 + var integer v_subscriptionIndex := -1;
  7441 + var EventNotificationCriteria v_eventNotificationCriteria := valueof(m_eventNotificationCriteria({int1}, -));
  7442 + var template RequestPrimitive v_createRequest := omit;
  7443 + var RequestPrimitive v_request;
  7444 + var integer v_ae2Index := -1;
  7445 + var XSD.NonNegativeInteger v_missingDataPointNumber := 1;
  7446 + var template PrimitiveContent v_contentNotification := {timeSeries := mw_contentTimeSeries(?,v_missingDataPointNumber)};
  7447 +
  7448 + v_eventNotificationCriteria.missingData := valueof(m_missingData(v_missingDataPointNumber, "1000"));
  7449 +
  7450 + // Test control
  7451 +
  7452 + // Test component configuration
  7453 + f_cf01Up(true);
  7454 +
  7455 + // Test adapter configuration
  7456 +
  7457 + // Preamble
  7458 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  7459 +
  7460 + v_timeSeriesIndex := f_cse_createResource(int29, m_createTimeSeries(-, true, 5, -, 2000), v_aeIndex);//TimeSeries
  7461 +
  7462 + f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23);//AE2 registered
  7463 +
  7464 + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_timeSeriesIndex), -, {f_getResourceAddress(v_aeIndex)}, v_eventNotificationCriteria, omit, omit, omit, omit, omit, omit);
  7465 +
  7466 + v_subscriptionIndex := f_cse_createResource(int23, v_createRequest, v_timeSeriesIndex);//Subscription under TimeSeries
  7467 +
  7468 + if(vc_ae2.running) {
  7469 + vc_ae2.stop;
  7470 + };
  7471 +
  7472 + // Test Body
  7473 +
  7474 + //Create data points and force a missingDataPoint
  7475 + vc_ae2.start(f_cse_generateMissingDataPoint(v_timeSeriesIndex));
  7476 + vc_ae2.done;
  7477 +
  7478 + f_cse_notifyProcedure_representationHandler(v_contentNotification);
  7479 +
  7480 + //Postamble
  7481 + f_cse_postamble_deleteResources();
  7482 +
  7483 + //Tear down
  7484 + f_cf01Down();
  7485 +
  7486 + } // end f_CSE_TS_003
  7487 +
  7488 + /**
  7489 + * @desc Check that the IUT does not send notification when the total number of missing data points does not exceed the minimum specified missing number of the Time Series Data specified in missingData condition of the subscription resource during the window duration specified in the same missingData condition
  7490 + *
  7491 + */
  7492 + testcase TC_CSE_TS_004() runs on Tester system CseSystem {
  7493 +
  7494 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  7495 +
  7496 + v_ae1.start(f_CSE_TS_004());
  7497 +
  7498 + v_ae1.done;
  7499 +
  7500 + }
  7501 +
  7502 + function f_CSE_TS_004() runs on AeSimu {
  7503 + // Local variables
  7504 + var integer v_aeIndex := -1;
  7505 + var integer v_timeSeriesIndex := -1;
  7506 + var integer v_subscriptionIndex := -1;
  7507 + var EventNotificationCriteria v_eventNotificationCriteria := valueof(m_eventNotificationCriteria({int1}, -));
  7508 + var template RequestPrimitive v_createRequest := omit;
  7509 + var ResponsePrimitive v_responsePrimitive;
  7510 + var integer v_ae2Index := -1;
  7511 + var XSD.NonNegativeInteger v_missingDataPointNumber := 100;
  7512 + var template PrimitiveContent v_contentResponse;
  7513 +
  7514 + v_eventNotificationCriteria.missingData := valueof(m_missingData(v_missingDataPointNumber, "1000"));
  7515 +
  7516 + // Test control
  7517 +
  7518 + // Test component configuration
  7519 + f_cf01Up(true);
  7520 +
  7521 + // Test adapter configuration
  7522 +
  7523 + // Preamble
  7524 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  7525 +
  7526 + v_timeSeriesIndex := f_cse_createResource(int29, m_createTimeSeries(-, true, 5, -, 2000), v_aeIndex);//TimeSeries
  7527 +
  7528 + f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23);//AE2 registered
  7529 +
  7530 + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_timeSeriesIndex), -, {f_getResourceAddress(v_aeIndex)}, v_eventNotificationCriteria, omit, omit, omit, omit, omit, omit);
  7531 +
  7532 + v_subscriptionIndex := f_cse_createResource(int23, v_createRequest, v_timeSeriesIndex);//Subscription under TimeSeries
  7533 +
  7534 + if(vc_ae2.running) {
  7535 + vc_ae2.stop;
  7536 + };
  7537 +
  7538 + // Test Body
  7539 +
  7540 + //Create data points and force a missingDataPoint
  7541 + vc_ae2.start(f_cse_generateMissingDataPoint(v_timeSeriesIndex));
  7542 + vc_ae2.done;
  7543 +
  7544 + tc_ac.start;
  7545 + alt {
  7546 + [] mcaPortIn.receive(mw_request(mw_notifyNotification(?))){
  7547 + tc_ac.stop;
  7548 + setverdict(fail, __SCOPE__ & ":ERROR: Notification received");
  7549 + //Send response in any case
  7550 + v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
  7551 + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
  7552 + mcaPortIn.send(m_response(v_responsePrimitive));
  7553 + }
  7554 + [] tc_ac.timeout {
  7555 + setverdict(pass, __SCOPE__ & ": Notification not received");
  7556 + }
  7557 + }
  7558 +
  7559 + //Check if the IUT restarts missing data point counter and timer
  7560 + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_timeSeriesIndex), f_getOriginator(v_timeSeriesIndex))));
  7561 +
  7562 + v_contentResponse.timeSeries := mw_contentTimeSeries_rc1;
  7563 + v_contentResponse.timeSeries.missingDataCurrentNr := 0;
  7564 +
  7565 + tc_ac.start;
  7566 + alt {
  7567 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))){
  7568 + tc_ac.stop;
  7569 + setverdict(pass, __SCOPE__ & ": Response OK for retrieving. MissingDataCurrentNr has been restarted");
  7570 + }
  7571 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))){
  7572 + tc_ac.stop;
  7573 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  7574 + }
  7575 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){
  7576 + tc_ac.stop;
  7577 + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
  7578 + }
  7579 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)){
  7580 + tc_ac.stop;
  7581 + setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
  7582 + }
  7583 + [] tc_ac.timeout {
  7584 + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
  7585 + }
  7586 + }
  7587 +
  7588 + //Postamble
  7589 + f_cse_postamble_deleteResources();
  7590 +
  7591 + //Tear down
  7592 + f_cf01Down();
  7593 +
  7594 + } // end f_CSE_TS_004
  7595 +
7421 7596 }//end group timeSeries
7422 7597  
7423 7598 }//end group dataManagement
7424 7599  
7425 7600 }//end group CSE
7426   -
7427   -
  7601 +
7428 7602 }
... ...