OneM2M_Functions.ttcn 83.3 KB
Newer Older
1 2 3 4 5 6 7 8
/**
 *  Copyright Notification
 *  No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
 *  The copyright and the foregoing restriction extend to reproduction in all media.
 *  © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
 *  All rights reserved.
 *  
 *  @author     ETSI
9 10
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
 *              $Id: OneM2M_Functions.ttcn 347 2017-08-11 08:48:20Z reinaortega $
11 12 13 14 15 16 17 18 19 20 21
 *  @desc       Module containing functions for oneM2M
 *
 */
module OneM2M_Functions {
	
	import from XSD all;
	import from OneM2M_Templates all;
	import from OneM2M_Types all;//{type XSD.ID};
	import from OneM2M_TypesAndValues all;
	import from OneM2M_TestSystem all;
	import from OneM2M_Pixits all;
22
	import from OneM2M_Pics all;
23 24 25
//	import from OneM2M_AdditionalTypes all;
	
	
26 27
	group ConfigFunctions {
		
28 29 30 31
		/**
			@desc Ports mapping and default behaviour activation for Config 1
		*/
		function f_cf01Up() runs on CseTester {
32
				
33
			// Variables
34 35
			vc_config := e_cf01;	
			
36 37 38 39
			// Map
			map(self:mcaPort, system:mcaPort);
			map(self:acPort, system:acPort);
			activate(a_default());
40
			activate(a_cse_cf01());
41
				
42
			// Connect
43
						
44
			//Initialze the IUT
45
							
46
		} // end f_cf01Up
47
		
48 49 50
		/**
		 * @desc Ports mapping and default behaviour activation for Config 02
		 */
51
		function f_cf02Up() runs on CseTester {
52
				
53
			// Variables
54 55
			vc_config := e_cf02;
				
56 57 58 59 60
			// Map
			map(self:mcaPort, system:mcaPort);
			map(self:mccPort, system:mccPort);
			map(self:acPort, system:acPort);
			activate(a_default());
61
			activate(a_cse_cf02());
62
				
63
			// Connect
64
					
65
			//Initialze the IUT
66
							
67
		} // end f_cf02Up
68
		
69 70 71 72
		/**
		 * @desc Ports mapping and default behaviour activation for Config 03
		 */
		function f_cf03Up() runs on AeTester {
73 74
		
			// Variables
75 76
			vc_config := e_cf03;
			
77 78 79 80
			// Map
			map(self:mcaPort, system:mcaPort);
			map(self:acPort, system:acPort);
			activate(a_default());
81
			activate(a_ae_cf03());
82 83 84 85 86 87 88
		
			// Connect
					
			//Initialze the IUT
					
		} // end f_cf03Up
		
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
		/**
		 * @desc Ports mapping and default behaviour activation for Config 04
		 */
		function f_cf04Up() runs on CseTester {

			// Variables
			vc_config := e_cf04;
	
			// Map
			map(self:mccPort, system:mccPort);
			map(self:acPort, system:acPort);
			activate(a_default());
			activate(a_cse_cf04());

			// Connect
			
			//Initialze the IUT
			
		} // end f_cf03Up

		/**
		 * @desc Ports unmapping
		 * @verdict 
		 */
		function f_cfCseTesterDown() runs on CseTester {
		
			if(vc_config == e_cf01) {
				f_cf01Down()
			} else if (vc_config == e_cf02){
				f_cf02Down()
			} 
		}
		/**
		 * @desc Ports unmapping
		 * @verdict 
		 */
		function f_cfAeTesterDown() runs on AeTester {
		
			if(vc_config == e_cf03) {
				f_cf03Down()
			} 
		}			
131 132 133
		/**
		 * @desc Ports unmapping
		 * @verdict 
134
		 */
135
		function f_cf01Down() runs on CseTester {
136
		
137
			unmap(self:mcaPort, system:mcaPort);
138 139
			unmap(self:acPort, system:acPort);
		}	
140 141 142 143
		/**
		 * @desc Ports unmapping
		 * @verdict 
		 */
144
		function f_cf02Down() runs on CseTester {
145
		
146
			unmap(self:mcaPort, system:mcaPort);
147
			unmap(self:mccPort, system:mccPort);
148
			unmap(self:acPort, system:acPort);
149
		}		
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
		/**
		 * @desc Ports unmapping for Config 03
		 */
		function f_cf03Down() runs on AeTester {
			
			unmap(self:mcaPort, system:mcaPort);
			unmap(self:acPort, system:acPort);
		}
		
		/**
		 * @desc Ports unmapping for Config 04
		 */
		function f_cf04Down() runs on CseTester {
	
			unmap(self:mccPort, system:mccPort);
			unmap(self:acPort, system:acPort);
		}
		
168
	}//end group configFunctions
169
	
170
	group CseFunctions {
171
	
172
		group PreambleFunctions {
173 174 175 176 177 178 179 180

			/**
			 * @desc Creation of auxiliar resources ACP for correct execution of the test case
			 * @param p_allowedOperations Allowed operations for the auxiliar AE resource
			 * @return Internal ACP resource index
			 * @verdict 
			 */
			function f_cse_preamble_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi
181
			
182
				return f_cse_createAccessControlPolicyAux(p_acpName, -, p_allowedOperations);
183
			
184 185
			}

186
	
187 188 189 190 191 192 193
			/**
			 * @desc Creation of auxiliar resources ACP and AE for correct execution of the test case
			 * @param p_allowedOperations Allowed operations for the auxiliar AE resource
			 * @return Internal AE resource index
			 * @verdict 
			 */
			function f_cse_preamble_registerAe(template (omit) AcpType p_accessControlPolicyIDs := omit, in template (omit) PoaList p_poaList := omit) runs on CseTester return integer {//c_CRUDNDi
194
			
195 196 197
				var RequestPrimitive v_request;
				var MsgIn v_response;
				var integer v_aeAuxIndex := -1;
198
								
199
				v_request := valueof(m_createAeAux(p_accessControlPolicyIDs, p_poaList));
200 201
				
				v_request := f_getCreateRequestPrimitive(int2, v_request, -1);
202 203
				
				mcaPort.send(m_request(v_request));
204
				
205 206 207 208
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
						tc_ac.stop;
209 210 211 212 213 214 215 216
						setverdict(pass,__SCOPE__&":INFO: Application registered successfuly");
						if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)) {
							vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.aE;
							
							f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
							
							v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
							
217 218 219 220
							if(ispresent(vc_aeAux.aE_ID)){
								f_sendAcPrimitive("AE-ID_changed", oct2char(unichar2oct(vc_aeAux.aE_ID)));
							} else {
								f_sendAcPrimitive("AE-ID_changed", "0");
221 222
							}
						}
223 224 225
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
226
						setverdict(inconc, __SCOPE__&":INFO: Error while registering application");
227 228 229 230
						stop;
					}
					[] mcaPort.receive {
						tc_ac.stop;
231
						setverdict(inconc, __SCOPE__&":INFO: Unexpected message received");
232
						stop;
233
					};
