Commit 0c81722b authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Merge branch 'master' of https://git.onem2m.org/TST/ATS

parents eb9f1917 1e079f6a
......@@ -236,6 +236,17 @@ module OneM2M_Templates {
tokenReqIndicator := omit
};
/**
* @desc Base UPDATE request primitive for Ae resource
*/
template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
from_ := PX_AE_ID_STEM,
requestIdentifier := "m_updateAe" & f_rnd(1, 1000000),
primitiveContent:= {
any_1 := {{AE_optional := m_contentUpdateAe}}
}
};
/**
* @desc Base UPDATE request primitive for Container resource
*/
......@@ -990,7 +1001,7 @@ module OneM2M_Templates {
notificationEventCat := omit,//O
subscriberURI := omit,//O
choice := omit//NP
};
};
template (value) Subscription_optional m_contentCreateSubscriptionAdvanced (in template (value) ListOfURIs p_notificationURI,
in template (omit) XSD.String p_name := c_defaultResourceName,
......@@ -1343,7 +1354,7 @@ module OneM2M_Templates {
e2eSecInfo:= *, //O
choice := *//O
};
template AE_optional mw_contentAe_allOmit := {
resourceName := omit,//M
resourceType := omit,//M
......@@ -1990,6 +2001,28 @@ module OneM2M_Templates {
locationID := omit,
ontologyRef := omit
};
template (value) EventNotificationCriteria m_eventNotificationCriteria (in NotificationEventType p_notificationEventType) := {
createdBefore := omit,
createdAfter := omit,
modifiedSince := omit,
unmodifiedSince := omit,
stateTagSmaller := omit,
stateTagBigger := omit,
expireBefore := omit,
expireAfter := omit,
sizeAbove := omit,
sizeBelow := omit,
operationMonitor_list := {},
attribute_list := {}, // TODO this list should be able to be omited see 9.6.8
notificationEventType_list := {p_notificationEventType},// TODO this list should be able to be omited see 9.6.8
missingData := omit
}
template (value) BatchNotify m_batchNotifyNumber3Duration1 := {
number := 3,
duration := " " //TODO duration has to be set to 1s and match to the Duration regex
}//normaly duration can be omited 6.3.5.6 (TS0004)
}//end group SpecialContents
......@@ -2094,5 +2127,5 @@ module OneM2M_Templates {
return v_address;
}
} // end of module
......@@ -98,7 +98,7 @@ module OneM2M_Testcases {
unmap(self:mcaPort, system:mcaPort);
stop;
}
}//end group helpingTestCases
}//end group oneM2M_demos
......@@ -1564,7 +1564,7 @@ module OneM2M_Testcases {
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
......@@ -4272,6 +4272,246 @@ module OneM2M_Testcases {
}//end group Data_Management_and_Repository
group Notification {
group g_CSE_SUB_BV_001_1{
testcase TC_CSE_SUB_BV_001_1() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_childResourceIndex := -1;
var template RequestPrimitive v_createRequestOne := m_createSubscriptionBase;
var template RequestPrimitive v_createRequestTwo := m_createSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
var RequestPrimitive v_request;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int23, v_createRequestOne, v_aeIndex);//Subscription
v_request := f_getCreateRequestPrimitive(int23, v_createRequestOne, v_resourceIndex);
//Postamble
f_cse_postamble_deleteResources();
//Tear down
f_cf01Down();
} // end TC_CSE_SUB_BV_001_1
}//end group g_CSE_SUB_BV_001_1
group g_CSE_SUB_BV_001{
testcase TC_CSE_SUB_BV_001() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var Labels v_labels_1:= {"VALUE_1"};
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var template RequestPrimitive v_createRequest := m_createSubscriptionAdvanced();
var template PrimitiveContent v_contentResponse;
var template RequestPrimitive v_updateRequest := m_updateAeBase;
var RequestPrimitive v_request;
v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1;
v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Attribute of resource type int2 (Ae) updated successfuly");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating resource type int2 (Ae)");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource type int2 (Ae)");
}
}
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Notification received");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while sending notification");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": None notification received");
}
}
//Postamble
f_cse_postamble_deleteResources();
//Tear down
f_cf01Down();
} // end TC_CSE_SUB_BV_001
}//end group g_CSE_SUB_BV_001
group g_CSE_SUB_BV_003{
testcase TC_CSE_SUB_BV_003() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_childResourceIndex := -1;
var ListOfURIs v_notificationURI := {"Not Initialized"};
var template RequestPrimitive v_createRequest := m_createSubscriptionAdvanced(v_notificationURI, m_eventNotificationCriteria(int3));
var template PrimitiveContent v_contentResponse;
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Notification received");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while sending notification");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": None notification received");
}
}
//Postamble
f_cse_postamble_deleteResources();
//Tear down
f_cf01Down();
} // end TC_CSE_SUB_BV_003
}//end group g_CSE_SUB_BV_003
group g_CSE_SUB_BV_004{
testcase TC_CSE_SUB_BV_004() runs on CseTester system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_deleteRequest;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_childResourceIndex := -1;
var ListOfURIs v_notificationURI := {"Not Initialized"};
var template RequestPrimitive v_createRequest := m_createSubscriptionAdvanced(v_notificationURI, m_eventNotificationCriteria(int4));
var template PrimitiveContent v_contentResponse;
//v_createRequest.primitiveContent.any_1[0].Subscription_optional.resourceName := omit; // name's R1 =! of his child ressource R2 ?
v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected in notification
v_deleteRequest := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex)));
v_deleteRequest.resultContent := int0; //none content is expected because if the child ressource triggers a notification the second received message will have no content and the test shall fail
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
v_childResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
mcaPort.send(m_request(v_deleteRequest));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource deleted successfuly");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while deleting resource ");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while deleting resource type ");
}
}
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Notification received");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while sending notification");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": None notification received");
}
}
//Postamble
f_cse_postamble_deleteResources();
//Tear down
f_cf01Down();
} // end TC_CSE_SUB_BV_004
}//end group g_CSE_SUB_BV_004
}//end group Notification
//@Martin
group Location {
......@@ -5320,7 +5560,7 @@ module OneM2M_Testcases {
} // end group g_CSE_GMG_BV_012
} // end group Group_Managment
group Subscription_And_Notification {
group g_CSE_SUB_BV_001{
......
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