Commit dd265a0fb9dd3adf716548bc367787aaedc490c3

Authored by Miguel Angel Reina Ortega
1 parent c170c6e4

First FLXC (FlexContainer) test cases implemented

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
... ... @@ -986,7 +986,16 @@ module OneM2M_Templates {
986 986 resourceType := int28,
987 987 primitiveContent := {flexContainer := ?}
988 988 };
989   -
  989 +
  990 + /**
  991 + * @desc Base CREATE request primitive for GenericInterworkingService resource
  992 + */
  993 + template (value) RequestPrimitive m_createGenericInterworkingServiceBase modifies m_create := {
  994 + requestIdentifier := testcasename() & "-m_createGenericInterworkingService",
  995 + resourceType := int28,
  996 + primitiveContent := {genericInterworkingService := m_contentCreateGenericInterworkingService()}
  997 + };
  998 +
990 999 /**
991 1000 * @desc Reception template for CREATE GenericInterworkingOperationInstance
992 1001 */
... ... @@ -1907,8 +1916,39 @@ module OneM2M_Templates {
1907 1916 aggregatedRequest := omit,//O
1908 1917 choice := omit//NP
1909 1918  
1910   - };
  1919 + };
1911 1920  
  1921 + /**
  1922 + * @desc Base primitiveContent for CREATE operation for GenericInterworkingService resource
  1923 + * @param p_accessControlPolicyIds ACP IDs for the PollingChannel
  1924 + * @param p_name Resource name
  1925 + */
  1926 + template (value) GenericInterworkingService_optional m_contentCreateGenericInterworkingService (in template (omit) XSD.String p_name := c_defaultGenericInterworkingServiceResourceName,
  1927 + in template (omit) AcpType p_accessControlPolicyIds := omit) := {
  1928 +
  1929 + resourceName := p_name,//O
  1930 + resourceType := omit,//NP
  1931 + resourceID := omit,//NP
  1932 + parentID := omit,//NP
  1933 + creationTime := omit,//NP
  1934 + lastModifiedTime := omit,//NP
  1935 + labels := omit,//O
  1936 + accessControlPolicyIDs := p_accessControlPolicyIds,//O
  1937 + expirationTime := omit,//O
  1938 + dynamicAuthorizationConsultationIDs := omit,//O
  1939 + announceTo := omit,//O
  1940 + announcedAttribute := omit,//O
  1941 + stateTag := omit,//NP
  1942 + creator := omit,//O
  1943 + containerDefinition := "org.onem2m.genericInterworkingService",//M
  1944 + ontologyRef := omit,//O
  1945 + serviceName := "MyService",//M??
  1946 + inputDataPointLinks := omit,//O
  1947 + outputDataPointLinks := omit,//O
  1948 + choice := omit//NP
  1949 +
  1950 + };
  1951 +
1912 1952 /**
1913 1953 * @desc Base primitiveContent for CREATE operation for Group resource
1914 1954 * @param p_maxNrOfMembers Max number of members
... ... @@ -4911,6 +4951,38 @@ module OneM2M_Templates {
4911 4951 choice := *//O
4912 4952 };
4913 4953  
  4954 + /**
  4955 + * @desc Base primitiveContent for CREATE operation for GenericInterworkingService resource
  4956 + * @param p_accessControlPolicyIds ACP IDs for the PollingChannel
  4957 + * @param p_name Resource name
  4958 + */
  4959 + template (value) GenericInterworkingService_invalid m_contentCreateGenericInterworkingService_invalid (in template (omit) XSD.String p_name := c_defaultGenericInterworkingServiceResourceName,
  4960 + in template (omit) AcpType p_accessControlPolicyIds := omit) := {
  4961 +
  4962 + resourceName := p_name,//O
  4963 + resourceType := omit,//NP
  4964 + resourceID := omit,//NP
  4965 + parentID := omit,//NP
  4966 + creationTime := omit,//NP
  4967 + lastModifiedTime := omit,//NP
  4968 + expirationCounter := 1,//Invalid attribute
  4969 + labels := omit,//O
  4970 + accessControlPolicyIDs := p_accessControlPolicyIds,//O
  4971 + expirationTime := omit,//O
  4972 + dynamicAuthorizationConsultationIDs := omit,//O
  4973 + announceTo := omit,//O
  4974 + announcedAttribute := omit,//O
  4975 + stateTag := omit,//NP
  4976 + creator := omit,//O
  4977 + containerDefinition := "org.onem2m.genericInterworkingService",//M
  4978 + ontologyRef := omit,//O
  4979 + serviceName := "MyService",//M??
  4980 + inputDataPointLinks := omit,//O
  4981 + outputDataPointLinks := omit,//O
  4982 + choice := omit//NP
  4983 +
  4984 + };
  4985 +
4914 4986 template (value) AE_update_invalid m_contentUpdateAe_invalid := {
4915 4987 resourceName := omit,//M
4916 4988 resourceType := omit,//M
... ...
... ... @@ -1720,6 +1720,7 @@ type union PrimitiveContent {
1720 1720 TimeSeriesInstance_optional timeSeriesInstance,
1721 1721 TimeSeriesAnnc_optional timeSeriesAnnc,
1722 1722 TimeSeriesInstanceAnnc_optional timeSeriesInstanceAnnc,
  1723 + GenericInterworkingService_optional genericInterworkingService,
1723 1724 GenericInterworkingOperationInstance_optional genericInterworkingOperationInstance,
1724 1725 //SecurityInfo
1725 1726 SecurityInfo securityInfo,
... ... @@ -1740,6 +1741,7 @@ type union PrimitiveContent {
1740 1741 AE_update_invalid aE_update_invalid,
1741 1742 ACP_update_invalid aCP_update_invalid,
1742 1743 Container_update_invalid container_update_invalid,
  1744 + GenericInterworkingService_invalid genericInterworkingService_invalid,
1743 1745 Group_update_invalid group_update_invalid,
1744 1746 PollingChannel_update_invalid pollingChannel_update_invalid,
1745 1747 Schedule_update_invalid schedule_update_invalid,
... ... @@ -7220,6 +7222,48 @@ group OptionalResourceTypes {
7220 7222 variant (choice.choice_list[-]) "untagged";
7221 7223 };
7222 7224  
  7225 + type record GenericInterworkingService_optional
  7226 + {
  7227 + ResourceName resourceName optional,
  7228 + ResourceType resourceType optional,
  7229 + XSD.ID resourceID optional,
  7230 + NhURI parentID optional,
  7231 + Timestamp creationTime optional,
  7232 + Timestamp lastModifiedTime optional,
  7233 + Labels labels optional,
  7234 + AcpType accessControlPolicyIDs optional,
  7235 + Timestamp expirationTime optional,
  7236 + ListOfURIs dynamicAuthorizationConsultationIDs optional,
  7237 + ListOfURIs announceTo optional,
  7238 + ListOfNCNames announcedAttribute optional,
  7239 + XSD.NonNegativeInteger stateTag optional,
  7240 + XSD.ID creator optional,
  7241 + XSD.AnyURI containerDefinition optional,
  7242 + XSD.AnyURI ontologyRef optional,
  7243 + XSD.String serviceName optional,
  7244 + ListOfDataLinks inputDataPointLinks optional,
  7245 + ListOfDataLinks outputDataPointLinks optional,
  7246 + union {
  7247 + record length(1 .. infinity) of ChildResourceRef childResource_list,
  7248 + record of union {
  7249 + GenericInterworkingService genericInterworkingService,
  7250 + GenericInterworkingOperationInstance genericInterworkingOperationInstance,
  7251 + SemanticDescriptor semanticDescriptor,
  7252 + Subscription subscription
  7253 + } choice_list
  7254 + } choice optional
  7255 + }
  7256 + with {
  7257 + variant "name as uncapitalized";
  7258 + variant "element";
  7259 + variant (resourceName) "attribute";
  7260 + variant (choice) "untagged";
  7261 + variant (choice.childResource_list) "untagged";
  7262 + variant (choice.childResource_list[-]) "name as 'childResource'";
  7263 + variant (choice.choice_list) "untagged";
  7264 + variant (choice.choice_list[-]) "untagged";
  7265 + };
  7266 +
7223 7267 type record GenericInterworkingOperationInstance_optional
7224 7268 {
7225 7269 ResourceName resourceName optional,
... ... @@ -8343,6 +8387,49 @@ group InvalidTypes {
8343 8387 variant (choice.choice_list[-]) "untagged";
8344 8388 };
8345 8389  
  8390 + type record GenericInterworkingService_invalid
  8391 + {
  8392 + ResourceName resourceName optional,
  8393 + ResourceType resourceType optional,
  8394 + XSD.ID resourceID optional,
  8395 + NhURI parentID optional,
  8396 + Timestamp creationTime optional,
  8397 + Timestamp lastModifiedTime optional,
  8398 + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Container
  8399 + Labels labels optional,
  8400 + AcpType accessControlPolicyIDs optional,
  8401 + Timestamp expirationTime optional,
  8402 + ListOfURIs dynamicAuthorizationConsultationIDs optional,
  8403 + ListOfURIs announceTo optional,
  8404 + ListOfNCNames announcedAttribute optional,
  8405 + XSD.NonNegativeInteger stateTag optional,
  8406 + XSD.ID creator optional,
  8407 + XSD.AnyURI containerDefinition optional,
  8408 + XSD.AnyURI ontologyRef optional,
  8409 + XSD.String serviceName optional,
  8410 + ListOfDataLinks inputDataPointLinks optional,
  8411 + ListOfDataLinks outputDataPointLinks optional,
  8412 + union {
  8413 + record length(1 .. infinity) of ChildResourceRef childResource_list,
  8414 + record of union {
  8415 + GenericInterworkingService genericInterworkingService,
  8416 + GenericInterworkingOperationInstance genericInterworkingOperationInstance,
  8417 + SemanticDescriptor semanticDescriptor,
  8418 + Subscription subscription
  8419 + } choice_list
  8420 + } choice optional
  8421 + }
  8422 + with {
  8423 + variant "name as uncapitalized";
  8424 + variant "element";
  8425 + variant (resourceName) "attribute";
  8426 + variant (choice) "untagged";
  8427 + variant (choice.childResource_list) "untagged";
  8428 + variant (choice.childResource_list[-]) "name as 'childResource'";
  8429 + variant (choice.choice_list) "untagged";
  8430 + variant (choice.choice_list[-]) "untagged";
  8431 + };
  8432 +
8346 8433 type record Group_update_invalid {
8347 8434 ResourceName resourceName optional,
8348 8435 ResourceType resourceType optional,
... ...
... ... @@ -43,6 +43,7 @@ module OneM2M_TypesAndValues {
43 43 const XSD.String c_defaultTimeSeriesResourceName := "MyTimeSeriesResource";
44 44 const XSD.String c_defaultTimeSeriesAnncResourceName := "MyTimeSeriesAnncResource";
45 45 const XSD.String c_defaultTimeSeriesInstanceResourceName := "MyTimeSeriesInstanceResource";
  46 + const XSD.String c_defaultGenericInterworkingServiceResourceName := "MyGenericInterworkingServiceResource"; //<genericInterworkingService>
46 47 const XSD.ID c_aeAuxName := "MyAe";
47 48 const XSD.String c_defaultAE2Name := "MyAe2";
48 49 const XSD.String c_acpAuxName := "MyAcp";
... ...
... ... @@ -1032,6 +1032,27 @@ module OneM2M_Testcases_CSE_Release_2 {
1032 1032 }
1033 1033 }
1034 1034  
  1035 + testcase TC_CSE_DMR_CRE_002_FLXC() runs on Tester system CseSystem {
  1036 + // Local variables
  1037 + var ResponsePrimitive v_responsePrimitive;
  1038 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  1039 +
  1040 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  1041 + v_ae1.done;
  1042 + v_ae1.start(f_CSE_DMR_CRE_002(int28, m_createGenericInterworkingServiceBase));//Specialization of FlexContainer
  1043 + v_ae1.done;
  1044 +
  1045 + if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1);
  1046 + if(not ispresent(v_responsePrimitive.primitiveContent.genericInterworkingService.resourceName)){
  1047 + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
  1048 + } else {
  1049 + if(v_responsePrimitive.primitiveContent.flexContainer.resourceName != c_defaultGenericInterworkingServiceResourceName){
  1050 + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct");
  1051 + }
  1052 + }
  1053 + }
  1054 + }
  1055 +
1035 1056 }// end group g_CSE_DMR_CRE_002
1036 1057  
1037 1058 group g_CSE_DMR_CRE_003 {
... ... @@ -13896,6 +13917,357 @@ module OneM2M_Testcases_CSE_Release_2 {
13896 13917 }//end group timeSeries
13897 13918  
13898 13919 }//end group dataManagement
  13920 +
  13921 + group FlexContainer {
  13922 +
  13923 + group Create {
  13924 +
  13925 + /**
  13926 + * @desc Check that the IUT rejects the creation of the <flexContainer> resource when the resource representation does not comply with the schema definition.
  13927 + *
  13928 + */
  13929 + testcase TC_CSE_FLXC_CRE_001() runs on Tester system CseSystem {
  13930 +
  13931 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  13932 +
  13933 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  13934 + v_ae1.done;
  13935 +
  13936 + v_ae1.start(f_CSE_FLXC_CRE_001());
  13937 + v_ae1.done;
  13938 +
  13939 + }
  13940 +
  13941 + function f_CSE_FLXC_CRE_001() runs on AeSimu {
  13942 + // Local variables
  13943 + var integer v_aeIndex := -1;
  13944 + var integer v_resourceIndex := -1;
  13945 + var RequestPrimitive v_request := m_create;
  13946 + // Test control
  13947 +
  13948 + // Test component configuration
  13949 + f_cf01Up();
  13950 +
  13951 + // Test adapter configuration
  13952 +
  13953 + // Preamble
  13954 + v_aeIndex := f_cse_preamble_registerAe(-, -);//AE1 is registred;
  13955 +
  13956 + v_request.primitiveContent := { genericInterworkingService_invalid := m_contentCreateGenericInterworkingService_invalid };
  13957 + v_request := f_getCreateRequestPrimitive(int28, v_request, v_aeIndex);
  13958 +
  13959 + mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
  13960 + tc_ac.start;
  13961 + alt {
  13962 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value vc_response {
  13963 + tc_ac.stop;
  13964 + setverdict(pass, __SCOPE__ & ": Creation of resource type 28 rejected correctly");
  13965 + }
  13966 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
  13967 + tc_ac.stop;
  13968 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  13969 + }
  13970 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
  13971 + tc_ac.stop;
  13972 + setverdict(fail, __SCOPE__ & ": Creating resource type 28 with invalid representation");
  13973 + }
  13974 + [] tc_ac.timeout {
  13975 + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 28");
  13976 + }
  13977 + }
  13978 +
  13979 + //Check to see if the resource is NOT present
  13980 + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
  13981 + setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
  13982 + } else {
  13983 + setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
  13984 + }
  13985 +
  13986 + // Postamble
  13987 + f_cse_postamble_deleteResources();
  13988 +
  13989 + // Tear down
  13990 + f_cf01Down();
  13991 + } // end TC_CSE_FLXC_CRE_001
  13992 +
  13993 + /**
  13994 + * @desc Check that the IUT rejects the creation of the <flexContainer> resource when the IUT does not have the schema definition.
  13995 + *
  13996 + */
  13997 + testcase TC_CSE_FLXC_CRE_002() runs on Tester system CseSystem {
  13998 +
  13999 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  14000 +
  14001 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  14002 + v_ae1.done;
  14003 +
  14004 + v_ae1.start(f_CSE_FLXC_CRE_002());
  14005 + v_ae1.done;
  14006 +
  14007 + }
  14008 +
  14009 + function f_CSE_FLXC_CRE_002() runs on AeSimu {
  14010 + // Local variables
  14011 + var integer v_aeIndex := -1;
  14012 + var integer v_resourceIndex := -1;
  14013 + var RequestPrimitive v_request;
  14014 + // Test control
  14015 +
  14016 + // Test component configuration
  14017 + f_cf01Up();
  14018 +
  14019 + // Test adapter configuration
  14020 +
  14021 + // Preamble
  14022 + v_aeIndex := f_cse_preamble_registerAe(-, -);//AE1 is registred;
  14023 +
  14024 + v_request := m_createGenericInterworkingServiceBase;
  14025 + v_request.primitiveContent.genericInterworkingService.containerDefinition := "org.onem2m.nonExistingDefinition";
  14026 + v_request := f_getCreateRequestPrimitive(int28, v_request, v_aeIndex);
  14027 +
  14028 + mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
  14029 + tc_ac.start;
  14030 + alt {
  14031 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value vc_response {
  14032 + tc_ac.stop;
  14033 + setverdict(pass, __SCOPE__ & ": Creation of resource type 28 rejected correctly");
  14034 + }
  14035 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
  14036 + tc_ac.stop;
  14037 + setverdict(fail, __SCOPE__ & ": Wrong response status code");
  14038 + }
  14039 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
  14040 + tc_ac.stop;
  14041 + setverdict(fail, __SCOPE__ & ": Creating resource type 28 with invalid representation");
  14042 + }
  14043 + [] tc_ac.timeout {
  14044 + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 28");
  14045 + }
  14046 + }
  14047 +
  14048 + //Check to see if the resource is NOT present
  14049 + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
  14050 + setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
  14051 + } else {
  14052 + setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
  14053 + }
  14054 +
  14055 + // Postamble
  14056 + f_cse_postamble_deleteResources();
  14057 +
  14058 + // Tear down
  14059 + f_cf01Down();
  14060 + } // end TC_CSE_FLXC_CRE_002
  14061 +
  14062 + /**
  14063 + * @desc Check that the IUT increments the field value of attribute stateTag in the parent <flexContainer> resource when a resource is created as the direct child of the parent <flexContainer>
  14064 + *
  14065 + */
  14066 + testcase TC_CSE_FLXC_CRE_003() runs on Tester system CseSystem {
  14067 +
  14068 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  14069 +
  14070 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  14071 + v_ae1.done;
  14072 + v_ae1.start(f_CSE_FLXC_CRE_003());
  14073 + v_ae1.done;
  14074 +
  14075 + }
  14076 +
  14077 + function f_CSE_FLXC_CRE_003() runs on AeSimu {
  14078 + //Local variables
  14079 + var integer v_aeIndex, v_acpAuxIndex := -1;
  14080 + var integer v_resourceIndex := -1;
  14081 + var RequestPrimitive v_req1;
  14082 + var RequestPrimitive v_req2;
  14083 + var RequestPrimitive v_req3;
  14084 + var MsgIn v_resp1, v_resp3;
  14085 + var ResponsePrimitive v_resp2;//Response to a Notify Request
  14086 +
  14087 + // Test control
  14088 +
  14089 +
  14090 + // Test component configuration
  14091 + f_cf02Up();
  14092 +
  14093 + // Test adapter configuration
  14094 +
  14095 + // Preamble
  14096 + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
  14097 + vc_cse1.done;
  14098 +
  14099 + v_acpAuxIndex := f_cse_preamble_createAcpAux();
  14100 +
  14101 + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//AE1 is registred;
  14102 +
  14103 + v_resourceIndex := f_cse_createResource(int15, m_createPollingChannelBase, v_aeIndex);
  14104 +
  14105 + v_req1 := valueof(m_retrievePollingRequest(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
  14106 + mcaPort.send(f_getMsgOutPrimitive(m_request(v_req1)));
  14107 +
  14108 + //v_req2 := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification));
  14109 + v_req2 := valueof(m_notify(f_getResourceAddress(v_aeIndex)));
  14110 + v_req2.requestExpirationTimestamp := {alt_1 := 15000};
  14111 +
  14112 + vc_cse1.start(f_cse_notifyProcedure_notify(v_req2));
  14113 +
  14114 + tc_ac.start;
  14115 + alt {
  14116 + [] mcaPort.receive(mw_response(mw_responsePollingResponse(v_req2))) -> value v_resp1 {
  14117 + tc_ac.stop;
  14118 + setverdict(pass, __SCOPE__ & ": Polling response received");
  14119 + }
  14120 + [] mcaPort.receive(mw_response(mw_responsePollingResponse)) {
  14121 + tc_ac.stop;
  14122 + setverdict(fail, __SCOPE__ & ": Content not carrying request targeting AE1");
  14123 + }
  14124 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
  14125 + tc_ac.stop;
  14126 + setverdict(fail, __SCOPE__ & ": Wrong status code");
  14127 + }
  14128 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
  14129 + tc_ac.stop;
  14130 + setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
  14131 + }
  14132 + [] tc_ac.timeout {
  14133 + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
  14134 + }
  14135 + }
  14136 +
  14137 + f_checkAeSimuStatus();
  14138 +
  14139 + //Send response in any case
  14140 + v_resp2 := valueof(m_responseNotification(int2000, omit));
  14141 + v_resp2.requestIdentifier := v_resp1.primitive.responsePrimitive.primitiveContent.requestPrimitive.requestIdentifier;
  14142 + v_req3 := valueof(m_notifyResponsePrimitive(f_getResourceAddress(v_resourceIndex) & "/" & c_resourceShortNamePollingChannelUri, v_resp2));
  14143 + v_req3.from_ := f_getOriginator(v_aeIndex);
  14144 + mcaPort.send(f_getMsgOutPrimitive(m_request(v_req3)));
  14145 +
  14146 + tc_ac.start;
  14147 + alt {
  14148 + [] mcaPort.receive(mw_response(mw_responseNotify(int2000))) -> value v_resp3 {
  14149 + tc_ac.stop;
  14150 + setverdict(pass, __SCOPE__ & ": Polling response received");
  14151 + }
  14152 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
  14153 + tc_ac.stop;
  14154 + setverdict(fail, __SCOPE__&":INFO: Error while performing notification");
  14155 + }
  14156 + [] mcaPort.receive {
  14157 + tc_ac.stop;
  14158 + setverdict(fail, __SCOPE__&":INFO: Unexpected message received");
  14159 + }
  14160 + [] tc_ac.timeout {
  14161 + setverdict(fail, __SCOPE__&":INFO: No answer while performing notification");
  14162 + }
  14163 + }
  14164 +
  14165 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
  14166 +
  14167 + //Postamble
  14168 + f_cse_postamble_deleteResources();
  14169 +
  14170 + // Tear down
  14171 + f_cf02Down();
  14172 + }
  14173 +
  14174 + }//end of group Create
  14175 +
  14176 + group Update {
  14177 +
  14178 + /**
  14179 + * @desc Check that the IUT rejects the update of the <flexContainer> resource when the resource representation does not comply with the schema definition.
  14180 + *
  14181 + */
  14182 + testcase TC_CSE_FLXC_UPD_001() runs on Tester system CseSystem {
  14183 +
  14184 + var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
  14185 +
  14186 + v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
  14187 + v_cse1.done;
  14188 + v_cse1.start(f_CSE_FLXC_UPD_001());
  14189 + v_cse1.done;
  14190 + }
  14191 +
  14192 + function f_CSE_FLXC_UPD_001() runs on CseSimu {
  14193 + //Local variables
  14194 + var integer v_localResourceIndex := -1;
  14195 + var MsgIn v_request_req1, v_request_req3;
  14196 + var RequestPrimitive v_request_req2;
  14197 + var ResponsePrimitive v_response_rsp1;
  14198 + var template UtTriggerPrimitive v_utRequest1 := m_utCreatePollingChannel;
  14199 + var template UtTriggerPrimitive v_utRequest2;
  14200 + var charstring v_action1 := "Please, send a Polling Channel CREATE request";
  14201 + var charstring v_action2 := "Please, send a Polling request (Retrieve PollingChannelURI request)";
  14202 + var RequestPrimitive v_requestNotify;
  14203 +
  14204 + //Test control
  14205 +
  14206 + // Test component configuration
  14207 + f_cf02UpCseSimuMaster();
  14208 +
  14209 + // Test adapter configuration
  14210 +
  14211 + // Preamble
  14212 + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
  14213 +
  14214 + //send triggering primitive to SUT
  14215 + v_localResourceIndex := f_cse_createLocalResource(v_utRequest1,v_action1);
  14216 +
  14217 + //Check that the created resource is a PollingChannel
  14218 + if(not(vc_localResourcesList[v_localResourceIndex].resourceType == int15)) {
  14219 + setverdict(inconc, __SCOPE__&":INFO: Polling Channel resource not creaded");
  14220 + f_checkCseSimuStatus();
  14221 + }
  14222 +
  14223 + //Trigger IUT for sending a polling request (req1)
  14224 + v_utRequest2 := valueof(m_utRetrievePollingChannelUri(f_getLocalResourceAddress(v_localResourceIndex) & "/" & c_resourceShortNamePollingChannelUri));
  14225 + f_sendUtPrimitive(v_utRequest2,v_action2);
  14226 +
  14227 + tc_ac.start;
  14228 + alt {
  14229 + [] mccPortIn.receive(mw_request(mw_retrieve(f_getResourceAddress(v_localResourceIndex) & "/" & c_resourceShortNamePollingChannelUri))) -> value v_request_req1 {
  14230 + tc_ac.stop;
  14231 + setverdict(pass, __SCOPE__&":INFO: Polling request received successfuly");
  14232 + v_response_rsp1 := valueof(m_responsePrimitive(int2000,v_request_req1.primitive.requestPrimitive.requestIdentifier));
  14233 + v_response_rsp1.from_ := PX_CSE1_ID;
  14234 + v_response_rsp1.to_ := v_request_req1.primitive.requestPrimitive.from_;
  14235 + //Put in the primitiveContent a Notify request (req2) (simulated) from another node CSE
  14236 + v_request_req2 := valueof(m_notify(f_getResourceAddress(vc_remoteCseIndex)));
  14237 + v_response_rsp1.primitiveContent := { requestPrimitive := v_request_req2 };
  14238 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response_rsp1)));
  14239 + }
  14240 + [] tc_ac.timeout {
  14241 + setverdict(inconc, __SCOPE__&":INFO: No request received for creating resource type Polling Channel");
  14242 + }
  14243 + }
  14244 +
  14245 + tc_ac.start;
  14246 + alt {
  14247 + [] mccPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value v_request_req3 {
  14248 + tc_ac.stop;
  14249 + //Check that primitiveContent carries the response to req2 (resp2)
  14250 + if(v_request_req3.primitive.requestPrimitive.primitiveContent.responsePrimitive.requestIdentifier == v_request_req2.requestIdentifier) {
  14251 + setverdict(pass, __SCOPE__ & ": NOTIFY request received carrying response (rsp2) to the Notify request (req2)");
  14252 + } else {
  14253 + setverdict(fail, __SCOPE__ & ": NOTIFY request received not carryng the expected response (rsp2) to the Notify request (req2)");
  14254 + }
  14255 + }
  14256 + [] tc_ac.timeout {
  14257 + setverdict(fail, __SCOPE__ & ": No message while expecting NOTIFY request");
  14258 + }
  14259 + }
  14260 +
  14261 + //Postamble
  14262 + f_cse_postamble_deleteResourcesCSE();
  14263 +
  14264 + // Tear down
  14265 + f_cf02DownCseSimuMaster();
  14266 + }
  14267 + }//end of group Update
  14268 +
  14269 + }//end group FlexContainer
  14270 +
13899 14271  
13900 14272 }//end group CSE
13901 14273  
... ...