Skip to content
Snippets Groups Projects
Commit af005b0e authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Merge remote-tracking branch 'remotes/origin/KETI'

parents 243c6e0c a02a4d46
No related branches found
No related tags found
1 merge request!25Ae fixes
......@@ -868,30 +868,34 @@ module OneM2M_Functions {
var integer v_resourceIndex;
// AE TODO To review the code (use of indexes, generation of value for certain attributes, etc..)
if(p_resourceType == int2 and ischosen(p_resource.any_1[0].AE_optional)) {
var AE_optional v_ae := p_resource.any_1[0].AE_optional;
var AE_optional v_aeModified;
v_resourceIndex := lengthof(vc_resourcesList) - 1;
v_ae.resourceType := p_resourceType;
v_ae.parentID := int2str(p_parentIndex);
v_ae.creationTime := fx_generateTimestamp();
v_ae.lastModifiedTime := v_ae.creationTime;
v_ae.resourceID := "ae" & int2char(v_resourceIndex);
v_ae.aE_ID := "ae" & int2char(v_resourceIndex);
v_ae.resourceName := "ae" & int2char(v_resourceIndex);
v_aeModified.parentID := v_ae.parentID;
v_aeModified.creationTime := v_ae.creationTime;
v_aeModified.lastModifiedTime := v_ae.lastModifiedTime;
v_aeModified.resourceID := v_ae.resourceID;
v_aeModified.aE_ID := v_ae.aE_ID;
v_aeModified.resourceName := v_ae.resourceName;
p_resource.any_1[0].AE_optional := v_ae;
p_modifiedResource.AE_optional := v_aeModified;
return f_setResource(p_resource, p_parentIndex);
if(p_resourceType == int2 and ispresent(p_resource)) {
if(ischosen(p_resource.any_1[0].AE_optional)){
var AE_optional v_ae := p_resource.any_1[0].AE_optional;
var AE_optional v_aeModified;
v_resourceIndex := lengthof(vc_resourcesList) - 1;
v_ae.resourceType := p_resourceType;
v_ae.parentID := int2str(p_parentIndex);
v_ae.creationTime := fx_generateTimestamp();
v_ae.lastModifiedTime := v_ae.creationTime;
v_ae.resourceID := "ae" & int2char(v_resourceIndex);
v_ae.aE_ID := "ae" & int2char(v_resourceIndex);
v_ae.resourceName := "ae" & int2char(v_resourceIndex);
v_aeModified.parentID := v_ae.parentID;
v_aeModified.creationTime := v_ae.creationTime;
v_aeModified.lastModifiedTime := v_ae.lastModifiedTime;
v_aeModified.resourceID := v_ae.resourceID;
v_aeModified.aE_ID := v_ae.aE_ID;
v_aeModified.resourceName := v_ae.resourceName;
p_resource.any_1[0].AE_optional := v_ae;
p_modifiedResource.AE_optional := v_aeModified;
return f_setResource(p_resource, p_parentIndex);
}
}
// TODO: implement other resource types
......
......@@ -1682,7 +1682,9 @@ module OneM2M_Testcases {
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var AttributeAux v_invalidAttribute;
// Test control
// Test component configuration
......@@ -1695,20 +1697,22 @@ module OneM2M_Testcases {
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex);
mcaPort.send(m_request(v_request, {valueof(p_invalidAttribute)}));
v_invalidAttribute := valueof(p_invalidAttribute);
mcaPort.send(m_request(v_request, {v_invalidAttribute}));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & p_invalidAttribute.name);
setverdict(pass, testcasename() & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & v_invalidAttribute.name);
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & p_invalidAttribute.name);
setverdict(fail, testcasename() & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & v_invalidAttribute.name);
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment