Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
ATS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TST
ATS
Commits
0e269726
Commit
0e269726
authored
7 years ago
by
acverdugo
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#13
and
#14
parent
7254733b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
OneM2M_Testcases_CSE_Release_1.ttcn
+59
-45
59 additions, 45 deletions
OneM2M_Testcases_CSE_Release_1.ttcn
with
59 additions
and
45 deletions
OneM2M_Testcases_CSE_Release_1.ttcn
+
59
−
45
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
5
20
7
)))
->
value
v_response
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int20
01
)))
->
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
K
O
))
->
value
v_response
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveO
K
))
->
value
v_response
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
&
":
Bad
response
S
tatus
C
ode in response"
);
setverdict
(
fail
,
__SCOPE__
&
":
Wrong
response
s
tatus
c
ode in
the
response"
);
}
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
O
K
))
->
value
v_response
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveK
O
))
->
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
5
20
7
)))
->
value
v_response
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitive
(
int20
01
)))
->
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
K
O
))
->
value
v_response
{
[]
mcaPort
.
receive
(
mw_response
(
mw_responsePrimitiveO
K
))
->
value
v_response
{
tc_ac
.
stop
;
setverdict
(
fail
,
__SCOPE__
&
":
Bad
response
S
tatus
C
ode in response"
);
setverdict
(
fail
,
__SCOPE__
&
":
Wrong
response
s
tatus
c
ode 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 not
if
(
f_isResourceNotPresent
(
v_containerIndex
,
f_getResourceName
(
v_request
.
primitiveContent
)
)){
setverdict
(
pass
,
__SCOPE__
&
":INFO:
Resource created
"
);
//Check to see if the resource is
NOT
present
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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment