OneM2M_Testcases_AE_Release_1.ttcn 95.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/**
 *  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
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_Testcases.ttcn $
 *              $Id: OneM2M_Testcases.ttcn 347 2017-08-11 08:48:20Z reinaortega $
 *  @desc       Module containing test cases for oneM2M
 *
 */
14
module OneM2M_Testcases_AE_Release_1 {
15 16 17 18 19 20 21 22 23

	import from OneM2M_TestSystem all;
	import from OneM2M_Templates all;
	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;
24
	import from OneM2M_PermutationFunctions all;
25 26 27 28 29 30 31 32 33 34 35 36 37 38
	import from XSD all;

	group AE {
		
		group General {
			
			group Create {
						
				group g_AE_GEN_CRE_001 {
							
					/**
					 * @desc  Check that the IUT sends the creation of a <container> resource using unstructured resource identifier
					 */
		
39
					testcase TC_AE_GEN_CRE_001_CSR() runs on Tester system AeSystem {
40
						
41 42
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
												
43 44
						// Test control
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
45
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
46 47 48
							stop;
						}
						
49 50
						v_cse1.start(f_AE_GEN_CRE_001(e_cseRelative));
						v_cse1.done;
51 52
					}
					
53 54 55
					testcase TC_AE_GEN_CRE_001_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
56 57 58
												
						// Test control
						if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
59
							setverdict(inconc, __SCOPE__ & ": Unstructured-SP-Relative-Resource-ID format support is required to run this test case");
60 61 62
							stop;
						}
						
63 64
						v_cse1.start(f_AE_GEN_CRE_001(e_spRelative));
						v_cse1.done;
65 66
					}
					
67 68 69
					testcase TC_AE_GEN_CRE_001_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
70 71 72
						
						// Test control
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
73
							setverdict(inconc, __SCOPE__ & ": Unstructured-Absolute-Resource-ID format support is required to run this test case");
74 75
							stop;
						}
76 77
						v_cse1.start(f_AE_GEN_CRE_001(e_absolute));
						v_cse1.done;
78 79
					}
					
80
				}//end group g_AE_GEN_CRE_002
81 82 83 84 85 86 87
						
				group g_AE_GEN_CRE_002 {
							
					/**
					 * @desc  Check that the IUT sends the creation of a <container> resource using structured resource identifier
					 */

88 89 90
					testcase TC_AE_GEN_CRE_002_CSR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
91 92
						
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
93
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
94 95 96
							stop;
						}
						
97 98
						v_cse1.start(f_AE_GEN_CRE_002(e_cseRelative));
						v_cse1.done;
99 100
					}

101 102 103
					testcase TC_AE_GEN_CRE_002_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
104 105
						
						if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
106
							setverdict(inconc, __SCOPE__ & ": Structured-SP-Relative-Resource-ID format support is required to run this test case");
107 108 109
							stop;
						}
						
110 111
						v_cse1.start(f_AE_GEN_CRE_002(e_spRelative));
						v_cse1.done;
112 113
					}

114 115 116
					testcase TC_AE_GEN_CRE_002_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
117 118
						
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
119
							setverdict(inconc, __SCOPE__ & ": Structured-Absolute-Resource-ID format support is required to run this test case");
120 121 122
							stop;
						}
						
123 124
						v_cse1.start(f_AE_GEN_CRE_002(e_absolute));
						v_cse1.done;
125 126 127 128 129 130 131 132 133 134 135 136 137 138
					}

				} //end group g_AE_GEN_CRE_002
				
			} //end group Create
			
			group Update {
						
				group g_AE_GEN_UPD_001 {
							
					/**
					 * @desc  Check that the IUT sends the update of a <container>  resource using unstructured resource identifier
					 */
		
139 140 141
					testcase TC_AE_GEN_UPD_001_CSR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
142 143 144
						
						// Test control
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
145
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
146 147 148
							stop;
						}
						
149 150
						v_cse1.start(f_AE_GEN_UPD_001(e_cseRelative));
						v_cse1.done;
151 152
					}
					
153 154 155
					testcase TC_AE_GEN_UPD_001_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
156 157 158
						
					//Test control
					if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
