OneM2M_PermutationFunctions.ttcn 371 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/**
 *  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
 *
 */
module OneM2M_PermutationFunctions {

	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;
	import from XSD all;
	
	group AE {
		
		group General {
			
			group Create {
						
					function f_AE_GEN_CRE_001(PrimitiveScope p_primitiveScope) runs on CseSimu {
						
						var template UtTriggerPrimitive v_utRequest := m_utCreateContainer;
						var integer v_resourceIndex := -1;
						var MsgIn v_request;
37
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for container to ";
38 39
						
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
40
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
41 42 43 44 45 46
							stop;
						}

						f_cf03Up();
						
						//Send Trigger Message
47
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);
48
						f_sendUtPrimitive(v_utRequest, v_action & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope));
49 50 51
						
						tc_ac.start;
						alt {
52
							[] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.requestPrimitive.to_))) -> value v_request {
53
								tc_ac.stop;
54
								setverdict(pass, __SCOPE__ & " : Container creation request received successfuly");
55 56
								v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
								mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
57
							}
58
							[] mcaPortIn.receive(mw_request(mw_createContainer())) -> value v_request {
59
								tc_ac.stop;
60
								setverdict(fail, __SCOPE__ & " : Create Request with unexpected target");
61
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
62 63 64
								stop;
							}
							[] tc_ac.timeout {
65
								setverdict(fail, __SCOPE__ & " : No answer while creating resource");
66 67 68 69 70 71 72 73
								stop;
							}
						}
						
						// Postamble
						f_cf03Down();
					}
					function f_AE_GEN_CRE_002(PrimitiveScope p_primitiveScope) runs on CseSimu {
74
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
75
						var Integer v_resourceIndex := -1;
76
						var template UtTriggerPrimitive v_utRequest := m_utCreateContainer;
77
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for container to ";
78 79 80 81
						
						
						//Test Control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
82
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
83 84 85 86 87 88
							stop;
						}
	
						f_cf03Up();
	
						//Send Trigger Message
89
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);
90
						f_sendUtPrimitive(v_utRequest,v_action  & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope));
91 92 93 94
							
	
						tc_ac.start;
						alt {
95
							[] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.requestPrimitive.to_))) -> value v_request {
96
								tc_ac.stop;
97
								setverdict(pass, __SCOPE__ & " : Container creation request received successfuly");
98 99
								v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
								mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
100
							}
101
							[] mcaPortIn.receive(mw_request(mw_createContainer())) -> value v_request {
102
								tc_ac.stop;
103
								setverdict(fail, __SCOPE__ & " : Create Request with unexpected target");
104
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
105 106 107
								stop;
							}
							[] tc_ac.timeout {
108
								setverdict(fail, __SCOPE__ & " : No answer while creating resource");
109 110 111 112 113 114 115 116 117 118 119 120 121
								stop;
							}
						}
	
						// Postamble
						f_cf03Down();
					}
				
			} //end group Create
			
			group Update {
						
					function f_AE_GEN_UPD_001(PrimitiveScope p_primitiveScope) runs on CseSimu {
122
						var MsgIn v_request;
123
						var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
124
						var integer v_resourceIndex;
125
						var PrimitiveContent v_localResource;
126
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid UPDATE Request for container to ";
127 128 129
						
						
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
130
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
131 132 133 134 135 136
							stop;
						}
						
						f_cf03Up();
						
						//Send Trigger Message
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
137
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
138 139
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex, e_nonHierarchical, p_primitiveScope);
140
						f_sendUtPrimitive(v_utRequest,v_action  & f_getLocalResourceAddress(v_resourceIndex, e_nonHierarchical, p_primitiveScope));
141 142 143
						
						tc_ac.start;
						alt {
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
144
							[] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.requestPrimitive.to_))) -> value v_request {
145
								tc_ac.stop;
146
								setverdict(pass, __SCOPE__ & " : Container update request received successfuly");
147 148
								f_processUpdateRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
149
							}
150
							[] mcaPortIn.receive(mw_request(mw_updateContainer())) {
151
								tc_ac.stop;
152
								setverdict(fail, __SCOPE__ & " : Update Request with unexpected target");
153
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
154 155 156
								stop;
							}
							[] tc_ac.timeout {
157
								setverdict(fail, __SCOPE__ & " : No answer while updating resource");
158 159 160 161 162 163 164 165
								stop;
							}
						}
						
						// Postamble
						f_cf03Down();
					}
					function f_AE_GEN_UPD_002(PrimitiveScope p_primitiveScope) runs on CseSimu {
166
						var MsgIn v_request;
167
						var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
168
						var integer v_resourceIndex := -1;
169
						var PrimitiveContent v_localResource;
170
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid UPDATE Request for container to ";
171 172
						
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
173
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
174 175 176 177 178 179
							stop;
						}
	
						f_cf03Up();
	
						//Send Trigger Message
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
180
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
181 182
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex, e_hierarchical, p_primitiveScope);
183
						f_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(v_resourceIndex, e_hierarchical, p_primitiveScope));
184 185 186
								
						tc_ac.start;
						alt {
187
							[] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.requestPrimitive.to_))) -> value v_request {
188
								tc_ac.stop;
189
								setverdict(pass, __SCOPE__ & " : Container update request received successfuly");
190 191
								f_processUpdateRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
192
							}
