Commit 7c8f2284713bd6d26406c8bb0631927212c36265

Authored by Miguel Angel Reina Ortega
1 parent 66ce2847

Assign specific resource names to the corresponding resource types instead of c_…

…defaultResourceName for all resources

Signed-off-by: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
... ... @@ -7,7 +7,7 @@
7 7 *
8 8 * @author oneM2M
9 9 * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
10   - * $Id: OneM2M_Templates.ttcn 245 2017-03-27 17:06:27Z reinaortega $
  10 + * $Id: OneM2M_Templates.ttcn 249 2017-03-30 12:24:57Z reinaortega $
11 11 * @desc Module containing templates for oneM2M
12 12 *
13 13 */
... ... @@ -462,7 +462,7 @@ module OneM2M_Templates {
462 462 }
463 463 };
464 464  
465   - template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name := c_defaultResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := {
  465 + template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := {
466 466 to_ := p_parentResourceAddress,
467 467 from_ := PX_AE_ID_STEM,
468 468 requestIdentifier := testcasename() & "-m_createAcp" & f_rnd(1, 1000000),
... ... @@ -520,7 +520,7 @@ module OneM2M_Templates {
520 520 }
521 521 };
522 522  
523   - template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultResourceName) modifies m_create := {
  523 + template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := {
524 524 to_ := p_parentResourceAddress,
525 525 from_ := PX_AE_ID_STEM,
526 526 requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000),
... ... @@ -1044,7 +1044,7 @@ module OneM2M_Templates {
1044 1044 * @param p_name Resource name
1045 1045 * @param p_accessControlPolicyIds ACP IDs for the AE
1046 1046 */
1047   - template (value) AE_optional m_contentCreateAe (in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.String p_name := c_defaultResourceName, in template (omit) XSD.ID p_appId := PX_APP_ID, in template (omit) PoaList p_poaList) := {
  1047 + template (value) AE_optional m_contentCreateAe (in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.String p_name := c_defaultAeResourceName, in template (omit) XSD.ID p_appId := PX_APP_ID, in template (omit) PoaList p_poaList) := {
1048 1048  
1049 1049 resourceName := p_name,//O
1050 1050 resourceType := omit,//NP
... ... @@ -1076,7 +1076,7 @@ module OneM2M_Templates {
1076 1076 * @param p_acor Allowed originators
1077 1077 * @param p_allowedOperations Allowed operations
1078 1078 */
1079   - template (value) AccessControlPolicy_optional m_contentCreateAcp (in template (omit) XSD.String p_name := c_defaultResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := {
  1079 + template (value) AccessControlPolicy_optional m_contentCreateAcp (in template (omit) XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := {
1080 1080 resourceName := p_name,//O
1081 1081 resourceType := omit,//NP
1082 1082 resourceID := omit,//NP
... ... @@ -1159,7 +1159,7 @@ module OneM2M_Templates {
1159 1159 in template (omit) MemberType p_memberType := omit,
1160 1160 in template (omit) ConsistencyStrategy p_consistencyStrategy := omit,
1161 1161 in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit,
1162   - in template (omit) XSD.String p_name := c_defaultResourceName) := {
  1162 + in template (omit) XSD.String p_name := c_defaultGroupResourceName) := {
1163 1163 resourceName := p_name,//O
1164 1164 resourceType := omit,//NP
1165 1165 resourceID := omit,//NP
... ... @@ -1189,7 +1189,7 @@ module OneM2M_Templates {
1189 1189 * @param p_name Resource name
1190 1190 * @param p_accessControlPolicyIds ACP IDs for the AE
1191 1191 */
1192   - template (value) MgmtObj_optional m_contentCreateMgmtObj (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultResourceName) := {
  1192 + template (value) MgmtObj_optional m_contentCreateMgmtObj (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultMgmtObjResourceName) := {
1193 1193  
1194 1194 resourceName := p_name,//O
1195 1195 resourceType := omit,//NP
... ... @@ -1214,7 +1214,7 @@ module OneM2M_Templates {
1214 1214 * @param p_name Resource name
1215 1215 * @param p_accessControlPolicyIds ACP IDs for the AE
1216 1216 */
1217   - template (value) Node_optional m_contentCreateNode (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultResourceName, in template (omit) XSD.ID p_nodeId := "NodeID") := {//TODO Create PX for NodeID
  1217 + template (value) Node_optional m_contentCreateNode (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultNodeResourceName, in template (omit) XSD.ID p_nodeId := "NodeID") := {//TODO Create PX for NodeID
1218 1218  
1219 1219 resourceName := p_name,//O
1220 1220 resourceType := omit,//NP
... ... @@ -1239,7 +1239,7 @@ module OneM2M_Templates {
1239 1239 * @param p_accessControlPolicyIds ACP IDs for the PollingChannel
1240 1240 * @param p_name Resource name
1241 1241 */
1242   - template (value) PollingChannel_optional m_contentCreatePollingChannel (in template (omit) XSD.String p_name := c_defaultResourceName) := {
  1242 + template (value) PollingChannel_optional m_contentCreatePollingChannel (in template (omit) XSD.String p_name := c_defaultPollingChannelResourceName) := {
1243 1243 resourceName := p_name,//O
1244 1244 resourceType := omit,//NP
1245 1245 resourceID := omit,//NP
... ... @@ -1256,7 +1256,7 @@ module OneM2M_Templates {
1256 1256 * @param p_name Resource name
1257 1257 */
1258 1258 template (value) Schedule_optional m_contentCreateSchedule (in template (value) ScheduleEntries p_scheduleElement,
1259   - in template (omit) XSD.String p_name := c_defaultResourceName) := {
  1259 + in template (omit) XSD.String p_name := c_defaultScheduleResourceName) := {
1260 1260 resourceName := p_name,//O
1261 1261 resourceType := omit,//NP
1262 1262 resourceID := omit,//NP
... ... @@ -1295,7 +1295,7 @@ module OneM2M_Templates {
1295 1295 * @param p_name Resource name
1296 1296 */
1297 1297 template (value) Subscription_optional m_contentCreateSubscription (in template (value) ListOfURIs p_notificationURI,
1298   - in template (omit) XSD.String p_name := c_defaultResourceName) := {
  1298 + in template (omit) XSD.String p_name := c_defaultSubscriptionResourceName) := {
1299 1299 resourceName := p_name,//O
1300 1300 resourceType := omit,//NP
1301 1301 resourceID := omit,//NP
... ... @@ -1325,7 +1325,7 @@ module OneM2M_Templates {
1325 1325 };
1326 1326  
1327 1327 template (value) Subscription_optional m_contentCreateSubscriptionAdvanced (in template (value) ListOfURIs p_notificationURI,
1328   - in template (omit) XSD.String p_name := c_defaultResourceName,
  1328 + in template (omit) XSD.String p_name := c_defaultSubscriptionResourceName,
1329 1329 in template (omit) EventNotificationCriteria p_eventNotificationCriteria,
1330 1330 in template (omit) XSD.PositiveInteger p_expirationCounter,
1331 1331 in template (omit) BatchNotify p_batchNotify,
... ... @@ -1371,7 +1371,7 @@ module OneM2M_Templates {
1371 1371 * @param p_primitiveContent Content for the ContentInstance
1372 1372 */
1373 1373 template (value) ContentInstance_optional m_contentCreateContentInstance(XSD.String p_primitiveContent := "NotInitializedValue") := {
1374   - resourceName := c_defaultResourceName,//O
  1374 + resourceName := c_defaultContentInstanceResourceName,//O
1375 1375 resourceType := omit,//NP
1376 1376 resourceID := omit,//NP
1377 1377 parentID := omit,//NP
... ... @@ -1399,7 +1399,7 @@ module OneM2M_Templates {
1399 1399 * @desc Base primitiveContent for CREATE operation for Container resource
1400 1400 * @param p_name Resource name
1401 1401 */
1402   - template (value) Container_optional m_contentCreateContainer (in template (omit) XSD.String p_name := c_defaultResourceName):= {
  1402 + template (value) Container_optional m_contentCreateContainer (in template (omit) XSD.String p_name := c_defaultContainerResourceName):= {
1403 1403 resourceName := p_name,//O
1404 1404 resourceType := omit,//NP
1405 1405 resourceID := omit,//NP
... ... @@ -1427,7 +1427,7 @@ module OneM2M_Templates {
1427 1427  
1428 1428 //@Martin
1429 1429 template (value) LocationPolicy_optional m_contentCreateLocationPolicy (in template (value) LocationSource p_locationSource, in template (omit) AcpType p_accessControlPolicyIds, in template (value) XSD.Duration p_locationUpdatePeriod, in template (value) NodeID p_locationTargetID, in template (value) XSD.AnyURI p_locationServerAddress) := {
1430   - resourceName := c_defaultResourceName, //O
  1430 + resourceName := c_defaultLocationPolicyResourceName, //O
1431 1431 resourceType := omit, //NP
1432 1432 resourceID := omit, //NP
1433 1433 parentID := omit, //NP
... ...
... ... @@ -7,7 +7,7 @@
7 7 *
8 8 * @author oneM2M
9 9 * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $
10   - * $Id: OneM2M_TypesAndValues.ttcn 234 2017-03-20 16:37:29Z reinaortega $
  10 + * $Id: OneM2M_TypesAndValues.ttcn 249 2017-03-30 12:24:57Z reinaortega $
11 11 * @desc Module containing types and values for oneM2M
12 12 *
13 13 */
... ... @@ -19,7 +19,19 @@ module OneM2M_TypesAndValues {
19 19 /* Constants */
20 20 const charstring c_uri_cse := "/~/in-cse/";
21 21 const charstring c_cse_name := "in-cse";
  22 +
22 23 const XSD.String c_defaultResourceName := "MyResource";
  24 + const XSD.String c_defaultGroupResourceName := "MyGroupResource";
  25 + const XSD.String c_defaultAccessControlPolicyResourceName := "MyAccessControlPolicyResource";
  26 + const XSD.String c_defaultScheduleResourceName := "MyScheduleResource";
  27 + const XSD.String c_defaultPollingChannelResourceName := "MyPollingChannelResource";
  28 + const XSD.String c_defaultSubscriptionResourceName := "MySubscriptionResource";
  29 + const XSD.String c_defaultContentInstanceResourceName := "MyContentInstanceResource";
  30 + const XSD.String c_defaultContainerResourceName := "MyContainerResource";
  31 + const XSD.String c_defaultMgmtObjResourceName := "MyMgmtObjResource";
  32 + const XSD.String c_defaultAeResourceName := "MyAeResource";
  33 + const XSD.String c_defaultLocationPolicyResourceName := "MyLocationPolicyResource";
  34 + const XSD.String c_defaultNodeResourceName := "MyNodeResource";
23 35 const XSD.ID c_aeAuxName := "MyAe";
24 36 const XSD.String c_acpAuxName := "MyAcp";
25 37 const charstring c_invalid_location_update_period := "-PT30M10S" ;//duration set to invalid value (minus value)
... ...
... ... @@ -7,7 +7,7 @@
7 7 *
8 8 * @author oneM2M
9 9 * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
10   - * $Id: OneM2M_Testcases.ttcn 248 2017-03-29 13:59:41Z reinaortega $
  10 + * $Id: OneM2M_Testcases.ttcn 249 2017-03-30 12:24:57Z reinaortega $
11 11 * @desc Module containing test cases for oneM2M
12 12 *
13 13 */
... ... @@ -1294,7 +1294,7 @@ module OneM2M_Testcases {
1294 1294 if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){
1295 1295 setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
1296 1296 } else {
1297   - if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName != c_defaultResourceName){
  1297 + if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName != c_defaultContainerResourceName){
1298 1298 setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
1299 1299 }
1300 1300 }
... ... @@ -1311,7 +1311,7 @@ module OneM2M_Testcases {
1311 1311 if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){
1312 1312 setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
1313 1313 } else {
1314   - if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName != c_defaultResourceName){
  1314 + if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName != c_defaultGroupResourceName){
1315 1315 setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
1316 1316 }
1317 1317 }
... ... @@ -1328,7 +1328,7 @@ module OneM2M_Testcases {
1328 1328 if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){
1329 1329 setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
1330 1330 } else {
1331   - if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName != c_defaultResourceName){
  1331 + if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName != c_defaultAccessControlPolicyResourceName){
1332 1332 setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
1333 1333 }
1334 1334 }
... ... @@ -1345,7 +1345,7 @@ module OneM2M_Testcases {
1345 1345 if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){
1346 1346 setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
1347 1347 } else {
1348   - if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName != c_defaultResourceName){
  1348 + if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName != c_defaultScheduleResourceName){
1349 1349 setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
1350 1350 }
1351 1351 }
... ... @@ -1361,7 +1361,7 @@ module OneM2M_Testcases {
1361 1361 if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){
1362 1362 setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
1363 1363 } else {
1364   - if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName != c_defaultResourceName){
  1364 + if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName != c_defaultPollingChannelResourceName){
1365 1365 setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
1366 1366 }
1367 1367 }
... ... @@ -1378,7 +1378,7 @@ module OneM2M_Testcases {
1378 1378 if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){
1379 1379 setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
1380 1380 } else {
1381   - if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName != c_defaultResourceName){
  1381 + if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName != c_defaultSubscriptionResourceName){
1382 1382 setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
1383 1383 }
1384 1384 }
... ... @@ -10966,7 +10966,7 @@ module OneM2M_Testcases {
10966 10966 // Test adapter configuration
10967 10967  
10968 10968 // Preamble
10969   - v_createRequest := valueof(m_createAcp(f_getResourceAddress(), c_defaultResourceName, {"testDomain"}));
  10969 + v_createRequest := valueof(m_createAcp(f_getResourceAddress(), -, {"testDomain"}));
10970 10970 v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
10971 10971  
10972 10972 v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -);
... ...