Commit 4c20e5f31a9eedbb9d1eb2de51b4d85983ed04b2

Authored by Subhash Gajare
1 parent 2164ace2

Created the Test cases structure for Semantics including Creation of Test cases …

…(TC_CSE_SEM_CRE_001, TC_CSE_SEM_CRE_002, TC_CSE_SEM_DEL_001)
... ... @@ -10169,6 +10169,275 @@ module OneM2M_Testcases_CSE_Release_3 {
10169 10169 }//end group timeSeries
10170 10170  
10171 10171 }//end group dataManagement
  10172 +
  10173 + group Semantic {
  10174 +
  10175 + group Create {
  10176 + /**
  10177 + * @desc Check that the IUT rejects the creation request of a <semanticDescriptor> resource which descriptor attribute does not conform to the RDF/XML syntax as defined in RDF 1.1 XML Syntax
  10178 + *
  10179 + */
  10180 + testcase TC_CSE_SEM_CRE_001() runs on Tester system CseSystem {
  10181 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  10182 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  10183 + v_ae1.done;
  10184 +
  10185 + v_ae1.start(f_CSE_SEM_CRE_001());
  10186 + v_ae1.done;
  10187 + }//end TC_CSE_SEM_CRE_001
  10188 +
  10189 + function f_CSE_SEM_CRE_001() runs on AeSimu {
  10190 +
  10191 + // Local variables
  10192 + var MsgIn v_response;
  10193 + var RequestPrimitive v_request;
  10194 + var integer v_aeIndex := -1;
  10195 + var ResourceType v_resourceType := int24; //Semantic Descriptor
  10196 +
  10197 + // Test control
  10198 +
  10199 + // Test component configuration
  10200 + f_cf01Up();
  10201 +
  10202 + // Test adapter configuration
  10203 +
  10204 + // Preamble
  10205 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  10206 +
  10207 + // Test Body
  10208 + v_request := f_getCreateRequestPrimitive(v_resourceType, null/*mw_contentCreateSemanticDescriptor*/, v_aeIndex);
  10209 + v_request.from_ := f_getOriginator(v_aeIndex);
  10210 +
  10211 + mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
  10212 + tc_ac.start;
  10213 + alt {
  10214 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
  10215 + tc_ac.stop;
  10216 + setverdict(pass, __SCOPE__ & ": Semantic Descripter creation rejected.");
  10217 + }
  10218 + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
  10219 + tc_ac.stop;
  10220 + setverdict(fail, __SCOPE__ & ": Error while creating Semantic Descripter with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
  10221 + }
  10222 + [] tc_ac.timeout {
  10223 + setverdict(fail, __SCOPE__ & ": No answer while creating Semantic Descripter");
  10224 + }
  10225 + }
  10226 +
  10227 + // Postamble
  10228 + f_cse_postamble_deleteResources();
  10229 +
  10230 + // Tear down
  10231 + f_cf01Down();
  10232 + }//end function f_CSE_SEM_CRE_001
  10233 +
  10234 + /**
  10235 + * @desc Check that the IUT generates a Response Status Code indicating a “ONTOLOGY_NOT_AVAILABLE” error when referenced ontology cannot be retrieved during a semantic validation process
  10236 + *
  10237 + */
  10238 + testcase TC_CSE_SEM_CRE_002() runs on Tester system CseSystem {
  10239 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  10240 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  10241 + v_ae1.done;
  10242 + }
  10243 + /**
  10244 + * @desc Check that the IUT generates a Response Status Code indicating a “LINKED_SEMANTICS_NOT_AVAILABLE” error when local linked <semanticDescriptor> resources cannot be retrieved during a semantic validation process
  10245 + *
  10246 + */
  10247 + testcase TC_CSE_SEM_CRE_003() runs on Tester system CseSystem {
  10248 + //
  10249 + }
  10250 + /**
  10251 + * @desc Check that the IUT retrieves the referenced ontology from the ontology hosting CSE when performing a semantic validation as a result of a creation of a stand-alone <semanticDescriptor> resource
  10252 + *
  10253 + */
  10254 + testcase TC_CSE_SEM_CRE_004() runs on Tester system CseSystem {
  10255 + //
  10256 + }
  10257 + /**
  10258 + * @desc Check that the IUT sends a valid response when performing a semantic validation as a result of a creation of a stand-alone <semanticDescriptor> resource
  10259 + *
  10260 + */
  10261 + testcase TC_CSE_SEM_CRE_005() runs on Tester system CseSystem {
  10262 + //
  10263 + }
  10264 + /**
  10265 + * @desc Check that the IUT rejects the creation request of a <semanticMashupInstance> resource, indicating a "NOT_ACCEPTABLE" error, when the <semanticMashupJobProfile> resource referenced in its smjpID attribute does not exist
  10266 + *
  10267 + */
  10268 + testcase TC_CSE_SEM_CRE_006() runs on Tester system CseSystem {
  10269 + //
  10270 + }
  10271 + /**
  10272 + * @desc Check that the IUT rejects the creation request of a <semanticMashupInstance> resource, indicating a "NOT_ACCEPTABLE" error, when its smjpInputParameter attribute value does not conform to the RDF/XML syntax as defined in RDF 1.1 XML Syntax
  10273 + *
  10274 + */
  10275 + testcase TC_CSE_SEM_CRE_007() runs on Tester system CseSystem {
  10276 + //
  10277 + }
  10278 + /**
  10279 + * @desc Check that the IUT rejects the creation request of a <semanticMashupInstance> resource, indicating a "NOT_ACCEPTABLE" error, when its smjpInputParameter attribute value does not meet the input parameter requirement specified by the inputDescriptor attribute of the corresponding <semanticMashupJobProfile> resource
  10280 + *
  10281 + */
  10282 + testcase TC_CSE_SEM_CRE_008() runs on Tester system CseSystem {
  10283 + //
  10284 + }
  10285 + /**
  10286 + * @desc Check that the IUT returns a "MASHUP_MEMBER_NOT_FOUND" error when creating a <semanticMashupInstance> when a required mashup member resource cannot be identified
  10287 + *
  10288 + */
  10289 + testcase TC_CSE_SEM_CRE_009() runs on Tester system CseSystem {
  10290 + //
  10291 + }
  10292 +
  10293 + } // end of group Create
  10294 +
  10295 + group Update {
  10296 +
  10297 + /**
  10298 + * @desc Check that the IUT rejects the update request of a <semanticDescriptor> resource indicating a "NOT_ACCEPTABLE" error when the request contains both semanticOpExec and descriptor attributes
  10299 + *
  10300 + */
  10301 + testcase TC_CSE_SEM_UPD_001() runs on Tester system CseSystem {
  10302 + }
  10303 + /**
  10304 + * @desc Check that the IUT rejects the update request of a <semanticDescriptor> resource indicating a "NOT_ACCEPTABLE" error when the request contains a semanticOpExec attribute which does not contain a valid SPARQL query request
  10305 + *
  10306 + */
  10307 + testcase TC_CSE_SEM_UPD_002() runs on Tester system CseSystem {
  10308 + }
  10309 + /**
  10310 + * @desc Check that the IUT rejects the update request of a <semanticDescriptor> resource when the request contains a descriptor attribute which does not conform to the RDF/XML syntax as defined in RDF 1.1 XML Syntax
  10311 + *
  10312 + */
  10313 + testcase TC_CSE_SEM_UPD_003() runs on Tester system CseSystem {
  10314 + }
  10315 + /**
  10316 + * @desc Check that the IUT retrieves the referenced ontology from the ontology hosting CSE when performing a semantic validation as a result of an update of a stand-alone <semanticDescriptor> resource
  10317 + *
  10318 + */
  10319 + testcase TC_CSE_SEM_UPD_004() runs on Tester system CseSystem {
  10320 + }
  10321 + /**
  10322 + * @desc Check that the IUT sends a valid response when performing a semantic validation as a result of an update of a stand-alone <semanticDescriptor> resource
  10323 + *
  10324 + */
  10325 + testcase TC_CSE_SEM_UPD_005() runs on Tester system CseSystem {
  10326 + }
  10327 + /**
  10328 + * @desc Check that the IUT retrieves the linked <semanticDescriptor> resource from the hosting CSE when performing a semantic validation as a result of an update of the <semanticValidation> virtual resource
  10329 + *
  10330 + */
  10331 + testcase TC_CSE_SEM_UPD_006() runs on Tester system CseSystem {
  10332 + }
  10333 + /**
  10334 + * @desc Check that the IUT sends a valid response when performing a semantic validation a semantic validation as a result of an update of the <semanticValidation> virtual resource
  10335 + *
  10336 + */
  10337 + testcase TC_CSE_SEM_UPD_007() runs on Tester system CseSystem {
  10338 + }
  10339 +
  10340 + } // end of group Update
  10341 +
  10342 + group Retrieve {
  10343 +
  10344 + /**
  10345 + * @desc Check that the IUT generates a Response Status Code indicating a “NOT_ACCEPTABLE” error to a retrieve request of a <semanticFanOutPoint> resource when the request contains a semanticsFilter condition set to a non-valid SPARQL query request
  10346 + *
  10347 + */
  10348 + testcase TC_CSE_SEM_RET_001() runs on Tester system CseSystem {
  10349 + }
  10350 + /**
  10351 + * @desc Check that the IUT generates a <semanticMashupResult> resource as a child of a <semanticMashupInstance> when a retrieve operation is sent to its <mashup> virtual resource
  10352 + *
  10353 + */
  10354 + testcase TC_CSE_SEM_RET_002() runs on Tester system CseSystem {
  10355 + }
  10356 +
  10357 + } // end of group Retrieve
  10358 +
  10359 + group Delete {
  10360 +
  10361 + /**
  10362 + * @desc Check that the IUT delete all <semanticMashupInstance> child resources when their parent <semanticMashupJobProfile> receives a delete request
  10363 + *
  10364 + */
  10365 + testcase TC_CSE_SEM_DEL_001() runs on Tester system CseSystem {
  10366 + // Local variables
  10367 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  10368 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  10369 + v_ae1.done;
  10370 +
  10371 + v_ae1.start(f_CSE_SEM_DEL_001());
  10372 + v_ae1.done;
  10373 + }//end TC_CSE_SEM_DEL_001()
  10374 +
  10375 + function f_CSE_SEM_DEL_001() runs on AeSimu {
  10376 + // Local variables
  10377 + var MsgIn v_response;
  10378 + var integer v_aeIndex := -1;
  10379 + var integer v_resourceIndex := -1;
  10380 + var Labels v_labels_1:= {"VALUE_1"};
  10381 + var template PrimitiveContent v_contentResponse;
  10382 + var template RequestPrimitive v_createRequest := omit;
  10383 + var template RequestPrimitive v_updateRequest := m_updateAeBase;
  10384 + var RequestPrimitive v_request;
  10385 + var integer v_ae2Index := -1;
  10386 +
  10387 + v_updateRequest.primitiveContent.aE.labels := v_labels_1;
  10388 + v_contentResponse.aE := mw_contentAeBase; // all attributes expected
  10389 +
  10390 + // Test control
  10391 +
  10392 + // Test component configuration
  10393 + f_cf01Up(true);
  10394 +
  10395 + // Test adapter configuration
  10396 +
  10397 + // Preamble
  10398 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  10399 +
  10400 + v_resourceIndex := f_cse_createResource(int2, v_createRequest, v_aeIndex);// SemanticMashupInstance
  10401 + mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))));
  10402 +
  10403 + tc_ac.start;
  10404 + alt {
  10405 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response {
  10406 + tc_ac.stop;
  10407 + setverdict(pass, __SCOPE__ & ": SemanticMashupInstance Resource have been successfully deleted");
  10408 + }
  10409 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
  10410 + tc_ac.stop;
  10411 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  10412 + }
  10413 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
  10414 + tc_ac.stop;
  10415 + setverdict(fail, __SCOPE__ & ": Error SemanticMashupInstance Resource has not been deleted");
  10416 + }
  10417 + [] tc_ac.timeout {
  10418 + setverdict(fail, __SCOPE__ & ": No answer while retrieving SemanticMashupInstance Resource");
  10419 + }
  10420 + }
  10421 +
  10422 + //f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
  10423 +
  10424 + //Postamble
  10425 + f_cse_postamble_deleteResources();
  10426 +
  10427 + //Tear down
  10428 + f_cf01Down();
  10429 +
  10430 + } // end TC_CSE_SEM_DEL_001
  10431 + /**
  10432 + * @desc Check that the IUT notifies all <semanticMashupInstance> resources referenced in the smiID attribute when the corresponding <semanticMashupJobProfile> receives a delete request
  10433 + *
  10434 + */
  10435 + testcase TC_CSE_SEM_DEL_002() runs on Tester system CseSystem {
  10436 + }
  10437 +
  10438 + } // end of group Delete
  10439 +
  10440 + }// end group Semantic
10172 10441  
10173 10442 }//end group CSE
10174 10443  
... ...