Commit 37b98c9c authored by oneM2MTester Develop Team's avatar oneM2MTester Develop Team
Browse files

correctify parameters c_acpAuxName, c_AeAuxName and c_defaultResourceName

parent 0c90e94f
......@@ -193,7 +193,6 @@ module OneM2M_Functions {
p_request.to_ := f_addPrefix(f_getResourceAddress(p_parentIndex));
//@Martin
p_request.resultContent := PX_RESULT_CONTENT_CREATE;
p_request.requestIdentifier := valueof(p_request.from_) & f_rnd(1, 1000000);//p_request.from_ & int2str(float2int(rnd()));
//p_request.name := p_name;
......@@ -233,7 +232,6 @@ module OneM2M_Functions {
p_request.to_ := f_addPrefix(f_getResourceAddress(p_resourceIndex));
//@Martin
p_request.resultContent := PX_RESULT_CONTENT_UPDATE;
p_request.requestIdentifier := valueof(p_request.from_) & f_rnd(1, 1000000);//p_request.from_ & int2str(float2int(rnd()));
//p_request.name := p_name;
......@@ -453,7 +451,7 @@ module OneM2M_Functions {
}
// "MyAcp"
function f_createAccessControlPolicyAux(in template (value) XSD.String p_acpName := PX_ACPAUX_NAME, in template (value) AccessControlOperations p_allowedOperations := int63) runs on M2M return integer{
function f_createAccessControlPolicyAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) AccessControlOperations p_allowedOperations := int63) runs on M2M return integer{
var RequestPrimitive v_request;
var M2MResponsePrimitive v_response;
var integer v_acpAuxIndex := -1;
......@@ -496,7 +494,7 @@ module OneM2M_Functions {
var integer v_acpAuxIndex := -1;
var integer v_containerResourceIndex := -1;
v_acpAuxIndex := f_createAccessControlPolicyAux(p_acpName := PX_ACPAUX_NAME);//"MyAcp_2"
v_acpAuxIndex := f_createAccessControlPolicyAux(p_acpName := c_acpAuxName);//"MyAcp_2"
v_request := valueof(m_createContainerBase);
v_request.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)};
......
......@@ -29,14 +29,7 @@ module OneM2M_Pixits {
modulepar charstring PX_CSE_NAME := "in-cse";
modulepar charstring PX_URI_CSE := "/~/in-cse";
//@Martin
modulepar charstring PX_DEFAULT_RESOURCE_NAME := "MyResource";//c_defaultResourceName
//@Martin
modulepar charstring PX_AEAUX_NAME := "MyAe";
//@Martin
modulepar XSD.String PX_ACPAUX_NAME := "MyAcp";
modulepar boolean PX_UNSTRUCTURED := false;
modulepar charstring PX_AE_ID_STEM := "admin:admin";
......@@ -67,8 +60,6 @@ module OneM2M_Pixits {
modulepar charstring PX_LOCATION_UPDATE_PERIOD := "PT10M10S" ;//10 Minute 10 Seconds
modulepar charstring PX_LOCATION_UPDATE_PERIOD_INVALID := "-PT30M10S" ;//duration set to invalid value (minus value)
modulepar charstring PX_LOCATION_CONTAINER_NAME := "myLoContainer";
modulepar ResultContent PX_RESULT_CONTENT_CREATE := int1; //default value for resultContent and permitted input value includes int0, int1, int2, and int3
modulepar ResultContent PX_RESULT_CONTENT_UPDATE := int1; //default value for resultContent and permitted input value includes int0, int1
modulepar Labels LABELS := {"VALUE_1"};
......
......@@ -357,7 +357,7 @@ module OneM2M_Templates {
operationExecutionTime := omit,
responseType := omit,
resultPersistence := omit,
resultContent := PX_RESULT_CONTENT_UPDATE,
resultContent := int1,//default
eventCategory := omit,
deliveryAggregation := omit,
groupRequestIdentifier := omit,
......@@ -406,7 +406,7 @@ module OneM2M_Templates {
requestIdentifier := "m_createAe" & f_rnd(1, 1000000),
resourceType := int2,
primitiveContent := {
any_1 := {{AE_optional := m_contentCreateAe(PX_AEAUX_NAME, p_accessControlPolicyIDs)}}
any_1 := {{AE_optional := m_contentCreateAe(c_aeAuxName, p_accessControlPolicyIDs)}}
},
role := omit,
originatingTimestamp := omit,
......@@ -449,7 +449,7 @@ module OneM2M_Templates {
};
template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name := PX_DEFAULT_RESOURCE_NAME, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) := {
template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name := c_defaultResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) := {
operation := int1,
to_ := f_addPrefix(p_parentResourceAddress),
from_ := PX_AE_ID_STEM,
......@@ -474,7 +474,7 @@ module OneM2M_Templates {
};
template (value) RequestPrimitive m_createAcpAux(in template (value) XSD.String p_acpName := PX_ACPAUX_NAME, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := {
template (value) RequestPrimitive m_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := {
operation := int1,
to_ := "Not Initialized",
from_ := PX_AE_ID_STEM,
......@@ -794,7 +794,7 @@ module OneM2M_Templates {
operationExecutionTime := omit,
responseType := omit,
resultPersistence := omit,
resultContent := PX_RESULT_CONTENT_CREATE,
resultContent := int1,//default
eventCategory := omit,
deliveryAggregation := omit,
groupRequestIdentifier := omit,
......@@ -880,7 +880,7 @@ module OneM2M_Templates {
choice := omit//NP
};
template (value) AccessControlPolicy_optional m_contentCreateAcp (in template (omit) XSD.String p_name := PX_DEFAULT_RESOURCE_NAME, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := {
template (value) AccessControlPolicy_optional m_contentCreateAcp (in template (omit) XSD.String p_name := c_defaultResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := {
resourceName := p_name,//O
resourceType := omit,//NP
resourceID := omit,//NP
......@@ -915,7 +915,7 @@ module OneM2M_Templates {
template (value) Group_optional m_contentCreateGroup ( in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
in template (value) ListOfURIs p_memberIds,
in template (omit) AcpType p_accessControlPolicyIDs) := {
resourceName := PX_DEFAULT_RESOURCE_NAME,//O
resourceName := c_defaultResourceName,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
......@@ -940,7 +940,7 @@ module OneM2M_Templates {
};
template (value) PollingChannel_optional m_contentCreatePollingChannel ( in template (omit) AcpType p_accessControlPolicyIDs) := {
resourceName := PX_DEFAULT_RESOURCE_NAME,//O
resourceName := c_defaultResourceName,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
......@@ -953,7 +953,7 @@ module OneM2M_Templates {
};
template (value) Schedule_optional m_contentCreateSchedule (in template (value) ScheduleEntries p_scheduleElement) := {
resourceName := PX_DEFAULT_RESOURCE_NAME,//O
resourceName := c_defaultResourceName,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
......@@ -968,7 +968,7 @@ module OneM2M_Templates {
};
template (value) Subscription_optional m_contentCreateSubscription (in template (value) ListOfURIs p_notificationURI) := {
resourceName := PX_DEFAULT_RESOURCE_NAME,//O
resourceName := c_defaultResourceName,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
......@@ -996,7 +996,7 @@ module OneM2M_Templates {
};
template (value) ContentInstance_optional m_contentCreateContentInstance(XSD.String p_primitiveContent) := {
resourceName := PX_DEFAULT_RESOURCE_NAME,//O
resourceName := c_defaultResourceName,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
......@@ -1019,7 +1019,7 @@ module OneM2M_Templates {
};
template (value) Container_optional m_contentCreateContainer := {
resourceName := PX_DEFAULT_RESOURCE_NAME,//O
resourceName := c_defaultResourceName,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
......@@ -1046,7 +1046,7 @@ module OneM2M_Templates {
//@Martin
template (value) LocationPolicy_optional m_contentCreateLocationPolicy (in template (omit) AcpType p_accessControlPolicyIDs, in template (value) XSD.Duration locationUpdatePeriod, in template (value) NodeID locationTargetID, in template (value) XSD.AnyURI locationServerAddress) := {
resourceName := PX_DEFAULT_RESOURCE_NAME, //O
resourceName := c_defaultResourceName, //O
resourceType := omit, //NP
resourceID := omit, //NP
parentID := omit, //NP
......
......@@ -1000,7 +1000,7 @@ module OneM2M_Testcases {
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName != PX_DEFAULT_RESOURCE_NAME){
if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
......@@ -1017,7 +1017,7 @@ module OneM2M_Testcases {
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName != PX_DEFAULT_RESOURCE_NAME){
if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
......@@ -1034,7 +1034,7 @@ module OneM2M_Testcases {
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName != PX_DEFAULT_RESOURCE_NAME){
if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
......@@ -1051,7 +1051,7 @@ module OneM2M_Testcases {
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName != PX_DEFAULT_RESOURCE_NAME){
if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
......@@ -1067,7 +1067,7 @@ module OneM2M_Testcases {
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName != PX_DEFAULT_RESOURCE_NAME){
if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
......@@ -1084,7 +1084,7 @@ module OneM2M_Testcases {
if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){
setverdict(fail, testcasename(), ": Error, resourceName attribute not provided");
} else {
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName != PX_DEFAULT_RESOURCE_NAME){
if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName != c_defaultResourceName){
setverdict(fail, testcasename(), ": Error, resourceName attribute not correct");
}
}
......@@ -3135,14 +3135,14 @@ module OneM2M_Testcases {
// Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_aeIndex, p_updateRequestPrimitive);
v_request.to_ := v_request.to_ & "/" & PX_DEFAULT_RESOURCE_NAME;
v_request.to_ := v_request.to_ & "/" & c_defaultResourceName;
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(int4005)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource " & PX_DEFAULT_RESOURCE_NAME & " of type " & int2str(enum2int(p_resourceType)) & " not found");
setverdict(pass, testcasename() & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found");
}
[] mcaPort.receive(mw_responseKO) -> value v_response {
tc_ac.stop;
......@@ -3541,7 +3541,7 @@ module OneM2M_Testcases {
testcase TC_CSE_LOC_BV_001_01() runs on M2M system M2MSystem {
var integer v_aeAuxIndex := -1;
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & PX_AEAUX_NAME;
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & c_aeAuxName;
var RequestPrimitive v_request;
var M2MResponsePrimitive v_response;
......@@ -3583,7 +3583,7 @@ module OneM2M_Testcases {
testcase TC_CSE_LOC_BV_001_02() runs on M2M system M2MSystem {
var integer v_aeAuxIndex := -1;
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & PX_AEAUX_NAME;
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & c_aeAuxName;
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
......@@ -3629,7 +3629,7 @@ module OneM2M_Testcases {
testcase TC_CSE_LOC_BO_001_01() runs on M2M system M2MSystem {//no AE_ID presented in the from_ is assigned privilege to do locationPolicy resource create operation!!
var integer v_aeAuxIndex := -1;
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & PX_AEAUX_NAME;
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & c_aeAuxName;
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
......@@ -3674,7 +3674,7 @@ module OneM2M_Testcases {
testcase TC_CSE_LOC_BO_001_02() runs on M2M system M2MSystem {
var integer v_aeAuxIndex := -1;
var XSD.ID p_targetResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & PX_AEAUX_NAME & "/" & PX_DEFAULT_RESOURCE_NAME;
var XSD.ID p_targetResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & c_aeAuxName & "/" & c_defaultResourceName;
var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD;
var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID;
var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS;
......@@ -3720,8 +3720,8 @@ module OneM2M_Testcases {
var integer v_aeAuxIndex := -1;
var integer v_locPolicyResourceIndex := -1;
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & PX_AEAUX_NAME;
var XSD.ID p_defaultResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & PX_AEAUX_NAME & "/" & PX_DEFAULT_RESOURCE_NAME;//which is better? if initialization of to_ := {"Not-initialized"}, then this parameter doesnot need!
var XSD.ID p_aeResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & c_aeAuxName;
var XSD.ID p_defaultResourceAddress := PX_URI_CSE & PX_CSE_NAME & "/" & c_aeAuxName & "/" & c_defaultResourceName;
var XSD.Duration locationUpdatePeriod_invalid := PX_LOCATION_UPDATE_PERIOD_INVALID;
var RequestPrimitive v_request;
var RequestPrimitive v_request_preamble;
......
......@@ -17,11 +17,11 @@ module OneM2M_TypesAndValues {
import from OneM2M_Types all;
/* Constants */
//const charstring c_uri_cse := "/~/in-cse/";
//const charstring c_cse_name := "in-cse";
//const XSD.String c_defaultResourceName := "MyResource";
//const charstring c_aeAuxName := "MyAe";
//const XSD.String c_acpAuxName := "MyAcp";
const charstring c_uri_cse := "/~/in-cse/";
const charstring c_cse_name := "in-cse";
const XSD.String c_defaultResourceName := "MyResource";
const charstring c_aeAuxName := "MyAe";
const XSD.String c_acpAuxName := "MyAcp";
//AccessControlOperations
const XSD.Integer c_C := 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment