diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index a43d0918a9f56abd441db46e0d38e9765f58da19..61e4841ebc70f37763dbb6516be2cf56adaed7be 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -596,7 +596,7 @@ module OneM2M_Templates { /** * @desc Base CREATE request primitive for remoteCSE resource */ - template (value) RequestPrimitive m_createRemoteCSEBase(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) ResourceName p_resourceName := c_defaultRemoteCSEResourceName, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE_ID) modifies m_create := { + template (value) RequestPrimitive m_createRemoteCSEBase(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) ResourceName p_resourceName := c_defaultRemoteCSEResourceName, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE1_ID) modifies m_create := { requestIdentifier := testcasename() & "-m_createRemoteCSE" & f_rnd(1, 1000000), resourceType := int16, primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)} @@ -892,8 +892,9 @@ module OneM2M_Templates { in template (omit) BatchNotify p_batchNotify := omit, in template (omit) XSD.Boolean p_latestNotify := omit, in template (omit) XSD.AnyURI p_subscriberURI := omit, - in template (omit) NotificationContentType p_notificationContentType := int1) modifies m_createSubscription := { - primitiveContent := {subscription := m_contentCreateSubscriptionAdvanced (p_notificationURI, p_name, p_eventNotificationCriteria, p_expirationCounter, p_batchNotify, p_latestNotify, p_subscriberURI, p_notificationContentType)} + in template (omit) NotificationContentType p_notificationContentType := int1, + in template (omit) PendingNotification p_pendingNotification) modifies m_createSubscription := { + primitiveContent := {subscription := m_contentCreateSubscriptionAdvanced (p_notificationURI, p_name, p_eventNotificationCriteria, p_expirationCounter, p_batchNotify, p_latestNotify, p_subscriberURI, p_notificationContentType, p_pendingNotification)} }; /** @@ -1600,10 +1601,12 @@ module OneM2M_Templates { in template (omit) BatchNotify p_batchNotify, in template (omit) XSD.Boolean p_latestNotify, in template (omit) XSD.AnyURI p_subscriberURI, - in template (omit) NotificationContentType p_notificationContentType) modifies m_contentCreateSubscription := { + in template (omit) NotificationContentType p_notificationContentType, + in template (omit) PendingNotification p_pendingNotification) modifies m_contentCreateSubscription := { eventNotificationCriteria := p_eventNotificationCriteria,//O expirationCounter := p_expirationCounter,//O batchNotify := p_batchNotify,//O + pendingNotification := p_pendingNotification,//O latestNotify := p_latestNotify,//O notificationContentType := p_notificationContentType, //TODO Set to omit once xsd is fixed,//O subscriberURI := p_subscriberURI//O @@ -1626,9 +1629,9 @@ module OneM2M_Templates { missingData := omit }; - template (value) BatchNotify m_batchNotifyNumber3Duration1 (in XSD.NonNegativeInteger p_number) := { + template (value) BatchNotify m_batchNotify (in XSD.NonNegativeInteger p_number) := { number := p_number, - duration := "PT1S" //TODO duration has to be set to 1s and match to the Duration regex + duration := "PT5S" //TODO duration has to be set to 1s and match to the Duration regex }; //normaly duration can be omited @@ -1716,7 +1719,7 @@ module OneM2M_Templates { * @desc Base primitiveContent for CREATE operation for Container resource * @param p_name Resource name */ - template (value) RemoteCSE_optional m_contentCreateRemoteCSE (in template (omit) XSD.String p_name := c_defaultRemoteCSEResourceName, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE_ID):= { + template (value) RemoteCSE_optional m_contentCreateRemoteCSE (in template (omit) XSD.String p_name := c_defaultRemoteCSEResourceName, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE1_ID):= { resourceName := p_name,//O resourceType := omit,//NP resourceID := omit,//NP diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 6f293445be9882023669ad4094a5cc2ef873720d..d102507f2d8613b37335378304aa27f023464d8f 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -2220,12 +2220,13 @@ module OneM2M_Testcases { p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(v_parentIndex)); } - v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex); + if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){ f_cse_preamble_registerAe(); } + v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex); } else {//Resource under CSEBase if(p_resourceType != int1) { @@ -16371,7 +16372,7 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int3}, -)); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int3}), -, omit, omit, omit, -, omit); f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); @@ -16583,7 +16584,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(numberOfAggregatedNotification), omit, omit, -, int2); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription @@ -16599,7 +16600,8 @@ module OneM2M_Testcases { f_cse_updateResource(v_request); v_updateRequest := m_updateAeBase; - v_updateRequest.primitiveContent.aE.labels := v_labels_2; + 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); @@ -16717,7 +16719,7 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int2); //notificationContentType ="modified attributes" + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int2, omit); //notificationContentType ="modified attributes" f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); @@ -16800,7 +16802,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int3); // notificationContentType ="ResourceID" + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int3, omit); // notificationContentType ="ResourceID" v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription @@ -16873,7 +16875,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 3); //expirationCounter set to 3 + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 3, omit, omit, omit, -, omit); //expirationCounter set to 3 v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription @@ -16958,7 +16960,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 1); //expirationCounter set to 1 + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 1, omit, omit, omit, -, omit); //expirationCounter set to 1 v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);// Subscription @@ -17036,7 +17038,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList)); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList), omit, omit, omit, omit, -, omit); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription @@ -17112,7 +17114,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(numberOfAggregatedNotification), omit, omit, -, omit ); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription @@ -17178,7 +17180,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification), true);// TODO fix the duration + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(numberOfAggregatedNotification), true, omit, -, omit); //TODO We Need to check if the IUT send a notification only for the latest update operation // like we match a Notification we have to verify if it is the first (unvalid behavior) or the last (valid behavior) @@ -17248,7 +17250,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList)); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList), omit, omit, omit, omit, -, omit); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription @@ -17323,7 +17325,7 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit,f_getResourceAddress(v_ae2Index)); // SubscriberURI ="ResourceID" + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit,f_getResourceAddress(v_ae2Index), -, omit); // SubscriberURI ="ResourceID" v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription @@ -17424,7 +17426,7 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int2}, -)); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int2}, -), omit, omit, omit, omit, -, omit); f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); @@ -17497,7 +17499,7 @@ module OneM2M_Testcases { v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int4}, -)); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int4}, -), omit, omit, omit, omit, -, omit); f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23);