234
					[] tc_ac.timeout {
235
						setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource");
236 237 238
						stop;
					}
				}	
239 240
				
				f_checkCseTesterStatus();
241
				return v_aeAuxIndex;
242
			
243
			}
244
			
245 246 247 248 249 250 251
			/**
			 * @desc Creation of auxiliar resources ACP and AE for correct execution of the test case
			 * @param p_allowedOperations Allowed operations for the auxiliar AE resource
			 * @return Internal AE resource index
			 * @verdict 
			 */
			function f_cse_preamble_registerAeWithId(XSD.ID p_appId, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi
252
			
253 254 255 256
				var RequestPrimitive v_request;
				var MsgIn v_response;
				var integer v_aeAuxIndex := -1;
				var integer v_acpAuxIndex := -1;
257
			
258 259 260 261
				if(PICS_ACP_SUPPORT){
					v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_allowedOperations := p_allowedOperations);
					vc_acpAuxIndex := v_acpAuxIndex;
				}
262
				
263 264 265
				if(v_acpAuxIndex != -1) {
					vc_resourcesIndexToBeDeleted := {v_acpAuxIndex};
					v_request := valueof(m_createAe(p_appId, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -));
266
					
267 268
					//TODO Test, to be removed
					v_request.to_ := f_getResourceAddress();
269
					
270 271 272 273 274 275 276 277 278
					mcaPort.send(m_request(v_request));
					//mcaPort.send(m_request(m_createAeAux(p_name, {PX_URI_CSE & PX_CSE_NAME & "/" & PX_ACPAUX_NAME})));
				} else {
					mcaPort.send(m_request(m_createAe(p_appId)));
				}
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
						tc_ac.stop;
279 280 281 282 283 284
						setverdict(pass, __SCOPE__&": INFO: Application registered successfuly");
						if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)) {
							vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.aE;
							
							v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
							
285 286 287 288 289 290 291
							if(ispresent(vc_aeAux.aE_ID)){
								f_sendAcPrimitive("AE-ID_changed", oct2char(unichar2oct(vc_aeAux.aE_ID)));
							} else {
								f_sendAcPrimitive("AE-ID_changed", "0");
							}	
						}
					}
