Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ATS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TST
ATS
Commits
0e269726
Commit
0e269726
authored
Feb 06, 2018
by
Antonio Castillo Verdugo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
#13
and
#14
parent
7254733b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
45 deletions
+59
-45
OneM2M_Testcases_CSE_Release_1.ttcn
OneM2M_Testcases_CSE_Release_1.ttcn
+59
-45
No files found.
OneM2M_Testcases_CSE_Release_1.ttcn
View file @
0e269726
...
...
@@ -3356,12 +3356,14 @@ module OneM2M_Testcases_CSE_Release_1 {
*/
testcase TC_CSE_DMR_CRE_007() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
var template RequestPrimitive v_createRequestContentInstance := m_createContentInstanceBase;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
const integer c_maxNumberOfInstances := 0;
var integer v_contentInstanceIndex := -1;
const integer c_maxNumberOfInstances := 1;
// Test control
// Test component configuration
...
...
@@ -3372,41 +3374,45 @@ module OneM2M_Testcases_CSE_Release_1 {
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_createRequest.primitiveContent.container.maxNrOfInstances := c_maxNumberOfInstances;
v_createRequest
Container
.primitiveContent.container.maxNrOfInstances := c_maxNumberOfInstances;
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex); //Container
v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); //ContentInstance
// Test Body
v_request := f_getCreateRequestPrimitive(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), "MyValue"), v_containerIndex);
v_createRequestContentInstance.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2"; //ContentInstance 2
v_request := f_getCreateRequestPrimitive(int4, v_createRequestContentInstance, v_containerIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int
5207
))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int
2001
))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":
Maximun number of instances exceed
ed");
setverdict(pass, __SCOPE__ & ":
ContentInstance creat
ed");
}
[] mcaPort.receive(mw_response(mw_responsePrimitive
KO
)) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive
OK
)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":
Bad responseStatusCode in
response");
setverdict(fail, __SCOPE__ & ":
Wrong response status code in the
response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitive
OK
)) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive
KO
)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":
Accepted creation of contentInstance exceding maximum number of instances
");
setverdict(fail, __SCOPE__ & ":
Error while creating resource type contentInstance
");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type
4
");
setverdict(fail, __SCOPE__ & ": No answer while creating resource type
contentInstance
");
}
}
f_checkAeSimuStatus();
//Check to see if the resource is NOT present
if(f_isResourceNotPresent(v_containerIndex,
f_getResourceName(v_request.primitiveContent)
)){
setverdict(pass, __SCOPE__ & ":INFO:
Resource not created
");
if(f_isResourceNotPresent(v_containerIndex,
c_defaultContentInstanceResourceName
)){
setverdict(pass, __SCOPE__ & ":INFO:
Oldest contentInstance has been removed to allow the creation of the new contentInstance
");
} else {
setverdict(fail, __SCOPE__ & ":ERROR:
Resource created
");
setverdict(fail, __SCOPE__ & ":ERROR:
Oldest contentInstance has not been removed to allow the creation of the new contentInstance
");
}
// Postamble
...
...
@@ -3426,64 +3432,72 @@ module OneM2M_Testcases_CSE_Release_1 {
*
*/
testcase TC_CSE_DMR_CRE_008() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
//Local variables
var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
var template RequestPrimitive v_createRequestContentInstance := m_createContentInstanceBase;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
const integer c_maxByteSize := 0;
var integer v_contentInstanceIndex := -1;
const integer c_maxByteSize := 10;
const XSD.String c_primitiveContent1 := "Content1";
const XSD.String c_primitiveContent2 := "Content2";
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
v_createRequestContainer.primitiveContent.container.maxByteSize := c_maxByteSize;
v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex); //Container
v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), c_primitiveContent1), v_containerIndex);//ContentInstance
// Test Body
v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex);
v_createRequestContentInstance.primitiveContent.contentInstance.content := c_primitiveContent2; //ContentInstance 2
v_createRequestContentInstance.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2";
v_request := f_getCreateRequestPrimitive(int4, v_createRequestContentInstance, v_containerIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int
5207
))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int
2001
))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":
Maximun byte size exceed
ed");
setverdict(pass, __SCOPE__ & ":
ContentInstance creat
ed");
}
[] mcaPort.receive(mw_response(mw_responsePrimitive
KO
)) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive
OK
)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":
Bad responseStatusCode in
response");
setverdict(fail, __SCOPE__ & ":
Wrong response status code in the
response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":
Accepted creation of contentInstance exceding maximum byte siz
e");
setverdict(fail, __SCOPE__ & ":
Error while creating resource type contentInstanc
e");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type
4
");
setverdict(fail, __SCOPE__ & ": No answer while creating resource type
contentInstance
");
}
}
f_checkAeSimuStatus();
//Check to see if the resource is
present or no
t
if(f_isResourceNotPresent(v_containerIndex,
f_getResourceName(v_request.primitiveContent)
)){
setverdict(pass, __SCOPE__ & ":INFO: Resource created
");
//Check to see if the resource is
NOT presen
t
if(f_isResourceNotPresent(v_containerIndex,
c_defaultContentInstanceResourceName
)){
setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance
");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource not created
");
setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance
");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment