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

						f_cf03Up();

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

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

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

						f_cf03Up();

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

						tc_ac.start;
						alt {
369
							[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value v_request {
370
								tc_ac.stop;
371 372 373
								setverdict(pass, __SCOPE__ & " : Container delete request received successfuly");
								f_processDeleteRequestPrimitive(v_request.primitive.requestPrimitive);
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
374
							}
375
							[] mcaPortIn.receive(mw_request(mw_delete(?))) -> value v_request {
376
								tc_ac.stop;
377
								setverdict(fail, __SCOPE__ & " : Delete request with unexpected target");
378
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
379 380 381
								stop;
							}
							[] tc_ac.timeout {
382
								setverdict(fail, __SCOPE__ & " : No answer while updating resource");
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398
								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
399
				   function f_AE_REG_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
400 401
	
						//primitives for mcaPortIn
402
					    var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
403 404 405
					    var integer v_parentIndex := -1;
					    var integer v_resourceIndex := -1;
					    var PrimitiveContent v_resource;
406 407 408 409 410
						var ResponsePrimitive v_responsePrimitive;
	
					   f_cf03Up();
	
					   //Send Trigger Message
411 412
					   p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
					   p_request.to_ := p_utRequest.requestPrimitive.to_;
413
					   f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(-, -, -));
414 415 416 417
	
					   //Test behavior
					   tc_ac.start;
					   alt{
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
418
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
419
							   tc_ac.stop;
420
							   setverdict(pass, __SCOPE__ & " : AE registration request is accepted!!");
421 422
							   v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
							
423
							   //send back responsePrimitive
424
							   mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
425
						   }
426
							[] mcaPortIn.receive(mw_request(mw_createAe())) -> value v_request {
427
							   tc_ac.stop;
428
							   setverdict(fail, __SCOPE__ & " : Unexpected AE registration request");
429
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
430 431
						   }
						   [] tc_ac.timeout{
432
							   setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
						   }
	
					   }
	
					   // 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 {
454
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
455
						var integer v_resourceIndex := -1;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
456 457
						var PrimitiveContent v_localResource;
						var integer v_containerIndex := -1;
458
						
459 460 461
						//Test component configuration
						f_cf03Up();
	
462 463
						//send triggering
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
464
						v_containerIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
465 466
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_containerIndex, -, -);
						p_request.to_ := p_utRequest.requestPrimitive.to_;
467
						f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(v_containerIndex, -, -));
468 469 470 471 472 473
	
						//Test behavior
						tc_ac.start;
						alt{
	
							//receive MsgIn requestPrimitive
474
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
475
								tc_ac.stop;
476
								setverdict(pass, __SCOPE__ & " : ContentInstance creation request is accepted!!");
477
								v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
478
								//send back responsePrimitive
479
								mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
480 481
							}
	
482
							[] mcaPortIn.receive(mw_request(mw_create)) -> value v_request{
483
								tc_ac.stop;
484
								setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
485
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
486 487
							}
							[] tc_ac.timeout{
488
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
489 490 491 492 493 494 495
							}
						}
	
						// 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 {
496
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
497
						var integer v_resourceIndex := -1;
498
						
499 500 501 502
						//Test component configuration
						f_cf03Up();
	
						//send triggering primitive to SUT
503 504
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
						p_request.to_ := p_utRequest.requestPrimitive.to_;
505
						f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(-, -, -));
506 507 508 509 510 511
	
						//Test behavior
						tc_ac.start;
						alt{
	
							//receive MsgIn requestPrimitive
512
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
513
								tc_ac.stop;
514
								setverdict(pass, __SCOPE__ & " : Container creation request is accepted!!");
515
								v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);	
516
								//send back responsePrimitive
517
								mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
518
							}
519
							[] mcaPortIn.receive(mw_request(mw_create)) {
520
								tc_ac.stop;
521
								setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
522
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
523 524
							}
							[] tc_ac.timeout{
525
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
526 527 528 529 530 531 532 533 534 535 536
							}
						}
	
						// Postamble
						f_cf03Down();
					}
				 
			}//End of subgroup Create
			
			group Update {
				
537
				   function f_AE_DMR_UPD_001(template UtTriggerPrimitive p_utRequest, in universal charstring p_action, template RequestPrimitive p_expectedUpdateRequest) runs on CseSimu {
538 539 540
	
						//primitives for mcaPortIn
					   	var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
541
						var integer v_resourceIndex := -1;
542
					   	var PrimitiveContent v_localResource;
543
					   	
544 545 546
					   	f_cf03Up();
					   
					   	//Preamble
547
						
548 549
					   	//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
550 551
						v_resourceIndex := f_setLocalResource(v_localResource, int2, vc_cSEBaseIndex);
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
552
					   	f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(v_resourceIndex));
553 554 555 556 557 558 559
	
					   //Test behavior
					   
					   tc_ac.start;
					   alt{
							[] mcaPortIn.receive(mw_request(p_expectedUpdateRequest)) -> value v_request {
							   tc_ac.stop;
560
							   setverdict(pass, __SCOPE__ & " : AE update request is accepted!");
561 562 563
							   f_processUpdateRequestPrimitive(v_request.primitive.requestPrimitive);
							   mcaPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
							}
564
							[] mcaPortIn.receive(mw_request(mw_update)) -> value v_request {
565
							   tc_ac.stop;
566
							   setverdict(fail, __SCOPE__ & " : Unexpected UPDATE request");
567
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
568 569
						   }
						   [] tc_ac.timeout{
570
							   setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
571 572 573 574 575 576 577 578 579
						   }
	
					   }
	
					   // 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 {
580
						var MsgIn v_request;
581
						var PrimitiveContent v_localResource;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
582
						var integer v_resourceIndex := -1;
583 584 585 586

						//Test component configuration
						f_cf03Up();

587 588
						//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
589 590
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
591
						f_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(v_resourceIndex));
592 593 594 595 596 597

						//Test behavior
						tc_ac.start;
						alt{

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

						// Postamble
						f_cf03Down();
					}

			}//End of subgroup Update

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

						f_cf03Up();

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

						//Test behavior
						tc_ac.start;
						alt{
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
								tc_ac.stop;
699
								setverdict(pass, __SCOPE__ & " : Subscription creation request is accepted!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
700
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
701
								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
702 703
								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));
704
								//send back responsePrimitive
705
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
706 707 708
							}
							[] mcaPortIn.receive {
								tc_ac.stop;
709
								setverdict(fail, __SCOPE__ & " : Subscription creation request is rejected due to not including the optional attribute!");
710
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
711 712
							}
							[] tc_ac.timeout{
713
								setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
714 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
							}
						}

						// 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);
						
774
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833
						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);
												
834
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
835 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
						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;
						
895
						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));
896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951
						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;
						
952
						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));tc_ac.start;
953 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
						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);
						
1018
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
1019 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
						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);
						
1081
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
1082 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
						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)));
												
1145
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1146 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
						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)));
						
1205
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1206 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
						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);
						
1258
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1259 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
						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);
					
1304
						mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1305 1306 1307 1308 1309
						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);
1310
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1311 1312 1313 1314
							}
							[] 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");
1315
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1316 1317 1318 1319
							}
							[] 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);
1320
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1321 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
							}
							[] 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);
						
1358
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1359 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
						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();
						
					}

1386
					function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
1387
	  
1388
						var MsgIn v_request;
1389 1390 1391
						var ResponsePrimitive v_responsePrimitive;
						
						//Test control
1392 1393
						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");
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407
							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
1408
							[] mccPortIn.receive(mw_request(p_request)) -> value v_request {
1409 1410 1411 1412
								tc_ac.stop;
								setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly");

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

								//send back responsePrimitive
1416
								mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434
							}
							[] 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();
	
					}
					
1435
					function f_CSE_REG_CRE_028(RequestPrimitive p_request, template PrimitiveContent p_contentResponse) runs on CseSimu {
1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451
						//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
1452
						if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) {
1453 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
							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);
						 
1485
						 mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex)))));
1486 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
						 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);
		 
1531
						 mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)))));//TODO Maybe PX_SUPER_AE_ID
