Commit 4a083b33 authored by Antonio Castillo Verdugo's avatar Antonio Castillo Verdugo
Browse files

Discovery fixes

parent f0116f7f
......@@ -204,6 +204,35 @@ module OneM2M_Templates {
}
};
/**
* @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
* @param p_targetResourceAddress Target resource address
* @param p_originator Originator (from)
* @param p_filterUsage FilterUsage
* @param p_labels Labels
*/
template (value) RequestPrimitive m_retrieveResourceFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieveResource := {
requestIdentifier := "m_retrieveResourceFilterUsageOptionLabel" & f_rnd(1, 1000000),
filterCriteria := {
createdBefore := omit,
createdAfter := omit,
modifiedSince := omit,
unmodifiedSince := omit,
stateTagSmaller := omit,
stateTagBigger := omit,
expireBefore := omit,
expireAfter := omit,
labels := p_labels,
resourceType := omit,
sizeAbove := omit,
sizeBelow := omit,
contentType_list := {},
attribute_list := {},
filterUsage := p_filterUsage,
limit := omit
}
};
/**
* @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
* @param p_targetResourceAddress Target resource address
......@@ -3294,10 +3323,10 @@ module OneM2M_Templates {
eventCategory := *
};
template ResponsePrimitive mw_responseDiscovery := {
template ResponsePrimitive mw_responseDiscovery(template URIList p_uriList := ?) := {
responseStatusCode := int2000,
requestIdentifier := ?,
primitiveContent := {uRIList := ?},
primitiveContent := {uRIList := p_uriList},
to_ := *,
from_ := *,
originatingTimestamp := *,
......
......@@ -15769,6 +15769,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
var Labels v_labels := {"NotFoundLabel"};
// Test control
......@@ -15782,12 +15783,14 @@ module OneM2M_Testcases {
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
//v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
v_request := valueof(m_retrieveResourceFilterUsageOptionLabel(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1, v_labels));
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
tc_ac.stop;
log("sizeof: " & int2str(sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)));
if(sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList) == 0){
setverdict(pass, __SCOPE__ & ": No Content is present");
}
......@@ -15828,6 +15831,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
var integer v_i_cont := 0;
// Test control
......@@ -15847,10 +15851,13 @@ module OneM2M_Testcases {
alt {
[] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response {
tc_ac.stop;
if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) {
setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList element");
} else {
setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList representation");
while (v_i_cont<sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){
if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) {
setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element");
} else {
setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element");
}
v_i_cont := v_i_cont + 1;
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
......@@ -16013,7 +16020,9 @@ module OneM2M_Testcases {
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
v_request := valueof(m_retrieveResourceInvalidFormatOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)));
v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1));
v_request.filterCriteria.expireBefore := "20171231T012345";
v_request.filterCriteria.expireAfter := "20181231T012345";
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
......
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