OneM2M_PermutationFunctions.ttcn 251 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 37 38 39
/**
 *  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 ResponsePrimitive v_responsePrimitive;
						var template UtTriggerPrimitive v_utRequest := m_utCreateContainer;
						var UtTriggerAckPrimitive v_trigger_response;
						var integer v_parentIndex := -1;
						var integer v_resourceIndex := -1;
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
40
						var PrimitiveContent v_resource;
41
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid CREATE Request for container containing To set to " & f_getLocalResourceAddress(0, e_nonHierarchical, p_primitiveScope);
42 43 44 45 46 47 48 49 50
						
						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;
						}

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

						f_cf03Up();

						//Send Trigger Message
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
300
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
301 302
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						v_utRequestTemplate := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex, e_hierarchical, p_primitiveScope));
303 304 305 306 307
                        v_utRequest := valueof(v_utRequestTemplate);
						f_sendUtPrimitive(v_utRequest,v_action);

						tc_ac.start;
						alt {
308
							[] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.requestPrimitive.to_))) -> value (v_request) {
309 310
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
311 312
								v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
								v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
313
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
314 315 316 317
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while retrieving container");
318
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
								stop;
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__, " : No answer while retrieving resource");
								stop;
							}
						}

						// Postamble
						f_cf03Down();
					}
	
			} //end group Retrieve
						
			group Delete {
						
					function f_AE_GEN_DEL_001(PrimitiveScope p_primitiveScope) runs on CseSimu {
336
						var MsgIn v_request;
337
						var ResponsePrimitive v_responsePrimitive;
338
						var template UtTriggerPrimitive v_utRequest := m_utDelete;
339 340 341
						var UtTriggerAckPrimitive v_trigger_response;
						var integer v_auxInteger;
						var PrimitiveContent v_localResource;
342
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);
343 344 345 346 347 348 349 350 351

						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;
						}
			
						f_cf03Up();
			
						//Send Trigger Message
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
352
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
353
						v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
354
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope);
355 356 357 358
						f_sendUtPrimitive(v_utRequest,v_action);
			
						tc_ac.start;
						alt {
359
							[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value (v_request) {
360 361
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container update request received successfuly");
362
								v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));
363
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
364 365 366 367
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while updating container");
368
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
369 370 371 372 373 374
								stop;
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__, " : No answer while updating resource");
								stop;
							}
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
375 376
						}" &Conflicts in index. Try without --index.
						"
377 378 379 380 381
			
						// Postamble
						f_cf03Down();
					}
					function f_AE_GEN_DEL_002(PrimitiveScope p_primitiveScope) runs on CseSimu {
382
						var MsgIn v_request;
383
						var ResponsePrimitive v_responsePrimitive;
384
						var template UtTriggerPrimitive v_utRequest := m_utDelete;
385 386 387
						var UtTriggerAckPrimitive v_trigger_response;
						var integer v_auxInteger;
						var PrimitiveContent v_localResource;
388
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);
389 390 391 392 393 394 395 396
						
						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;
						}

						f_cf03Up();

Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
397
						//Send Trigger Mesf_generateLocalResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
398
						v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
399
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope);
400 401 402 403 404
						f_sendUtPrimitive(v_utRequest,v_action);
				

						tc_ac.start;
						alt {
405
							[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value (v_request) {
406 407
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container update request received successfuly");
408
								v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));
409
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
410 411 412 413
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while updating container");
414
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
								stop;
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__, " : No answer while updating resource");
								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
435
				   function f_AE_REG_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
436 437
	
						//primitives for mcaPortIn
438
					    var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
439 440 441
					    var integer v_parentIndex := -1;
					    var integer v_resourceIndex := -1;
					    var PrimitiveContent v_resource;
442 443 444 445 446
						var ResponsePrimitive v_responsePrimitive;
	
					   f_cf03Up();
	
					   //Send Trigger Message
447 448
					   p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
					   p_request.to_ := p_utRequest.requestPrimitive.to_;
449 450 451 452 453
					   f_sendUtPrimitive(p_utRequest,p_action);
	
					   //Test behavior
					   tc_ac.start;
					   alt{
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
454
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
455 456
							   tc_ac.stop;
							   setverdict(pass, __SCOPE__, " : AE registration request is accepted!!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
457
							   v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
458
							   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
459 460 461
							   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));

462
							   //send back responsePrimitive
463
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
464 465 466 467
						   }
							[] mcaPortIn.receive(mw_request(mw_createAe(*,?,m_contentCreateAe_Invalid))) -> value v_request {
							   tc_ac.stop;
							   setverdict(fail, __SCOPE__, " : AE registration request is rejected due to not including the optional attribute!");
468
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
						   }
						   [] tc_ac.timeout{
							   setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
						   }
	
					   }
	
					   // 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 {
493
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
494 495 496
						var integer v_parentIndex := -1;
						var integer v_resourceIndex := -1;
						var PrimitiveContent v_resource;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
497 498
						var PrimitiveContent v_localResource;
						var integer v_containerIndex := -1;
499 500 501 502 503
						var ResponsePrimitive v_responsePrimitive;
	
						//Test component configuration
						f_cf03Up();
	
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
504
						//send triggeringf_generateLocalResourcelocalResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
505
						v_containerIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
506 507
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_containerIndex, -, -);
						p_request.to_ := p_utRequest.requestPrimitive.to_;
508 509 510 511 512 513 514
						f_sendUtPrimitive(p_utRequest,p_action);
	
						//Test behavior
						tc_ac.start;
						alt{
	
							//receive MsgIn requestPrimitive
515
							[] mcaPortIn.receive(mw_request(p_request)) -> value (v_request) {
516 517
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : ContentInstance creation request is accepted!!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
518
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
519
								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
520 521 522
								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));

523
								//send back responsePrimitive
524
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
525 526 527 528 529
							}
	
							[] mcaPortIn.receive {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : ContentInstance creation request is rejected due to not including the attribute!");
530
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
531 532 533 534 535 536 537 538 539 540 541
							}
	
							[] tc_ac.timeout{
								setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
							}
						}
	
						// 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 {
542
						var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
543 544 545
						var integer v_parentIndex := -1;
						var integer v_resourceIndex := -1;
						var PrimitiveContent v_resource;
546 547 548 549 550 551
						var ResponsePrimitive v_responsePrimitive;
	
						//Test component configuration
						f_cf03Up();
	
						//send triggering primitive to SUT
552 553
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
						p_request.to_ := p_utRequest.requestPrimitive.to_;
554 555 556 557 558 559 560
						f_sendUtPrimitive(p_utRequest,p_action);
	
						//Test behavior
						tc_ac.start;
						alt{
	
							//receive MsgIn requestPrimitive
561
							[] mcaPortIn.receive(mw_request(p_request)) -> value (v_request) {
562 563
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container creation request is accepted!!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
564
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
565
								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
566 567
								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));
568 569
	
								//send back responsePrimitive
570
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
571 572 573 574
							}
							[] mcaPortIn.receive {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Container creation request is rejected due to not including the attribute!");
575
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
576 577 578 579 580 581 582 583 584 585 586 587 588 589
							}
							[] tc_ac.timeout{
								setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
							}
						}
	
						// Postamble
						f_cf03Down();
					}
				 
			}//End of subgroup Create
			
			group Update {
				
590
				   function f_AE_DMR_UPD_001(template UtTriggerPrimitive p_utRequest, in universal charstring p_action, template RequestPrimitive p_expectedUpdateRequest) runs on CseSimu {
591 592 593
	
						//primitives for mcaPortIn
					   	var MsgIn v_request;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
594
						var integer v_resourceIndex := -1;
595
					   	var PrimitiveContent v_localResource;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
596
					   	var ResponsePrimitive v_responsePrimitive;
597 598 599 600
	
					   	f_cf03Up();
					   
					   	//Preamble
601
						
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
602
					   	//Send Trf_generateLocalResourcelResource := f_ae_generateLocalResource(valueof(m_primitiveContentAe(m_contentCreateAe(omit, omit, omit, omit))), vc_cSEBaseIndex, int2);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
603 604
						v_resourceIndex := f_setLocalResource(v_localResource, int2, vc_cSEBaseIndex);
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
605
					   	f_sendUtPrimitive(p_utRequest,p_action);
606 607 608 609 610 611 612 613
	
					   //Test behavior
					   
					   tc_ac.start;
					   alt{
							[] mcaPortIn.receive(mw_request(p_expectedUpdateRequest)) -> value v_request {
							   tc_ac.stop;
							   setverdict(pass, __SCOPE__, " : AE update request is accepted!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
614
							   v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
615
							   f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
616
							   v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
617
							   mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
618 619 620 621
						   }
							[] mcaPortIn.receive(mw_request(?)) -> value v_request {
							   tc_ac.stop;
							   setverdict(fail, __SCOPE__, " : AE update request is rejected due to not including the optional attribute!");
622
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
623 624 625 626 627 628 629 630 631 632 633 634
						   }
						   [] tc_ac.timeout{
							   setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
						   }
	
					   }
	
					   // 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 {
635
						var MsgIn v_request;
636
						var ResponsePrimitive v_responsePrimitive;
637
						var PrimitiveContent v_localResource;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
638
						var integer v_resourceIndex := -1;
639 640 641 642

						//Test component configuration
						f_cf03Up();

Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
643
						//send triggering f_generateLocalResourceocalResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
644 645
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
646 647 648 649 650 651 652
						f_sendUtPrimitive(p_utRequest,p_action);

						//Test behavior
						tc_ac.start;
						alt{

							//receive MsgIn requestPrimitive
653
							[] mcaPortIn.receive(mw_request(p_request)) -> value (v_request) {
654 655
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container update request is accepted!!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
656
								v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
657
								f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
658
								v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
659
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
660 661 662 663 664
							}

							[] mcaPortIn.receive {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Container update request is rejected due to not including the attribute!");
665
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680
							}

							[] tc_ac.timeout{
								setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
							}
						}

						// Postamble
						f_cf03Down();
					}

			}//End of subgroup Update

			group Retrieve {
				
681
					function f_AE_DMR_RET_001(ResourceType p_resourceType, template PrimitiveContent p_primitiveContent, in universal charstring p_action) runs on CseSimu {
682 683
		
						//variables
684
						var template UtTriggerPrimitive v_utRequest;
685 686
						var MsgIn v_request;
						var ResponsePrimitive v_responsePrimitive;
687
						var PrimitiveContent v_localResource;
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
688 689
						var integer v_resourceIndex := -1;

690 691 692
						//Test component configuration
						f_cf03Up();
		
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
693
						//send triggerinf_generateLocalResource_localResource := f_ae_generateLocalResource(valueof(p_primitiveContent), vc_cSEBaseIndex, p_resourceType);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
694 695
						v_resourceIndex := f_setLocalResource(v_localResource, p_resourceType, vc_cSEBaseIndex);
						v_utRequest := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex));
696 697 698 699 700
						f_sendUtPrimitive(v_utRequest,p_action);
						
						//Test behavior
						tc_ac.start;
						alt{
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
701
							[] mcaPortIn.receive(mw_request(mw_retrieve(f_getLocalResourceAddress(v_resourceIndex)))) -> value v_request {
702 703
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
704 705
								v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
								v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
706
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
707 708 709 710
							}
							[] mcaPortIn.receive {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : error while retrieving resource !");
711
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737
							}
							[] tc_ac.timeout{
								setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
							}
						}
		
						// 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
738 739 740
						var integer v_parentIndex := -1;
						var integer v_resourceIndex := -1;
						var PrimitiveContent v_resource;
741 742 743 744 745
						var ResponsePrimitive v_responsePrimitive;

						f_cf03Up();

						//send triggering primitive to SUT
746
						p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress();
747 748 749 750 751 752 753 754
						f_sendUtPrimitive(p_utRequest,p_action);

						//Test behavior
						tc_ac.start;
						alt{
							[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Subscription creation request is accepted!");
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
755
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
756
								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
757 758
								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));
759
								//send back responsePrimitive
760
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
761 762 763 764
							}
							[] mcaPortIn.receive {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Subscription creation request is rejected due to not including the optional attribute!");
765
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828
							}
							[] tc_ac.timeout{
								setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
							}
						}

						// 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);
						
829
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
830 831 832 833 834 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
						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);
												
889
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949
						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;
						
950
						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));
951 952 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
						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;
						
1007
						mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));tc_ac.start;
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 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
						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);
						
1073
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
1074 1075 1076 1077 1078 1079 1080 1081 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
						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);
						
1136
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
1137 1138 1139 1140 1141 1142 1143 1144 1145 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
						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)));
												
1200
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1201 1202 1203 1204 1205 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 1258 1259
						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)));
						
1260
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
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 1305 1306 1307 1308 1309 1310 1311 1312
						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);
						
1313
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1314 1315 1316 1317 1318 1319 1320 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 1358
						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);
					
1359
						mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1360 1361 1362 1363 1364
						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);
1365
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1366 1367 1368 1369
							}
							[] 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");
1370
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1371 1372 1373 1374
							}
							[] 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);
1375
								f_setResource(v_response.primitive.responsePrimitive.primitiveContent,int16);
1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412
							}
							[] 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);
						
1413
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440
						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();
						
					}

1441
					function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
1442
	  
1443
						var MsgIn v_request;
1444 1445 1446
						var ResponsePrimitive v_responsePrimitive;
						
						//Test control
1447 1448
						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");
1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462
							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
1463
							[] mccPortIn.receive(mw_request(p_request)) -> value v_request {
1464 1465 1466 1467
								tc_ac.stop;
								setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly");

								//set responseStatusCode back to SUT
1468
								v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));
1469 1470

								//send back responsePrimitive
1471
								mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 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 1531 1532 1533 1534 1535 1536 1537 1538 1539
							}
							[] 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();
	
					}
					
					function f_CSE_REG_CRE_028(RequestPrimitive p_request, template PrimitiveContent p_contentResponse) runs on CseSimu{ //system CseSystem {
						//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
						if(f_cse_isResourcePresent(vc_remoteCseIndex)) {
							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);
						 
1540
						 mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex)))));
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 1577 1578 1579 1580 1581 1582 1583 1584 1585
						 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);
		 
1586
						 mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)))));//TODO Maybe PX_SUPER_AE_ID
1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 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 1630 1631 1632
						 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
						if(PICS_IN_CSE){
							vc_remoteCseIndex := f_cse_registerRemoteCse(p_createRequestPrimitive);
1633
							mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex)))));
1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657
						    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");
								}
							}
						} else if (PICS_MN_CSE){
							vc_remoteCseIndex := f_cse_registrationRemoteCse(p_createRequestPrimitive);
1658
							mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex)))));
1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 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
							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");
								}
							}
						}
						
						//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);
	
1712
						mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
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 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762
						tc_ac.start;
						alt {
							[] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute ");
							}
							[] 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;
								setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute ");
							}
							[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute");
							}
							[] 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
1763
						vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
1764 1765
						
						//Send Trigger Message
1766
					    v_utRequest.requestPrimitive.to_ := f_getResourceAddress();
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830
					    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)){
1831
								vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
1832 1833
								f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
								
1834
								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
1835 1836
								f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
								
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 1862 1863 1864 1865 1866 1867 1868 1869
								v_ae2Index := f_getResource(vc_ae2);
								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)){
1870
							vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
1871
							f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
1872
							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
1873
							f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
1874 1875 1876 1877 1878 1879 1880
							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);
						
1881
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
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 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943
						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
						if (f_isResourcePresent(v_resourceIndex)){
							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)){
1944
    							vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
1945
								f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
1946
								vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered
1947
								f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
1948 1949 1950 1951 1952 1953 1954 1955 1956
								v_ae1Index := f_getResource(vc_ae1);
								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);
						
1957
							mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981
							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
1982
							if (f_cse_isResourcePresent(v_resourceIndex)){
1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021
								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
    									
					function f_CSE_DMR_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive{//system CseSystem { MRO system keyword not supported on functions in Titan
				
						// 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);
						
2022
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084
						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
						if(f_isResourcePresent(v_resourceIndex)){
							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
					
					function f_CSE_DMR_CRE_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {//system CseSystem { MRO system keyword not supported on functions in Titan
    				
						// 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
2085
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
2086 2087 2088
  					    						    									
						// Test Body
						v_request.requestIdentifier := "Existing resource";
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
2089 2090 2091 2092
						
						if(p_resourceType == int23){
							vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
						}
2093
    					
2094
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152
						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
    				
					function f_CSE_DMR_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {//system CseSystem { MRO system keyword not supported on functions in Titan
    				
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_acpAuxIndex := -1;
						var integer v_aeIndex := -1;
											   
						// Test control
						if(not(PICS_ACP_SUPPORT)) {
							setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up(); 
    				
						// Test adapter configuration
    				
						// Preamble
						if (p_resourceType != int23) {
							v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi)
						} else {
							v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int60);//c_UDNDi);
						}	
												
						v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);
						
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
						
2153
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Access denied to create a resource");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating a resource without privileges");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Resource created without creation privileges");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						f_checkAeSimuStatus();
    					
						//Check to see if the resource is NOT present
						if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
						} else {
						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
						}
						
						// Postamble
						f_cse_postamble_deleteResources();
    				
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_DMR_CRE_004
    				
					function f_CSE_DMR_CRE_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_invalidAttribute) runs on AeSimu {
    				
2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
								   
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
2209
						
2210
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request, {p_invalidAttribute})));
2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & p_invalidAttribute.name);
							}								
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & p_invalidAttribute.name);
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));  
2227
							}
2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241
						}	
								
						f_checkAeSimuStatus();
					
						//Check to see if the resource is NOT present
						if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
						} else {
						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
						}
					
				        		
						// Postamble
						f_cse_postamble_deleteResources();
2242
						
2243 2244 2245 2246
						// Tear down
						f_cf01Down();
					    				
					}//end f_CSE_DMR_CRE_005
2247 2248 2249
						
					function f_CSE_DMR_CRE_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive {
    				
2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
										   
						// Test control
				
						// Test component configuration
						f_cf01Up();
				
						// Test adapter configuration
				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 
					
						// Test Body
						v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
					
2269
						mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
2270 2271 2272 2273 2274 2275 2276
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType)));
								f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
								v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex);
2277
							}
2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291
							[] 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__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType)));
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
							}
						}	
								
						f_checkAeSimuStatus();
2292
						
2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308
						//Check to see if the resource is present or not
						if(f_isResourcePresent(v_resourceIndex)){
							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_006
2309 2310 2311
						
					function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeList p_optionalAttribute) runs on AeSimu {
    				
2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327
						// Local variables
						var MsgIn v_response;
						var RequestPrimitive v_request;
						var integer v_containerIndex := -1;
						var integer v_parentIndex := -1;
						var integer v_acpAuxIndex := -1;
						var integer v_ae2Index := -1;
						const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs";
						var integer v_resourceIndex := -1;
						var XSD.NCName v_myOptionalAttribute := p_optionalAttribute[0];
										   
						// Test control
						if(v_myOptionalAttribute == c_accessControlPolicyIDs) {
							if(not(PICS_ACP_SUPPORT)) {
								setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case");
								stop;
2328
							}
2329
						}
2330

2331 2332
						// Test component configuration
						f_cf01Up(true); 
2333

2334
						// Test adapter configuration
2335

2336 2337 2338 2339
						// Preamble
						if (v_myOptionalAttribute == c_accessControlPolicyIDs) {
							v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi)
						}     				
2340
						
2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354
						v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); 
						
						f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType);
						
						
						if(p_resourceType == int4) {
							v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex);