Clean up and refactoring

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 0cac2e43
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
* $Id: OneM2M_Templates.ttcn 103 2016-08-30 09:39:32Z reinaortega $ * $Id: OneM2M_Templates.ttcn 105 2016-08-31 13:01:46Z reinaortega $
* @desc Module containing templates for oneM2M * @desc Module containing templates for oneM2M
* *
*/ */
...@@ -19,7 +19,7 @@ module OneM2M_Templates { ...@@ -19,7 +19,7 @@ module OneM2M_Templates {
import from OneM2M_TypesAndValues all; import from OneM2M_TypesAndValues all;
//import from OneM2M_AdditionalTypes all; //import from OneM2M_AdditionalTypes all;
import from OneM2M_Pixits all; import from OneM2M_Pixits all;
import from OneM2M_Functions all; //import from OneM2M_Functions all;
/** /**
...@@ -36,27 +36,34 @@ module OneM2M_Templates { ...@@ -36,27 +36,34 @@ module OneM2M_Templates {
/* Templates */ /* Templates */
/**
* @desc Base template for request sending operations group primitives {
* @param p_requestPrimitive /**
*/ * @desc Base template for request sending operations
template (value) M2MRequestPrimitive m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := { * @param p_requestPrimitive
requestPrimitive_ := p_requestPrimitive, */
host := PX_HOST_ADDRESS, template (value) MsgOut m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := {
xmlNamespace := PX_XML_NAMESPACE, primitive := { requestPrimitive := p_requestPrimitive},
protocolBinding := PX_PROTOCOL_BINDING, host := PX_HOST_ADDRESS,
serialization := PX_SERIALIZATION, xmlNamespace := PX_XML_NAMESPACE,
nullFields := p_nullFields protocolBinding := PX_PROTOCOL_BINDING,
}; serialization := PX_SERIALIZATION,
//Added by @Naum nullFields := p_nullFields
template M2MRequestPrimitive mw_request(in template RequestPrimitive p_requestPrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := { };
requestPrimitive_ := p_requestPrimitive, //Added by @Naum
host := omit, template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := {
xmlNamespace := omit, primitive := { requestPrimitive := p_requestPrimitive}
protocolBinding := omit, };
serialization := omit,
nullFields := omit /**
}; * @desc Base template for response receiving operations
* @param p_responsePrimitive
*/
template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive) := {
primitive := { responsePrimitive := p_responsePrimitive}
};
}
group RequestPrimitives { group RequestPrimitives {
...@@ -2123,57 +2130,48 @@ module OneM2M_Templates { ...@@ -2123,57 +2130,48 @@ module OneM2M_Templates {
}//end group SpecialContents }//end group SpecialContents
group ResponsePrimitives { group ResponsePrimitives {
template M2MResponsePrimitive mw_response(ResponseStatusCode p_statusCode) := { template ResponsePrimitive mw_responsePrimitive(ResponseStatusCode p_statusCode) := {
responsePrimitive_ := { responseStatusCode := p_statusCode,
responseStatusCode := p_statusCode, requestIdentifier := ?,
requestIdentifier := ?, primitiveContent := *,
primitiveContent := *, to_ := *,
to_ := *, from_ := *,
from_ := *, originatingTimestamp := *,
originatingTimestamp := *, resultExpirationTimestamp := *,
resultExpirationTimestamp := *, eventCategory := *
eventCategory := *
}
}; };
template M2MResponsePrimitive mw_responseInverse(ResponseStatusCode p_statusCode) := { template ResponsePrimitive mw_responsePrimitiveInverse(ResponseStatusCode p_statusCode) := {
responsePrimitive_ := { responseStatusCode := complement(p_statusCode),
responseStatusCode := complement(p_statusCode), requestIdentifier := ?,
requestIdentifier := ?, primitiveContent := *,
primitiveContent := *, to_ := *,
to_ := *, from_ := *,
from_ := *, originatingTimestamp := *,
originatingTimestamp := *, resultExpirationTimestamp := *,
resultExpirationTimestamp := *, eventCategory := *
eventCategory := *
}
}; };
template M2MResponsePrimitive mw_responseOK(in template PrimitiveContent p_content := *) := { template ResponsePrimitive mw_responsePrimitiveOK(in template PrimitiveContent p_content := *) := {
responsePrimitive_ := { responseStatusCode := (int2000, int2001, int2002, int2004),
responseStatusCode := (int2000, int2001, int2002, int2004), requestIdentifier := ?,
requestIdentifier := ?, primitiveContent := p_content,
primitiveContent := p_content, to_ := *,
to_ := *, from_ := *,
from_ := *, originatingTimestamp := *,
originatingTimestamp := *, resultExpirationTimestamp := *,
resultExpirationTimestamp := *, eventCategory := *
eventCategory := *
}
}; };
template M2MResponsePrimitive mw_responseKO := { template ResponsePrimitive mw_responsePrimitiveKO := {
responsePrimitive_ := { responseStatusCode := complement(int2000, int2001, int2002, int2004),
responseStatusCode := complement(int2000, int2001, int2002, int2004), requestIdentifier := ?,
requestIdentifier := ?, primitiveContent := *,
primitiveContent := *, to_ := *,
to_ := *, from_ := *,
from_ := *, originatingTimestamp := *,
originatingTimestamp := *, resultExpirationTimestamp := *,
resultExpirationTimestamp := *, eventCategory := *
eventCategory := *
}
}; };
}//end group ResponsePrimitives }//end group ResponsePrimitives
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* @author ETSI * @author ETSI
* @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $ * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $
* $Id: OneM2M_TestSystem.ttcn 103 2016-08-30 09:39:32Z reinaortega $ * $Id: OneM2M_TestSystem.ttcn 105 2016-08-31 13:01:46Z reinaortega $
* @desc Test System module for oneM2M * @desc Test System module for oneM2M
* *
*/ */
...@@ -24,9 +24,9 @@ module OneM2M_TestSystem { ...@@ -24,9 +24,9 @@ module OneM2M_TestSystem {
*/ */
type port OneM2MPort message { type port OneM2MPort message {
in in
M2MRequestPrimitive, M2MResponsePrimitive; MsgIn;
out out
M2MRequestPrimitive, M2MResponsePrimitive; MsgOut;
} }
/** /**
...@@ -39,61 +39,78 @@ module OneM2M_TestSystem { ...@@ -39,61 +39,78 @@ module OneM2M_TestSystem {
AcRequestPrimitive; AcRequestPrimitive;
} }
/* Components */ /* Components */
type component M2M { type component Tester {
port OneM2MPort mcaPort;
port OneM2MPort mccPort;
port AdapterControlPort acPort; port AdapterControlPort acPort;
//timers //timers
timer tc_ac := PX_TAC; timer tc_ac := PX_TAC;
timer tc_wait; timer tc_wait;
//global variables
var MyResourcesList vc_resourcesList;
var IntegerList vc_resourcesIndexToBeDeleted;
}
type component CseTester extends Tester {
port OneM2MPort mcaPort;
port OneM2MPort mccPort;
//global variables //global variables
var AE_optional vc_aeAux;//TODO To be removed var AE_optional vc_aeAux;//TODO To be removed
var AccessControlPolicy_optional vc_acpAux; var AccessControlPolicy_optional vc_acpAux;
var integer vc_acpAuxIndex := -1; var integer vc_acpAuxIndex := -1;
var MyResourcesList vc_resourcesList;
var IntegerList vc_resourcesIndexToBeDeleted; }
type component AeTester extends Tester {
port OneM2MPort mcaPort;
//global variables
} }
type component M2MSystem { type component CseSystem {
port OneM2MPort mcaPort; port OneM2MPort mcaPort;
port OneM2MPort mccPort; port OneM2MPort mccPort;
port AdapterControlPort acPort; port AdapterControlPort acPort;
} }
type component AeSystem {
port OneM2MPort mcaPort;
port AdapterControlPort acPort;
}
/* Primitives */ /* Primitives */
/** /**
* @desc Type for the oneM2M primitives exchange * @desc Type for the oneM2M primitives exchange
* @member requestPrimitive_ oneM2M primitive * @member primitive oneM2M primitive
* @member host IP Address of the destination * @member host IP Address of the destination
* @member xmlNamespace XML Namespace to be used * @member xmlNamespace XML Namespace to be used
* @member protocolBinding Protocol binding to be used * @member protocolBinding Protocol binding to be used
* @member serialization Serialization to be used * @member serialization Serialization to be used
* @member nullFields Fields that are to be included in the oneM2M primitive but empty, i.e. <labels></labels> * @member nullFields Fields that are to be included in the oneM2M primitive but empty, i.e. <labels></labels>
*/ */
type record M2MRequestPrimitive { type record MsgOut {
RequestPrimitive requestPrimitive_, union {
RequestPrimitive requestPrimitive,
ResponsePrimitive responsePrimitive
} primitive,
charstring host optional, charstring host optional,
charstring xmlNamespace optional, charstring xmlNamespace optional,
charstring protocolBinding optional, charstring protocolBinding optional,
charstring serialization optional, charstring serialization optional,
AttributeList_1 nullFields optional AttributeList_1 nullFields optional
} }
type record M2MResponsePrimitive {
ResponsePrimitive responsePrimitive_
}
type record M2MPrimitive { /**
* @desc Type for the oneM2M primitives exchange
* @member primitive oneM2M primitive
*/
type record MsgIn {
union { union {
RequestPrimitive requestPrimitive_, RequestPrimitive requestPrimitive,
ResponsePrimitive responsePrimitive_ ResponsePrimitive responsePrimitive
} primitive, } primitive
charstring host optional,
charstring xmlNamespace optional,
charstring protocolBinding optional,
charstring serialization optional,
AttributeList_1 nullFields optional
} }
type record AcRequestPrimitive { type record AcRequestPrimitive {
......
This diff is collapsed.
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