OneM2M_PermutationFunctions.ttcn 372 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
Fix #44    
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
Fix #47    
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
Fix #44    
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(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(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
Fix #44    
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
Fix #44    
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
99
						
						
						//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
100
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);
101
102
103
104
105
						f_sendUtPrimitive(v_utRequest,v_action);
							
	
						tc_ac.start;
						alt {
106
							[] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.requestPrimitive.to_))) -> value (v_request) {
107
108
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container creation request received successfuly");
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
109
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
Miguel Angel Reina Ortega committed
110
								v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
111
112
								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));
113
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
114
115
116
117
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while creating container");
118
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
								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 {
136
						var MsgIn v_request;
137
138
139
						var ResponsePrimitive v_responsePrimitive;
						var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer;
						var UtTriggerAckPrimitive v_trigger_response;
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
140
						var integer v_resourceIndex;
141
						var PrimitiveContent v_localResource;
142
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);
143
144
145
146
147
148
149
150
151
152
						
						
						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
Fix #47    
Miguel Angel Reina Ortega committed
153
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
154
155
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex, e_nonHierarchical, p_primitiveScope);
156
157
158
159
						f_sendUtPrimitive(v_utRequest,v_action);
						
						tc_ac.start;
						alt {
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
160
							[] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.requestPrimitive.to_))) -> value v_request {
161
162
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container update request received successfuly");
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
163
								v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
Miguel Angel Reina Ortega committed
164
								f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
165
								v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
166
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
167
168
169
170
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while updating container");
171
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
172
173
174
175
176
177
178
179
180
181
182
183
								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 {
184
						var MsgIn v_request;
185
186
187
						var ResponsePrimitive v_responsePrimitive;
						var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer;
						var UtTriggerAckPrimitive v_trigger_response;
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
188
						var integer v_resourceIndex := -1;
189
						var PrimitiveContent v_localResource;
190
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);
191
192
193
194
195
196
197
198
199
						
						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
Fix #47    
Miguel Angel Reina Ortega committed
200
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
201
202
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex, e_hierarchical, p_primitiveScope);
203
204
205
206
						f_sendUtPrimitive(v_utRequest,v_action);
								
						tc_ac.start;
						alt {
207
							[] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.requestPrimitive.to_))) -> value (v_request) {
208
209
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container update request received successfuly");
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
210
								v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
Miguel Angel Reina Ortega committed
211
								f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
212
								v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
213
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
214
215
216
217
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while updating container");
218
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
								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 {
236
						var MsgIn v_request;
237
238
239
240
						var ResponsePrimitive v_responsePrimitive;
						var template UtTriggerPrimitive v_utRequestTemplate;
                        var UtTriggerPrimitive v_utRequest;
						var UtTriggerAckPrimitive v_trigger_response;
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
241
						var integer v_resourceIndex := -1;
242
						var PrimitiveContent v_localResource;
243
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);
244
245
246
247
248
249
250
251
252
						
						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
Fix #47    
Miguel Angel Reina Ortega committed
253
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
254
255
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						v_utRequestTemplate := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex, e_nonHierarchical, p_primitiveScope));
256
257
258
259
260
						f_sendUtPrimitive(v_utRequestTemplate,v_action);
                        v_utRequest := valueof(v_utRequestTemplate);
			
						tc_ac.start;
						alt {
261
							[] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.requestPrimitive.to_))) -> value (v_request) {
262
263
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly");
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
264
265
								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));
266
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
267
268
269
270
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while retrieving container");
271
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
272
273
274
275
276
277
278
279
280
281
282
283
								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 {
284
						var MsgIn v_request;
285
286
287
288
						var ResponsePrimitive v_responsePrimitive;
						var template UtTriggerPrimitive v_utRequestTemplate;
                        var UtTriggerPrimitive v_utRequest;
						var UtTriggerAckPrimitive v_trigger_response;
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
289
						var integer v_resourceIndex := -1;
290
						var PrimitiveContent v_localResource;
291
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);
292
293
294
295
296
297
298
299
300
						
						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