193
							[] mcaPortIn.receive(mw_request(mw_updateContainer())) {
194
								tc_ac.stop;
195
								setverdict(fail, __SCOPE__ & " : Update Request with unexpected target");
196
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
197 198 199
								stop;
							}
							[] tc_ac.timeout {
200
								setverdict(fail, __SCOPE__ & " : No answer while updating resource");
201 202 203 204 205 206 207 208 209 210 211 212 213
								stop;
							}
						}
	
						// Postamble
						f_cf03Down();
					}
				
			} //end group Update
			
			group Retrieve {
						
					function f_AE_GEN_RET_001(PrimitiveScope p_primitiveScope) runs on CseSimu {
214
						var MsgIn v_request;
215 216
						var template UtTriggerPrimitive v_utRequest;
                        var integer v_resourceIndex := -1;
217
						var PrimitiveContent v_localResource;
218
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid RETRIEVE Request for container to ";
219 220
						
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
221
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
222 223 224 225 226 227
							stop;
						}
			
						f_cf03Up();
			
						//Send Trigger Message
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
228
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
229
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
230 231 232
						v_utRequest := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex, e_nonHierarchical, p_primitiveScope));
						f_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(v_resourceIndex, e_nonHierarchical, p_primitiveScope));
                        
233 234
						tc_ac.start;
						alt {
235
							[] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.requestPrimitive.to_))) -> value v_request {
236
								tc_ac.stop;
237
								setverdict(pass, __SCOPE__ & " : Container retrieve request received successfuly");
238 239
								f_processRetrieveRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
240
							}
241
							[] mcaPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request {
242
								tc_ac.stop;
243
								setverdict(fail, __SCOPE__ & " : Retrieve request with unexpected target");
244
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
245 246 247
								stop;
							}
							[] tc_ac.timeout {
248
								setverdict(fail, __SCOPE__ & " : No answer while retrieving resource");
249 250 251 252 253 254 255 256
								stop;
							}
						}
			
						// Postamble
						f_cf03Down();
					}
					function f_AE_GEN_RET_002(PrimitiveScope p_primitiveScope) runs on CseSimu {
257
						var MsgIn v_request;
258 259
						var template UtTriggerPrimitive v_utRequest;
                        var integer v_resourceIndex := -1;
260
						var PrimitiveContent v_localResource;
261
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid RETRIEVE Request for container to ";
262 263
						
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
264
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
265 266 267 268 269 270
							stop;
						}

						f_cf03Up();

						//Send Trigger Message
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
271
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
272
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
273
						v_utRequest := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex, e_hierarchical, p_primitiveScope));
274 275
                        f_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(v_resourceIndex, e_hierarchical, p_primitiveScope));
						
276 277
						tc_ac.start;
						alt {
278
							[] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.requestPrimitive.to_))) -> value v_request {
279
								tc_ac.stop;
280
								setverdict(pass, __SCOPE__ & " : Container retrieve request received successfuly");
281 282
								f_processRetrieveRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
283
							}
284
							[] mcaPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request {
285
								tc_ac.stop;
286
								setverdict(fail, __SCOPE__ & " : Retrieve request with unexpected target");
287
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
288 289 290
								stop;
							}
							[] tc_ac.timeout {
291
								setverdict(fail, __SCOPE__ & " : No answer while retrieving resource");
292 293 294 295 296 297 298 299 300 301 302 303 304
								stop;
							}
						}

						// Postamble
						f_cf03Down();
					}
	
			} //end group Retrieve
						
			group Delete {
						
					function f_AE_GEN_DEL_001(PrimitiveScope p_primitiveScope) runs on CseSimu {
305
						var MsgIn v_request;
306
						var template UtTriggerPrimitive v_utRequest := m_utDelete;
307 308
						var integer v_auxInteger;
						var PrimitiveContent v_localResource;
309
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid DELETE Request for container to ";
310 311

						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
312
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
313 314 315 316 317 318
							stop;
						}
			
						f_cf03Up();
			
						//Send Trigger Message
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
319
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
320
						v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
321
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope);
322
						f_sendUtPrimitive(v_utRequest,v_action  & f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope));
323 324 325
			
						tc_ac.start;
						alt {
326
							[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value v_request {
327
								tc_ac.stop;
328 329 330
								setverdict(pass, __SCOPE__ & " : Container delete request received successfuly");
								f_processDeleteRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
331
							}
332
							[] mcaPortIn.receive(mw_request(mw_delete(?))) -> value v_request {
333
								tc_ac.stop;
334
								setverdict(fail, __SCOPE__ & " : Delete request with unexpected target");
335
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
336 337 338
								stop;
							}
							[] tc_ac.timeout {
339
								setverdict(fail, __SCOPE__ & " : No answer while updating resource");
340 341 342 343 344 345 346 347
								stop;
							}
						}
			
						// Postamble
						f_cf03Down();
					}
					function f_AE_GEN_DEL_002(PrimitiveScope p_primitiveScope) runs on CseSimu {
348
						var MsgIn v_request;
349
						var template UtTriggerPrimitive v_utRequest := m_utDelete;
350 351
						var integer v_auxInteger;
						var PrimitiveContent v_localResource;
352
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid DELETE Request for container to ";
353 354
						
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
355
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
356 357 358 359 360
							stop;
						}

						f_cf03Up();

361
						//Send Trigger Message
362
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
363
						v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
364
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope);
365
						f_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope));
366 367 368 369
				

						tc_ac.start;
						alt {
370
							[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value v_request {
371
								tc_ac.stop;
372 373 374
								setverdict(pass, __SCOPE__ & " : Container delete request received successfuly");
								f_processDeleteRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
375
							}
376
							[] mcaPortIn.receive(mw_request(mw_delete(?))) -> value v_request {
377
								tc_ac.stop;
378
								setverdict(fail, __SCOPE__ & " : Delete request with unexpected target");
379
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
380 381 382
								stop;
							}
							[] tc_ac.timeout {
383
								setverdict(fail, __SCOPE__ & " : No answer while updating resource");
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
								stop;
							}
						}

						// Postamble
						f_cf03Down();
					}
	
			} //end group Delete
			
		}//end group General

		group Registration {
			
			group Create {
						
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
400
				   function f_AE_REG_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
401 402
	
						//primitives for mcaPortIn
403
					    var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
404 405 406
					    var integer v_parentIndex := -1;
					    var integer v_resourceIndex := -1;
					    var PrimitiveContent v_resource;
407 408 409 410 411
						var ResponsePrimitive v_responsePrimitive;
	
					   f_cf03Up();
	
					   //Send Trigger Message
412 413
					   p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
					   p_request.to_ := p_utRequest.requestPrimitive.to_;
414
					   f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(-, -, -));
415 416 417 418
	
					   //Test behavior
					   tc_ac.start;
					   alt{
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
419
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
420
							   tc_ac.stop;
421
							   setverdict(pass, __SCOPE__ & " : AE registration request is accepted!!");
422 423
							   v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
							
424
							   //send back responsePrimitive
425
							   mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
426
						   }
427
							[] mcaPortIn.receive(mw_request(mw_createAe())) -> value v_request {
428
							   tc_ac.stop;
429
							   setverdict(fail, __SCOPE__ & " : Unexpected AE registration request");
430
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
431 432
						   }
						   [] tc_ac.timeout{
433
							   setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
						   }
	
					   }
	
					   // Postamble
					   f_cf03Down();
			   		}
			
			} // End of subgroup Create
			
			group Delete {
			
			}// End Delete subgroup

		}//end Registration subgroup

		group Data_Management_and_Repository {
			
			group Create {
			
					function f_AE_DMR_CRE_003(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
455
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
456
						var integer v_resourceIndex := -1;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
457 458
						var PrimitiveContent v_localResource;
						var integer v_containerIndex := -1;
459
						
460 461 462
						//Test component configuration
						f_cf03Up();
	
463 464
						//send triggering
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
465
						v_containerIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
466 467
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_containerIndex, -, -);
						p_request.to_ := p_utRequest.requestPrimitive.to_;
468
						f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(v_containerIndex, -, -));
469 470 471 472 473 474
	
						//Test behavior
						tc_ac.start;
						alt{
	
							//receive MsgIn requestPrimitive
475
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
476
								tc_ac.stop;
477
								setverdict(pass, __SCOPE__ & " : ContentInstance creation request is accepted!!");
478
								v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
479
								//send back responsePrimitive
480
								mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
481 482
							}
	
483
							[] mcaPortIn.receive(mw_request(mw_create)) -> value v_request{
484
								tc_ac.stop;
485
								setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
486
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
487 488
							}
							[] tc_ac.timeout{
489
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
490 491 492 493 494 495 496
							}
						}
	
						// Postamble
						f_cf03Down();
					}
					function f_AE_DMR_CRE_004(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
497
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
498
						var integer v_resourceIndex := -1;
499
						
500 501 502 503
						//Test component configuration
						f_cf03Up();
	
						//send triggering primitive to SUT
504 505
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
						p_request.to_ := p_utRequest.requestPrimitive.to_;
506
						f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(-, -, -));
507 508 509 510 511 512
	
						//Test behavior
						tc_ac.start;
						alt{
	
							//receive MsgIn requestPrimitive
513
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
514
								tc_ac.stop;
515
								setverdict(pass, __SCOPE__ & " : Container creation request is accepted!!");
516
								v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
517
								//send back responsePrimitive
518
								mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
519
							}
520
							[] mcaPortIn.receive(mw_request(mw_create)) {
521
								tc_ac.stop;
522
								setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
523
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
524 525
							}
							[] tc_ac.timeout{
526
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
527 528 529 530 531 532 533 534 535 536 537
							}
						}
	
						// Postamble
						f_cf03Down();
					}
				 
			}//End of subgroup Create
			
			group Update {
				
538
				   function f_AE_DMR_UPD_001(template UtTriggerPrimitive p_utRequest, in universal charstring p_action, template RequestPrimitive p_expectedUpdateRequest) runs on CseSimu {
539 540 541
	
						//primitives for mcaPortIn
					   	var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
542
						var integer v_resourceIndex := -1;
543
					   	var PrimitiveContent v_localResource;
544
					   	
545 546 547
					   	f_cf03Up();
					   
					   	//Preamble
548
						
549 550
					   	//Send Tr
					    v_localResource := f_generateLocalResource(valueof(m_primitiveContentAe(m_contentCreateAe(omit, omit, omit, omit))), vc_cSEBaseIndex, int2);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
551 552
						v_resourceIndex := f_setLocalResource(v_localResource, int2, vc_cSEBaseIndex);
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
553
					   	f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(v_resourceIndex));
554 555 556 557 558 559 560
	
					   //Test behavior
					   
					   tc_ac.start;
					   alt{
							[] mcaPortIn.receive(mw_request(p_expectedUpdateRequest)) -> value v_request {
							   tc_ac.stop;
561
							   setverdict(pass, __SCOPE__ & " : AE update request is accepted!");
562 563 564
							   f_processUpdateRequestPrimitive(v_request.primitive.requestPrimitive);
							   mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
							}
565
							[] mcaPortIn.receive(mw_request(mw_update)) -> value v_request {
566
							   tc_ac.stop;
567
							   setverdict(fail, __SCOPE__ & " : Unexpected UPDATE request");
568
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
569 570
						   }
						   [] tc_ac.timeout{
571
							   setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
572 573 574 575 576 577 578 579 580
						   }
	
					   }
	
					   // Postamble
					   f_cf03Down();
					}
	
					function f_AE_DMR_UPD_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
581
						var MsgIn v_request;
582
						var PrimitiveContent v_localResource;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
583
						var integer v_resourceIndex := -1;
584 585 586 587

						//Test component configuration
						f_cf03Up();

588 589
						//send triggering 
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
590 591
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
592
						f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(v_resourceIndex));
593 594 595 596 597 598

						//Test behavior
						tc_ac.start;
						alt{

							//receive MsgIn requestPrimitive
599
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
600
								tc_ac.stop;
601
								setverdict(pass, __SCOPE__ & " : Container update request is accepted!!");
602 603
								f_processUpdateRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
604
							}
605
							[] mcaPortIn.receive(mw_request(mw_update)) {
606
								tc_ac.stop;
607
								setverdict(fail, __SCOPE__ & " : Unexpected UPDATE request");
608
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
609 610
							}
							[] tc_ac.timeout{
611
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
612 613 614 615 616 617 618 619 620 621 622
							}
						}

						// Postamble
						f_cf03Down();
					}

			}//End of subgroup Update

			group Retrieve {
				
623
					function f_AE_DMR_RET_001(ResourceType p_resourceType, in template (omit) PrimitiveContent p_primitiveContent, in universal charstring p_action) runs on CseSimu {
624 625
		
						//variables
626
						var template UtTriggerPrimitive v_utRequest;
627 628
						var MsgIn v_request;
						var ResponsePrimitive v_responsePrimitive;
629
						var PrimitiveContent v_localResource;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
630
						var integer v_resourceIndex := -1;
631
						
632 633 634
						//Test component configuration
						f_cf03Up();
		
635
						//send triggering message
636 637 638 639 640 641
					    if(p_resourceType != int5) {
					    	v_localResource := f_generateLocalResource(p_primitiveContent, vc_cSEBaseIndex, p_resourceType);
					    	v_resourceIndex := f_setLocalResource(v_localResource, p_resourceType, vc_cSEBaseIndex);
					    } else {
					    	v_resourceIndex := vc_cSEBaseIndex;
					    }
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
642
						v_utRequest := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex));
643
						f_sendUtPrimitive(v_utRequest,p_action & f_getLocalResourceAddress(v_resourceIndex));