292 293
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO))
					{
294
						tc_ac.stop;
295
						setverdict(inconc, __SCOPE__&":INFO: Error while registering application");
296 297 298 299
						stop;
					}
					[] mcaPort.receive {
						tc_ac.stop;
300
						setverdict(inconc, __SCOPE__&":INFO: Unexpected message received");
301 302 303
						stop;
					}
					[] tc_ac.timeout {
304
						setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource");
305 306 307
						stop;
					}
				}	
308 309
				
				f_checkCseTesterStatus();
310
				return v_aeAuxIndex;
311
			
312
			}
313 314 315
			
			function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs := {""}) runs on CseTester return integer {//c_CRUDNDi
			
316
				var integer v_serviceSubscribedAppRuleIndex := -1;
317
	
318
				v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {PX_APP_ID}, valueof(p_allowedAEs)));
319
				
320
				return v_serviceSubscribedAppRuleIndex;
321
			
322
			}
323 324
			
			function f_cse_preamble_subscriptionVerification(out CseTester p_notifyHandler,in integer p_aeIndex, inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType, in ResponseStatusCode p_responseStatusCode := int2001) runs on CseTester {
325 326
				if(p_resourceType == int23){
					p_notifyHandler := CseTester.create("NotifyHandler") alive;
327 328 329
					p_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1); // AE2 is registred
					if(ischosen(p_createRequestPrimitive.primitiveContent.subscription)){		//this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced
						p_createRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_ae2Index)}; 
330
					}
331
					p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(p_aeIndex, p_responseStatusCode));
332 333
				}
			}
334
		
335
		}//end group preambleFunctions
336 337 338
		
		group PostambleFunctions {
	
339 340 341 342 343 344 345 346
			/**
			 * @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution
			 * @verdict 
			 */
			function f_cse_postamble_deleteResources() runs on CseTester {
				var integer i;
				var XSD.ID v_resourceAddress;
				var RequestPrimitive v_request;
347
				
348
				if (PX_RUN_POSTAMBLE) {
349
					
350 351 352 353
					for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) {
						
						v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]); 
						
354
						v_request := valueof(m_delete(v_resourceAddress, f_getOriginator(vc_resourcesIndexToBeDeleted[i])));
355 356
						
						v_request.from_ := f_getOriginator(vc_resourcesIndexToBeDeleted[i]);
357

358
						mcaPort.send(m_request(v_request));
359
						
360 361 362 363
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
364
								log(__SCOPE__&" INFO: Resource " & v_request.to_ & " deleted");
365 366 367
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
368
								log(__SCOPE__&" INFO: Error while deleting resource " & v_request.to_);
369 370
							}
							[] tc_ac.timeout {
371
								log(__SCOPE__&" INFO: No answer while deleting resource " & v_request.to_);
372 373
							}	
						}	
374
						
375 376
					}
				}
377
							
378 379
				f_cse_postamble_default();
			}
380
			
381 382 383 384 385
			/**
			 * @desc Default postamble
			 * @verdict 
			 */
			function f_cse_postamble_default() runs on CseTester {
386
			}
387 388
			
			function f_is_component_done(in CseTester p_notifyHandler) runs on CseTester {
389
			
390 391 392 393 394 395
				tc_ac.start(10.0);
				alt {
					[] p_notifyHandler.done {
					tc_ac.stop;
					}
					[] tc_ac.timeout {
396
						setverdict(inconc, __SCOPE__ & "INFO: Notify verification not received");
397 398 399
					}
				}
			} //end f_is_component_done
400 401
			
			
402
		}//end group postambleFunctions
403 404 405
		
		group HelpingFunctions {
	
406 407 408 409 410 411 412 413 414
			/**
			 * @desc Creation of a resource
			 * @param p_resourceType Resource type of the resource to be created
			 * @param p_requestPrimitive Template request primitive
			 * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
			 * @return Internal resource index of the created resource
			 * @verdict 
			 */
			function f_cse_createResource(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on CseTester return integer {
415
			
416 417 418
				var MsgIn v_response;
				var RequestPrimitive v_request;
				var integer v_resourceIndex := -1;
419
				
420
				v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex);
421
			
422 423 424 425 426
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
						tc_ac.stop;
427 428 429
						setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly");
						f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive);
						v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, p_parentIndex);