159
						setverdict(inconc, __SCOPE__ & ": Unstructured-SP-Relative-Resource-ID format support is required to run this test case");
160 161 162
						stop;
					}
						
163 164
						v_cse1.start(f_AE_GEN_UPD_001(e_spRelative));
						v_cse1.done;
165 166
					}
					
167 168 169
					testcase TC_AE_GEN_UPD_001_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
170 171 172
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
173
							setverdict(inconc, __SCOPE__ & ": Unstructured-Absolute-Resource-ID format support is required to run this test case");
174 175 176
							stop;
						}
						
177 178
						v_cse1.start(f_AE_GEN_UPD_001(e_absolute));
						v_cse1.done;
179 180 181 182 183 184 185 186 187 188
					}
					
				}//end group g_AE_GEN_UPD_001
					
				group g_AE_GEN_UPD_002 {
							
					/**
					 * @desc  Check that the IUT sends the update of a <container>  resource using structured resource identifier
					 */

189 190 191
					testcase TC_AE_GEN_UPD_002_CSR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
192 193 194
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
195
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
196 197 198
							stop;
						}
						
199 200
						v_cse1.start(f_AE_GEN_UPD_002(e_cseRelative));
						v_cse1.done;
201 202
					}

203 204 205
					testcase TC_AE_GEN_UPD_002_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
206 207 208
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
209
							setverdict(inconc, __SCOPE__ & ": Structured-SP-Relative-Resource-ID format support is required to run this test case");
210 211 212
							stop;
						}
						
213 214
						v_cse1.start(f_AE_GEN_UPD_002(e_spRelative));
						v_cse1.done;
215 216
					}

217 218 219
					testcase TC_AE_GEN_UPD_002_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
220 221 222
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
223
							setverdict(inconc, __SCOPE__ & ": Structured-Absolute-Resource-ID format support is required to run this test case");
224 225 226
							stop;
						}
						
227 228
						v_cse1.start(f_AE_GEN_UPD_002(e_absolute));
						v_cse1.done;
229 230 231 232 233 234 235 236 237 238 239 240 241 242
					}

				} //end group g_AE_GEN_UPD_002
				
			} //end group Update
			
			group Retrieve {
						
				group g_AE_GEN_RET_001 {
				
					/**
					 * @desc  Check that the IUT sends the retrieval of a <container>  resource using unstructured resource identifier
					 */

243 244 245
					testcase TC_AE_GEN_RET_001_CSR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
246 247 248
						
						// Test control
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
249
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
250 251 252
							stop;
						}
						
253 254
						v_cse1.start(f_AE_GEN_RET_001(e_cseRelative));
						v_cse1.done;
255 256
					}
		
257 258 259
					testcase TC_AE_GEN_RET_001_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
260 261 262
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
263
							setverdict(inconc, __SCOPE__ & ": Unstructured-SP-Relative-Resource-ID format support is required to run this test case");
264 265 266
							stop;
						}
						
267 268
						v_cse1.start(f_AE_GEN_RET_001(e_spRelative));
						v_cse1.done;
269 270
					}
		
271 272 273
					testcase TC_AE_GEN_RET_001_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
274 275 276
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
277
							setverdict(inconc, __SCOPE__ & ": Unstructured-Absolute-Resource-ID format support is required to run this test case");
278 279 280
							stop;
						}
						
281 282
						v_cse1.start(f_AE_GEN_RET_001(e_absolute));
						v_cse1.done;
283 284 285 286 287 288 289 290 291 292
					}
		
				}//end group g_AE_GEN_RET_001
		
				group g_AE_GEN_RET_002 {
				
					/**
					 * @desc  Check that the IUT sends the retrieval of a <container>  resource using structured resource identifier
					 */

293 294 295
					testcase TC_AE_GEN_RET_002_CSR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
296 297 298
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
299
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
300 301 302
							stop;
						}
						
303 304
						v_cse1.start(f_AE_GEN_RET_002(e_cseRelative));
						v_cse1.done;
305 306
					}

307 308 309
					testcase TC_AE_GEN_RET_002_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
310 311 312
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
313
							setverdict(inconc, __SCOPE__ & ": Structured-SP-Relative-Resource-ID format support is required to run this test case");
314 315 316
							stop;
						}
						