644 645 646 647
						
						//Test behavior
						tc_ac.start;
						alt{
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
648
							[] mcaPortIn.receive(mw_request(mw_retrieve(f_getLocalResourceAddress(v_resourceIndex)))) -> value v_request {
649
								tc_ac.stop;
650
								setverdict(pass, __SCOPE__ & " : retrieve resource type request is accepted!!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
651
								v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
652
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
653
							}
654
							[] mcaPortIn.receive (mw_request(mw_retrieve(?))){
655
								tc_ac.stop;
656
								setverdict(fail, __SCOPE__ & " : Retrieve request for unexpected target");
657
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
658 659
							}
							[] tc_ac.timeout{
660
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
							}
						}
		
						// Postamble
						f_cf03Down();
					}
					

			}//End of subgroup Retrieve
			
			group Delete {
			
			}

		}//end DMR subgroup

		group Subscription_and_Notification {
			
			group Create {
				
					function f_AE_SUB_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
	
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
684 685 686
						var integer v_parentIndex := -1;
						var integer v_resourceIndex := -1;
						var PrimitiveContent v_resource;
687 688 689 690 691
						var ResponsePrimitive v_responsePrimitive;

						f_cf03Up();

						//send triggering primitive to SUT
692
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress();
693 694 695 696 697 698 699
						f_sendUtPrimitive(p_utRequest,p_action);

						//Test behavior
						tc_ac.start;
						alt{
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
								tc_ac.stop;
700
								setverdict(pass, __SCOPE__ & " : Subscription creation request is accepted!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
701
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
702
								v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
703 704
								v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);	
								v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
705
								//send back responsePrimitive
706
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
707 708 709
							}
							[] mcaPortIn.receive {
								tc_ac.stop;
710
								setverdict(fail, __SCOPE__ & " : Subscription creation request is rejected due to not including the optional attribute!");
711
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
712 713
							}
							[] tc_ac.timeout{
714
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 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
							}
						}

						// Postamble
						f_cf03Down();

					}
			
			}//End Create Group
			
			group Notify {
				
			}//End of Notify group


		}//end SUB subgroup


	}//end group AE
	
	
		
	group CSE {
		
		group Generic {
			
			group Create {
								
					function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
						v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
						v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
						
775
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
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 824 825 826 827 828 829 830 831 832 833 834
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_CRE_001				
				
					function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
						v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
						v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
												
835
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
836 837 838 839 840 841 842 843 844 845 846 847 848 849 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 883 884 885 886 887 888 889 890 891 892 893 894 895
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_CRE_002				
				
			} // end of group Create
			
			group Retrieve {

					function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
						
896
						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));
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 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_RET_001				
				
					function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
						
953
						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));tc_ac.start;
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 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 1018
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_RET_002				
				
			} // end of group Retrieve
			
			group Update {
								
					function f_CSE_GEN_UPD_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
						
						v_updateRequest.primitiveContent.container.labels := {"MyLabel"};
						
						v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
						v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
						
1019
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 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 1080 1081
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource updated using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_UPD_001				
				
					function f_CSE_GEN_UPD_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
						
						v_updateRequest.primitiveContent.container.labels := {"MyLabel"};
						
						v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
						v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
						
1082
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 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 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_UPD_002				
				
			} // end of group Update
			
			group Delete {

					function f_CSE_GEN_DEL_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
						
						v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)));
												
1146
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource deleted using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while deleting container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_DEL_001				
				
					function f_CSE_GEN_DEL_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
						
						v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)));
						
1206
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_DEL_002				
				
			} // end of group Delete
		
		} // end of group Generic
		
		group Registration {
			
			group Create{
				
					function f_CSE_REG_CRE_012(in template RequestPrimitive p_createAe) runs on AeSimu {
					
						//Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var ResourceType v_resourceType := int2;	//AE
										   
						// Test control
					
						// Test component configuration
						f_cf01Up(); 
						
						//Test Body
						
						v_request := valueof(p_createAe);
						v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
						
1259
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{
								tc_ac.stop;
								
								f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
								vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
								
								setverdict(pass, __SCOPE__ & ": AE creation successfull.");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating AE");
							}
						}
						
						//Postamble
						f_cse_postamble_deleteResources();
						
						// Tear down
						f_cf01Down();
					}
									
					function f_CSE_REG_CRE_013(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseSimu {
					
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var ResourceType v_resourceType := int16;	//remoteCSE
										   
						// Test control
					
						// Test component configuration
						f_cf04Up(); 
					
						// Test adapter configuration
					
						// Preamble
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(v_resourceType, p_requestPrimitive, -1);
					
1305
						mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1306 1307 1308 1309 1310
						tc_ac.start;
						alt {
							[] mccPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Accepted creation for resource type remoteCSE containing attribute " & p_optionalAttribute.name);
1311
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1312 1313 1314 1315
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
1316
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1317 1318 1319 1320
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Accepted creation for resource type remoteCSE without containing attribute " & p_optionalAttribute.name);
1321
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Rejected creation of resource type remoteCSE containing attribute " & p_optionalAttribute.name);
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE");
							}
						}	
								
						// Postamble
						f_cse_postamble_deleteResourcesCSE();
						
						// Tear down
						f_cf04Down();
																
					}//end f_CSE_REG_CRE_BV_013
					
					
					function f_CSE_REG_CRE_017(template RequestPrimitive p_createRequestPrimitive) runs on AeSimu {
						
						//Local variables
						var ResourceType v_resourceType := int2;   
						var RequestPrimitive v_request;
						
						// Test control

						// Test component configuration
						f_cf01Up();

						// Test adapter configuration

						// Preamble

						// Test Body
						v_request := f_getCreateRequestPrimitive(int2, p_createRequestPrimitive, -1);
						
1359
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386
						tc_ac.start;
						alt {
							 [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST
								 tc_ac.stop;
								 setverdict(pass, __SCOPE__ & ": Request successfully rejected");
							 }
							 [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { 
								 tc_ac.stop;
								 setverdict(fail, __SCOPE__ & ": Wrong response status code");
							 }
							 [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){
								 tc_ac.stop;
								 setverdict(fail, __SCOPE__ & ": Error, AE has been registered");
							 }
							 [] tc_ac.timeout {
								 setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							 }
						}	

						// Postamble
						f_cse_postamble_deleteResources();

						// Tear down
						f_cf01Down();
						
					}

1387
					function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
1388
	  
1389
						var MsgIn v_request;
1390 1391 1392
						var ResponsePrimitive v_responsePrimitive;
						
						//Test control
1393 1394
						if(not(PICS_MN_CSE or PICS_ASN_CSE)) {
							setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE or ASN-CSE to run this test case");
1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408
							stop;
						}

						//Test component configuration
						f_cf04Up();

						//send triggering primitive to SUT
						f_sendUtPrimitive(p_utRequest,p_action);

						//Test behavior
						tc_ac.start;
						alt{

							//receive MsgIn requestPrimitive
1409
							[] mccPortIn.receive(mw_request(p_request)) -> value v_request {
1410 1411 1412 1413
								tc_ac.stop;
								setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly");

								//set responseStatusCode back to SUT
1414
								v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));
1415 1416

								//send back responsePrimitive
1417
								mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435
							}
							[] mccPortIn.receive {
								tc_ac.stop;
								setverdict(fail, __SCOPE__&":INFO: Unexpected message received");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__&":INFO: No request received for creating resource type remoteCSE");
							}
						}

						// Postamble
						f_cse_postamble_deleteResourcesCSE();
	
						// Tear down
						f_cf04Down();
	
					}
					