430 431 432
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
433
						setverdict(inconc, __SCOPE__&":INFO: Error while creating resource type " & int2str(enum2int(p_resourceType)));
434 435 436
					}
					[] mcaPort.receive {
						tc_ac.stop;
437
						setverdict(inconc, __SCOPE__&":INFO: Unexpected message received");
438 439
					}
					[] tc_ac.timeout {
440
						setverdict(inconc, __SCOPE__&":INFO: No answer while creating resource type " & int2str(enum2int(p_resourceType)));
441 442
					}
				}	
443 444 445
				
				f_checkCseTesterStatus();
				
446
				return v_resourceIndex;
447
		
448
			}
449
		
450 451 452 453 454 455 456
			/**
			 * @desc Creation of the auxiliar ACP resource
			 * @param p_acpName ACP name
			 * @param p_allowedOperations Allowed operations
			 * @return Internal resource index of the created auxiliar ACP resource
			 * @verdict 
			 */
457
			function f_cse_createAccessControlPolicyAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer{				var RequestPrimitive v_request;
458 459
				var MsgIn v_response;
				var integer v_acpAuxIndex := -1;
460
				
461
				v_request := valueof(m_createAcpAux(p_acpName := p_acpName, p_allowedOperations := p_allowedOperations));
462
				
463 464
				v_request := f_getCreateRequestPrimitive(int1, v_request, -1);
								
465 466 467 468 469
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
						tc_ac.stop;
470 471 472
						setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(1) & " created successfuly");
						f_checkAttributesToBeSaved(int1, v_request, v_response.primitive.responsePrimitive);
						v_acpAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1);
473 474 475 476
						vc_acpAuxIndex := v_acpAuxIndex;
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
477
						setverdict(inconc, __SCOPE__&":INFO: Error while creating resource type " & int2str(1));
478 479 480
					}
					[] mcaPort.receive {
						tc_ac.stop;
481
						setverdict(inconc, __SCOPE__&":INFO: Unexpected message received");
482 483
					}
					[] tc_ac.timeout {
484
						setverdict(inconc, __SCOPE__&":INFO: No answer while creating resource type " & int2str(1));
485 486
					}
				}	
487 488 489
				
				f_checkCseTesterStatus();
			
490
				return v_acpAuxIndex;
491
	
492
			}
493 494
				
				
495 496 497 498 499 500 501
			/**
			 * @desc Creation of the auxiliar Container resource
			 * @param p_parentIndex Internal resource index which indicates the parent of the Container resource to be created
			 * @return Internal resource index of the created Container resource
			 * @verdict 
			 */
			function f_cse_createContainerResourceAux (integer p_parentIndex := -1) runs on CseTester return integer {
502
			
503 504 505
				var RequestPrimitive v_request;
				var integer v_acpAuxIndex := -1;
				var integer v_containerResourceIndex := -1;
506
				
507
				v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_acpName := c_acpAuxName);//"MyAcp_2"
508
				
509
				v_request := valueof(m_createContainerBase);
510 511 512
				v_request.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)};
				v_request.primitiveContent.container.resourceName := "MyContainerAux";
				
513
				v_containerResourceIndex := f_cse_createResource(int3, v_request, p_parentIndex);
514
				
515
				return v_containerResourceIndex;		
516
		
517
			}
518
			
519 520 521 522 523 524 525 526 527 528 529 530 531
			/**
			 * @desc 
			 * @param p_requestPrimitive
			 * @verdict 
			 */
			function f_cse_updateResource(in RequestPrimitive p_requestPrimitive) runs on CseTester {
				var MsgIn v_response;

				mcaPort.send(m_request(p_requestPrimitive));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
						tc_ac.stop;
532
						setverdict(pass, __SCOPE__&":INFO: Attribute of resource updated successfuly");
533 534 535
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
						tc_ac.stop;
536
						setverdict(inconc, __SCOPE__&":INFO: Error while updating resource");
537 538 539
					}
					[] mcaPort.receive{
						tc_ac.stop;
540
						setverdict(inconc, __SCOPE__&":INFO: Unexpected message received");
541 542
					}
					[] tc_ac.timeout {
543
						setverdict(inconc, __SCOPE__&":INFO: No answer while updating resource");
544 545
					}
				}	
546 547 548
				
				f_checkCseTesterStatus();
				
549
			}// end f_cse_updateResource
550
			
551
			/**
552 553
			 * @desc 
			 * @param p_resourceIndex
554 555
			 * @verdict 
			 */
556 557 558 559
			function f_cse_retrieveResource(integer p_resourceIndex) runs on CseTester return PrimitiveContent{
				var MsgIn v_response;

				mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))));
560 561
				tc_ac.start;
				alt {
562
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
563
						tc_ac.stop;
564
						setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly");
565
					}
566 567 568 569 570
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
						tc_ac.stop;
						setverdict(inconc, __SCOPE__&":INFO: Error while retrieving resource");
					}
					[] mcaPort.receive{
571
						tc_ac.stop;
572
						setverdict(inconc, __SCOPE__&":INFO: Unexpected message received");
573 574
					}
					[] tc_ac.timeout {
575
						setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource");
576
					}
577 578 579 580 581 582 583
				}	
				
				f_checkCseTesterStatus();
				
				return v_response.primitive.responsePrimitive.primitiveContent;
				
			}// end f_cse_retrievingResource
584
			
585 586 587 588 589 590 591 592 593
			/**
			 * @desc 
			 * @param p_requestPrimitive
			 * @verdict 
			 */
			function f_cse_deleteResource(in integer p_index, in template (omit) RequestPrimitive p_requestPrimitive := omit) runs on CseTester {
				var RequestPrimitive v_request;
				
				if(not isvalue(p_requestPrimitive)) {
594
					v_request := valueof(m_delete(f_getResourceAddress(p_index), f_getOriginator(p_index)));
595 596
				} else {
					v_request := valueof(p_requestPrimitive);
597
				}
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
				
				mcaPort.send(m_request(v_request));
						
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
						tc_ac.stop;
						setverdict(pass, __SCOPE__&"INFO: Resource " & v_request.to_ & " deleted");
						
						f_removeElementFromList(vc_resourcesIndexToBeDeleted, p_index);
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(inconc, __SCOPE__&"INFO: Error while deleting resource " & v_request.to_);
					}
					[] tc_ac.timeout {
						setverdict(inconc, __SCOPE__&"INFO: No answer while deleting resource " & v_request.to_);
					}	
				}	
				
				f_checkCseTesterStatus();
				
			}// end f_cse_deleteResource
			
			/**
			 * @desc Check that a resource is present in the IUT (resourceId is known)
			 * @param p_resourceIndex Resource index 
			 * @return boolean
			 */
			function f_isResourcePresent (integer p_resourceIndex) runs on CseTester return boolean {
			
				//Check to see if the resource is present or not
				mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
						tc_ac.stop;
						setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex));
						return true;
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) {
						tc_ac.stop;
						setverdict(inconc, testcasename() & ": Wrong response status code in the response");
						return false;
					}
					[] tc_ac.timeout {
						setverdict(inconc, testcasename() & ": No answer while retrieving resource");
						return false;
					}
				}	
				return false;
649
			}
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732
			
			/**
			 * @desc Check that a resource is not present in the IUT (resourceId is NOT known)
			 * @param p_parentIndex Index of the parent resource
			 * @param p_resourceName Resource name (Hierarchical method is used)
			 * @return boolean
			 */
			function f_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on CseTester return boolean {
			
				log(testcasename() & ":INFO: Hierarchical method is required to check the non presence of the resource");
				vc_addressingMethod := e_hierarchical;
				//Check to see if the resource has NOT been created
				mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_parentIndex) & "/" & p_resourceName, f_getOriginator(p_parentIndex))));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) {
						tc_ac.stop;
						setverdict(pass, testcasename() & ": Resource not present");
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						return true;
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitive(?))) {
						tc_ac.stop;
						setverdict(inconc, testcasename() & ": Wrong response status code in the response");
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						return false;
					}
					[] tc_ac.timeout {
						setverdict(inconc, testcasename() & ": No answer while retrieving resource");
						vc_addressingMethod := PX_ADDRESSING_METHOD;
						return false;
					}
				}	
				return false;
			}
			
			/**
			 * @desc Update of the auxiliar ACP resource
			 * @param p_allowedOperations New allowed operations
			 * @verdict 
			 */
			function f_cse_updateAcpAuxResource (in template (value) AccessControlOperations p_allowedOperations) runs on CseTester {
				var RequestPrimitive v_request;
				
				v_request := valueof(m_updateAcpBase);
				
				v_request.to_ := f_getResourceAddress(vc_acpAuxIndex);
				v_request.from_ := f_getOriginator(vc_acpAuxIndex);
				v_request.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {valueof(m_createAcr(PX_ACOR, p_allowedOperations))};
							
				mcaPort.send(m_request(v_request));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK))  {
						tc_ac.stop;
						setverdict(pass, __SCOPE__&":INFO: " & v_request.to_ & " resource updated successfuly");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
						tc_ac.stop;
						setverdict(inconc, __SCOPE__&":INFO: Error while updating " & v_request.to_ & " resource");
					}
					[] tc_ac.timeout {
						setverdict(inconc, __SCOPE__&":INFO: No answer while updating " & v_request.to_ & " resource" );
					}
				}		
				
				f_checkCseTesterStatus();
			}   
			
			/**
			 * @desc Function to handle announcement of resources
			 * @param p_from
			 * @param p_to
			 * @verdict 
			 */
			 //TODO To finalize this function
			function f_cse_resourceAnnouncementHandler(template XSD.ID p_from := *, template XSD.ID p_to := ?) runs on CseTester {
				// Local variables
				var MsgIn v_request;
				var ResponsePrimitive v_responsePrimitive;
				
				map(self:mccPort, system:mccPort);
				map(self:acPort, system:acPort);
733

734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_request(mw_create(p_from, p_to))) -> value v_request {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
						v_responsePrimitive := f_getCreateResponsePrimitive(v_request.primitive.requestPrimitive.resourceType, v_request.primitive.requestPrimitive);
						mcaPort.send(m_response(v_responsePrimitive)); 						
					}
					[] mcaPort.receive{
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ":ERROR: Unexpected message received");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ":ERROR:  No announcement received");
					}
				}