317 318
						v_cse1.start(f_AE_GEN_RET_002(e_spRelative));
						v_cse1.done;
319 320
					}

321 322 323
					testcase TC_AE_GEN_RET_002_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
324 325 326
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
327
							setverdict(inconc, __SCOPE__ & ": Structured-Absolute-Resource-ID format support is required to run this test case");
328 329 330
							stop;
						}
						
331 332
						v_cse1.start(f_AE_GEN_RET_002(e_absolute));
						v_cse1.done;
333 334 335 336 337 338 339 340 341 342 343 344 345 346
					}

				} //end group g_AE_GEN_RET_002
	
			} //end group Retrieve
						
			group Delete {
						
				group g_AE_GEN_DEL_001 {
				
					/**
					 * @desc  Check that the IUT sends the deletion of a <container>  resource using unstructured resource identifier
					 */

347 348 349
					testcase TC_AE_GEN_DEL_001_CSR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
350 351 352
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
353
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
354 355 356
							stop;
						}
						
357 358
						v_cse1.start(f_AE_GEN_DEL_001(e_cseRelative));
						v_cse1.done;
359 360
					}
		
361 362 363
					testcase TC_AE_GEN_DEL_001_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
364 365 366
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
367
							setverdict(inconc, __SCOPE__ & ": Unstructured-SP-Relative-Resource-ID format support is required to run this test case");
368 369 370
							stop;
						}
						
371 372
						v_cse1.start(f_AE_GEN_DEL_001(e_spRelative));
						v_cse1.done;
373 374
					}
		
375 376 377
					testcase TC_AE_GEN_DEL_001_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
378 379 380
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
381
							setverdict(inconc, __SCOPE__ & ": Unstructured-Absolute-Resource-ID format support is required to run this test case");
382 383 384
							stop;
						}
						
385 386
						v_cse1.start(f_AE_GEN_DEL_001(e_absolute));
						v_cse1.done;
387 388 389 390 391 392 393 394 395 396
					}
		
				}//end group g_AE_GEN_DEL_001
		
				group g_AE_GEN_DEL_002 {
				
					/**
					 * @desc  Check that the IUT sends the deletion of a <container>  resource using structured resource identifier
					 */

397 398 399
					testcase TC_AE_GEN_DEL_002_CSR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
400 401 402
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_CSE_RELATIVE)) {
403
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
404 405 406
							stop;
						}
						
407 408
						v_cse1.start(f_AE_GEN_DEL_002(e_cseRelative));
						v_cse1.done;
409 410
					}

411 412 413
					testcase TC_AE_GEN_DEL_002_SPR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
414 415 416
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_SP_RELATIVE)) {
417
							setverdict(inconc, __SCOPE__ & ": Structured-SP-Relative-Resource-ID format support is required to run this test case");
418 419 420
							stop;
						}
						
421 422
						v_cse1.start(f_AE_GEN_DEL_002(e_spRelative));
						v_cse1.done;
423 424
					}

425 426 427
					testcase TC_AE_GEN_DEL_002_ABS() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
428 429 430
						
						//Test control
						if(not(PICS_PRIMITIVE_SCOPE_ABSOLUTE)) {
431
							setverdict(inconc, __SCOPE__ & ": Structured-Absolute-Resource-ID format support is required to run this test case");
432 433 434
							stop;
						}
						
435 436
						v_cse1.start(f_AE_GEN_DEL_002(e_absolute));
						v_cse1.done;
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452
					}

				} //end group g_AE_GEN_DEL_002
	
			} //end group Delete
			
		}//end group General

		group Registration {
			
			group Create {
						
				/**
				 * @desc  Check that the IUT sends an AE initial registration request with no AE-ID-STEM provided when it is started
				 */

453 454 455 456 457 458 459 460 461 462
				testcase TC_AE_REG_CRE_001() runs on Tester system AeSystem {
						
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
					
					v_cse1.start(f_AE_REG_CRE_001());
					
					v_cse1.done;
				}
					
				function f_AE_REG_CRE_001() runs on CseSimu {
463 464

					//primitives for utPort
465
					var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
Miguel Angel Reina Ortega's avatar
Fix #44  
Miguel Angel Reina Ortega committed
466 467 468
					var integer v_parentIndex := -1;
					var integer v_resourceIndex := -1;
					var PrimitiveContent v_resource;
469

470
					//primitives for mcaPortIn
471
					var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Fix #38  
Miguel Angel Reina Ortega committed
472
					var template RequestPrimitive v_requestPrimitive := mw_createAe;
473
					var ResponsePrimitive v_responsePrimitive;
474
					var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request";
475 476 477 478

					f_cf03Up();
				
					//Send Trigger Message
479 480
					v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
					v_requestPrimitive.to_ := v_utRequest.requestPrimitive.to_;
481
					f_sendUtPrimitive(v_utRequest, v_action & f_getLocalResourceAddress(-, -, -));
482 483 484 485

					//Test behavior
					tc_ac.start;
					alt{
Miguel Angel Reina Ortega's avatar
Fix #38  
Miguel Angel Reina Ortega committed
486
						[] mcaPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
487
							tc_ac.stop;
488
							setverdict(pass, __SCOPE__ & " : AE registration request is accepted!!");
489
							v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
490 491
							
							//send back responsePrimitive
492
							f_send(e_mca_in_port, f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
493
						}
494
						[] mcaPortIn.receive(mw_request(mw_createAe())) -> value v_request {
495
							tc_ac.stop;
496
							setverdict(fail, __SCOPE__ & " : Unexpected AE registration request");
497
							f_send(e_mca_in_port, f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
498 499
						}
						[] tc_ac.timeout{
500
							setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
501 502 503 504 505 506 507 508 509 510 511 512 513 514
						}
	
					}
	
					// Postamble
					f_cf03Down();
				}
				
				/**
				 * @desc  Check that the IUT sends a registration CREATE Request with the value of the attribute ATTRIBUTE_NAME  of the AE resource
				 */
				
				group g_AE_REG_CRE_002 {
				
515 516 517
					testcase TC_AE_REG_CRE_002_RN() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
518
						//primitives for utPort
519
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
520
						var template RequestPrimitive v_createAe := mw_createAe;
521
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute ResourceName";
522
						v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED";
523
						v_createAe.primitiveContent.aE.resourceName := complement("UNINITIALIZED");
524 525
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
526 527
					}
	
528 529 530
					testcase TC_AE_REG_CRE_002_ET() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
531
						//primitives for utPort
532
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
533
						var template RequestPrimitive v_createAe := mw_createAe;
534
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute ExpirationTime";
535 536 537
						v_utRequest.requestPrimitive.primitiveContent.aE.expirationTime := "20301231T012345";
						v_utRequest.forcedFields := {{name := "expirationTime", value_ := "UNINITIALIZED"}};
						v_createAe.primitiveContent.aE.expirationTime := ?;//Check value other than "UNINITIALIZED", done by typing
538 539
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
540 541
					}
	
542 543 544
					testcase TC_AE_REG_CRE_002_LBL() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
545
						//primitives for utPort
546
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
547
						var template RequestPrimitive v_createAe := mw_createAe;
548
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute Labels";
549
						v_utRequest.requestPrimitive.primitiveContent.aE.labels := {"UNINITIALIZED"};
550
						v_createAe.primitiveContent.aE.labels := complement({*,"UNINITIALIZED",*});
551 552
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
553 554
					}
	
555 556 557
					testcase TC_AE_REG_CRE_002_APN() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
558
						//primitives for utPort
559
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
560
						var template RequestPrimitive v_createAe := mw_createAe;
561
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute AppName";
562
						v_utRequest.requestPrimitive.primitiveContent.aE.appName := "UNINITIALIZED";
563
						v_createAe.primitiveContent.aE.appName := complement("UNINITIALIZED");
564 565
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
566 567
					}
	
568 569 570
					testcase TC_AE_REG_CRE_002_API() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
571
						//primitives for utPort
572
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
573
						var template RequestPrimitive v_createAe := mw_createAe;
574
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute AppID";
575
						v_utRequest.requestPrimitive.primitiveContent.aE.app_ID := "UNINITIALIZED";
576
						v_createAe.primitiveContent.aE.app_ID := complement("UNINITIALIZED");