Fix #47    
Miguel Angel Reina Ortega committed
301
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
302
303
						v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
						v_utRequestTemplate := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex, e_hierarchical, p_primitiveScope));
304
305
306
307
308
                        v_utRequest := valueof(v_utRequestTemplate);
						f_sendUtPrimitive(v_utRequest,v_action);

						tc_ac.start;
						alt {
309
							[] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.requestPrimitive.to_))) -> value (v_request) {
310
311
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly");
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
312
313
								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));
314
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
315
316
317
318
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while retrieving container");
319
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
								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 {
337
						var MsgIn v_request;
338
						var ResponsePrimitive v_responsePrimitive;
339
						var template UtTriggerPrimitive v_utRequest := m_utDelete;
340
341
342
						var UtTriggerAckPrimitive v_trigger_response;
						var integer v_auxInteger;
						var PrimitiveContent v_localResource;
343
						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);
344
345
346
347
348
349
350
351
352

						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
Fix #47    
Miguel Angel Reina Ortega committed
353
						v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
354
						v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
355
						v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope);
356
357
358
359
						f_sendUtPrimitive(v_utRequest,v_action);
			
						tc_ac.start;
						alt {
360
							[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value (v_request) {
361
362
								tc_ac.stop;
								setverdict(pass, __SCOPE__, " : Container update request received successfuly");
363
								v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));
364
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
365
366
367
368
							}
							[] mcaPortIn.receive(mw_request(?)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__, " : Error while updating container");
369
								mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
370
371
372
373
374
375
376
377
378
379
380
381
								stop;
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__, " : No answer while updating resource");
								stop;
							}
						}
			
						// 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
Fix #47    
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
Fix #38    
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
Fix #44    
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
Fix #38    
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
Fix #44    
Miguel Angel Reina Ortega committed
457
							   v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
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
Fix #44    
Miguel Angel Reina Ortega committed
459
460
							   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));
461
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
Fix #44    
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
Fix #38    
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
Fix #47    
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
Fix #44    
Miguel Angel Reina Ortega committed
518
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
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
Fix #44    
Miguel Angel Reina Ortega committed
520
521
								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));
522
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
Fix #44    
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
Fix #44    
Miguel Angel Reina Ortega committed
564
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
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
Fix #44    
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
Fix #44    
Miguel Angel Reina Ortega committed
594
						var integer v_resourceIndex := -1;
595
					   	var PrimitiveContent v_localResource;
Miguel Angel Reina Ortega's avatar
Fix #44    
Miguel Angel Reina Ortega committed
596
					   	var ResponsePrimitive v_responsePrimitive;
597
598
599
600
	
					   	f_cf03Up();
					   
					   	//Preamble
601
						
Miguel Angel Reina Ortega's avatar
Fix #47    
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
Fix #44    
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
Fix #44    
Miguel Angel Reina Ortega committed
614
							   v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
Miguel Angel Reina Ortega committed
615
							   f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
Miguel Angel Reina Ortega's avatar
Fix #44    
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
Fix #44    
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
Fix #47    
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
Fix #44    
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
Fix #44    
Miguel Angel Reina Ortega committed
656
								v_resourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
Miguel Angel Reina Ortega committed
657
								f_updateLocalResource(v_resourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
Miguel Angel Reina Ortega's avatar
Fix #44    
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
Fix #44    
Miguel Angel Reina Ortega committed
688
						var integer v_resourceIndex := -1;
689
690
691
692
		
						//Test component configuration
						f_cf03Up();
		
Miguel Angel Reina Ortega's avatar
Fix #47    
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
Fix #44    
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
Fix #44    
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
Fix #44    
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
Fix #44    
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
Fix #44    
Miguel Angel Reina Ortega committed
755
								v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
Miguel Angel Reina Ortega's avatar
Fix #47    
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
Fix #44    
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
						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); 
For faster browsing, not all history is shown. View entire blame