750
	
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
				unmap(self:mccPort, system:mccPort);
				unmap(self:acPort, system:acPort); 

			} //end f_cse_resourceAnnouncementHandler			
    		
			function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) {
				select (p_resourceType) {
					case (int1) {
						if(isvalue(p_response.primitiveContent.accessControlPolicy) and
								not(ispresent(p_response.primitiveContent.accessControlPolicy.resourceName))) {
							p_response.primitiveContent.accessControlPolicy.resourceName :=  p_request.primitiveContent.accessControlPolicy.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.accessControlPolicy.resourceName)
						}
					}
					case (int2) {
						if(isvalue(p_response.primitiveContent.aE) and
								not(ispresent(p_response.primitiveContent.aE.resourceName))) {
							p_response.primitiveContent.aE.resourceName :=  p_request.primitiveContent.aE.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.aE.resourceName)
						}
					}
					case (int3) {
						if(isvalue(p_response.primitiveContent.container) and
								not(ispresent(p_response.primitiveContent.container.resourceName))) {
							p_response.primitiveContent.container.resourceName :=  p_request.primitiveContent.container.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.container.resourceName)
						}
					}
					case (int4) {
						if(isvalue(p_response.primitiveContent.contentInstance) and
								not(ispresent(p_response.primitiveContent.contentInstance.resourceName))) {
							p_response.primitiveContent.contentInstance.resourceName :=  p_request.primitiveContent.contentInstance.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.contentInstance.resourceName)
						}
					}
					case (int15) {
						if (isvalue(p_response.primitiveContent.pollingChannel) and
								not(ispresent(p_response.primitiveContent.pollingChannel.resourceName))) {
							p_response.primitiveContent.pollingChannel.resourceName :=  p_request.primitiveContent.pollingChannel.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.pollingChannel.resourceName)
						}
					}
					case (int16) {
						if (isvalue(p_response.primitiveContent.remoteCSE) and
								not(ispresent(p_response.primitiveContent.remoteCSE.resourceName))) {
							p_response.primitiveContent.remoteCSE.resourceName :=  p_request.primitiveContent.remoteCSE.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.remoteCSE.resourceName)
						}
					}
					case (int18) {
						if (isvalue(p_response.primitiveContent.schedule) and
								not(ispresent(p_response.primitiveContent.schedule.resourceName))) {
							p_response.primitiveContent.schedule.resourceName :=  p_request.primitiveContent.schedule.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.schedule.resourceName)
						}
					}
					case (int23) {
						if (isvalue(p_response.primitiveContent.subscription) and
								not(ispresent(p_response.primitiveContent.subscription.resourceName))) {
							p_response.primitiveContent.subscription.resourceName :=  p_request.primitiveContent.subscription.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.subscription.resourceName)
						}
					}
					case (int9) {
						if (isvalue(p_response.primitiveContent.group_) and
								not(ispresent(p_response.primitiveContent.group_.resourceName))) {
							p_response.primitiveContent.group_.resourceName :=  p_request.primitiveContent.group_.resourceName;
							log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.group_.resourceName)
						}
					}
					case else {
						log(__SCOPE__&":WARNING: Resource Type "&int2str(enum2int(p_resourceType))&" not implemented");
					}