1436
					function f_CSE_REG_CRE_028(RequestPrimitive p_request, template PrimitiveContent p_contentResponse) runs on CseSimu {
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452
						//Local variables
						var ResourceType v_resourceType := int16;	//remoteCSE	
						// Test control
	
						// Test component configuration
						f_cf04Up();
	
						// Test adapter configuration
	
						// Preamble
						
						
						//Test Body					
						vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse);
						
						//Check if the resource has been deleted or not
1453
						if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) {
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485
							setverdict(pass, __SCOPE__ & ":INFO: Resource created");
						} else {
							setverdict(fail, __SCOPE__ & ":INFO: Resource not created");
						}	
	
						// Postamble
						f_cse_postamble_deleteResourcesCSE();
	
						// Tear down
						f_cf04Down();
	
					}//end TC_CSE_REG_CRE_028
			
			}	//end group Create
			
			group Retrieve{
				
					function f_CSE_REG_RET_002(template PrimitiveContent p_contentResponse) runs on AeSimu {
						//Local variables
						 var MsgIn v_response;
						 var integer v_aeIndex := -1;
								   
						 // Test control

						 // Test component configuration
						 f_cf01Up();

						 // Test adapter configuration

						 // Preamble
						 v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
						 
1486
						 mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex)))));
1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531
						 tc_ac.start;
						 alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	

						// Postamble
						f_cse_postamble_deleteResources();

						// Tear down
						f_cf01Down();
					} //end f_CSE_REG_RET_002
					
					function f_CSE_REG_RET_004(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu {
						//Local variables
						 var MsgIn v_response;
						 var integer v_aeIndex := -1;
				   
						 // Test control

						 // Test component configuration
						 f_cf01Up();

						 // Test adapter configuration

						 // Preamble
						 v_aeIndex := f_cse_createResource(int2, p_createRequestPrimitive, -1);
		 
1532
						 mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)))));//TODO Maybe PX_SUPER_AE_ID
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576
						 tc_ac.start;
						 alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
							    setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	

						// Postamble
						f_cse_postamble_deleteResources();

						// Tear down
						f_cf01Down();
					} //end f_CSE_REG_RET_004
	
					function f_CSE_REG_RET_007(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on CseSimu {
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var ResourceType v_resourceType := int16;	//remoteCSE
						var template PrimitiveContent v_contentResponse;
 		
						// Test control

						// Test component configuration
						f_cf04Up();

						// Test adapter configuration

						// Preamble
1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599
						vc_remoteCseIndex := f_cse_registerRemoteCse(p_createRequestPrimitive);
						mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex)))));
					    tc_ac.start;
						alt {
							[] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute");
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630
							}
						
						//Postamble
  					    f_cse_postamble_deleteResourcesCSE();

						// Tear down
						f_cf04Down();
					} // f_CSE_REG_RET_007
							
			}//end group Retrieve
			
			group Update{
			
					function f_CSE_REG_UPD_002(template RequestPrimitive p_requestPrimitive) runs on CseSimu {
						//Local variables
					    var MsgIn v_response;
					    var RequestPrimitive v_request;
						var ResourceType v_resourceType := int16;	//remoteCSE		
						// Test control

						// Test component configuration
						f_cf04Up();

						// Test adapter configuration

						// Preamble
						vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);

						// Test Body
						v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive);
	
