New GMG test cases added and pre validation of GMG group

Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 14dc291f
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $
* $Id: OneM2M_Functions.ttcn 170 2016-11-21 15:53:54Z reinaortega $
* $Id: OneM2M_Functions.ttcn 174 2016-11-22 11:36:56Z carres $
* @desc Module containing functions for oneM2M
*
*/
......@@ -714,7 +714,7 @@ module OneM2M_Functions {
*/
function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on CseTester return RequestPrimitive {
var integer p_locresourceIndex := p_parentIndex;
var template ListOfURIs v_notificationURI := {"Not Initialized"};
var template ListOfURIs v_defaultListOfURIs := {"Not Initialized"};
p_request.from_ := f_getOriginator(p_parentIndex);
p_request.to_ := f_getResourceAddress(p_parentIndex);
......@@ -723,7 +723,9 @@ module OneM2M_Functions {
}
if (p_resourceType == int9) {//group
p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)};
if(match(valueof(p_request.primitiveContent.any_1[0].Group_optional.memberIDs), v_defaultListOfURIs )){
p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)};
}
}
if(p_resourceType == int3){//container
......@@ -743,7 +745,7 @@ module OneM2M_Functions {
}
if (p_resourceType == int23) {//subscription
if(match(valueof(p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI), v_notificationURI )){
if(match(valueof(p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI), v_defaultListOfURIs )){
p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(p_parentIndex)};
}
/*if(PX_FROM_IS_AE_ID) {
......
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
* $Id: OneM2M_Templates.ttcn 170 2016-11-21 15:53:54Z reinaortega $
* $Id: OneM2M_Templates.ttcn 179 2016-11-24 10:39:02Z carres $
* @desc Module containing templates for oneM2M
*
*/
......@@ -470,13 +470,13 @@ module OneM2M_Templates {
}
};
template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName) modifies m_create := {
template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultResourceName) modifies m_create := {
to_ := p_parentResourceAddress,
from_ := PX_AE_ID_STEM,
requestIdentifier := "m_createContainer" & f_rnd(1, 1000000),
resourceType := int3,
primitiveContent := {
any_1 := {{Container_optional := m_contentCreateContainer}}
any_1 := {{Container_optional := m_contentCreateContainer(p_resourceName)}}
}
};
......@@ -498,17 +498,21 @@ module OneM2M_Templates {
requestIdentifier := "m_createGroup" & f_rnd(1, 1000000),
resourceType := int9,
primitiveContent := {
any_1 := {{Group_optional := m_contentCreateGroup (1, {"/" & PX_CSE_NAME & "/" & "NotInitialized"}, omit)}} //TODO: p_resourceId
any_1 := {{Group_optional := m_contentCreateGroup (1, {"Not Initialized"}, omit, omit)}} //TODO: p_resourceId
}
};
template (value) RequestPrimitive m_createGroup(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name, in template (omit) AcpType p_accessControlPolicyIDs, in template (value) XSD.AnyURI p_memberId ) modifies m_create := {
to_ := p_parentResourceAddress,
from_ := PX_AE_ID_STEM,
template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
in template (value) ListOfURIs p_memberIds := {"Not Initialized"},
in template (omit) AcpType p_accessControlPolicyIDs,
in template (omit) MemberType p_memberType := omit,
in template (omit) ConsistencyStrategy p_consistencyStrategy := omit,
in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit,
in template (omit) XSD.String p_name := "MyGroup") modifies m_create := {
requestIdentifier := "m_createGroup" & f_rnd(1, 1000000),
resourceType := int9,
primitiveContent := {
any_1 := {{Group_optional := m_contentCreateGroup (1, {"/" & PX_CSE_NAME & "/" & valueof(p_memberId)}, p_accessControlPolicyIDs)}} //TODO: p_resourceId
any_1 := {{Group_optional := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIDs, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}} //TODO: p_resourceId
}
};
......@@ -882,6 +886,9 @@ 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,
in template (omit) MemberType p_memberType := omit,
in template (omit) ConsistencyStrategy p_consistencyStrategy := omit,
in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit,
in template (omit) XSD.String p_name := c_defaultResourceName) := {
resourceName := p_name,//O
resourceType := omit,//NP
......@@ -896,13 +903,13 @@ module OneM2M_Templates {
announceTo := omit,//O
announcedAttribute := omit,//O
creator := omit,//O
memberType := omit,//O
memberType := p_memberType,//O
currentNrOfMembers := omit,//NP
maxNrOfMembers := p_maxNrOfMembers,//M
memberIDs := p_memberIds,//M
membersAccessControlPolicyIDs := omit,//O
membersAccessControlPolicyIDs := p_membersAccessControlPolicyIDs,//O
memberTypeValidated := omit,//NP
consistencyStrategy := omit,//O
consistencyStrategy := p_consistencyStrategy,//O
groupName := omit,//O
choice := omit//NP
};
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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