824
				}
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842
    
				// TODO test that if the resource name is returned is the same resource name as used in the create message
			}
		
			function f_compareURIs(in integer p_expectedURIIndex, in XSD.ID p_receivedURI) runs on CseTester return boolean{
				// Local variables
				var boolean v_matchResult := false;
    			
				if (f_isNonHierarchical(p_receivedURI)) {
					vc_addressingMethod := e_nonHierarchical;
				} else if (f_isHierarchical(p_receivedURI)) {
					vc_addressingMethod := e_hierarchical;
				}
				if (f_isScopeCseRelative(p_receivedURI)) {
					vc_primitiveScope := e_cseRelative;
				}
				if (f_isScopeSpRelative(p_receivedURI)) {
					vc_primitiveScope := e_spRelative;
843
				}
844 845 846 847 848
				if (f_isScopeAbsolute(p_receivedURI)) {
					vc_primitiveScope := e_absolute;
				}
    			
				if(match(f_getResourceAddress(p_expectedURIIndex), p_receivedURI)) {
849
					v_matchResult := true;
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882
				} else {
					v_matchResult := false;
				}
				
				vc_primitiveScope := PX_PRIMITIVE_SCOPE;
				vc_addressingMethod := PX_ADDRESSING_METHOD;
    						
				return v_matchResult;
    
			} //end f_compareURIs	

			group NotificationFunctions { 
				
				function f_cse_notifyProcedure_subscriptionVerificationHandler(in integer p_creatorIndex, in ResponseStatusCode p_responseStatusCode := int2001) runs on CseTester {
					// Local variables
					var MsgIn v_request;
					var ResponsePrimitive v_responsePrimitive;
					var template Notification v_notificationRequest := mw_contentNotificationVerification;
    			
					map(self:mcaPort, system:mcaPort);
					map(self:acPort, system:acPort);
    			
					//Preparation of expected Notification verification
					//TODO To add checks for creator and subscription reference
					//v_notificationRequest.creator := p_creator; TODO To check what address format is to be expected
					//Some participants use SP relative UNSTRUCTURED
					//v_notificationRequest.subscriptionReference := "I Don't know which URI is expected"; // TODO mandatory parameter 
    			
					//Preparation of Notification response to be sent
					v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit));
    	
					tc_ac.start;
					alt {
883
						[] mcaPort.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_request {
884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ":INFO: Notification received");
							v_responsePrimitive.requestIdentifier := v_request.primitive.requestPrimitive.requestIdentifier;
//							if(f_isHierarchical(v_request.primitive.requestPrimitive.primitiveContent.notification.creator)) {
//								setverdict(fail, __SCOPE__ & ": Creator cannot contain a hierarchical address");
//								v_responsePrimitive.responseStatusCode := int4000;
//							}
//							if(f_compareURIs(p_creatorIndex, v_request.primitive.requestPrimitive.primitiveContent.notification.creator)) {
//								setverdict(pass, __SCOPE__ & ": Creator set to originator of the subscription creation primitive");
//							} else {
//								setverdict(fail, __SCOPE__ & ": Creator not set to originator of the subscription creation primitive");
//								v_responsePrimitive.responseStatusCode := int4000;
//							}
							mcaPort.send(m_httpResponse(v_responsePrimitive)); 						
						}
						[] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_request {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE");							
						}
						[] mcaPort.receive{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ":ERROR:  No notification received");
						}
					}
    	
					//mcaPort.send(m_response(v_responsePrimitive));	// TODO have to be deleted
    
					unmap(self:mcaPort, system:mcaPort);
					unmap(self:acPort, system:acPort); 
    
				} //end f_subscriptionVerificationHandler
    		
				function f_cse_notifyProcedure_representationHandler(template PrimitiveContent p_primitiveContent) runs on CseTester {
					// Local variables
					var MsgIn v_request;
	    	
					map(self:mcaPort, system:mcaPort);
					map(self:acPort, system:acPort);
	    	
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_request {
							tc_ac.stop;
							if(f_check_notificationContent(v_request.primitive.requestPrimitive, p_primitiveContent)){
								setverdict(pass, __SCOPE__ & ":INFO: Notification received");
								mcaPort.send(m_response(valueof(m_responseNotification(int2001))));
							}
							else{
								setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
936 937
							}
						}
938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970
						[] mcaPort.receive{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ":ERROR: No notification received");
						}
					}
	    	
	    		
					unmap(self:mcaPort, system:mcaPort);
					unmap(self:acPort, system:acPort); 
	    	
				} //end f_cse_notifyProcedure_representationHandler
	    		
				function f_cse_notifyProcedure_aggregatedNoficationHandler(template PrimitiveContent p_primitiveContent,in integer p_numberOfAggregatedNotification) runs on CseTester {
					// Local variables
					var MsgIn v_response;
    
					map(self:mcaPort, system:mcaPort);
					map(self:acPort, system:acPort);
    
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_request(mw_aggregatedNotifyBase)) -> value v_response {
							tc_ac.stop;
							if(p_numberOfAggregatedNotification == lengthof(v_response.primitive.requestPrimitive.primitiveContent.aggregatedNotification.notification_list)){
								if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){
									setverdict(pass, __SCOPE__ & ": Notification received");
								}
								else{
									setverdict(fail, __SCOPE__ & ": Notification received but the content doesn't match");
								}
971
							}