577 578
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
579 580
					}
	
581 582 583
					testcase TC_AE_REG_CRE_002_POA() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
584
						//primitives for utPort
585
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
586
						var template RequestPrimitive v_createAe := mw_createAe;
587
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute PointOfAccess";
588
						v_utRequest.requestPrimitive.primitiveContent.aE.pointOfAccess := {"UNINITIALIZED"};
589
						v_createAe.primitiveContent.aE.pointOfAccess := complement({*,"UNINITIALIZED",*});
590 591
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
592 593
					}
	
594 595 596
					testcase TC_AE_REG_CRE_002_OR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
597
						//primitives for utPort
598
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
599
						var template RequestPrimitive v_createAe := mw_createAe;
600
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute OntologyRef";
601
						v_utRequest.requestPrimitive.primitiveContent.aE.ontologyRef := "UNINITIALIZED";
602
						v_createAe.primitiveContent.aE.ontologyRef := complement("UNINITIALIZED");
603 604
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
605 606
					}
	
607 608 609
					testcase TC_AE_REG_CRE_002_NL() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
610
						//primitives for utPort
611
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
612
						var template RequestPrimitive v_createAe := mw_createAe;
613
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute NodeLink";
614
						v_utRequest.requestPrimitive.primitiveContent.aE.nodeLink := "UNINITIALIZED";
615
						v_createAe.primitiveContent.aE.nodeLink := complement("UNINITIALIZED");
616 617
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
618 619
					}
	
620 621 622
					testcase TC_AE_REG_CRE_002_RR() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
623
						//primitives for utPort
624
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
625
						var template RequestPrimitive v_createAe := mw_createAe;
626
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute RequestReachability";
627 628 629
						v_utRequest.requestPrimitive.primitiveContent.aE.requestReachability := true;
						v_utRequest.forcedFields := {{name := "requestReachability", value_ := "UNINITIALIZED"}};
						v_createAe.primitiveContent.aE.requestReachability := ?;//Check value other than UNINITIALIZED, done by typing
630 631
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
632 633
					}
	
634 635 636
					testcase TC_AE_REG_CRE_002_CSZ() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
637
						//primitives for utPort
638
						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
639
						var template RequestPrimitive v_createAe := mw_createAe;
640
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute ContentSerialization";
641 642 643
						v_utRequest.requestPrimitive.primitiveContent.aE.contentSerialization := {applicationxml};
						v_utRequest.forcedFields := {{name := "contentSerialization", value_ := "UNINITIALIZED"}};
						v_createAe.primitiveContent.aE.contentSerialization := ?;//Check value other than UNINITIALIZED, done by typing
644 645
						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
						v_cse1.done;
646 647 648 649 650 651 652 653 654 655 656 657
					}
	
				}//End of subgroup AE_REG_CRE_002
				
			} // End of subgroup Create
			
			group Delete {
			
			/**
				 * @desc Check that the IUT sends AE deregistration request to CSE
				 */
	
658 659 660 661 662 663 664 665 666 667 668
				testcase TC_AE_REG_DEL_001() runs on Tester system AeSystem {
						
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
					
					v_cse1.start(f_AE_REG_DEL_001());
					
					v_cse1.done;
					
				}
					
				function f_AE_REG_DEL_001() runs on CseSimu {
669 670 671
	
					//variables
					var MsgIn v_request;
672
					var ResponsePrimitive v_responsePrimitive;
Miguel Angel Reina Ortega's avatar
Fix #42  
Miguel Angel Reina Ortega committed
673 674
					var PrimitiveContent v_localResource;
					var integer v_auxInteger := -1;
675
					var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE DELETE Registration Request";
676 677
					
					//primitives for utPort
678
					var template UtTriggerPrimitive v_utRequest := m_utDelete;
679 680 681
	
					f_cf03Up();
	
Miguel Angel Reina Ortega's avatar
Fix #47  
Miguel Angel Reina Ortega committed
682
					v_localResource := f_generateLocalResource(valueof(m_primitiveContentAe(m_contentCreateAe(omit, -, -, omit))), vc_cSEBaseIndex, int2);
683
					v_auxInteger := f_setLocalResource(v_localResource, int2, vc_cSEBaseIndex);
Miguel Angel Reina Ortega's avatar
Fix #42  
Miguel Angel Reina Ortega committed
684
					v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, -, -);
685
					f_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(v_auxInteger, -, -));