1631
						mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1632 1633 1634 1635
						tc_ac.start;
						alt {
							[] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
1636
								setverdict(pass, __SCOPE__ & ": Accepted update for resource type remoteCSE containing attribute ");
1637 1638 1639 1640 1641 1642 1643
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
1644
								setverdict(fail, __SCOPE__ & ": Accepted update for resource type remoteCSE without containing attribute ");
1645 1646 1647
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
1648
								setverdict(fail, __SCOPE__ & ": Rejected update of resource type remoteCSE containing attribute");
1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE");
							}
						}					    

						// Postamble
						f_cse_postamble_deleteResourcesCSE();

						// Tear down
						f_cf04Down();

					}//end f_CSE_REG_UPD_002
	
					function f_CSE_REG_UPD_003(template RequestPrimitive p_requestPrimitive, in AttributeList p_attribute) runs on CseSimu {
						// Local variables
						//Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var ResourceType v_resourceType := int16;	//remoteCSE
						var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE;
						var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request containing To set to " & PX_CSE1_ADDRESS & " and Content containing remoteCSE resource containing a valid attribute " & p_attribute[0];														// Test control
						if(not(PICS_MN_CSE)) {
							setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
							stop;
						}

						// Test component configuration
						f_cf04Up();

						// Test adapter configuration

						// Preamble
1682
						vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
1683 1684
						
						//Send Trigger Message
1685
					    v_utRequest.requestPrimitive.to_ := f_getResourceAddress();
1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725
					    f_sendUtPrimitive(v_utRequest, v_action);

						// Test Body
						v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive);

						tc_ac.start;
						alt {
							[] mccPortIn.receive(mw_request(v_request)) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Received request for updation for resource type remoteCSE containing attribute " & p_attribute[0]);
								f_setResource(v_request.primitiveContent,int16);
							}
							[] mccPortIn.receive {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error: Did not receive update request for resource type remoteCSE");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE");
							}
						}					    

						// Postamble
						f_cse_postamble_deleteResourcesCSE();

						// Tear down
						f_cf04Down();

					}//end f_CSE_REG_UPD_003
			    
			}// end group Update
			
			group Delete{
			
			
			}// end group Delete
	  	  	
		}//end Registration
		
		group Data_Management_and_Repository {
						
1726
			function f_CSE_DMR_001(template RequestPrimitive p_requestPrimitive) runs on CseSimu {
1727
    				
1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741
				// Local variables
				var integer v_aeIndex, v_remoteCseIndex, v_targetResourceIndex := -1;
				var ResponseStatusCode v_responseStatusCode := int2000;   
				var XSD.ID v_targetResourceAddress;
				
				// Test control

				// Test component configuration
				f_cf02UpCseSimuMaster();

				// Test adapter configuration

				// Preamble
				
1742
				v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()}));
1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778
				
				vc_ae1.start(f_cse_preamble_registerAe());				
				vc_ae1.done;
				
				//Creating resource in Hosting CSE
				v_targetResourceIndex := f_generateAndSetLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
				
				// Test Body
				v_aeIndex := f_getLatestResource(vc_ae1);
				
				v_targetResourceAddress := f_getLocalResourceAddress(v_targetResourceIndex, PX_ADDRESSING_METHOD, e_spRelative);
				p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
				p_requestPrimitive.to_ := v_targetResourceAddress;
				
				if(valueof(p_requestPrimitive.operation) == int1) {
					v_responseStatusCode := int2001;
				} else if(valueof(p_requestPrimitive.operation) == int2) {
					v_responseStatusCode := int2000;
				} else if(valueof(p_requestPrimitive.operation) == int3) {
					v_responseStatusCode := int2004;
				} else if(valueof(p_requestPrimitive.operation) == int4) {
					v_responseStatusCode := int2002;
				}
				vc_ae1.start(f_cse_operationResource(p_requestPrimitive));
				
				tc_ac.start;
				alt {
					[v_responseStatusCode == int2001] mccPortIn.receive(mw_request(mw_create(-, v_targetResourceAddress))) -> value vc_request {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Request primitive retargeted successfully");
						f_processCreateRequestPrimitive(vc_request.primitive.requestPrimitive);
						mccPortIn.send(m_response(vc_response.primitive.responsePrimitive));
					}
					[v_responseStatusCode == int2000] mccPortIn.receive(mw_request(mw_retrieve(v_targetResourceAddress))) -> value vc_request {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Request primitive retargeted successfully");
1779
						f_processRetrieveRequestPrimitive(vc_request.primitive.requestPrimitive);
1780 1781 1782 1783 1784
						mccPortIn.send(m_response(vc_response.primitive.responsePrimitive));
					}
					[v_responseStatusCode == int2004] mccPortIn.receive(mw_request(mw_update(-, v_targetResourceAddress))) -> value vc_request {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Request primitive retargeted successfully");
1785
						f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive);
1786 1787 1788 1789 1790
						mccPortIn.send(m_response(vc_response.primitive.responsePrimitive));
					}
					[v_responseStatusCode == int2002] mccPortIn.receive(mw_request(mw_delete(v_targetResourceAddress))) -> value vc_request {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Request primitive retargeted successfully");
1791
						f_processDeleteRequestPrimitive(vc_request.primitive.requestPrimitive);
1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814
						mccPortIn.send(m_response(vc_response.primitive.responsePrimitive));
					}
					[] mccPortIn.receive(mw_request(?)) -> value vc_request {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong request received");
						mccPortIn.send(m_response(m_responsePrimitive(int4000, vc_request.primitive.requestPrimitive.requestIdentifier)));
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retargeting request");
					}
				}	
				
				f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);

				// Postamble
				f_cse_postamble_deleteResourcesCSE();

				// Tear down
				f_cf02DownCseSimuMaster();
				
			}//end f_CSE_DMR_001

			function f_CSE_DMR_002(template RequestPrimitive p_requestPrimitive) runs on AeSimu {
1815
    				
1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831
				// Local variables
				var integer v_aeIndex, v_cseBaseIndex, v_targetResourceIndex := -1;
				var ResponseStatusCode v_responseStatusCode := int2000;   
				var XSD.ID v_targetResourceAddress;
				
				// Test control

				// Test component configuration
				f_cf02Up();

				// Test adapter configuration

				// Preamble
				
				v_cseBaseIndex := f_getLatestLocalResourceIndex(vc_cse1);

1832
				vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()})));
1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853
				f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
				
				v_aeIndex := f_cse_preamble_registerAe();				
				
				//Creating resource in Hosting CSE
				vc_cse1.start(f_generateAndSetLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), v_cseBaseIndex, int3));
				vc_cse1.done;
				
				// Test Body

				v_targetResourceAddress := f_getLatestLocalResourceAddress(vc_cse1, PX_ADDRESSING_METHOD, e_spRelative);
				p_requestPrimitive.to_ := v_targetResourceAddress;
				p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
				
				v_targetResourceIndex := f_getLatestLocalResourceIndex(vc_cse1);
				
				if(valueof(p_requestPrimitive.operation) == int1) {
					v_responseStatusCode := int2001;
					vc_cse1.start(f_cse_createResourceHandler(mw_create(-, v_targetResourceAddress )));
				} else if(valueof(p_requestPrimitive.operation) == int2) {
					v_responseStatusCode := int2000;
1854
					vc_cse1.start(f_cse_retrieveResourceHandler(v_targetResourceIndex));
1855 1856
				} else if(valueof(p_requestPrimitive.operation) == int3) {
					v_responseStatusCode := int2004;
1857
					vc_cse1.start(f_cse_updateResourceHandler(v_targetResourceIndex));
1858 1859
				} else if(valueof(p_requestPrimitive.operation) == int4) {
					v_responseStatusCode := int2002;
1860
					vc_cse1.start(f_cse_deleteResourceHandler(v_targetResourceIndex));
1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916
				}

				mcaPort.send(f_getMsgOutPrimitive(m_request(valueof(p_requestPrimitive))));
				tc_ac.start;
				alt {
					[] mcaPort.receive(mw_response(mw_responsePrimitive(v_responseStatusCode))) -> value vc_response {
						tc_ac.stop;
						setverdict(pass, __SCOPE__ & ": Request primitieve retargeted successfully");
					}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Wrong response status code");
						}
					[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
						tc_ac.stop;
						setverdict(fail, __SCOPE__ & ": Error while retargeting request");
					}
					[] tc_ac.timeout {
						setverdict(fail, __SCOPE__ & ": No answer while retargeting request");
					}
				}	
				
				f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);

				// Postamble
				f_cse_postamble_deleteResources();

				// Tear down
				f_cf02Down();
				
			}//end f_CSE_DMR_002

			group Create {	
				
				function f_CSE_DMR_CRE_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on AeSimu return ResponsePrimitive {
				
					// Local variables
					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_parentIndex := -1;
					var integer v_resourceIndex := -1;
					var integer v_ae2Index := -1;
					var integer v_acpAuxIndex := -1;
					var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"};
										   
					// Test control
				
					// Test component configuration
					f_cf01Up(true);
					
					// Test adapter configuration
				
					// Preamble
					
					if(ispresent(p_parentRequestPrimitive)) {
						if(match(int23, p_parentRequestPrimitive.resourceType)){
1917
							vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
1918
							f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
1919
							
1920
							vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred
1921
							f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
1922
							
1923
							v_ae2Index := f_getResource(vc_ae2);
1924
							p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
1925 1926
							vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
						}
1927 1928 1929
						if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){
						
							f_cse_preamble_registerAe();
1930 1931
						
						}
1932
						v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex);
1933 1934
						
						
1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991
						
					} else {//Resource under CSEBase
					
						if(p_resourceType != int1) {
												
							v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -);
											
							p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID});
						}
						
						if(ischosen(p_requestPrimitive.primitiveContent.group_)){
						
							f_cse_preamble_registerAe();
						
						}
											
					}															
									
					// Test Body
					
					if(match(int23, p_requestPrimitive.resourceType)){
						vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
						f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
						vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred
						f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
						v_ae2Index := f_getResource(vc_ae2);
						p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; 
						vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
					}
					
					v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
					
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
							f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
							v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
						}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Wrong response status code");
							}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
						}
					}	
					
					f_checkAeSimuStatus();
								
					//Check to see if the resource is present or not
1992
					if (f_cse_isResourcePresent(v_resourceIndex)){
1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006
						setverdict(pass, __SCOPE__ & ":INFO: Resource created");
					} else {
						setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
					}
								
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
					
					return vc_response.primitive.responsePrimitive;
					    				
				}//end f_CSE_DMR_CRE_001
2007
					
2008
					function f_CSE_DMR_CRE_001_cseSimu(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, ResourceType p_parentResourceType := int2, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on CseSimu{
2009
    				
2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_parentIndex := -1;
						var integer v_resourceIndex := -1;
						var integer v_ae1Index := -1;
						var integer v_acpAuxIndex := -1;
						var PoaList v_poaList := {"http://" & PX_AE1_ADDRESS & "/"};
										   
						// Test control
				
						// Test component configuration
						f_cf02UpCseSimuMaster();
					
						// Test adapter configuration
				
						// Preamble
						vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
2028
						
2029 2030 2031 2032 2033 2034 2035 2036 2037
						if(match(int23, p_resourceType)){
							vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
							f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
							vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered
							f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
							v_ae1Index := f_getResource(vc_ae1);
							p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getRes