972 973 974 975 976 977 978 979 980 981 982
							else {
								setverdict(fail, __SCOPE__ & ": Number of Notification in Aggregatednotification isn't right");
							}
						}
						[] mcaPort.receive{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error, unexpected message received");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No notification received");
						}
983
					}
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017
    	
					unmap(self:mcaPort, system:mcaPort);
					unmap(self:acPort, system:acPort); 
    
				} //end f_cse_notifyProcedure_aggregatedNotificationHandler
	    		
				function f_cse_notifyProcedure_subscriptionDeletionHandler( template PrimitiveContent p_primitiveContent) runs on CseTester {
					var MsgIn v_response;
	
					map(self:mcaPort, system:mcaPort);
					map(self:acPort, system:acPort);
					
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response {
							tc_ac.stop;
							mcaPort.send(m_response(valueof(m_responseNotification(int2001))));
							if(not(match(v_response.primitive.requestPrimitive.primitiveContent.notification.subscriptionDeletion, true))) {
								setverdict(fail, __SCOPE__ & ":ERROR: subscriptionDeletion attribute have to be set to TRUE");
							}
							if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){
								setverdict(pass, __SCOPE__ & ":INFO: Notification received");
							}
							else{
								setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
							}
						}
						[] mcaPort.receive{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ":ERROR: No notification received");
						}
1018
					}
1019 1020 1021
					
					unmap(self:mcaPort, system:mcaPort);
					unmap(self:acPort, system:acPort);  
1022
	
1023 1024 1025 1026 1027
				} //end f_cse_notifyProcedure_subscriptionDeletionHandler  
				
				function f_cse_notifyProcedure_noNotificationHandler() runs on CseTester {
					// Local variables
					var MsgIn v_response;
1028
	
1029 1030
					map(self:mcaPort, system:mcaPort);
					map(self:acPort, system:acPort);
1031
		
1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079
					tc_ac.start(10.0);
					alt {
						[] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error, Non expected notification received");
						}
						[] tc_ac.timeout {
							setverdict(pass, __SCOPE__ & ": No notification received");
						}
					}
	
					unmap(self:mcaPort, system:mcaPort);
					unmap(self:acPort, system:acPort); 
	
				} //end f_cse_notifyProcedure_noNotification Handler
				
				function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on CseTester return boolean{
					// Local variables
					var boolean v_matchResult := false;
					var integer i;
					var integer v_numberOfAggregatedNotification;
    	
					if (ischosen(p_primitiveContent.aE)){
						if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource)) {
							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE, p_primitiveContent.aE)
						}
						else if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive)) {
							v_matchResult :=match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE)
						}
						else if (ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification)) {
							v_matchResult := true;
							v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list);
							for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){
								if(ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource)) {
									if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE, p_primitiveContent.aE))){
										v_matchResult := false;
									}
								}
								else if(ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive)) {
									if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE))){
										v_matchResult := false;
									}
								}						
							}
							if (i == 0){
								v_matchResult := false;
							}
						}
1080
    
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092
					}
    	
					if (ischosen(p_primitiveContent.container)){
						if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource)) {
							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container, p_primitiveContent.container)
						}
						else if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive)) {
							v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container, p_primitiveContent.container)
						}
					}
    	
					return v_matchResult;
1093
    
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117
				} //end f_check_notificationContent	
				
			}// end of group NotificationFunctions 		
	    		
			/**
			 * @desc It determines whether the addressing method of the given address is non-hierarchical. Not valid for CSE-Base as target
			 * @param p_resourceAddress
			 * @return boolean
			 */
			function f_isNonHierarchical(XSD.ID p_resourceAddress) runs on Tester return boolean {	
				var integer i;
				var