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 @@
*
* @author ETSI
* @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
*
*/
......@@ -19,7 +19,7 @@ module OneM2M_Templates {
import from OneM2M_TypesAndValues all;
//import from OneM2M_AdditionalTypes all;
import from OneM2M_Pixits all;
import from OneM2M_Functions all;
//import from OneM2M_Functions all;
/**
......@@ -36,12 +36,14 @@ module OneM2M_Templates {
/* Templates */
group primitives {
/**
* @desc Base template for request sending operations
* @param p_requestPrimitive
*/
template (value) M2MRequestPrimitive m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := {
requestPrimitive_ := p_requestPrimitive,
template (value) MsgOut m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := {
primitive := { requestPrimitive := p_requestPrimitive},
host := PX_HOST_ADDRESS,
xmlNamespace := PX_XML_NAMESPACE,
protocolBinding := PX_PROTOCOL_BINDING,
......@@ -49,15 +51,20 @@ module OneM2M_Templates {
nullFields := p_nullFields
};
//Added by @Naum
template M2MRequestPrimitive mw_request(in template RequestPrimitive p_requestPrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := {
requestPrimitive_ := p_requestPrimitive,
host := omit,
xmlNamespace := omit,
protocolBinding := omit,
serialization := omit,
nullFields := omit
template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := {
primitive := { requestPrimitive := p_requestPrimitive}
};
/**
* @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 Retrieve {
......@@ -2123,8 +2130,7 @@ module OneM2M_Templates {
}//end group SpecialContents
group ResponsePrimitives {
template M2MResponsePrimitive mw_response(ResponseStatusCode p_statusCode) := {
responsePrimitive_ := {
template ResponsePrimitive mw_responsePrimitive(ResponseStatusCode p_statusCode) := {
responseStatusCode := p_statusCode,
requestIdentifier := ?,
primitiveContent := *,
......@@ -2133,11 +2139,9 @@ module OneM2M_Templates {
originatingTimestamp := *,
resultExpirationTimestamp := *,
eventCategory := *
}
};
template M2MResponsePrimitive mw_responseInverse(ResponseStatusCode p_statusCode) := {
responsePrimitive_ := {
template ResponsePrimitive mw_responsePrimitiveInverse(ResponseStatusCode p_statusCode) := {
responseStatusCode := complement(p_statusCode),
requestIdentifier := ?,
primitiveContent := *,
......@@ -2146,11 +2150,9 @@ module OneM2M_Templates {
originatingTimestamp := *,
resultExpirationTimestamp := *,
eventCategory := *
}
};
template M2MResponsePrimitive mw_responseOK(in template PrimitiveContent p_content := *) := {
responsePrimitive_ := {
template ResponsePrimitive mw_responsePrimitiveOK(in template PrimitiveContent p_content := *) := {
responseStatusCode := (int2000, int2001, int2002, int2004),
requestIdentifier := ?,
primitiveContent := p_content,
......@@ -2159,12 +2161,9 @@ module OneM2M_Templates {
originatingTimestamp := *,
resultExpirationTimestamp := *,
eventCategory := *
}
};
template M2MResponsePrimitive mw_responseKO := {
responsePrimitive_ := {
template ResponsePrimitive mw_responsePrimitiveKO := {
responseStatusCode := complement(int2000, int2001, int2002, int2004),
requestIdentifier := ?,
primitiveContent := *,
......@@ -2173,7 +2172,6 @@ module OneM2M_Templates {
originatingTimestamp := *,
resultExpirationTimestamp := *,
eventCategory := *
}
};
}//end group ResponsePrimitives
......
......@@ -7,7 +7,7 @@
*
* @author ETSI
* @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
*
*/
......@@ -24,9 +24,9 @@ module OneM2M_TestSystem {
*/
type port OneM2MPort message {
in
M2MRequestPrimitive, M2MResponsePrimitive;
MsgIn;
out
M2MRequestPrimitive, M2MResponsePrimitive;
MsgOut;
}
/**
......@@ -40,39 +40,61 @@ module OneM2M_TestSystem {
}
/* Components */
type component M2M {
port OneM2MPort mcaPort;
port OneM2MPort mccPort;
type component Tester {
port AdapterControlPort acPort;
//timers
timer tc_ac := PX_TAC;
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
var AE_optional vc_aeAux;//TODO To be removed
var AccessControlPolicy_optional vc_acpAux;
var integer vc_acpAuxIndex := -1;
var MyResourcesList vc_resourcesList;
var IntegerList vc_resourcesIndexToBeDeleted;
}
type component M2MSystem {
type component AeTester extends Tester {
port OneM2MPort mcaPort;
//global variables
}
type component CseSystem {
port OneM2MPort mcaPort;
port OneM2MPort mccPort;
port AdapterControlPort acPort;
}
type component AeSystem {
port OneM2MPort mcaPort;
port AdapterControlPort acPort;
}
/* Primitives */
/**
* @desc Type for the oneM2M primitives exchange
* @member requestPrimitive_ oneM2M primitive
* @member primitive oneM2M primitive
* @member host IP Address of the destination
* @member xmlNamespace XML Namespace to be used
* @member protocolBinding Protocol binding 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>
*/
type record M2MRequestPrimitive {
RequestPrimitive requestPrimitive_,
type record MsgOut {
union {
RequestPrimitive requestPrimitive,
ResponsePrimitive responsePrimitive
} primitive,
charstring host optional,
charstring xmlNamespace optional,
charstring protocolBinding optional,
......@@ -80,20 +102,15 @@ module OneM2M_TestSystem {
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 {
RequestPrimitive requestPrimitive_,
ResponsePrimitive responsePrimitive_
} primitive,
charstring host optional,
charstring xmlNamespace optional,
charstring protocolBinding optional,
charstring serialization optional,
AttributeList_1 nullFields optional
RequestPrimitive requestPrimitive,
ResponsePrimitive responsePrimitive
} primitive
}
type record AcRequestPrimitive {
......
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