1532 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
						 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
1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598
						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");
							}
1599 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
							}
						
						//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);
	
1630
						mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1631 1632 1633 1634
						tc_ac.start;
						alt {
							[] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
1635
								setverdict(pass, __SCOPE__ & ": Accepted update for resource type remoteCSE containing attribute ");
1636 1637 1638 1639 1640 1641 1642
							}
							[] 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;
1643
								setverdict(fail, __SCOPE__ & ": Accepted update for resource type remoteCSE without containing attribute ");
1644 1645 1646
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
1647
								setverdict(fail, __SCOPE__ & ": Rejected update of resource type remoteCSE containing attribute");
1648 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
							}
							[] 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
1681
						vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
1682 1683
						
						//Send Trigger Message
1684
					    v_utRequest.requestPrimitive.to_ := f_getResourceAddress();
1685 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 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748
					    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 {
						
			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)){
1749
								vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
1750 1751
								f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
								
1752
								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
1753 1754
								f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
								
1755
								v_ae2Index := f_getResourceFromAeSimu(vc_ae2);
1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787
								p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
								vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
							}
							if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){
							
								f_cse_preamble_registerAe();
							
							}
							v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex);
							
							
							
						} else {//Resource under CSEBase
						
							if(p_resourceType != int1) {
													
								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)){
1788
							vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
1789
							f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
1790
							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
1791
							f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
1792
							v_ae2Index := f_getResourceFromAeSimu(vc_ae2);
1793 1794 1795 1796 1797 1798
							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);
						
1799
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823
						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
1824
						if (f_cse_isResourcePresent(v_resourceIndex)){
1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861
							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
					
					function f_CSE_DMR_CRE_001_cseSimu(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseSimu 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_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);
							
    						if(match(int23, p_resourceType)){
1862
    							vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
1863
								f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
1864
								vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered
1865
								f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
1866
								v_ae1Index := f_getResourceFromAeSimu(vc_ae1);
1867 1868 1869 1870 1871 1872 1873 1874
								p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)}; 
								vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
							}
							
							// Test Body
    					
							v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, vc_remoteCseIndex);
						
1875
							mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899
							tc_ac.start;
							alt {
								[] mccPort.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, vc_remoteCseIndex);
								}
								[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
									tc_ac.stop;
									setverdict(fail, __SCOPE__ & ": Wrong response status code");
									}
								[] mccPort.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_checkCseSimuStatus();
    								
							//Check to see if the resource is present or not
1900
							if (f_cse_isResourcePresent_cseSimu(v_resourceIndex)){
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915
								setverdict(pass, __SCOPE__ & ":INFO: Resource created");
							} else {
								setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
							}
    								
							// Postamble
							f_cse_postamble_deleteResourcesCSE();
						
							// Tear down
							f_cf02DownCseSimuMaster();
						
							return vc_response.primitive.responsePrimitive;
    					    				
						}//end f_CSE_DMR_CRE_001_cseSimu
    									
1916
					function f_CSE_DMR_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive {
1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939
				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_ae2Index := -1;
						var integer v_resourceIndex := -1;
										   
						// Test control
				
						// Test component configuration
						f_cf01Up(true);
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 
						
						f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
									
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
						
1940
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964
						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_aeIndex);
							}
							[] 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
1965
						if(f_cse_isResourcePresent(v_resourceIndex)){
1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979
							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_002
					
1980
					function f_CSE_DMR_CRE_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
						var integer v_ae2Index := -1;
    										   
						// Test control
    				
						// Test component configuration
						f_cf01Up(true); 
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi)
						
						f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
						
						v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); 	
						
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
2003
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
2004 2005 2006
  					    						    									
						// Test Body
						v_request.requestIdentifier := "Existing resource";
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
2007 2008 2009 2010
						
						if(p_resourceType == int23){
							vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
						}
2011
    					
2012
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Resource already exists");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating an already existing resource");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Creating a resource that already exists");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
    					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_CRE_003
    				
2040
					function f_CSE_DMR_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {
2041 2042 2043 2044 2045 2046 2047 2048 2049