686 687 688 689
	
					//Test behavior
					tc_ac.start;
					alt{
Miguel Angel Reina Ortega's avatar
Fix #42  
Miguel Angel Reina Ortega committed
690
						[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value v_request {
691
							tc_ac.stop;
692
							setverdict(pass, __SCOPE__ & " : AE deregistration request is accepted!");
Miguel Angel Reina Ortega's avatar
Fix #44  
Miguel Angel Reina Ortega committed
693
							v_responsePrimitive := valueof(m_responsePrimitive(int2002, v_request.primitive.requestPrimitive.requestIdentifier, omit));
694 695
	
							//send back responsePrimitive
696
							f_send(e_mca_in_port, f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
697
						}
698
						[] mcaPortIn.receive (mw_request(mw_delete(?)))  {
699
							tc_ac.stop;
700
							setverdict(fail, __SCOPE__ & " : Unexpected DELETE request");
701
							f_send(e_mca_in_port, f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
702 703
						}
						[] tc_ac.timeout{
704
							setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723
						}
	
					}
					// Postamble
					f_cf03Down();
				}
			
			}// End Delete subgroup

		}//end Registration subgroup

		group Data_Management_and_Repository {
			
			group Create {
			
				/**
				 * @desc Check that the IUT sends a Container creation request when it is triggered
				 */
			
724 725 726 727 728 729 730 731 732 733
				testcase TC_AE_DMR_CRE_001() runs on Tester system AeSystem {
						
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
					
					v_cse1.start(f_AE_DMR_CRE_001());
					
					v_cse1.done;
				}

				function f_AE_DMR_CRE_001() runs on CseSimu {
734 735 736 737
	
					//variables
					var template UtTriggerPrimitive v_utRequest := m_utCreateContainer;
					var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Fix #44  
Miguel Angel Reina Ortega committed
738
					var integer v_resourceIndex := -1;
Miguel Angel Reina Ortega's avatar
Fix #38  
Miguel Angel Reina Ortega committed
739
					var template RequestPrimitive v_requestPrimitive := mw_createContainer;
740
					var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for container to ";
741 742 743
					
					f_cf03Up();
	
744
					//send triggering primitive to SUT
745 746
					v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
					v_requestPrimitive.to_ := v_utRequest.requestPrimitive.to_;
747
					f_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(-, -, -));
748 749 750 751
					
					//Test behavior
					tc_ac.start;
					alt{
Miguel Angel Reina Ortega's avatar
Fix #38  
Miguel Angel Reina Ortega committed
752
						[] mcaPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
753
							tc_ac.stop;
754
							setverdict(pass, __SCOPE__ & " : Container creation request is accepted!");
755
							v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
756
							//send back responsePrimitive
757
							f_send(e_mca_in_port, f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
758
						}
759
						[] mcaPortIn.receive(mw_request(mw_create)) -> value v_request{
760
							tc_ac.stop;
761
							setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
762
							f_send(e_mca_in_port, f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
763 764
						}
						[] tc_ac.timeout{
765
							setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
766 767 768 769 770 771 772 773 774 775
						}
					}
	
					// Postamble
					f_cf03Down();
				}
				
				/**
				 * @desc Check that the IUT sends a ContentInstance creation request when it is triggered
				 */
776 777 778 779 780 781 782 783 784 785
				testcase TC_AE_DMR_CRE_002() runs on Tester system AeSystem {
						
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
					
					v_cse1.start(f_AE_DMR_CRE_002());
					
					v_cse1.done;
				}

				function f_AE_DMR_CRE_002() runs on CseSimu {
786 787 788
	
					var template UtTriggerPrimitive v_utRequest := m_utCreateContentInstance;
					var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Fix #44  
Miguel Angel Reina Ortega committed
789
					var integer v_resourceIndex := -1;
Miguel Angel Reina Ortega's avatar
Fix #38  
Miguel Angel Reina Ortega committed
790 791 792
					var PrimitiveContent v_localResource;
					var integer v_containerIndex := -1;
					var template RequestPrimitive v_requestPrimitive := mw_createContentInstance;
793
					var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for ContentInstance to ";
794 795 796 797
	
					//Test component configuration
					f_cf03Up();
	
798
					//send triggering primitive to SUT
Miguel Angel Reina Ortega's avatar
Fix #47  
Miguel Angel Reina Ortega committed
799
					v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
800
					v_containerIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
801 802
					v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_containerIndex, -, -);
					v_requestPrimitive.to_ := v_utRequest.requestPrimitive.to_;
803
					f_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(v_containerIndex, -, -));
804 805 806 807 808 809
	
					//Test behavior
					tc_ac.start;
					alt{
	
						//receive MsgIn requestPrimitive
Miguel Angel Reina Ortega's avatar
Fix #38  
Miguel Angel Reina Ortega committed
810
						[] mcaPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
811
							tc_ac.stop;
812
							setverdict(pass, __SCOPE__ & " : ContentInstance creation request is accepted!!");
813
							v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
814
							//send back responsePrimitive
815
							f_send(e_mca_in_port, f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
816
						}
817
						[] mcaPortIn.receive(mw_request(mw_create)) -> value v_request {
818
							tc_ac.stop;
819
							setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
820
							f_send(e_mca_in_port, f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
821 822
						}
						[] tc_ac.timeout{
823
							setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
824 825 826 827 828 829 830 831
						}
					}
					
					// Postamble
					f_cf03Down();
				}
				
				/**
832
				 * @desc Check that the IUT sends a ContentInstance creation request with optional attribute ATTRIBUTE_NAME
833 834 835 836
				 */
				 
				 group g_AE_DMR_CRE_003 {
				 
837 838 839
					testcase TC_AE_DMR_CRE_003_CNF() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
840 841
						var template UtTriggerPrimitive v_utRequest := m_utCreateContentInstance;
						var template RequestPrimitive v_request := mw_createContentInstance;
842
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for ContentInstance containing attribute ContentInfo to ";
843
						v_utRequest.requestPrimitive.primitiveContent.contentInstance.contentInfo := "UNINITIALIZED";
844
						v_request.primitiveContent.contentInstance.contentInfo := complement("UNINITIALIZED");
845 846
						v_cse1.start(f_AE_DMR_CRE_003(v_utRequest,v_request,v_action));
						v_cse1.done;
847 848
					}
					
849 850 851
					testcase TC_AE_DMR_CRE_003_RN() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
852 853
						var template UtTriggerPrimitive v_utRequest := m_utCreateContentInstance;
						var template RequestPrimitive v_request := mw_createContentInstance;
854
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for ContentInstance containing attribute ResourceName to ";
855
						v_utRequest.requestPrimitive.primitiveContent.contentInstance.resourceName := "UNINITIALIZED";
856
						v_request.primitiveContent.contentInstance.resourceName := complement("UNINITIALIZED");
857 858
						v_cse1.start(f_AE_DMR_CRE_003(v_utRequest,v_request,v_action));
						v_cse1.done;
859 860
					}
					
861 862 863
					testcase TC_AE_DMR_CRE_003_ET() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
864 865
						var template UtTriggerPrimitive v_utRequest := m_utCreateContentInstance;
						var template RequestPrimitive v_request := mw_createContentInstance;
866
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for ContentInstance containing attribute ExpirationTime to";
867 868 869
						v_utRequest.requestPrimitive.primitiveContent.contentInstance.expirationTime := "20301231T012345";
						v_utRequest.forcedFields := {{name := "expirationTime", value_ := "UNINITIALIZED"}};
						v_request.primitiveContent.contentInstance.expirationTime := ?;//Check value other than "UNINITIALIZED", done by typing
870 871
						v_cse1.start(f_AE_DMR_CRE_003(v_utRequest,v_request,v_action));
						v_cse1.done;
872 873
					}
					
874 875 876
					testcase TC_AE_DMR_CRE_003_LBL() runs on Tester system AeSystem {
						
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
877 878
						var template UtTriggerPrimitive v_utRequest := m_utCreateContentInstance;
						var template RequestPrimitive v_request := mw_createContentInstance;
879
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for ContentInstance containing attribute Labels to ";