Initial code commit
diff --git a/demo/MBT_demo.cfg b/demo/MBT_demo.cfg
new file mode 100755
index 0000000..4775520
--- /dev/null
+++ b/demo/MBT_demo.cfg
@@ -0,0 +1,55 @@
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Copyright Test Competence Center (TCC) ETH 2009 //
+// //
+// The copyright to the computer program(s) herein is the property of TCC. //
+// The program(s) may be used and/or copied only with the written permission //
+// of TCC or in accordance with the terms and conditions stipulated in the //
+// agreement/contract under which the program(s) have been supplied //
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: SIP_Demo.cfg
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-04-20
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+[DEFINE]
+//num_entities := 1
+//Number of simulated entities
+
+[LOGGING]
+ConsoleMask := ERROR | STATISTICS | ACTION
+FileMask := LOG_ALL | DEBUG | MATCHING
+#FileMask := ERROR | STATISTICS | PARALLEL | ACTION | WARNING
+#LogFile := "%l/%e.%h-%t%r.%s"
+LogEntityName := Yes
+LogEventTypes := Yes//Subcategories;
+SourceInfoFormat := Stack
+
+[TESTPORT_PARAMETERS]
+//*.*.debug := "YES";
+
+[MODULE_PARAMETERS]
+
+tsp_debug_EPTF_SchedulerFunctions := false
+tsp_debugVerbose_EPTF_SchedulerFunctions := false
+tsp_EPTF_LGenBaseDebugTraffic := false
+tsp_EPTF_LGenBaseDebug := false
+
+[EXECUTE]
+MBT_demo.tc_MBT_SIP_Demo
+MBT_demo.tc_MBT_HTTP_Demo
+
+[TESTPORT_PARAMETERS]
+*.IPL4_PCO.debug := "NO"
+# In this section you can specify groups of hosts. These groups can be used inside the
+# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.
+
+[COMPONENTS]
+//TERM := rhea;
+//ORIG := 10.6.70.7;
+
+# This section consists of rules restricting the location of created PTCs.
+[MAIN_CONTROLLER]
+# The options herein control the behaviour of MC.
diff --git a/demo/MBT_demo.prj b/demo/MBT_demo.prj
new file mode 100644
index 0000000..28dcdc1
--- /dev/null
+++ b/demo/MBT_demo.prj
@@ -0,0 +1,153 @@
+<!DOCTYPE TITAN_GUI_project_file>
+<Project TITAN_version="1.8.pre0 build 3" >
+ <General>
+ <Project_Name>MBT_demo</Project_Name>
+ <Executable_Path>bin/demo</Executable_Path>
+ <Working_Dir>bin</Working_Dir>
+ <Build_Host>alpha</Build_Host>
+ <Execution_Mode>Parallel</Execution_Mode>
+ <ScriptFile_AfterMake>makefile_patch.sh</ScriptFile_AfterMake>
+ <Log_Format>yes</Log_Format>
+ <Update_Symlinks>yes</Update_Symlinks>
+ <Create_Absolute_Symlinks>no</Create_Absolute_Symlinks>
+ <Update_Makefile>yes</Update_Makefile>
+ <Localhost_Execute>yes</Localhost_Execute>
+ <Execute_Command>rsh %host "cd %project_working_dir ; "%executable" %localhost %mctr_port"</Execute_Command>
+ <Execute_Hosts>alfa, beta, gamma</Execute_Hosts>
+ <UnUsed_List></UnUsed_List>
+ </General>
+ <Modules>
+ <Module>MBT_demo.ttcn</Module>
+ </Modules>
+ <Configs>
+ <Config>MBT_demo.cfg</Config>
+ </Configs>
+ <Test_Cases>
+ </Test_Cases>
+ <File_Group name="MainFileGroup" >
+ <File_Groups>
+ <File_Group name="EPTF_Applib_MBT_CNL113659" >
+ <File path="../src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn" />
+ <File path="../src/LoadGen/EPTF_MBT_LGen_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Applib_SIP_CNL113522" >
+ <File_Groups>
+ <File_Group path="../../EPTF_Applib_SIP_CNL113522/src/LoadGen/EPTF_SIP_LoadGen.grp" />
+ <File_Group path="../../EPTF_Applib_SIP_CNL113522/src/Logger/EPTF_SIP_Logger.grp" />
+ <File_Group path="../../EPTF_Applib_SIP_CNL113522/src/Transport/EPTF_SIP_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="EPTF_Applib_HTTP_CNL113618" >
+ <File_Groups>
+ <File_Group path="../../EPTF_Applib_HTTP_CNL113618/src/LoadGen/EPTF_HTTP_LoadGen.grp" />
+ <File_Group path="../../EPTF_Applib_HTTP_CNL113618/src/Logger/EPTF_HTTP_Logger.grp" />
+ <File_Group path="../../EPTF_Applib_HTTP_CNL113618/src/Transport/EPTF_HTTP_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="TCCUsefulFunctions_CNL113472" >
+ <File path="../../TCCUsefulFunctions_CNL113472/src/digcalc.c" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/digcalc.h" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCInterface.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCInterface_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCSecurity.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCSecurity_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCIPsec.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Definitions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCEncoding.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCEncoding_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.c" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.h" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCFileIO.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCFileIO_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCDateTime.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCDateTime_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCMaths.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCMaths_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCMaths_GenericTypes.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCInterface_ip.h" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCConversion.cc" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCConversion_Functions.ttcn" />
+ <File path="../../TCCUsefulFunctions_CNL113472/src/TCCTemplate_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="SIPmsg_CNL113319" >
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/lex.SIP_parse_.c" />
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse.h" />
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.c" />
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.h" />
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PortType.ttcn" />
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.cc" />
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.hh" />
+ <File path="../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_Types.ttcn" />
+ </File_Group>
+ <File_Group name="HTTPmsg_CNL113312" >
+ <File path="../../../TestPorts/HTTPmsg_CNL113312/src/HTTPmsg_PortType.ttcn" />
+ <File path="../../../TestPorts/HTTPmsg_CNL113312/src/HTTPmsg_PT.cc" />
+ <File path="../../../TestPorts/HTTPmsg_CNL113312/src/HTTPmsg_PT.hh" />
+ <File path="../../../TestPorts/HTTPmsg_CNL113312/src/HTTPmsg_Types.ttcn" />
+ <File path="../../../TestPorts/HTTPmsg_CNL113312/src/HTTPmsg_MessageLen_Function.cc" />
+ <File path="../../../TestPorts/HTTPmsg_CNL113312/src/HTTPmsg_MessageLen.ttcn" />
+ </File_Group>
+ <File_Group name="UDPasp_CNL113346" >
+ <File path="../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PortType.ttcn" />
+ <File path="../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.cc" />
+ <File path="../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.hh" />
+ <File path="../../../TestPorts/UDPasp_CNL113346/src/UDPasp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="IPL4asp_CNL113531" >
+ <File path="../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_discovery.cc" />
+ <File path="../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Functions.ttcn" />
+ <File path="../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PortType.ttcn" />
+ <File path="../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_protocol_L234.hh" />
+ <File path="../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.cc" />
+ <File path="../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.hh" />
+ <File path="../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="Abstract_Socket_CNL113384" >
+ <File path="../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.cc" />
+ <File path="../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.hh" />
+ </File_Group>
+ <File_Group name="IP_CNL113418" >
+ <File path="../../../ProtocolModules/IP_CNL113418/src/IP_EncDec.cc" />
+ <File path="../../../ProtocolModules/IP_CNL113418/src/IP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="LANL2asp_CNL113519" >
+ <File path="../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PortType.ttcn" />
+ <File path="../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.cc" />
+ <File path="../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.hh" />
+ <File path="../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="TCP_CNL113675" >
+ <File path="../../../ProtocolModules/TCP_CNL113675/src/TCP_EncDec.cc" />
+ <File path="../../../ProtocolModules/TCP_CNL113675/src/TCP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="GeneralTypes" >
+ <File path="../../../ProtocolModules/COMMON/src/General_Types.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Core_Library_CNL113512" >
+ <File_Groups>
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Base/EPTF_CLL_Base.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Common/EPTF_CLL_Common.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/FreeBusyQueue/EPTF_CLL_FreeBusyQueue.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/HashMap/EPTF_CLL_HashMap.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/LGenBase/EPTF_CLL_LGenBase.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Logging/EPTF_CLL_Logging.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/RedBlackTree/EPTF_CLL_RBtree_Float.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Scheduler/EPTF_CLL_Scheduler_RBT.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Variable/EPTF_CLL_Variable.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_Transport.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportCommPortIPL4.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportMessageBufferManager.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportRouting.grp" />
+ <File_Group path="../../../TestPorts/Common_Components/Socket_API_CNL113686/src/Socket_API.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/RandomNArray/EPTF_CLL_RNA.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/Semaphore/EPTF_CLL_Semaphore.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/StatMeasure/EPTF_CLL_StatMeasure.grp" />
+ <File_Group path="../../EPTF_Core_Library_CNL113512/src/StatHandler/EPTF_CLL_StatHandler.grp" />
+ </File_Groups>
+ </File_Group>
+ </File_Groups>
+ </File_Group>
+</Project>
diff --git a/demo/MBT_demo.ttcn b/demo/MBT_demo.ttcn
new file mode 100644
index 0000000..7edad5f
--- /dev/null
+++ b/demo/MBT_demo.ttcn
@@ -0,0 +1,317 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_demo.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+module MBT_demo
+{
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_MBT_LGen_Functions all;
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Base_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_RBTScheduler_Functions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+import from EPTF_CLL_LGenBase_ConfigFunctions all;
+import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
+
+import from EPTF_SIP_LGen_Definitions all;
+import from EPTF_SIP_LGen_Functions all;
+import from EPTF_SIP_Common_Functions all;
+import from EPTF_SIP_UserDatabase_Functions all;
+import from EPTF_SIP_Transport_Definitions all;
+import from EPTF_SIP_Transport_Functions all;
+import from EPTF_SIP_MessageHandler_Functions all;
+
+import from EPTF_HTTP_Transport_Definitions all;
+import from EPTF_HTTP_Transport_Functions all;
+
+import from EPTF_HTTP_Definitions all;
+import from EPTF_HTTP_Functions all;
+
+
+type component MBT_Demo_LGen_CT extends EPTF_MBT_LGen_CT, EPTF_SIP_LGen_CT, EPTF_SIP_LocalTransport_CT,
+EPTF_HTTP_LGen_CT,EPTF_HTTP_LocalTransport_CT
+{}
+
+type component MBT_Demo_Tester_CT extends EPTF_MBT_Tester_CT {}
+
+type component MBT_Demo_Main_CT extends EPTF_Base_CT {}
+
+testcase tc_MBT_HTTP_Demo() runs on MBT_Demo_Main_CT
+{
+ f_EPTF_Base_init_CT("mtc");
+
+ var MBT_Demo_LGen_CT vc_MBT_CT := MBT_Demo_LGen_CT.create;
+ var MBT_Demo_Tester_CT vc_Tester_CT := MBT_Demo_Tester_CT.create;
+
+ connect(vc_MBT_CT:EPTF_MBT_PCO, vc_Tester_CT:EPTF_MBT_TESTER_PCO);
+
+ vc_MBT_CT.start(f_MBT_Demo_LGen_HTTP_behavior());
+ vc_Tester_CT.start(f_MBT_Demo_Tester_HTTP_behavior());
+
+ //all component.done;
+ f_EPTF_Base_wait4Shutdown();
+}
+
+testcase tc_MBT_SIP_Demo() runs on MBT_Demo_Main_CT
+{
+ f_EPTF_Base_init_CT("mtc");
+
+ var MBT_Demo_LGen_CT vc_MBT_CT := MBT_Demo_LGen_CT.create;
+ var MBT_Demo_Tester_CT vc_Tester_CT := MBT_Demo_Tester_CT.create;
+
+ connect(vc_MBT_CT:EPTF_MBT_PCO, vc_Tester_CT:EPTF_MBT_TESTER_PCO);
+
+ vc_MBT_CT.start(f_MBT_Demo_LGen_SIP_behavior());
+ vc_Tester_CT.start(f_MBT_Demo_Tester_SIP_behavior());
+
+ //all component.done;
+ f_EPTF_Base_wait4Shutdown();
+}
+
+function f_MBT_Demo_LGen_HTTP_behavior() runs on MBT_Demo_LGen_CT
+{
+ //map(self:IPL4_PCO, system:IPL4_PCO);
+ f_EPTF_MBT_init("MBT_Demo_LGen",0, "MBT_")
+
+ f_EPTF_HTTP_init(
+ pl_selfName:="HTTP_LoadGen",
+ pl_selfId:=0,
+ pl_entityNamePrefix:="HTTP_AppLib_",
+ pl_numEntities:=0)
+
+ f_EPTF_HTTP_LocalTransport_init_CT(
+ pl_selfName:="EPTF_HTTP_LocalTransport",
+ pl_receiveFunction:=refers(f_EPTF_HTTP_messageReceived),
+ pl_eventReceiveFunction:=refers(f_EPTF_HTTP_eventReceived))
+
+ f_EPTF_HTTP_setSendRequestFunction(pl_sendRequest_fp:=refers(f_EPTF_HTTP_LocalTransport_sendMessage))
+ f_EPTF_HTTP_setConnectionOpenFunction(plf_connectionOpen:=refers(f_EPTF_HTTP_LocalTransport_connectionOpen))
+ f_EPTF_HTTP_setConnectionCloseFunction(plf_connectionClose:=refers(f_EPTF_HTTP_LocalTransport_connectionClose))
+ f_EPTF_HTTP_setConnectionHalfCloseFunction(plf_connectionHalfClose:=refers(f_EPTF_HTTP_LocalTransport_connectionHalfClose))
+ f_EPTF_HTTP_setFreePortOfUserFunction(plf_fpou:=refers(f_EPTF_HTTP_LocalTransport_freePortOfUser));
+ f_EPTF_HTTP_setClosePortOfUserFunction(plf_cpou:=refers(f_EPTF_HTTP_LocalTransport_closePortOfUser));
+
+ f_EPTF_MBT_initLGenFsm
+ (
+ refers(f_mbt_userfunction),
+ refers(f_EPTF_MBT_HTTP_Demo_fillInDB)
+ );
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+function f_MBT_Demo_Tester_HTTP_behavior() runs on MBT_Demo_Tester_CT
+{
+ f_EPTF_Base_init_CT("MBT_Demo_Tester");
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "MBT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "HTTP Behavior"},
+ fsmName := "FSM_MBT"
+ }
+ );
+
+ // TODO: activate default altstep, with timeout handling
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_ConfigResponse:?);
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {"EPTF HTTP: Sends HTTP Request", {}, omit, omit});
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := "HTTP Behavior", iName := "HTTP CHAR Response Message Received", addr := *});
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_CommandRequest:{ quit := {}});
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+function f_MBT_Demo_LGen_SIP_behavior() runs on MBT_Demo_LGen_CT
+{
+ f_EPTF_MBT_init("MBT_Demo_LGen",0, "MBT_")
+
+ f_SIP_applibInit("MBT_Demo_LGen");
+
+ f_EPTF_SIP_LocalTransport_init("udp");
+ vf_EPTF_SIP_LocalTransport_receive := refers(f_EPTF_SIP_Message_MsgHandler); //receive callback function on LocalTransport
+ vf_EPTF_SIP_LGen_msgSender := refers(f_EPTF_SIP_LocalTransport_sendSIPMessage); //send callback function on LGen
+ v_removeUAS := refers(fcb_EPTF_SIP_LocalTransport_removeUAS);
+
+ f_EPTF_MBT_initLGenFsm
+ (
+ null,
+ refers(f_EPTF_MBT_SIP_Demo_fillInDB)
+ );
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+function f_MBT_Demo_Tester_SIP_behavior() runs on MBT_Demo_Tester_CT
+{
+ f_EPTF_Base_init_CT("MBT_Demo_Tester");
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "MBT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "HTTP Behavior"},
+ fsmName := "FSM_MBT"
+ }
+ );
+
+ // TODO: activate default altstep, with timeout handling
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_ConfigResponse:?);
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {"SIPAppLib: StepFunction_init", {}, omit, omit});
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {"SIPAppLib: StepFunction_createREGISTER", {}, omit, omit});
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := "Behavior_SIP", iName := "401", addr := * });
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {"SIPAppLib: StepFunction_createREGISTER", {}, omit, omit});
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := "Behavior_SIP", iName := "200", addr := * });
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {"SIPAppLib: StepFunction_createDEREGISTER", {}, omit, omit});
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := "Behavior_SIP", iName := "401", addr := * });
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {"SIPAppLib: StepFunction_createDEREGISTER", {}, omit, omit});
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := "Behavior_SIP", iName := "200", addr := * });
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {"SIPAppLib: StepFunction_cleanUp", {}, omit, omit});
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_CommandRequest:{ quit := {}});
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+// CUSTOM PART
+
+function f_mbt_userfunction(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_Demo_LGen_CT
+return boolean
+{
+ v_msgToProcess.response.messageBody:="Ferike";
+ return true;
+}
+
+function f_EPTF_MBT_SIP_Demo_fillInDB(in EPTF_MBT_ConfigRequest p_req) runs on MBT_Demo_LGen_CT
+{
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(p_req.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ for (var integer i:=0; i<p_req.noEntities; i:=i+1)
+ {
+ var EPTF_IntegerList vl_bCtx := f_EPTF_LGenBase_getBehaviorCtx(i + vl_entityIdx, v_SIP_myBIdx);
+ f_EPTF_SIP_IPL4asp_SetUserData
+ (
+ vl_bCtx[0],
+ "10.251.64.2", // local IP
+ {15000, 15001},
+ "udp",
+ "10.80.36.65", // proxy ip
+ 5060 // proxy port
+ );
+
+ f_EPTF_SIP_User_SetUserData(
+ vl_bCtx[0],
+ {
+ {
+ addr := {
+ nameAddr := {
+ displayName := "titansim_user_7465000",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465000",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := 5060
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ },
+ password := "pass2ICS"
+ }
+ },
+ "10.251.64.2",
+ {15000, 15001},
+ i + vl_entityIdx //entity index
+ );
+
+ f_EPTF_SIP_Session_AddData(vl_bCtx[0], f_EPTF_SIP_getTransport("UDP"),345600);
+
+ //f_EPTF_SIP_mapUser2TransportUser(vl_bCtx[0], 0);
+
+ f_EPTF_SIP_IPL4asp_startListening(vl_bCtx[0], true); // Both UDP and TCP
+ }
+}
+
+function f_EPTF_MBT_HTTP_Demo_fillInDB(in EPTF_MBT_ConfigRequest p_req) runs on MBT_Demo_LGen_CT
+{
+
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(p_req.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ for (var integer i:=0; i<p_req.noEntities; i:=i+1)
+ {
+ var EPTF_IntegerList vl_bCtx := f_EPTF_LGenBase_getBehaviorCtx(i + vl_entityIdx, v_EPTF_HTTP_myBIdx);
+
+
+ var integer vl_connHandle := f_EPTF_HTTP_LocalTransport_newPort(
+ {
+ name:="SingleHTTP_Port"& "_" & int2str(vl_bCtx[0]),
+ localHostInformation := { "192.168.163.130", 50000+vl_bCtx[0]},
+ remoteHostInformation := { "ttcn.ericsson.se", 80},
+ instantConnOpen := true,
+ instantConnClose := true,
+ useSSL := false,
+ userFunctions := omit
+ }
+ )
+ v_EPTF_HTTP_contexts[vl_bCtx[0]] := {
+ method := "GET",
+ uri:= "/",
+ version_major:=1,
+ version_minor:=1,
+ headerLinesIdx := f_EPTF_HTTP_addNewHeaderLines({
+ {header_name:="Host", header_value:="ttcn.ericsson.se" },
+ {header_name:="Connection", header_value:="close" } }),
+ authDetails := {"","","","","00000001","MD5","","","","",""},
+ //authDetails := {"","","","","00000001","MD5",""},
+ requestPending:=false,
+ connId := vl_connHandle,
+ bodyId :=f_EPTF_HTTP_setCharEntityBody("<HTML>Request.</HTML>"),
+ headerGetterFn:=refers(f_EPTF_HTTP_getHeaderContentForEntity),
+ rawHeaderGetterFn:= null,
+ contentGetterFn:=refers(f_EPTF_HTTP_getCharstringBodyContentForEntity),
+ charBodyHandlerFn:=refers(f_EPTF_HTTP_defaultCharstringBodyHandler) ,
+ binaryBodyHandlerFn:= refers(f_EPTF_HTTP_defaultBinaryBodyHandler)
+
+ }
+ }
+}
+
+}
diff --git a/demo/SpecExplorer/Project/MBT_SIP.sln b/demo/SpecExplorer/Project/MBT_SIP.sln
new file mode 100644
index 0000000..739f237
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP.sln
@@ -0,0 +1,35 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestSuite", "MBT_SIP\TestSuite\TestSuite.csproj", "{30090E84-4B5F-4E61-B57C-D7E9A3EC999D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "MBT_SIP\Model\Model.csproj", "{A62A6869-D02F-4A7D-B41E-0C1E2A1DD4C9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Adapter", "MBT_SIP\Implementation\Adapter.csproj", "{E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {30090E84-4B5F-4E61-B57C-D7E9A3EC999D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {30090E84-4B5F-4E61-B57C-D7E9A3EC999D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {30090E84-4B5F-4E61-B57C-D7E9A3EC999D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {30090E84-4B5F-4E61-B57C-D7E9A3EC999D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A62A6869-D02F-4A7D-B41E-0C1E2A1DD4C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A62A6869-D02F-4A7D-B41E-0C1E2A1DD4C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A62A6869-D02F-4A7D-B41E-0C1E2A1DD4C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A62A6869-D02F-4A7D-B41E-0C1E2A1DD4C9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(SpecExplorer.ActivityCompletionStatus) = preSolution
+ SpecExplorer.ActivityCompletionStatus =
+ EndGlobalSection
+EndGlobal
diff --git a/demo/SpecExplorer/Project/MBT_SIP.suo b/demo/SpecExplorer/Project/MBT_SIP.suo
new file mode 100644
index 0000000..27b6b2d
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP.suo
Binary files differ
diff --git a/demo/SpecExplorer/Project/MBT_SIP/Implementation/Adapter.cs b/demo/SpecExplorer/Project/MBT_SIP/Implementation/Adapter.cs
new file mode 100644
index 0000000..5552754
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/Implementation/Adapter.cs
@@ -0,0 +1,271 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Export2TTCN;
+
+namespace MBT.Adapter
+{
+ public class NewExporter : TTCNExporter
+ {
+ public NewExporter(string p_modulename,string p_path) : base(p_modulename,p_path)
+ {
+ }
+
+ protected override void write_imports()
+ {
+ if (!is_started()) return;
+ write("import from MBT_SpecExpl_Demo all;");
+ write("import from EPTF_MBT_LGen_Definitions all;");
+ }
+
+ protected override void write_types()
+ {
+ if (!is_started()) return;
+
+
+ write("type port netInPort message\n {\n inout SIPResp;\n inout SIPReq;\n } with { extension \"internal\" }\n");
+ write("type port userInPort message\n {\n inout UserInput;\n } with { extension \"internal\" }\n");
+ write("type port netOutPort message\n {\n inout SIPResp;\n inout SIPReq;\n } with { extension \"internal\" }\n");
+ write("type port userOutPort message\n {\n inout TimeOutIndication;\n } with { extension \"internal\" }\n");
+
+ write("type record SIPReq\n {\n charstring op,\n charstring param_\n }\n");
+ write("type record SIPResp\n {\n integer status,\n charstring cseq\n }\n");
+ write("type record UserInput\n {\n charstring input1,\n charstring input2\n }\n");
+ write("type record TimeOutIndication\n {\n\n }\n");
+
+ write("type component SpecExpl_CT extends MBT_SpecExpl_Demo_Main_CT\n {\n port netInPort netIn;\n port userInPort userIn;\n port netOutPort netOut;\n port userOutPort userOut;\n timer harnessTimer := 0.0;\n }\n");
+ }
+
+ protected override void write_altsteps()
+ {
+ if (!is_started()) return;
+ write("altstep SpecExplDefaultAlt() runs on SpecExpl_CT\n {");
+ ind_p();
+ write("[] any port.receive\n {\n harnessTimer.stop;\n setverdict(fail);\n f_MBT_SpecExpl_Demo_endTestCase();\n stop;\n }");
+ write("[] harnessTimer.timeout\n {\n setverdict(fail);\n f_MBT_SpecExpl_Demo_endTestCase();\n stop;\n }");
+ ind_n();
+ write("}");
+ }
+
+ protected override void write_else()
+ {
+ if (!is_started()) return;
+ write("function specexpl_send_SIPResp_to_netIn(template SIPResp msgToSend) runs on SpecExpl_CT");
+ write("{");
+ ind_p();
+ write("netIn.send(msgToSend);");
+ ind_n();
+ write("}\n");
+
+ write("function specexpl_send_SIPReq_to_netIn(template SIPReq msgToSend) runs on SpecExpl_CT");
+ write("{");
+ ind_p();
+ write("netIn.send(msgToSend);");
+ ind_n();
+ write("}\n");
+
+ write("function specexpl_send_UserInput_to_userIn(template UserInput msgToSend) runs on SpecExpl_CT");
+ write("{");
+ ind_p();
+ write("userIn.send(msgToSend);");
+ ind_n();
+ write("}\n");
+
+ write("function specexpl_receive_SIPResp_from_netOut(template SIPResp tmplToMatch) runs on SpecExpl_CT");
+ write("{");
+ ind_p();
+ write("netOut.receive(tmplToMatch);");
+ ind_n();
+ write("}\n");
+
+ write("function specexpl_receive_SIPReq_from_netOut(template SIPReq tmplToMatch) runs on SpecExpl_CT");
+ write("{");
+ ind_p();
+ write("netOut.receive(tmplToMatch);");
+ ind_n();
+ write("}\n");
+
+ write("function specexpl_receive_TimeOutIndication_from_userOut(template TimeOutIndication tmplToMatch) runs on SpecExpl_CT");
+ write("{");
+ ind_p();
+ write("userOut.receive(tmplToMatch);");
+ ind_n();
+ write("}\n");
+ }
+
+ public void send(string command, string message)
+ {
+ write_tc(command + "(" + message + ");");
+ //write_tc("oldtimer := 0.0;");
+ }
+
+ public void receive(string command, string message, double wait)
+ {
+ write_tc("harnessTimer.start(" + wait.ToString("F2") + " + SLACK);");
+ //write_tc("log(\"Waiting for: " + message + "\");");
+ write_tc(command + "(" + message + ");");
+ write_tc("harnessTimer.stop;");
+ //write_tc("oldtimer := 0.0;");
+ }
+
+ protected override void beginning_tc()
+ {
+ write_tc("var float oldtimer := 0.0;");
+ write_tc("var float SLACK := 10.0;");
+ write_tc("var default default_behaviour_ref;");
+ write_tc("f_MBT_SpecExpl_Demo_beginTestCase();");
+ write_tc("default_behaviour_ref := activate(SpecExplDefaultAlt());");
+ }
+
+ protected override void ending_tc()
+ {
+ write_tc("setverdict(pass);");
+ write_tc("deactivate(default_behaviour_ref);");
+ write_tc("f_MBT_SpecExpl_Demo_endTestCase();");
+ }
+
+ }
+
+ public static class Adapter
+ {
+ private static NewExporter exporter = new NewExporter("MBT_SpecExpl_Testcases", "C:/Users/eolicze/Documents/Visual Studio 2010/Projects/MBT_SIP/");
+ private static double[] timeouts = {0.0, 0.5, 1.0, 2.0, 4.0};
+
+ public static void start()
+ {
+ /**/
+ exporter.start();
+ }
+
+ public static void end()
+ {
+ exporter.end();
+ }
+
+ private static string getmessage_UserInput(string input1, string input2)
+ {
+ return "{" +
+ "input1 := \"" + input1 + "\", " +
+ "input2 := \"" + input2 + "\"}";
+ }
+
+ private static string getmessage_SIPReq(string op, string param_)
+ {
+ return "{" +
+ "op := \"" + op + "\", " +
+ "param_ := \"" + param_ + "\"}";
+ }
+
+ private static string getmessage_SIPResp(int status, string cseq)
+ {
+ return "{" +
+ "status := " + status + ", " +
+ "cseq := \"" + cseq + "\"}";
+ }
+
+ public static void Init_Calling()
+ {
+ exporter.write_tc("//Init_Calling");
+ exporter.write_tc("log(\"Init_Calling\");");
+ exporter.send("specexpl_send_UserInput_to_userIn", getmessage_UserInput("invite", "sip:127.0.0.1:5061"));
+ exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("INVITE", "sip:127.0.0.1:5061"),0.0);
+ }
+
+ public static void Calling_Ringing()
+ {
+ exporter.write_tc("//Calling_Ringing");
+ exporter.write_tc("log(\"Calling_Ringing\");");
+ exporter.send("specexpl_send_SIPResp_to_netIn",getmessage_SIPResp(180,""));
+ }
+
+ public static void Calling_Timeout()
+ {
+ exporter.write_tc("//Calling_Timeout");
+ exporter.write_tc("log(\"Calling_Timeout\");");
+ exporter.send("specexpl_send_UserInput_to_userIn", getmessage_UserInput("invite", "sip:127.0.0.1:5061"));
+ foreach (double timeout in timeouts)
+ { exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("INVITE", "sip:127.0.0.1:5061"), timeout); }
+ }
+
+ public static void Ringing_Canceling()
+ {
+ exporter.write_tc("//Ringing_Canceling");
+ exporter.write_tc("log(\"Ringing_Canceling\");");
+ exporter.send("specexpl_send_UserInput_to_userIn",getmessage_UserInput("cancel",""));
+ exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("CANCEL", "sip:127.0.0.1:5061"),0.0);
+ }
+
+ public static void Ringing_Ready()
+ {
+ exporter.write_tc("//Ringing_Ready");
+ exporter.write_tc("log(\"Ringing_Ready\");");
+ exporter.send("specexpl_send_SIPResp_to_netIn", getmessage_SIPResp(200, "INVITE"));
+ exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("ACK", "sip:127.0.0.1:5061"),0.0);
+ }
+
+ public static void Ringing_Reject()
+ {
+ exporter.write_tc("//Ringing_Reject");
+ exporter.write_tc("log(\"Ringing_Reject\");");
+ exporter.send("specexpl_send_SIPResp_to_netIn", getmessage_SIPResp(486, "INVITE"));
+ exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("ACK", "sip:127.0.0.1:5061"),0.0);
+ }
+
+ public static void Canceling_WaitingResponse()
+ {
+ exporter.write_tc("//Canceling_WaitingResponse");
+ exporter.write_tc("log(\"Canceling_WaitingResponse\");");
+ exporter.send("specexpl_send_SIPResp_to_netIn", getmessage_SIPResp(200, "CANCEL"));
+ }
+
+ public static void Canceling_Timeout()
+ {
+ exporter.write_tc("//Canceling_Timeout");
+ exporter.write_tc("log(\"Canceling_Timeout\");");
+ exporter.send("specexpl_send_UserInput_to_userIn", getmessage_UserInput("cancel", ""));
+ foreach (double timeout in timeouts)
+ { exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("CANCEL", "sip:127.0.0.1:5061"), timeout); }
+ }
+
+ public static void WaitingResponse_Terminate()
+ {
+ exporter.write_tc("//WaitingResponse_Terminate");
+ exporter.write_tc("log(\"WaitingResponse_Terminate\");");
+ exporter.send("specexpl_send_SIPResp_to_netIn", getmessage_SIPResp(487, "INVITE"));
+ exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("ACK", "sip:127.0.0.1:5061"),0.0);
+ }
+
+ public static void Ready_Terminating()
+ {
+ exporter.write_tc("//Ready_Terminating");
+ exporter.write_tc("log(\"Ready_Terminating\");");
+ exporter.send("specexpl_send_UserInput_to_userIn", getmessage_UserInput("bye", ""));
+ exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("BYE", "sip:127.0.0.1:5061"), 0.0);
+ }
+
+ public static void Ready_End()
+ {
+ exporter.write_tc("//Ready_End");
+ exporter.write_tc("log(\"Ready_End\");");
+ exporter.send("specexpl_send_SIPReq_to_netIn", getmessage_SIPReq("BYE", "sip:127.0.0.1"));
+ exporter.receive("specexpl_receive_SIPResp_from_netOut", getmessage_SIPResp(200, "BYE"),0.0);
+ }
+
+ public static void Terminating_OK()
+ {
+ exporter.write_tc("//Terminating_OK");
+ exporter.write_tc("log(\"Terminating_OK\");");
+ exporter.send("specexpl_send_SIPResp_to_netIn", getmessage_SIPResp(200, ""));
+ }
+
+ public static void Terminating_Timeout()
+ {
+ exporter.write_tc("//Terminating_Timeout");
+ exporter.write_tc("log(\"Terminating_Timeout\");");
+ exporter.send("specexpl_send_UserInput_to_userIn", getmessage_UserInput("bye", ""));
+ foreach (double timeout in timeouts)
+ { exporter.receive("specexpl_receive_SIPReq_from_netOut", getmessage_SIPReq("BYE", "sip:127.0.0.1:5061"), timeout); }
+ }
+
+ }
+}
diff --git a/demo/SpecExplorer/Project/MBT_SIP/Implementation/Adapter.csproj b/demo/SpecExplorer/Project/MBT_SIP/Implementation/Adapter.csproj
new file mode 100644
index 0000000..14173f7
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/Implementation/Adapter.csproj
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20714</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MBT.Implementation</RootNamespace>
+ <AssemblyName>TCP_MBT.Implementation</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ItemGroup>
+ <Compile Include="Adapter.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Export2TTCN.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/demo/SpecExplorer/Project/MBT_SIP/Implementation/Export2TTCN.cs b/demo/SpecExplorer/Project/MBT_SIP/Implementation/Export2TTCN.cs
new file mode 100644
index 0000000..c78c456
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/Implementation/Export2TTCN.cs
@@ -0,0 +1,185 @@
+using System.IO;
+
+namespace Export2TTCN
+{
+
+ public class FileExport
+ {
+ private string[] fileBuffer;
+ private int rowNumber;
+ private string filename;
+ private const int indent = 2;
+ private int act_indent = 0;
+
+ public void ind_p()
+ {
+ act_indent += indent;
+ }
+
+ public void ind_n()
+ {
+ if (act_indent == 0) return;
+ act_indent -= indent;
+ }
+
+ private string getindented(string row)
+ {
+ for (int i = 0; i < act_indent; i++)
+ {
+ row = row.Insert(0, " ");
+ }
+ return row;
+ }
+
+ public FileExport(string filename)
+ {
+ this.filename = filename;
+ fileBuffer = new string[128];
+ rowNumber = 0;
+ File.Delete(filename);
+ }
+
+ public void write(string row)
+ {
+ fileBuffer[rowNumber++] = getindented(row);
+ if (rowNumber == 128)
+ {
+ dump();
+ }
+ }
+
+ public void dump()
+ {
+ FileStream writer;
+ writer = new FileStream(filename, FileMode.OpenOrCreate);
+ writer.Seek(0, SeekOrigin.End);
+ for (int i = 0; i < rowNumber; i++)
+ {
+ writer.Write(System.Text.ASCIIEncoding.ASCII.GetBytes(fileBuffer[i]), 0, fileBuffer[i].Length);
+ writer.WriteByte(10);
+ }
+ writer.Close();
+ rowNumber = 0;
+ }
+
+ public void write_tc(string row) //write testcase rows
+ {
+ fileBuffer[rowNumber++] = getindented(row);
+ if (rowNumber == 128)
+ {
+ dump_tc();
+ }
+ }
+
+ public void dump_tc() //dump testcase rows
+ {
+ FileStream writer;
+ writer = new FileStream(filename, FileMode.OpenOrCreate);
+ writer.Seek(-3, SeekOrigin.End);
+ for (int i = 0; i < rowNumber; i++)
+ {
+ writer.Write(System.Text.ASCIIEncoding.ASCII.GetBytes(fileBuffer[i]), 0, fileBuffer[i].Length);
+ writer.WriteByte(10);
+ }
+ writer.Close();
+ rowNumber = 0;
+ }
+
+ }
+
+ public abstract class TTCNExporter
+ {
+ private FileExport file;
+ private bool started = true;
+ private int nof_testcases = 0;
+ private string modulename;
+ private string filename;
+
+ public bool is_started() { return !started; }
+
+ protected TTCNExporter(string p_modulename, string p_path)
+ {
+ modulename = p_modulename;
+ filename = p_path + p_modulename + ".ttcn";
+ }
+
+ protected abstract void write_imports();
+
+ protected abstract void write_types();
+
+ protected abstract void write_altsteps();
+
+ protected abstract void write_else();
+
+ protected abstract void beginning_tc();
+
+ protected abstract void ending_tc();
+
+ private void start_testcase()
+ {
+ nof_testcases++;
+ file.ind_p();
+ file.write_tc("\n");
+ file.write_tc("testcase Testcase_" + nof_testcases + "() runs on SpecExpl_CT");
+ file.write_tc("{");
+ file.ind_p();
+
+ beginning_tc();
+
+ file.write_tc("log(\"START TESTCASE: Testcase_" + nof_testcases + "\");");
+ }
+
+ public void start()
+ {
+ if (started)
+ {
+ file = new FileExport(filename);
+ started = file == null;
+ file.write("module " + modulename);
+ file.write("{");
+ file.ind_p();
+ write_imports();
+ write_types();
+ write_altsteps();
+ write_else();
+ file.ind_n();
+ file.write("}");
+ file.dump();
+ }
+ start_testcase();
+ }
+
+ public void end()
+ {
+ file.write_tc("log(\"THE END\");");
+
+ ending_tc();
+
+ file.ind_n();
+ file.write_tc("}");
+ file.ind_n();
+ file.write_tc("}");
+ file.dump_tc();
+ }
+
+ protected void write(string row)
+ {
+ file.write(row);
+ }
+
+ public void write_tc(string row)
+ {
+ file.write_tc(row);
+ }
+
+ public void ind_p()
+ {
+ file.ind_p();
+ }
+
+ public void ind_n()
+ {
+ file.ind_n();
+ }
+ }
+}
\ No newline at end of file
diff --git a/demo/SpecExplorer/Project/MBT_SIP/Model/Config.cord b/demo/SpecExplorer/Project/MBT_SIP/Model/Config.cord
new file mode 100644
index 0000000..a29b3ab
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/Model/Config.cord
@@ -0,0 +1,98 @@
+// This is a Spec Explorer coordination script (Cord version 1.0).
+// Here is where you define configurations and machines describing the
+// exploration to be performed.
+
+using MBT.Adapter;
+
+/// Contains actions of the model, bounds, and switches.
+config Main
+{
+ action abstract static void Adapter.start();
+ action abstract static void Adapter.end();
+ action abstract static void Adapter.Init_Calling();
+ action abstract static void Adapter.Calling_Ringing();
+ action abstract static void Adapter.Calling_Timeout();
+ action abstract static void Adapter.Ringing_Canceling();
+ action abstract static void Adapter.Ringing_Ready();
+ action abstract static void Adapter.Ringing_Reject();
+ action abstract static void Adapter.Canceling_WaitingResponse();
+ action abstract static void Adapter.Canceling_Timeout();
+ action abstract static void Adapter.WaitingResponse_Terminate();
+ action abstract static void Adapter.Ready_Terminating();
+ action abstract static void Adapter.Ready_End();
+ action abstract static void Adapter.Terminating_OK();
+ action abstract static void Adapter.Terminating_Timeout();
+
+ switch StepBound = 1024;
+ switch PathDepthBound = 1024;
+ switch StateBound = 1024;
+ switch TestClassBase = "vs";
+ switch GeneratedTestPath = "..\\TestSuite";
+ switch GeneratedTestNamespace = "MBT.TestSuite";
+ switch TestEnabled = false;
+ switch ForExploration = false;
+}
+
+machine Model() : Main where ForExploration = true
+{
+ Model_CLOSED_START()*
+}
+
+machine Model_CLOSED_START() : Main
+{
+ start() ; (( Init_Calling() ; Model_Calling() ) | ( Calling_Timeout() ; Model_CLOSED_END() ) )
+}
+
+machine Model_Calling() : Main
+{
+ ( Calling_Ringing() ; Model_Ringing() )
+}
+
+machine Model_Ringing() : Main
+{
+ ( Ringing_Canceling() ; Model_Canceling() ) | ( Ringing_Ready() ; Model_Ready() ) | ( Ringing_Reject() ; Model_CLOSED_END() ) | ( Canceling_Timeout() ; Model_CLOSED_END() )
+}
+
+machine Model_Canceling() : Main
+{
+ ( Canceling_WaitingResponse() ; Model_WaitingResponse() )
+}
+
+machine Model_Ready() : Main
+{
+ ( Ready_Terminating() ; Model_Terminating() ) | ( Ready_End() ; Model_CLOSED_END() ) | ( Terminating_Timeout() ; Model_CLOSED_END() )
+}
+
+machine Model_Terminating() : Main
+{
+ ( Terminating_OK() ; Model_CLOSED_END() )
+}
+
+machine Model_WaitingResponse() : Main
+{
+ ( WaitingResponse_Terminate() ; Model_CLOSED_END() )
+}
+
+
+machine Model_CLOSED_END() : Main
+{
+ end()
+}
+
+machine ModelProgram() : Main
+{
+ construct model program from Main
+ where namespace = "MBT.Model"
+}
+
+machine Model_Sync() : Main where ForExploration = true
+{
+ Model || ModelProgram
+}
+
+machine Testsuite() : Main where ForExploration = true, TestEnabled = true
+{
+ construct test cases
+ where AllowUndeterminedCoverage = true
+ for Model_Sync
+}
diff --git a/demo/SpecExplorer/Project/MBT_SIP/Model/Model.cs b/demo/SpecExplorer/Project/MBT_SIP/Model/Model.cs
new file mode 100644
index 0000000..84cac67
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/Model/Model.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Linq;
+
+using Microsoft.Modeling;
+
+namespace MBT.Model
+{
+ /// <summary>
+ /// An example model program.
+ /// </summary>
+ static class ModelProgram
+ {
+ [Action]
+ static void start()
+ {
+ }
+
+ [Action]
+ static void Init_Calling() { }
+
+ [Action]
+ static void Calling_Ringing() { }
+
+ [Action]
+ static void Calling_Timeout() { }
+
+ [Action]
+ static void Ringing_Canceling() { }
+
+ [Action]
+ static void Ringing_Ready() { }
+
+ [Action]
+ static void Ringing_Reject() { }
+
+ [Action]
+ static void Canceling_WaitingResponse() { }
+
+ [Action]
+ static void Canceling_Timeout() { }
+
+ [Action]
+ static void WaitingResponse_Terminate() { }
+
+ [Action]
+ static void Ready_Terminating() { }
+
+ [Action]
+ static void Ready_End() { }
+
+ [Action]
+ static void Terminating_OK() { }
+
+ [Action]
+ static void Terminating_Timeout() { }
+
+ [Action]
+ static void end()
+ {
+ }
+
+ }
+}
diff --git a/demo/SpecExplorer/Project/MBT_SIP/Model/Model.csproj b/demo/SpecExplorer/Project/MBT_SIP/Model/Model.csproj
new file mode 100644
index 0000000..066ea0b
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/Model/Model.csproj
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20714</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A62A6869-D02F-4A7D-B41E-0C1E2A1DD4C9}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MBT.Model</RootNamespace>
+ <AssemblyName>TCP_MBT.Model</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ItemGroup>
+ <None Include="Config.cord">
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Model.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Xrt.Runtime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>True</SpecificVersion>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Implementation\Adapter.csproj">
+ <Project>{E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}</Project>
+ <Name>Adapter</Name>
+ </ProjectReference>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/demo/SpecExplorer/Project/MBT_SIP/TestSuite/TestSuite.csproj b/demo/SpecExplorer/Project/MBT_SIP/TestSuite/TestSuite.csproj
new file mode 100644
index 0000000..6db62f6
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/TestSuite/TestSuite.csproj
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.20714</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{30090E84-4B5F-4E61-B57C-D7E9A3EC999D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MBT.TestSuite</RootNamespace>
+ <AssemblyName>TCP_MBT.TestSuite</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ItemGroup>
+ <Reference Include="Microsoft.SpecExplorer.Runtime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>True</SpecificVersion>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.SpecExplorer.Runtime.VisualStudio, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,
 processorArchitecture=MSIL">
+ <SpecificVersion>True</SpecificVersion>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Implementation\Adapter.csproj">
+ <Project>{E9DBC668-9BC2-4650-A70E-AE9A8F293E8F}</Project>
+ <Name>Adapter</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Testsuite.cs" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/demo/SpecExplorer/Project/MBT_SIP/TestSuite/Testsuite.cs b/demo/SpecExplorer/Project/MBT_SIP/TestSuite/Testsuite.cs
new file mode 100644
index 0000000..e6d6f6f
--- /dev/null
+++ b/demo/SpecExplorer/Project/MBT_SIP/TestSuite/Testsuite.cs
@@ -0,0 +1,305 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.21006.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace MBT.TestSuite {
+ using System;
+ using System.Collections.Generic;
+ using System.Text;
+ using System.Reflection;
+ using Microsoft.SpecExplorer.Runtime.Testing;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("Spec Explorer", "3.0.2167.0")]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()]
+ public partial class Testsuite : VsTestClassBase {
+
+ public Testsuite() {
+ this.SetSwitch("ProceedControlTimeout", "100");
+ this.SetSwitch("QuiescenceTimeout", "2000");
+ }
+
+ #region Test Initialization and Cleanup
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestInitializeAttribute()]
+ public virtual void TestInitialize() {
+ this.InitializeTestManager();
+ }
+
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestCleanupAttribute()]
+ public virtual void TestCleanup() {
+ this.CleanupTestManager();
+ }
+ #endregion
+
+ #region Test Starting in S0
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("TestID", "0x01afa11b37bc675d097fe4a5530ea6a8c9")]
+ public virtual void TestsuiteS0() {
+ this.Manager.BeginTest("TestsuiteS0");
+ this.Manager.Comment("reaching state \'S0\'");
+ this.Manager.Comment("executing step \'call start()\'");
+ MBT.Adapter.Adapter.start();
+ this.Manager.Comment("reaching state \'S1\'");
+ this.Manager.Comment("checking step \'return start\'");
+ this.Manager.Comment("reaching state \'S14\'");
+ this.Manager.Comment("executing step \'call Init_Calling()\'");
+ MBT.Adapter.Adapter.Init_Calling();
+ this.Manager.Comment("reaching state \'S21\'");
+ this.Manager.Comment("checking step \'return Init_Calling\'");
+ this.Manager.Comment("reaching state \'S28\'");
+ this.Manager.Comment("executing step \'call Calling_Ringing()\'");
+ MBT.Adapter.Adapter.Calling_Ringing();
+ this.Manager.Comment("reaching state \'S35\'");
+ this.Manager.Comment("checking step \'return Calling_Ringing\'");
+ this.Manager.Comment("reaching state \'S42\'");
+ this.Manager.Comment("executing step \'call Ringing_Canceling()\'");
+ MBT.Adapter.Adapter.Ringing_Canceling();
+ this.Manager.Comment("reaching state \'S49\'");
+ this.Manager.Comment("checking step \'return Ringing_Canceling\'");
+ this.Manager.Comment("reaching state \'S55\'");
+ this.Manager.Comment("executing step \'call Canceling_WaitingResponse()\'");
+ MBT.Adapter.Adapter.Canceling_WaitingResponse();
+ this.Manager.Comment("reaching state \'S61\'");
+ this.Manager.Comment("checking step \'return Canceling_WaitingResponse\'");
+ this.Manager.Comment("reaching state \'S67\'");
+ this.Manager.Comment("executing step \'call WaitingResponse_Terminate()\'");
+ MBT.Adapter.Adapter.WaitingResponse_Terminate();
+ this.Manager.Comment("reaching state \'S73\'");
+ this.Manager.Comment("checking step \'return WaitingResponse_Terminate\'");
+ this.Manager.Comment("reaching state \'S77\'");
+ this.Manager.Comment("executing step \'call end()\'");
+ MBT.Adapter.Adapter.end();
+ this.Manager.Comment("reaching state \'S81\'");
+ this.Manager.Comment("checking step \'return end\'");
+ this.Manager.Comment("reaching state \'S83\'");
+ this.Manager.EndTest();
+ }
+ #endregion
+
+ #region Test Starting in S10
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("TestID", "0x017ff0fce7268e7de05fa2a0fba546b497")]
+ public virtual void TestsuiteS10() {
+ this.Manager.BeginTest("TestsuiteS10");
+ this.Manager.Comment("reaching state \'S10\'");
+ this.Manager.Comment("executing step \'call start()\'");
+ MBT.Adapter.Adapter.start();
+ this.Manager.Comment("reaching state \'S11\'");
+ this.Manager.Comment("checking step \'return start\'");
+ this.Manager.Comment("reaching state \'S19\'");
+ this.Manager.Comment("executing step \'call Init_Calling()\'");
+ MBT.Adapter.Adapter.Init_Calling();
+ this.Manager.Comment("reaching state \'S26\'");
+ this.Manager.Comment("checking step \'return Init_Calling\'");
+ this.Manager.Comment("reaching state \'S33\'");
+ this.Manager.Comment("executing step \'call Calling_Ringing()\'");
+ MBT.Adapter.Adapter.Calling_Ringing();
+ this.Manager.Comment("reaching state \'S40\'");
+ this.Manager.Comment("checking step \'return Calling_Ringing\'");
+ this.Manager.Comment("reaching state \'S47\'");
+ this.Manager.Comment("executing step \'call Canceling_Timeout()\'");
+ MBT.Adapter.Adapter.Canceling_Timeout();
+ this.Manager.Comment("reaching state \'S54\'");
+ this.Manager.Comment("checking step \'return Canceling_Timeout\'");
+ this.Manager.Comment("reaching state \'S60\'");
+ this.Manager.Comment("executing step \'call end()\'");
+ MBT.Adapter.Adapter.end();
+ this.Manager.Comment("reaching state \'S66\'");
+ this.Manager.Comment("checking step \'return end\'");
+ this.Manager.Comment("reaching state \'S72\'");
+ this.Manager.EndTest();
+ }
+ #endregion
+
+ #region Test Starting in S12
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("TestID", "0x016815222e0a5f5da29344dcbed7345e1f")]
+ public virtual void TestsuiteS12() {
+ this.Manager.BeginTest("TestsuiteS12");
+ this.Manager.Comment("reaching state \'S12\'");
+ this.Manager.Comment("executing step \'call start()\'");
+ MBT.Adapter.Adapter.start();
+ this.Manager.Comment("reaching state \'S13\'");
+ this.Manager.Comment("checking step \'return start\'");
+ this.Manager.Comment("reaching state \'S20\'");
+ this.Manager.Comment("executing step \'call Calling_Timeout()\'");
+ MBT.Adapter.Adapter.Calling_Timeout();
+ this.Manager.Comment("reaching state \'S27\'");
+ this.Manager.Comment("checking step \'return Calling_Timeout\'");
+ this.Manager.Comment("reaching state \'S34\'");
+ this.Manager.Comment("executing step \'call end()\'");
+ MBT.Adapter.Adapter.end();
+ this.Manager.Comment("reaching state \'S41\'");
+ this.Manager.Comment("checking step \'return end\'");
+ this.Manager.Comment("reaching state \'S48\'");
+ this.Manager.EndTest();
+ }
+ #endregion
+
+ #region Test Starting in S2
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("TestID", "0x01d417f2842cdb81a2e516c5142757acd4")]
+ public virtual void TestsuiteS2() {
+ this.Manager.BeginTest("TestsuiteS2");
+ this.Manager.Comment("reaching state \'S2\'");
+ this.Manager.Comment("executing step \'call start()\'");
+ MBT.Adapter.Adapter.start();
+ this.Manager.Comment("reaching state \'S3\'");
+ this.Manager.Comment("checking step \'return start\'");
+ this.Manager.Comment("reaching state \'S15\'");
+ this.Manager.Comment("executing step \'call Init_Calling()\'");
+ MBT.Adapter.Adapter.Init_Calling();
+ this.Manager.Comment("reaching state \'S22\'");
+ this.Manager.Comment("checking step \'return Init_Calling\'");
+ this.Manager.Comment("reaching state \'S29\'");
+ this.Manager.Comment("executing step \'call Calling_Ringing()\'");
+ MBT.Adapter.Adapter.Calling_Ringing();
+ this.Manager.Comment("reaching state \'S36\'");
+ this.Manager.Comment("checking step \'return Calling_Ringing\'");
+ this.Manager.Comment("reaching state \'S43\'");
+ this.Manager.Comment("executing step \'call Ringing_Ready()\'");
+ MBT.Adapter.Adapter.Ringing_Ready();
+ this.Manager.Comment("reaching state \'S50\'");
+ this.Manager.Comment("checking step \'return Ringing_Ready\'");
+ this.Manager.Comment("reaching state \'S56\'");
+ this.Manager.Comment("executing step \'call Ready_Terminating()\'");
+ MBT.Adapter.Adapter.Ready_Terminating();
+ this.Manager.Comment("reaching state \'S62\'");
+ this.Manager.Comment("checking step \'return Ready_Terminating\'");
+ this.Manager.Comment("reaching state \'S68\'");
+ this.Manager.Comment("executing step \'call Terminating_OK()\'");
+ MBT.Adapter.Adapter.Terminating_OK();
+ this.Manager.Comment("reaching state \'S74\'");
+ this.Manager.Comment("checking step \'return Terminating_OK\'");
+ this.Manager.Comment("reaching state \'S78\'");
+ this.Manager.Comment("executing step \'call end()\'");
+ MBT.Adapter.Adapter.end();
+ this.Manager.Comment("reaching state \'S82\'");
+ this.Manager.Comment("checking step \'return end\'");
+ this.Manager.Comment("reaching state \'S84\'");
+ this.Manager.EndTest();
+ }
+ #endregion
+
+ #region Test Starting in S4
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("TestID", "0x01a1fff5e0b6582382edb5a5cc5393de78")]
+ public virtual void TestsuiteS4() {
+ this.Manager.BeginTest("TestsuiteS4");
+ this.Manager.Comment("reaching state \'S4\'");
+ this.Manager.Comment("executing step \'call start()\'");
+ MBT.Adapter.Adapter.start();
+ this.Manager.Comment("reaching state \'S5\'");
+ this.Manager.Comment("checking step \'return start\'");
+ this.Manager.Comment("reaching state \'S16\'");
+ this.Manager.Comment("executing step \'call Init_Calling()\'");
+ MBT.Adapter.Adapter.Init_Calling();
+ this.Manager.Comment("reaching state \'S23\'");
+ this.Manager.Comment("checking step \'return Init_Calling\'");
+ this.Manager.Comment("reaching state \'S30\'");
+ this.Manager.Comment("executing step \'call Calling_Ringing()\'");
+ MBT.Adapter.Adapter.Calling_Ringing();
+ this.Manager.Comment("reaching state \'S37\'");
+ this.Manager.Comment("checking step \'return Calling_Ringing\'");
+ this.Manager.Comment("reaching state \'S44\'");
+ this.Manager.Comment("executing step \'call Ringing_Ready()\'");
+ MBT.Adapter.Adapter.Ringing_Ready();
+ this.Manager.Comment("reaching state \'S51\'");
+ this.Manager.Comment("checking step \'return Ringing_Ready\'");
+ this.Manager.Comment("reaching state \'S57\'");
+ this.Manager.Comment("executing step \'call Ready_End()\'");
+ MBT.Adapter.Adapter.Ready_End();
+ this.Manager.Comment("reaching state \'S63\'");
+ this.Manager.Comment("checking step \'return Ready_End\'");
+ this.Manager.Comment("reaching state \'S69\'");
+ this.Manager.Comment("executing step \'call end()\'");
+ MBT.Adapter.Adapter.end();
+ this.Manager.Comment("reaching state \'S75\'");
+ this.Manager.Comment("checking step \'return end\'");
+ this.Manager.Comment("reaching state \'S79\'");
+ this.Manager.EndTest();
+ }
+ #endregion
+
+ #region Test Starting in S6
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("TestID", "0x01d513f2fed3847551573ca8967f84031f")]
+ public virtual void TestsuiteS6() {
+ this.Manager.BeginTest("TestsuiteS6");
+ this.Manager.Comment("reaching state \'S6\'");
+ this.Manager.Comment("executing step \'call start()\'");
+ MBT.Adapter.Adapter.start();
+ this.Manager.Comment("reaching state \'S7\'");
+ this.Manager.Comment("checking step \'return start\'");
+ this.Manager.Comment("reaching state \'S17\'");
+ this.Manager.Comment("executing step \'call Init_Calling()\'");
+ MBT.Adapter.Adapter.Init_Calling();
+ this.Manager.Comment("reaching state \'S24\'");
+ this.Manager.Comment("checking step \'return Init_Calling\'");
+ this.Manager.Comment("reaching state \'S31\'");
+ this.Manager.Comment("executing step \'call Calling_Ringing()\'");
+ MBT.Adapter.Adapter.Calling_Ringing();
+ this.Manager.Comment("reaching state \'S38\'");
+ this.Manager.Comment("checking step \'return Calling_Ringing\'");
+ this.Manager.Comment("reaching state \'S45\'");
+ this.Manager.Comment("executing step \'call Ringing_Ready()\'");
+ MBT.Adapter.Adapter.Ringing_Ready();
+ this.Manager.Comment("reaching state \'S52\'");
+ this.Manager.Comment("checking step \'return Ringing_Ready\'");
+ this.Manager.Comment("reaching state \'S58\'");
+ this.Manager.Comment("executing step \'call Terminating_Timeout()\'");
+ MBT.Adapter.Adapter.Terminating_Timeout();
+ this.Manager.Comment("reaching state \'S64\'");
+ this.Manager.Comment("checking step \'return Terminating_Timeout\'");
+ this.Manager.Comment("reaching state \'S70\'");
+ this.Manager.Comment("executing step \'call end()\'");
+ MBT.Adapter.Adapter.end();
+ this.Manager.Comment("reaching state \'S76\'");
+ this.Manager.Comment("checking step \'return end\'");
+ this.Manager.Comment("reaching state \'S80\'");
+ this.Manager.EndTest();
+ }
+ #endregion
+
+ #region Test Starting in S8
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
+ [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("TestID", "0x01be85886e5b722402381661d4ae68e15b")]
+ public virtual void TestsuiteS8() {
+ this.Manager.BeginTest("TestsuiteS8");
+ this.Manager.Comment("reaching state \'S8\'");
+ this.Manager.Comment("executing step \'call start()\'");
+ MBT.Adapter.Adapter.start();
+ this.Manager.Comment("reaching state \'S9\'");
+ this.Manager.Comment("checking step \'return start\'");
+ this.Manager.Comment("reaching state \'S18\'");
+ this.Manager.Comment("executing step \'call Init_Calling()\'");
+ MBT.Adapter.Adapter.Init_Calling();
+ this.Manager.Comment("reaching state \'S25\'");
+ this.Manager.Comment("checking step \'return Init_Calling\'");
+ this.Manager.Comment("reaching state \'S32\'");
+ this.Manager.Comment("executing step \'call Calling_Ringing()\'");
+ MBT.Adapter.Adapter.Calling_Ringing();
+ this.Manager.Comment("reaching state \'S39\'");
+ this.Manager.Comment("checking step \'return Calling_Ringing\'");
+ this.Manager.Comment("reaching state \'S46\'");
+ this.Manager.Comment("executing step \'call Ringing_Reject()\'");
+ MBT.Adapter.Adapter.Ringing_Reject();
+ this.Manager.Comment("reaching state \'S53\'");
+ this.Manager.Comment("checking step \'return Ringing_Reject\'");
+ this.Manager.Comment("reaching state \'S59\'");
+ this.Manager.Comment("executing step \'call end()\'");
+ MBT.Adapter.Adapter.end();
+ this.Manager.Comment("reaching state \'S65\'");
+ this.Manager.Comment("checking step \'return end\'");
+ this.Manager.Comment("reaching state \'S71\'");
+ this.Manager.EndTest();
+ }
+ #endregion
+ }
+}
diff --git a/demo/SpecExplorer/TTCN/MBT_SUT_SIP_Phone.ttcn b/demo/SpecExplorer/TTCN/MBT_SUT_SIP_Phone.ttcn
new file mode 100644
index 0000000..e4e36f2
--- /dev/null
+++ b/demo/SpecExplorer/TTCN/MBT_SUT_SIP_Phone.ttcn
@@ -0,0 +1,401 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_SUT_SIP_Phone.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+module MBT_SUT_SIP_Phone
+{
+import from MBT_SpecExpl_Testcases all;
+
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_RBTScheduler_Functions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+import from EPTF_CLL_LGenBase_ConfigFunctions all;
+import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_MBT_LGen_Functions all;
+
+import from EPTF_SIP_LGen_Definitions all;
+import from EPTF_SIP_LGen_Functions all;
+import from EPTF_SIP_Common_Functions all;
+import from EPTF_SIP_UserDatabase_Functions all;
+import from EPTF_SIP_Transport_Definitions all;
+import from EPTF_SIP_Transport_Functions all;
+import from EPTF_SIP_MessageHandler_Functions all;
+
+import from EPTF_SIP_TestSteps all;
+import from EPTF_SIP_Templates all;
+import from EPTF_SIP_Events all;
+
+modulepar
+{
+ charstring tsp_MBT_SUT_LocalIP := "159.107.193.33";
+ integer tsp_MBT_SUT_LocalPort := 20000;
+ charstring tsp_MBT_SUT_RemoteIP := "159.107.193.33";
+ integer tsp_MBT_SUT_RemotePort := 15000;
+
+ charstring tsp_MBT_SUT_SIP_Transport := "udp";
+}
+
+type component MBT_SpecExpl_Demo_SUT_CT
+ extends
+ EPTF_MBT_LGen_CT,
+ EPTF_SIP_LGen_CT, EPTF_SIP_LocalTransport_CT
+{
+ port userInPort userIn;
+ port userOutPort userOut;
+
+ var integer v_SUT_myBIdx := -1;
+}
+
+function f_MBT_SpecExpl_Demo_SUT_behavior() runs on MBT_SpecExpl_Demo_SUT_CT
+{
+ // map(self:IPL4_PCO, system:IPL4_PCO);
+
+ activate(as_MBT_SpecExpl_Demo_SUT_userMessageHandler());
+
+ f_EPTF_MBT_init("MBT_Demo_SUT",0, "MBT_")
+
+ f_SIP_applibInit("MBT_Demo_SUT");
+
+ f_EPTF_SIP_LocalTransport_init(tsp_MBT_SUT_SIP_Transport);
+ vf_EPTF_SIP_LocalTransport_receive := refers(f_EPTF_SIP_Message_MsgHandler); //receive callback function on LocalTransport
+ vf_EPTF_SIP_LGen_msgSender := refers(f_EPTF_SIP_LocalTransport_sendSIPMessage); //send callback function on LGen
+ v_removeUAS := refers(fcb_EPTF_SIP_LocalTransport_removeUAS);
+
+ v_SUT_myBIdx := f_EPTF_LGenBase_declareBehaviorType("SUT_Behavior", -1, null, null, null);
+
+ var integer vl_temp := -1;
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent("SUT_Behavior", "SUT_INVITE");
+ f_EPTF_Base_assert(%definitionId&": Error during registration of SUT_INVITE", vl_temp == c_MBT_SpecExpl_Demo_SUT_Event_invite);
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent("SUT_Behavior", "SUT_CANCEL");
+ f_EPTF_Base_assert(%definitionId&": Error during registration of SUT_CANCEL", vl_temp == c_MBT_SpecExpl_Demo_SUT_Event_cancel);
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent("SUT_Behavior", "SUT_BYE");
+ f_EPTF_Base_assert(%definitionId&": Error during registration of SUT_BYE", vl_temp == c_MBT_SpecExpl_Demo_SUT_Event_bye);
+
+
+ f_EPTF_LGenBase_declareCompactFsmTable(f_IMBT_SpecExpl_Demo_SUT_getFSM());
+
+ f_EPTF_MBT_initLGenFsm
+ (
+ refers(f_MBT_SpecExpl_Demo_SUT_createUserMessage),
+ refers(f_MBT_SpecExpl_Demo_SUT_fillInDB)
+ );
+
+ EPTF_MBT_PCO.send(EPTF_MBT_CommandResponse:{ ready := {}}) to mtc;
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+altstep as_MBT_SpecExpl_Demo_SUT_userMessageHandler()
+runs on MBT_SpecExpl_Demo_SUT_CT
+{
+ var UserInput vl_UserInput;
+
+ [] userIn.receive(UserInput:?) -> value vl_UserInput
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ action(%definitionId, " incoming: ", vl_UserInput);
+
+ if (vl_UserInput.input1 == "invite")
+ {
+ f_EPTF_LGenBase_dispatchEvent({{v_SUT_myBIdx, c_MBT_SpecExpl_Demo_SUT_Event_invite,{ 0, 0}, omit},{}});
+ }
+ else if (vl_UserInput.input1 == "cancel")
+ {
+ f_EPTF_LGenBase_dispatchEvent({{v_SUT_myBIdx, c_MBT_SpecExpl_Demo_SUT_Event_cancel,{ 0, 0}, omit},{}});
+ }
+ else if (vl_UserInput.input1 == "bye")
+ {
+ f_EPTF_LGenBase_dispatchEvent({{v_SUT_myBIdx, c_MBT_SpecExpl_Demo_SUT_Event_bye,{ 0, 0}, omit},{}});
+ }
+ else
+ {
+ action(%definitionId & "(): UserInput not recognized: ", vl_UserInput);
+ }
+
+ repeat;
+ }
+}
+
+function f_MBT_SpecExpl_Demo_SUT_createUserMessage(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_SpecExpl_Demo_SUT_CT
+{
+ action(%definitionId & "(): creating message for: ", pl_ptr, "\n", pl_ptr.reportedEvent);
+}
+
+function f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_SpecExpl_Demo_SUT_CT
+{
+ userOut.send(TimeOutIndication:{});
+}
+
+function f_MBT_SpecExpl_Demo_SUT_fillInDB(in EPTF_MBT_ConfigRequest p_req) runs on MBT_SpecExpl_Demo_SUT_CT
+{
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(p_req.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ for (var integer i:=0; i<p_req.noEntities; i:=i+1)
+ {
+ var EPTF_IntegerList vl_bCtx := f_EPTF_LGenBase_getBehaviorCtx(i + vl_entityIdx, v_SIP_myBIdx);
+ f_EPTF_SIP_IPL4asp_SetUserData
+ (
+ vl_bCtx[0],
+ tsp_MBT_SUT_LocalIP, // local IP
+ {tsp_MBT_SUT_LocalPort, tsp_MBT_SUT_LocalPort+1},
+ tsp_MBT_SUT_SIP_Transport,
+ tsp_MBT_SUT_RemoteIP, // proxy ip
+ tsp_MBT_SUT_RemotePort // proxy port
+ );
+
+ f_EPTF_SIP_User_SetUserData(
+ vl_bCtx[0],
+ {
+ {
+ addr := {
+ nameAddr := {
+ displayName := "titansim_user_7465001",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465001",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := tsp_MBT_SUT_LocalPort
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ },
+ password := "pass2ICS"
+ }
+ },
+ tsp_MBT_SUT_LocalIP,
+ {tsp_MBT_SUT_LocalPort, tsp_MBT_SUT_LocalPort+1},
+ i + vl_entityIdx //entity index
+ );
+
+ f_EPTF_SIP_Session_AddData(vl_bCtx[0], f_EPTF_SIP_getTransport(tsp_MBT_SUT_SIP_Transport),345600);
+
+ f_EPTF_SIP_Session_addCalledUser(
+ i,
+ {
+ nameAddr := {
+ displayName := "titansim_user_7465000",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465000",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := tsp_MBT_SUT_RemotePort
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ }
+ );
+
+ f_EPTF_SIP_IPL4asp_startListening(vl_bCtx[0], true); // Both UDP and TCP
+ }
+}
+
+const integer c_MBT_SpecExpl_Demo_SUT_Event_invite := 0;
+const integer c_MBT_SpecExpl_Demo_SUT_Event_cancel := 1;
+const integer c_MBT_SpecExpl_Demo_SUT_Event_bye := 2;
+
+const integer c_MBT_SpecExpl_Demo_SUT_State_idle := 0;
+const integer c_MBT_SpecExpl_Demo_SUT_State_initiated := 1;
+const integer c_MBT_SpecExpl_Demo_SUT_State_canceling := 2;
+const integer c_MBT_SpecExpl_Demo_SUT_State_established := 3;
+const integer c_MBT_SpecExpl_Demo_SUT_State_closing := 4;
+
+function f_IMBT_SpecExpl_Demo_SUT_getFSM()
+ runs on MBT_SpecExpl_Demo_SUT_CT
+ return EPTF_LGenBase_CompactFsmTable
+{
+ return
+ {
+ //DOT: digraph c_MBT_SpecExpl_Demo_SUT_FSM {
+ name := "MBT_SpecExpl_Demo_SUT_FSM",
+ stateList := {"idle", "initiated", "canceling", "established", "closing"},
+ timerList := {},
+ table :=
+ {
+ {eventToListen := {v_SUT_myBIdx, c_MBT_SpecExpl_Demo_SUT_Event_invite, entity},
+ cellRow := {
+ //state=idle
+ { {
+ //DOT: idle -> initiated [label="i:invite\n o:INVITE"]
+ {refers(f_SIP_step_init), {}},
+ {refers(f_SIP_step_createINVITE),{0,0}}
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_initiated},
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SUT_myBIdx, c_MBT_SpecExpl_Demo_SUT_Event_cancel, entity},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { {
+ //DOT: initiated -> canceling [label="i:cancel\n o:CANCEL"]
+ {refers(f_SIP_step_createCANCEL),{}}
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_canceling},
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SUT_myBIdx, c_MBT_SpecExpl_Demo_SUT_Event_bye, entity},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { {
+ //DOT: established -> closing [label="i:bye\n o:BYE"]
+ {refers(f_SIP_step_createBYE),{}}
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_closing},
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, 200, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { {
+ //DOT: initiated -> established [label="i:200\n o:ACK"]
+ {refers(f_SIP_step_createACK),{}}
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_established},
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { {
+ //DOT: closing -> idle [label="i:200"]
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_idle }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, 486, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { {
+ //DOT: initiated -> idle [label="i:486\n o:ACK"]
+ {refers(f_SIP_step_createACK),{}}
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_idle},
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, 487, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { {
+ //DOT: canceling -> idle [label="i:487\n o:ACK"]
+ {refers(f_SIP_step_createACK),{}}
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_idle},
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, c_SIP_eventIdx_BYE, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { {
+ //DOT: canceling -> idle [label="i:487\n o:ACK"]
+ {refers(f_SIP_step_handleBYE), {}},
+ {refers(f_SIP_step_createResponse),{c_status_200OK_idx}}
+ },omit, c_MBT_SpecExpl_Demo_SUT_State_idle},
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, c_SIP_eventIdx_UACTransactionTimeout, fsm},
+ cellRow := {
+ //state=idle
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=initiated
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=canceling
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=established
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=closing
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, c_SIP_eventIdx_UASTransactionTimeout, fsm},
+ cellRow := {
+ //state=idle
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=initiated
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=canceling
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=established
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=closing
+ { { {refers(f_MBT_SpecExpl_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit }
+ }
+ }//row
+ }//table
+ }//fsm
+ //DOT: }
+}
+
+}
diff --git a/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.cfg b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.cfg
new file mode 100644
index 0000000..00e35d7
--- /dev/null
+++ b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.cfg
@@ -0,0 +1,62 @@
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Copyright Test Competence Center (TCC) ETH 2009 //
+// //
+// The copyright to the computer program(s) herein is the property of TCC. //
+// The program(s) may be used and/or copied only with the written permission //
+// of TCC or in accordance with the terms and conditions stipulated in the //
+// agreement/contract under which the program(s) have been supplied //
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Demo.cfg
+// Rev: <RnXnn>
+// Prodnr: CNL 113 522
+// Updated: 2009-04-20
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+[LOGGING]
+ConsoleMask := ERROR | STATISTICS | ACTION | USER | WARNING | VERDICTOP
+#FileMask := LOG_ALL | DEBUG
+FileMask := LOG_ALL| ERROR | STATISTICS | PARALLEL | ACTION | WARNING
+#LogFile := "%l/%e.%h-%t%r.%s"
+LogEntityName := Yes
+LogEventTypes := Yes//Subcategories;
+SourceInfoFormat := Stack
+
+[MODULE_PARAMETERS]
+
+tsp_debug_EPTF_SchedulerFunctions := false
+tsp_debugVerbose_EPTF_SchedulerFunctions := false
+tsp_EPTF_LGenBaseDebugTraffic := false
+tsp_EPTF_LGenBaseDebug := false
+
+tsp_SIP_TransactionTimerValues :=
+{
+ 0.5,//T1
+ 0.0,//no max
+ 8.0,//64*T1
+ 8.0,//Timer D, >= 32.0
+ 0.5,//T1
+ 4.0,//T2
+ 8.0,//64*T1
+ 5.0,//T4
+ 0.5,//T1
+ 4.0,//T2,
+ 8.0,//64*T1
+ 5.0,//T4
+ 8.0//64*T1
+};
+
+[EXECUTE]
+MBT_SpecExpl_Testcases.Testcase_1
+//MBT_SpecExpl_Testcases.Testcase_2
+//MBT_SpecExpl_Testcases.Testcase_3
+//MBT_SpecExpl_Testcases.Testcase_4
+//MBT_SpecExpl_Testcases.Testcase_5
+//MBT_SpecExpl_Testcases.Testcase_6
+//MBT_SpecExpl_Testcases.Testcase_7
+
+
+[TESTPORT_PARAMETERS]
+*.IPL4_PCO.debug := "NO"
diff --git a/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.prj b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.prj
new file mode 100644
index 0000000..ea341e1
--- /dev/null
+++ b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.prj
@@ -0,0 +1,142 @@
+<!DOCTYPE TITAN_GUI_project_file>
+<Project TITAN_version="1.8.pl1" >
+ <General>
+ <Project_Name>MBT_SpecExpl_Demo</Project_Name>
+ <Executable_Path>MBT_SpecExpl_Demo</Executable_Path>
+ <Working_Dir>bin</Working_Dir>
+ <Build_Host>alpha</Build_Host>
+ <Execution_Mode>Parallel</Execution_Mode>
+ <ScriptFile_AfterMake>../../makefile_patch.sh</ScriptFile_AfterMake>
+ <Log_Format>yes</Log_Format>
+ <Update_Symlinks>yes</Update_Symlinks>
+ <Create_Absolute_Symlinks>no</Create_Absolute_Symlinks>
+ <Update_Makefile>yes</Update_Makefile>
+ <Localhost_Execute>yes</Localhost_Execute>
+ <Execute_Command>rsh %host "cd %project_working_dir ; "%executable" %localhost %mctr_port"</Execute_Command>
+ <Execute_Hosts>alfa, beta, gamma</Execute_Hosts>
+ <UnUsed_List></UnUsed_List>
+ </General>
+ <Modules>
+ <Module>MBT_SUT_SIP_Phone.ttcn</Module>
+ <Module>MBT_SpecExpl_Demo.ttcn</Module>
+ <Module>MBT_SpecExpl_Testcases.ttcn</Module>
+ </Modules>
+ <Configs>
+ <Config>MBT_SpecExpl_Demo.cfg</Config>
+ </Configs>
+ <Test_Cases>
+ <Test_Case>MBT_SpecExpl_Testcases.Testcase_1</Test_Case>
+ <Test_Case>MBT_SpecExpl_Testcases.Testcase_2</Test_Case>
+ <Test_Case>MBT_SpecExpl_Testcases.Testcase_3</Test_Case>
+ <Test_Case>MBT_SpecExpl_Testcases.Testcase_4</Test_Case>
+ <Test_Case>MBT_SpecExpl_Testcases.Testcase_5</Test_Case>
+ <Test_Case>MBT_SpecExpl_Testcases.Testcase_6</Test_Case>
+ <Test_Case>MBT_SpecExpl_Testcases.Testcase_7</Test_Case>
+ </Test_Cases>
+ <File_Group name="MainFileGroup" >
+ <File_Groups>
+ <File_Group name="EPTF_Applib_MBT_CNL113659" >
+ <File path="../../../src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn" />
+ <File path="../../../src/LoadGen/EPTF_MBT_LGen_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Applib_SIP_CNL113522" >
+ <File_Groups>
+ <File_Group path="../../../../EPTF_Applib_SIP_CNL113522/src/LoadGen/EPTF_SIP_LoadGen.grp" />
+ <File_Group path="../../../../EPTF_Applib_SIP_CNL113522/src/Logger/EPTF_SIP_Logger.grp" />
+ <File_Group path="../../../../EPTF_Applib_SIP_CNL113522/src/Transport/EPTF_SIP_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="TCCUsefulFunctions_CNL113472" >
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/digcalc.c" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/digcalc.h" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCInterface.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Definitions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.c" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.h" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCMaths.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_GenericTypes.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_ip.h" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCConversion.cc" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCConversion_Functions.ttcn" />
+ <File path="../../../../TCCUsefulFunctions_CNL113472/src/TCCTemplate_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="SIPmsg_CNL113319" >
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/lex.SIP_parse_.c" />
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse.h" />
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.c" />
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.h" />
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PortType.ttcn" />
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.cc" />
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.hh" />
+ <File path="../../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_Types.ttcn" />
+ </File_Group>
+ <File_Group name="UDPasp_CNL113346" >
+ <File path="../../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PortType.ttcn" />
+ <File path="../../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.cc" />
+ <File path="../../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.hh" />
+ <File path="../../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="XTDPasp_CNL113494" >
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/lex.xtdp.c" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XTDP-EXER-EncDec.cc" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XTDP_Images.ttcn" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XTDP_PDU_Defs.asn" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XTDPasp_PortType.ttcn" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XTDPasp_PT.cc" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XTDPasp_PT.hh" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XTDPasp_Types.ttcn" />
+ <File path="../../../../../TestPorts/XTDPasp_CNL113494/src/XUL_XTDL.asn" />
+ </File_Group>
+ <File_Group name="XSDASN_CNL113474" >
+ <File path="../../../../../ProtocolModules/XSDASN_CNL113474/src/XSD.asn" />
+ </File_Group>
+ <File_Group name="IPL4asp_CNL113531" >
+ <File path="../../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_discovery.cc" />
+ <File path="../../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Functions.ttcn" />
+ <File path="../../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PortType.ttcn" />
+ <File path="../../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_protocol_L234.hh" />
+ <File path="../../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.cc" />
+ <File path="../../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.hh" />
+ <File path="../../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="Abstract_Socket_CNL113384" >
+ <File path="../../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.cc" />
+ <File path="../../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.hh" />
+ </File_Group>
+ <File_Group name="EPTF_Core_Library_CNL113512" >
+ <File_Groups>
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Base/EPTF_CLL_Base.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Common/EPTF_CLL_Common.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/FreeBusyQueue/EPTF_CLL_FreeBusyQueue.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/HashMap/EPTF_CLL_HashMap.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Logging/EPTF_CLL_Logging.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/RedBlackTree/EPTF_CLL_RBtree_Float.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Scheduler/EPTF_CLL_Scheduler_RBT.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Variable/EPTF_CLL_Variable.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/StatMeasure/EPTF_CLL_StatMeasure.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportCommPortIPL4.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportMessageBufferManager.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportRouting.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/RandomNArray/EPTF_CLL_RNA.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/Semaphore/EPTF_CLL_Semaphore.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/StatHandler/EPTF_CLL_StatHandler.grp" />
+ <File_Group path="../../../../EPTF_Core_Library_CNL113512/src/LGenBase/EPTF_CLL_LGenBase.grp" />
+ </File_Groups>
+ </File_Group>
+ </File_Groups>
+ </File_Group>
+</Project>
diff --git a/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.ttcn b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.ttcn
new file mode 100644
index 0000000..3100c16
--- /dev/null
+++ b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Demo.ttcn
@@ -0,0 +1,721 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_SpecExpl_Demo.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+module MBT_SpecExpl_Demo
+{
+
+import from MBT_SpecExpl_Testcases all;
+
+import from MBT_SUT_SIP_Phone all;
+
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Base_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_RBTScheduler_Functions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+import from EPTF_CLL_LGenBase_ConfigFunctions all;
+import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_MBT_LGen_Functions all;
+
+import from EPTF_SIP_LGen_Definitions all;
+import from EPTF_SIP_LGen_Functions all;
+import from EPTF_SIP_Common_Functions all;
+import from EPTF_SIP_UserDatabase_Functions all;
+import from EPTF_SIP_Transport_Definitions all;
+import from EPTF_SIP_Transport_Functions all;
+import from EPTF_SIP_MessageHandler_Functions all;
+
+import from EPTF_SIP_TestSteps all;
+import from EPTF_SIP_Templates all;
+import from EPTF_SIP_Events all;
+import from EPTF_SIP_Transaction_Definitions all;
+
+import from TCCFileIO_Functions all;
+import from TCCDateTime_Functions all;
+
+modulepar
+{
+ charstring tsp_MBT_Tester_LocalIP := "159.107.193.33";
+ integer tsp_MBT_Tester_LocalPort := 15000;
+ charstring tsp_MBT_Tester_RemoteIP := "159.107.193.33";
+ integer tsp_MBT_Tester_RemotePort := 20000;
+
+ charstring tsp_MBT_SIP_Transport := "udp";
+}
+
+type component MBT_SpecExpl_Demo_Main_CT
+ extends
+ EPTF_Base_CT,
+ EPTF_MBT_Tester_CT
+{}
+
+type record Message
+{
+ charstring name,
+ boolean type_in,
+ record of record
+ {
+ charstring paramName,
+ charstring paramValue
+ } params
+}
+type record of Message Messages;
+type record ExportData
+{
+ charstring tcName,
+ verdicttype verdict,
+ Messages messages,
+ record of charstring states
+}
+type record of ExportData ExportDatas;
+
+function f_MBT_SpecExpl_Demo_beginTestCase() runs on SpecExpl_CT
+{
+ log(%definitionId, " started");
+
+ f_EPTF_Base_init_CT("mtc");
+
+ log(%definitionId, " Creating SUT");
+ var MBT_SpecExpl_Demo_SUT_CT vc_sut := MBT_SpecExpl_Demo_SUT_CT.create;
+ connect(self:userIn, vc_sut:userIn);
+ connect(self:userOut, vc_sut:userOut);
+ connect(self:EPTF_MBT_PCO,vc_sut:EPTF_MBT_PCO);
+ vc_sut.start(f_MBT_SpecExpl_Demo_SUT_behavior());
+
+ EPTF_MBT_PCO.receive(EPTF_MBT_CommandResponse:?) from vc_sut;
+
+ EPTF_MBT_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "SUT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "Behavior_SIP", "SUT_Behavior"},
+ fsmName := "MBT_SpecExpl_Demo_SUT_FSM"
+ }
+ ) to vc_sut;
+ EPTF_MBT_PCO.receive(EPTF_MBT_ConfigResponse:?) from vc_sut;
+ log(%definitionId, " SUT ready");
+
+ log(%definitionId, " Creating LGen");
+ var MBT_SpecExpl_Demo_LGen_CT vc_lgen := MBT_SpecExpl_Demo_LGen_CT.create;
+ connect(self:netIn, vc_lgen:netOut);
+ connect(self:netOut, vc_lgen:netIn);
+ connect(self:EPTF_MBT_PCO,vc_lgen:EPTF_MBT_PCO);
+ vc_lgen.start(f_MBT_SpecExpl_Demo_LGen_behavior());
+
+ EPTF_MBT_PCO.receive(EPTF_MBT_CommandResponse:?) from vc_lgen;
+
+ EPTF_MBT_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "MBT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "Behavior_SIP"},
+ fsmName := "FSM_MBT"
+ }
+ ) to vc_lgen;
+ EPTF_MBT_PCO.receive(EPTF_MBT_ConfigResponse:?) from vc_lgen;
+
+ log(%definitionId, " LGen ready");
+
+ log(%definitionId, " finished");
+}
+
+
+function f_MBT_SpecExpl_Demo_endTestCase() runs on SpecExpl_CT
+{
+ log("### MAIN: END TESTCASE started");
+
+ f_EPTF_Base_stopAll(none, true);
+
+ log("### MAIN: END TESTCASE finished");
+}
+
+/////////////////////////////////////////////////////////////////////////
+//
+// M B T Applib
+//
+/////////////////////////////////////////////////////////////////////////
+
+type component MBT_SpecExpl_Demo_LGen_CT
+ extends
+ EPTF_MBT_LGen_CT,
+ EPTF_SIP_LGen_CT, EPTF_SIP_LocalTransport_CT
+{
+ port netInPort netIn;
+ port netOutPort netOut;
+}
+
+function f_MBT_SpecExpl_Demo_LGen_behavior() runs on MBT_SpecExpl_Demo_LGen_CT
+{
+ //map(self:IPL4_PCO, system:IPL4_PCO);
+
+ activate(as_MBT_SpecExpl_Demo_LGen_userMessageHandler());
+
+ f_EPTF_MBT_init("MBT_Demo_LGen",0, "MBT_")
+
+ f_SIP_applibInit("MBT_Demo_LGen");
+
+ f_EPTF_SIP_LocalTransport_init(tsp_MBT_SIP_Transport);
+ vf_EPTF_SIP_LocalTransport_receive := refers(f_EPTF_SIP_Message_MsgHandler); //receive callback function on LocalTransport
+ vf_EPTF_SIP_LGen_msgSender := refers(f_EPTF_SIP_LocalTransport_sendSIPMessage); //send callback function on LGen
+ v_removeUAS := refers(fcb_EPTF_SIP_LocalTransport_removeUAS);
+
+ f_EPTF_MBT_initLGenFsm
+ (
+ refers(f_MBT_SpecExpl_Demo_LGen_createUserMessage),
+ refers(f_MBT_SpecExpl_Demo_LGen_fillInDB)
+ );
+
+ EPTF_MBT_PCO.send(EPTF_MBT_CommandResponse:{ ready := {}}) to mtc;
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+altstep as_MBT_SpecExpl_Demo_LGen_userMessageHandler()
+runs on MBT_SpecExpl_Demo_LGen_CT
+{
+ var SIPResp vl_SIPResp;
+ var SIPReq vl_SIPReq;
+
+ var EPTF_LGenBase_TestStepArgs vl_stepArgs :=
+ { eIdx := 0, refContext := { fCtxIdx := 0, fRefArgs := { } }, stepArgs := { } };
+
+ [] netOut.receive(SIPResp:?) -> value vl_SIPResp
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ log(%definitionId & "(): incoming ", vl_SIPResp);
+
+ if (vl_SIPResp.status == 180)
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_180Ringing_idx};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else if (vl_SIPResp.status == 200)
+ {
+ if (vl_SIPResp.cseq == "INVITE")
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_200OK_idx, c_SIP_Method_INVITE};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else if (vl_SIPResp.cseq == "CANCEL")
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_200OK_idx, c_SIP_Method_CANCEL};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ }
+ else if (vl_SIPResp.status == 486)
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_486BusyHere_idx};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else if (vl_SIPResp.status == 487)
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_487RequestTerminated_idx, c_SIP_Method_INVITE};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else
+ {
+ log(%definitionId & "(): unhandled SIPResp");
+ }
+
+ repeat;
+ }
+ [] netOut.receive(SIPReq:?) -> value vl_SIPReq
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ log(%definitionId & "(): incoming ", vl_SIPReq);
+
+ if (vl_SIPReq.op == "BYE")
+ {
+ f_SIP_step_createBYE(vl_stepArgs);
+ }
+ else
+ {
+ log(%definitionId & "(): unhandled SIPResp");
+ }
+ repeat;
+ }
+}
+
+function f_MBT_SpecExpl_Demo_LGen_createUserMessage(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_SpecExpl_Demo_LGen_CT
+{
+ log(%definitionId & " creating message for:\n", pl_ptr, "\n", pl_ptr.reportedEvent);
+
+ var charstring vl_param := "sip:127.0.0.1:5061";
+
+ if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_INVITE)
+ {
+ var integer vl_FSMIdx := -1;
+ pl_ptr.refContext.fCtxIdx := 0;
+
+ if (not f_EPTF_SIP_FSMInitialized(pl_ptr.eIdx, pl_ptr.refContext.fCtxIdx, vl_FSMIdx))
+ {
+ f_SIP_step_init(pl_ptr);
+ f_SIP_step_handleINVITE(pl_ptr);
+ }
+ netIn.send(SIPReq:{"INVITE", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_ACK)
+ {
+ netIn.send(SIPReq:{"ACK", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_BYE)
+ {
+ netIn.send(SIPReq:{"BYE", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_CANCEL)
+ {
+ netIn.send(SIPReq:{"CANCEL", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == 200)
+ {
+ netIn.send(SIPResp:{200, v_msgToProcess.response.msgHeader.cSeq.method});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_retransmittedRequest)
+ {
+ netIn.send(SIPReq:{v_msgToProcess.request.msgHeader.cSeq.method, vl_param});
+ }
+ else
+ {
+ log(%definitionId & "(): unhandled incoming message");
+ }
+}
+
+function f_MBT_SpecExpl_Demo_LGen_fillInDB(in EPTF_MBT_ConfigRequest p_req) runs on MBT_SpecExpl_Demo_LGen_CT
+{
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(p_req.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ for (var integer i:=0; i<p_req.noEntities; i:=i+1)
+ {
+ var EPTF_IntegerList vl_bCtx := f_EPTF_LGenBase_getBehaviorCtx(i + vl_entityIdx, v_SIP_myBIdx);
+ f_EPTF_SIP_IPL4asp_SetUserData
+ (
+ vl_bCtx[0],
+ tsp_MBT_Tester_LocalIP, // local IP
+ {tsp_MBT_Tester_LocalPort, tsp_MBT_Tester_LocalPort+1},
+ tsp_MBT_SIP_Transport,
+ tsp_MBT_Tester_RemoteIP, // proxy ip
+ tsp_MBT_Tester_RemotePort // proxy port
+ );
+
+ f_EPTF_SIP_User_SetUserData(
+ vl_bCtx[0],
+ {
+ {
+ addr := {
+ nameAddr := {
+ displayName := "titansim_user_7465000",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465000",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := tsp_MBT_Tester_LocalPort
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ },
+ password := "pass2ICS"
+ }
+ },
+ tsp_MBT_Tester_LocalIP,
+ {tsp_MBT_Tester_LocalPort, tsp_MBT_Tester_LocalPort+1},
+ i + vl_entityIdx //entity index
+ );
+
+ f_EPTF_SIP_Session_AddData(vl_bCtx[0], f_EPTF_SIP_getTransport(tsp_MBT_SIP_Transport),345600);
+
+ f_EPTF_SIP_IPL4asp_startListening(vl_bCtx[0], true); // Both UDP and TCP
+ }
+}
+
+function f_exportHTML(in ExportDatas db)
+{
+ var charstring vl_datetime := f_getTimeFormatted(f_time(),"%A %d %B %Y %H:%M:%S");
+ var integer vl_write;
+ var charstring vl_html_start :=
+"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
+<html>
+<head>
+<title>Test results html export " & vl_datetime & "</title>
+<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">
+<script language=\"JavaScript\" type=\"text/javascript\">
+
+$pass = '#99FF99';
+$fail = '#FF9999';
+$inconc = '#FFFF99';
+$selected = '#9999FF';
+
+function mouseover(row) {row.style.background=$selected;};
+function mouseout(row) {if(row.getAttribute(\"verdicttype\")==\"pass\")row.style.background=$pass;
+ else if(row.getAttribute(\"verdicttype\")==\"fail\")row.style.background=$fail;
+ else if(row.getAttribute(\"verdicttype\")==\"inconc\")row.style.background=$inconc;};
+function mouseclick(tcnum) {window.location = \"#testcase\"+tcnum;}
+
+</script>
+
+<style type=\"text/css\">
+
+ body { margin: 0px;
+ background-color: #CCCCCC;
+ text-align: center; }
+
+ .header { background-color: #DDDDDD; }
+
+ .c1 { text-align: left;
+ vertical-align: top;
+ width: 120px;}
+ .c2 { text-align: left;
+ vertical-align: top;
+ width: 80px;}
+ .c3 { text-align: left;
+ vertical-align: top;
+ width: 250px;}
+ .c4 { text-align: left;
+ vertical-align: top;
+ width: 300px;}
+
+ .r1 {background-color: #99FF99;}
+ .r2 {background-color: #FF9999;}
+ .r3 {background-color: #FFFF99;}
+
+ .table1 { border: 2px solid black;
+ border-collapse: collapse;
+ border-spacing: 0px;
+ padding: 0px; }
+
+ .table1 td{ border: 1px solid black;
+ border-collapse: collapse; }
+
+ .sumtable { border: 2px solid black;
+ border-collapse: collapse;
+ border-spacing: 0px;
+ padding: 0px; }
+
+ .maintable { border: 0px solid black;}
+
+ .innertable { border: 0px solid black;
+ width: 100%;
+ height: 100%;}
+
+ #wrapper { position: relative;
+ top: 36px;
+ display: inline-block; }
+
+ .dtitle { background-color: #DDDDDD;
+ font-size: 24px;
+ white-space: pre; }
+
+ .dt {background-color: transparent;
+ font-size: 1px; }
+
+ .ds {background-color: #222222;
+ font-size: 1px;
+ filter:alpha(opacity=90);
+ -moz-opacity: 0.9;
+ opacity: 0.9; }
+
+</style>
+</head>
+<body>
+<div align=\"center\" id=\"wrapper\">
+
+<table align=\"center\" class=\"maintable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr>
+ <td>
+ <table class=\"table1\" cellpadding=\"5px\" cellspacing=\"0px\">
+ <tr class=\"dtitle\">
+ <td>" & vl_datetime & "</td>
+ </tr>
+ </table>
+ </td>
+ <td width=\"10px\" height=\"100%\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr height=\"10px\"><td class=\"dt\"> </td></tr>
+ <tr><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td height=\"10px\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr><td width=\"10px\" class=\"dt\"> </td><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ <td class=\"ds\"> </td>
+ </tr>
+</table>
+
+<br>
+<table align=\"center\" class=\"maintable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr>
+ <td>
+ <table class=\"table1\" cellpadding=\"5px\">
+ <tr class=\"header\">
+ <th class=\"c1\">TC Name</th><th class=\"c2\">Verdict</th>
+ </tr>
+";
+
+ var integer vl_nof_pass := 0;
+ var integer vl_nof_fail := 0;
+ var integer vl_nof_inconc := 0;
+ var integer vl_fd;
+ var charstring vl_text_out;
+ vl_fd := f_FIO_open_append_wronly ("exportHTML_"&f_getTimeFormatted(f_time(),"%d_%m_%Y__%H_%M_%S")&".html");
+ if (vl_fd < 0)
+ {
+ log(f_FIO_get_error_string ());
+ return;
+ }
+ vl_write := f_FIO_write_text (vl_fd, vl_html_start);
+
+ for(var integer i := 0; i < sizeof(db) ; i:= i+1)
+ {
+ //new row
+ if (db[i].verdict == pass)
+ {
+ vl_text_out := " <tr class=\"r1\" verdicttype=\"pass\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onclick=\"mouseclick(" & int2str(i) & ");\" style=\"cursor: pointer\">\n";
+ vl_nof_pass := vl_nof_pass +1;
+ }
+ else if (db[i].verdict == fail)
+ {
+ vl_text_out := " <tr class=\"r2\" verdicttype=\"fail\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onclick=\"mouseclick(" & int2str(i) & ");\" style=\"cursor: pointer\">\n";
+ vl_nof_fail := vl_nof_fail +1;
+ }
+ else if (db[i].verdict == inconc)
+ {
+ vl_text_out := " <tr class=\"r3\" verdicttype=\"inconc\" onmouseover=\"mouseover(this);\" onmouseout=\"mouseout(this);\" onclick=\"mouseclick(" & int2str(i) & ");\" style=\"cursor: pointer\">\n";
+ vl_nof_inconc := vl_nof_inconc +1;
+ }
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+
+ //new cell - tcName
+ vl_text_out := " <td class=\"c1\">\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //cell content
+ vl_text_out := " "&db[i].tcName&"\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //end of cell
+ vl_text_out := " </td>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+
+ //new cell - Verdict
+ vl_text_out := " <td class=\"c2\">\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //cell content
+ if (db[i].verdict == pass)
+ {
+ vl_text_out := " pass\n";
+ }
+ else if (db[i].verdict == fail)
+ {
+ vl_text_out := " fail\n";
+ }
+ else if (db[i].verdict == inconc)
+ {
+ vl_text_out := " error\n";
+ }
+
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //end of cell
+ vl_text_out := " </td>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ }
+
+ vl_text_out :=
+" </table>
+ </td>
+ <td width=\"10px\" height=\"100%\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr height=\"10px\"><td class=\"dt\"> </td></tr>
+ <tr><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td height=\"10px\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr><td width=\"10px\" class=\"dt\"> </td><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ <td class=\"ds\"> </td>
+ </tr>
+</table>
+<br>
+
+<table align=\"center\" class=\"maintable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr>
+ <td>
+ <table class=\"sumtable\" cellpadding=\"5px\">
+ <tr>
+ <td class=\"r1\" style=\"border-left: 1px solid black\">Passed: </td><td class=\"r1\">" & int2str(vl_nof_pass) & "</td>
+ <td class=\"r2\" style=\"border-left: 1px solid black\">Failed: </td><td class=\"r2\">" & int2str(vl_nof_fail) & "</td>
+ <td class=\"r3\" style=\"border-left: 1px solid black\">Error: </td><td class=\"r3\">" & int2str(vl_nof_inconc) & "</td>
+ </tr>
+ </table>
+ </td>
+ <td width=\"10px\" height=\"100%\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr height=\"10px\"><td class=\"dt\"> </td></tr>
+ <tr><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td height=\"10px\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr><td width=\"10px\" class=\"dt\"> </td><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ <td class=\"ds\"> </td>
+ </tr>
+</table>
+<br><br><br>
+<table align=\"center\" class=\"maintable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr>
+ <td>
+ <table class=\"table1\" cellpadding=\"5px\" cellspacing=\"0px\">
+ <tr class=\"header\">
+ <th class=\"c1\">TC Name</th><th class=\"c2\">Verdict</th><th class=\"c3\">Messages</th><th class=\"c4\">States</th>
+ </tr>
+";
+ vl_write := f_FIO_write_text (vl_fd, vl_text_out);
+
+ for(var integer i := 0; i < sizeof(db) ; i:= i+1)
+ {
+ //new row
+ if (db[i].verdict == pass)
+ {
+ vl_text_out := " <tr class=\"r1\">\n";
+ }
+ else if (db[i].verdict == fail)
+ {
+ vl_text_out := " <tr class=\"r2\">\n";
+ }
+ else if (db[i].verdict == inconc)
+ {
+ vl_text_out := " <tr class=\"r3\">\n";
+ }
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+
+ //new cell - tcName
+ vl_text_out := " <td class=\"c1\">\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //cell content
+ vl_text_out := " <a name=\"testcase" & int2str(i) & "\">"&db[i].tcName&"</a>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //end of cell
+ vl_text_out := " </td>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+
+ //new cell - Verdict
+ vl_text_out := " <td class=\"c2\">\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //cell content
+ if (db[i].verdict == pass)
+ {
+ vl_text_out := " pass\n";
+ }
+ else if (db[i].verdict == fail)
+ {
+ vl_text_out := " fail\n";
+ }
+ else if (db[i].verdict == inconc)
+ {
+ vl_text_out := " error\n";
+ }
+
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //end of cell
+ vl_text_out := " </td>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+
+ //new cell - Messages
+ vl_text_out := " <td class=\"c3\">\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //cell content
+ for(var integer j := 0; j < sizeof(db[i].messages); j := j+1)
+ {
+ if (db[i].messages[j].type_in) {vl_text_out := "<------- ";} else {vl_text_out := "-------- ";}
+ vl_text_out := vl_text_out & db[i].messages[j].name;
+ if (db[i].messages[j].type_in) {vl_text_out := vl_text_out & " --------<br>\n";} else {vl_text_out := vl_text_out & " -------><br>\n";}
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ for(var integer k := 0; k < sizeof(db[i].messages[j].params); k := k+1)
+ {
+ vl_text_out := " - " & db[i].messages[j].params[k].paramName & ": \"" & db[i].messages[j].params[k].paramValue & "\"<br>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ }
+ }
+ //end of cell
+ vl_text_out := " </td>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+
+ //new cell - States
+ vl_text_out := " <td class=\"c4\">\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ //cell content
+ for(var integer j := 0; j < sizeof(db[i].states); j := j+1)
+ {
+ vl_text_out := db[i].states[j] & "<br>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ }
+ //end of cell
+ vl_text_out := " </td>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+
+ //end of row
+ vl_text_out := " </tr>\n";
+ vl_write := f_FIO_write_text (vl_fd,vl_text_out);
+ }
+
+ var charstring vl_html_end :=
+" </table>
+ </td>
+ <td width=\"10px\" height=\"100%\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr height=\"10px\"><td class=\"dt\"> </td></tr>
+ <tr><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td height=\"10px\">
+ <table class=\"innertable\" cellpadding=\"0px\" cellspacing=\"0px\">
+ <tr><td width=\"10px\" class=\"dt\"> </td><td class=\"ds\"> </td></tr>
+ </table>
+ </td>
+ <td class=\"ds\"> </td>
+ </tr>
+</table>
+<br>
+</div>
+</body>
+</html>";
+
+ vl_write := f_FIO_write_text (vl_fd, vl_html_end);
+ f_FIO_flush (vl_fd);
+ f_FIO_close (vl_fd);
+}
+
+}
diff --git a/demo/SpecExplorer/TTCN/MBT_SpecExpl_Testcases.ttcn b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Testcases.ttcn
new file mode 100644
index 0000000..93a3b0a
--- /dev/null
+++ b/demo/SpecExplorer/TTCN/MBT_SpecExpl_Testcases.ttcn
@@ -0,0 +1,381 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_SpecExpMBT_SpecExpl_Testcasesl_Demo.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+module MBT_SpecExpl_Testcases
+{
+ import from MBT_SpecExpl_Demo all;
+ import from EPTF_MBT_LGen_Definitions all;
+ type port netInPort message
+ {
+ inout SIPResp;
+ inout SIPReq;
+ } with { extension "internal" }
+
+ type port userInPort message
+ {
+ inout UserInput;
+ } with { extension "internal" }
+
+ type port netOutPort message
+ {
+ inout SIPResp;
+ inout SIPReq;
+ } with { extension "internal" }
+
+ type port userOutPort message
+ {
+ inout TimeOutIndication;
+ } with { extension "internal" }
+
+ type record SIPReq
+ {
+ charstring op,
+ charstring param_
+ }
+
+ type record SIPResp
+ {
+ integer status,
+ charstring cseq
+ }
+
+ type record UserInput
+ {
+ charstring input1,
+ charstring input2
+ }
+
+ type record TimeOutIndication
+ {
+
+ }
+
+ type component SpecExpl_CT extends MBT_SpecExpl_Demo_Main_CT
+ {
+ port netInPort netIn;
+ port userInPort userIn;
+ port netOutPort netOut;
+ port userOutPort userOut;
+ timer harnessTimer := 0.0;
+ }
+
+ altstep SpecExplDefaultAlt() runs on SpecExpl_CT
+ {
+ [] any port.receive
+ {
+ harnessTimer.stop;
+ setverdict(fail);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ stop;
+ }
+ [] harnessTimer.timeout
+ {
+ setverdict(fail);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ stop;
+ }
+ }
+ function specexpl_send_SIPResp_to_netIn(template SIPResp msgToSend) runs on SpecExpl_CT
+ {
+ netIn.send(msgToSend);
+ }
+
+ function specexpl_send_SIPReq_to_netIn(template SIPReq msgToSend) runs on SpecExpl_CT
+ {
+ netIn.send(msgToSend);
+ }
+
+ function specexpl_send_UserInput_to_userIn(template UserInput msgToSend) runs on SpecExpl_CT
+ {
+ userIn.send(msgToSend);
+ }
+
+ function specexpl_receive_SIPResp_from_netOut(template SIPResp tmplToMatch) runs on SpecExpl_CT
+ {
+ netOut.receive(tmplToMatch);
+ }
+
+ function specexpl_receive_SIPReq_from_netOut(template SIPReq tmplToMatch) runs on SpecExpl_CT
+ {
+ netOut.receive(tmplToMatch);
+ }
+
+ function specexpl_receive_TimeOutIndication_from_userOut(template TimeOutIndication tmplToMatch) runs on SpecExpl_CT
+ {
+ userOut.receive(tmplToMatch);
+ }
+
+
+ testcase Testcase_1() runs on SpecExpl_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_SpecExpl_Demo_beginTestCase();
+ default_behaviour_ref := activate(SpecExplDefaultAlt());
+ log("START TESTCASE: Testcase_1");
+ //Init_Calling
+ log("Init_Calling");
+ specexpl_send_UserInput_to_userIn({input1 := "invite", input2 := "sip:127.0.0.1:5061"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Calling_Ringing
+ log("Calling_Ringing");
+ specexpl_send_SIPResp_to_netIn({status := 180, cseq := ""});
+ //Ringing_Ready
+ log("Ringing_Ready");
+ specexpl_send_SIPResp_to_netIn({status := 200, cseq := "INVITE"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "ACK", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Ready_End
+ log("Ready_End");
+ specexpl_send_SIPReq_to_netIn({op := "BYE", param_ := "sip:127.0.0.1"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPResp_from_netOut({status := 200, cseq := "BYE"});
+ harnessTimer.stop;
+ log("THE END");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ }
+
+ testcase Testcase_2() runs on SpecExpl_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_SpecExpl_Demo_beginTestCase();
+ default_behaviour_ref := activate(SpecExplDefaultAlt());
+ log("START TESTCASE: Testcase_2");
+ //Init_Calling
+ log("Init_Calling");
+ specexpl_send_UserInput_to_userIn({input1 := "invite", input2 := "sip:127.0.0.1:5061"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Calling_Ringing
+ log("Calling_Ringing");
+ specexpl_send_SIPResp_to_netIn({status := 180, cseq := ""});
+ //Ringing_Ready
+ log("Ringing_Ready");
+ specexpl_send_SIPResp_to_netIn({status := 200, cseq := "INVITE"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "ACK", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Ready_Terminating
+ log("Ready_Terminating");
+ specexpl_send_UserInput_to_userIn({input1 := "bye", input2 := ""});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "BYE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Terminating_OK
+ log("Terminating_OK");
+ specexpl_send_SIPResp_to_netIn({status := 200, cseq := ""});
+ log("THE END");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ }
+
+ testcase Testcase_3() runs on SpecExpl_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_SpecExpl_Demo_beginTestCase();
+ default_behaviour_ref := activate(SpecExplDefaultAlt());
+ log("START TESTCASE: Testcase_3");
+ //Init_Calling
+ log("Init_Calling");
+ specexpl_send_UserInput_to_userIn({input1 := "invite", input2 := "sip:127.0.0.1:5061"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Calling_Ringing
+ log("Calling_Ringing");
+ specexpl_send_SIPResp_to_netIn({status := 180, cseq := ""});
+ //Ringing_Reject
+ log("Ringing_Reject");
+ specexpl_send_SIPResp_to_netIn({status := 486, cseq := "INVITE"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "ACK", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ log("THE END");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ }
+
+ testcase Testcase_4() runs on SpecExpl_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_SpecExpl_Demo_beginTestCase();
+ default_behaviour_ref := activate(SpecExplDefaultAlt());
+ log("START TESTCASE: Testcase_4");
+ //Init_Calling
+ log("Init_Calling");
+ specexpl_send_UserInput_to_userIn({input1 := "invite", input2 := "sip:127.0.0.1:5061"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Calling_Ringing
+ log("Calling_Ringing");
+ specexpl_send_SIPResp_to_netIn({status := 180, cseq := ""});
+ //Ringing_Canceling
+ log("Ringing_Canceling");
+ specexpl_send_UserInput_to_userIn({input1 := "cancel", input2 := ""});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "CANCEL", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Canceling_WaitingResponse
+ log("Canceling_WaitingResponse");
+ specexpl_send_SIPResp_to_netIn({status := 200, cseq := "CANCEL"});
+ //WaitingResponse_Terminate
+ log("WaitingResponse_Terminate");
+ specexpl_send_SIPResp_to_netIn({status := 487, cseq := "INVITE"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "ACK", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ log("THE END");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ }
+
+ testcase Testcase_5() runs on SpecExpl_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_SpecExpl_Demo_beginTestCase();
+ default_behaviour_ref := activate(SpecExplDefaultAlt());
+ log("START TESTCASE: Testcase_5");
+ //Init_Calling
+ log("Init_Calling");
+ specexpl_send_UserInput_to_userIn({input1 := "invite", input2 := "sip:127.0.0.1:5061"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Calling_Ringing
+ log("Calling_Ringing");
+ specexpl_send_SIPResp_to_netIn({status := 180, cseq := ""});
+ //Canceling_Timeout
+ log("Canceling_Timeout");
+ specexpl_send_UserInput_to_userIn({input1 := "cancel", input2 := ""});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "CANCEL", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(0.50 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "CANCEL", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(1.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "CANCEL", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(2.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "CANCEL", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(4.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "CANCEL", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ log("THE END");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ }
+
+ testcase Testcase_6() runs on SpecExpl_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_SpecExpl_Demo_beginTestCase();
+ default_behaviour_ref := activate(SpecExplDefaultAlt());
+ log("START TESTCASE: Testcase_6");
+ //Calling_Timeout
+ log("Calling_Timeout");
+ specexpl_send_UserInput_to_userIn({input1 := "invite", input2 := "sip:127.0.0.1:5061"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(0.50 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(1.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(2.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(4.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ log("THE END");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ }
+
+ testcase Testcase_7() runs on SpecExpl_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_SpecExpl_Demo_beginTestCase();
+ default_behaviour_ref := activate(SpecExplDefaultAlt());
+ log("START TESTCASE: Testcase_7");
+ //Init_Calling
+ log("Init_Calling");
+ specexpl_send_UserInput_to_userIn({input1 := "invite", input2 := "sip:127.0.0.1:5061"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "INVITE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Calling_Ringing
+ log("Calling_Ringing");
+ specexpl_send_SIPResp_to_netIn({status := 180, cseq := ""});
+ //Ringing_Ready
+ log("Ringing_Ready");
+ specexpl_send_SIPResp_to_netIn({status := 200, cseq := "INVITE"});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "ACK", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ //Terminating_Timeout
+ log("Terminating_Timeout");
+ specexpl_send_UserInput_to_userIn({input1 := "bye", input2 := ""});
+ harnessTimer.start(0.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "BYE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(0.50 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "BYE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(1.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "BYE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(2.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "BYE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ harnessTimer.start(4.00 + SLACK);
+ specexpl_receive_SIPReq_from_netOut({op := "BYE", param_ := "sip:127.0.0.1:5061"});
+ harnessTimer.stop;
+ log("THE END");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_SpecExpl_Demo_endTestCase();
+ }
+}
diff --git a/demo/TTCNScripter/TTCNScripter_v211.jar b/demo/TTCNScripter/TTCNScripter_v211.jar
new file mode 100644
index 0000000..497b2d7
--- /dev/null
+++ b/demo/TTCNScripter/TTCNScripter_v211.jar
Binary files differ
diff --git a/demo/TTCNScripter/TTCNScripter_v421.jar b/demo/TTCNScripter/TTCNScripter_v421.jar
new file mode 100644
index 0000000..4b87429
--- /dev/null
+++ b/demo/TTCNScripter/TTCNScripter_v421.jar
Binary files differ
diff --git a/demo/direct/MBT_Qtronic_Demo.cfg b/demo/direct/MBT_Qtronic_Demo.cfg
new file mode 100644
index 0000000..52510d9
--- /dev/null
+++ b/demo/direct/MBT_Qtronic_Demo.cfg
@@ -0,0 +1,62 @@
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Copyright Test Competence Center (TCC) ETH 2009 //
+// //
+// The copyright to the computer program(s) herein is the property of TCC. //
+// The program(s) may be used and/or copied only with the written permission //
+// of TCC or in accordance with the terms and conditions stipulated in the //
+// agreement/contract under which the program(s) have been supplied //
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Demo.cfg
+// Rev: <RnXnn>
+// Prodnr: CNL 113 522
+// Updated: 2009-04-20
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+[LOGGING]
+
+ConsoleMask := ERROR | STATISTICS | ACTION | TESTCASE
+FileMask := LOG_ALL | DEBUG
+#FileMask := ERROR | STATISTICS | PARALLEL | ACTION | WARNING
+#LogFile := "%l/%e.%h-%t%r.%s"
+LogEntityName := Yes
+LogEventTypes := Yes//Subcategories;
+SourceInfoFormat := Stack
+
+
+[MODULE_PARAMETERS]
+
+tsp_EPTF_MBT_LGen_debug := true;
+tsp_debug_EPTF_SchedulerFunctions := false
+tsp_debugVerbose_EPTF_SchedulerFunctions := false
+tsp_EPTF_LGenBaseDebugTraffic := false
+tsp_EPTF_LGenBaseDebug := false
+
+tsp_SIP_TransactionTimerValues :=
+{
+ 0.5,//T1
+ 0.0,//no max
+ 8.0,//64*T1
+ 8.0,//Timer D, >= 32.0
+ 0.5,//T1
+ 4.0,//T2
+ 8.0,//64*T1
+ 5.0,//T4
+ 0.5,//T1
+ 4.0,//T2,
+ 8.0,//64*T1
+ 5.0,//T4
+ 8.0//64*T1
+};
+
+
+[EXECUTE]
+
+MBT_Qtronic_Testcases.control
+
+
+[TESTPORT_PARAMETERS]
+
+*.IPL4_PCO.debug := "NO"
diff --git a/demo/direct/MBT_Qtronic_Demo.prj b/demo/direct/MBT_Qtronic_Demo.prj
new file mode 100644
index 0000000..35a29dc
--- /dev/null
+++ b/demo/direct/MBT_Qtronic_Demo.prj
@@ -0,0 +1,150 @@
+<!DOCTYPE TITAN_GUI_project_file>
+<Project TITAN_version="1.8.pl1" >
+ <General>
+ <Project_Name>MBT_Qtronic_Demo</Project_Name>
+ <Executable_Path>bin/demo</Executable_Path>
+ <Working_Dir>bin</Working_Dir>
+ <Build_Host>alpha</Build_Host>
+ <Execution_Mode>Parallel</Execution_Mode>
+ <ScriptFile_AfterMake>../makefile_patch.sh</ScriptFile_AfterMake>
+ <Log_Format>yes</Log_Format>
+ <Update_Symlinks>yes</Update_Symlinks>
+ <Create_Absolute_Symlinks>no</Create_Absolute_Symlinks>
+ <Update_Makefile>yes</Update_Makefile>
+ <Localhost_Execute>yes</Localhost_Execute>
+ <Execute_Command>rsh %host "cd %project_working_dir ; "%executable" %localhost %mctr_port"</Execute_Command>
+ <Execute_Hosts>alfa, beta, gamma</Execute_Hosts>
+ <UnUsed_List></UnUsed_List>
+ </General>
+ <Modules>
+ <Module>MBT_Qtronic_Demo.ttcn</Module>
+ <Module>MBT_Qtronic_Testcases.ttcn</Module>
+ <Module>MBT_Qtronic_Types.ttcn</Module>
+ <Module>MBT_Qtronic_TestHarness.ttcn</Module>
+ <Module>../sut/MBT_SUT_SIP_Phone.ttcn</Module>
+ </Modules>
+ <Configs>
+ <Config>MBT_Qtronic_Demo.cfg</Config>
+ </Configs>
+ <Test_Cases>
+ <Test_Case>MBT_Qtronic_Testcases.control</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_1</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_2</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_3</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_4</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_5</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_6</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_7</Test_Case>
+ </Test_Cases>
+ <File_Group name="MainFileGroup" >
+ <File_Groups>
+ <File_Group name="EPTF_Applib_MBT_CNL113659" >
+ <File path="../../src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn" />
+ <File path="../../src/LoadGen/EPTF_MBT_LGen_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Applib_SIP_CNL113522" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Applib_SIP_CNL113522/src/LoadGen/EPTF_SIP_LoadGen.grp" />
+ <File_Group path="../../../EPTF_Applib_SIP_CNL113522/src/Logger/EPTF_SIP_Logger.grp" />
+ <File_Group path="../../../EPTF_Applib_SIP_CNL113522/src/Transport/EPTF_SIP_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="TCCUsefulFunctions_CNL113472" >
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/digcalc.c" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/digcalc.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Definitions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.c" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_GenericTypes.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_ip.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCConversion.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCConversion_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCTemplate_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="SIPmsg_CNL113319" >
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/lex.SIP_parse_.c" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse.h" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.c" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.h" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PortType.ttcn" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.cc" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.hh" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_Types.ttcn" />
+ </File_Group>
+ <File_Group name="UDPasp_CNL113346" >
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PortType.ttcn" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.cc" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.hh" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="IPL4asp_CNL113531" >
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_discovery.cc" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Functions.ttcn" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PortType.ttcn" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_protocol_L234.hh" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.cc" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.hh" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="Abstract_Socket_CNL113384" >
+ <File path="../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.cc" />
+ <File path="../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.hh" />
+ </File_Group>
+ <File_Group name="IP_CNL113418" >
+ <File path="../../../../ProtocolModules/IP_CNL113418/src/IP_EncDec.cc" />
+ <File path="../../../../ProtocolModules/IP_CNL113418/src/IP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="LANL2asp_CNL113519" >
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PortType.ttcn" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.cc" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.hh" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="TCP_CNL113675" >
+ <File path="../../../../ProtocolModules/TCP_CNL113675/src/TCP_EncDec.cc" />
+ <File path="../../../../ProtocolModules/TCP_CNL113675/src/TCP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="GeneralTypes" >
+ <File path="../../../../ProtocolModules/COMMON/src/General_Types.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Core_Library_CNL113512" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Base/EPTF_CLL_Base.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Common/EPTF_CLL_Common.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/FreeBusyQueue/EPTF_CLL_FreeBusyQueue.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/HashMap/EPTF_CLL_HashMap.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Logging/EPTF_CLL_Logging.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/RedBlackTree/EPTF_CLL_RBtree_Float.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Scheduler/EPTF_CLL_Scheduler_RBT.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Variable/EPTF_CLL_Variable.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/StatMeasure/EPTF_CLL_StatMeasure.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_Transport.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportCommPortIPL4.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportMessageBufferManager.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportRouting.grp" />
+ <File_Group path="../../../../TestPorts/Common_Components/Socket_API_CNL113686/src/Socket_API.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/RandomNArray/EPTF_CLL_RNA.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Semaphore/EPTF_CLL_Semaphore.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/StatHandler/EPTF_CLL_StatHandler.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/LGenBase/EPTF_CLL_LGenBase.grp" />
+ </File_Groups>
+ </File_Group>
+ </File_Groups>
+ </File_Group>
+</Project>
diff --git a/demo/direct/MBT_Qtronic_Demo.ttcn b/demo/direct/MBT_Qtronic_Demo.ttcn
new file mode 100644
index 0000000..a67a0a2
--- /dev/null
+++ b/demo/direct/MBT_Qtronic_Demo.ttcn
@@ -0,0 +1,212 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Demo.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+module MBT_Qtronic_Demo
+{
+
+import from MBT_Qtronic_Testcases all;
+import from MBT_Qtronic_Types all;
+import from MBT_Qtronic_TestHarness all;
+
+import from MBT_SUT_SIP_Phone all;
+
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Base_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_LGenBase_ConfigFunctions all;
+
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_MBT_LGen_Functions all;
+
+import from EPTF_SIP_LGen_Definitions all;
+import from EPTF_SIP_LGen_Functions all;
+import from EPTF_SIP_Common_Functions all;
+import from EPTF_SIP_UserDatabase_Functions all;
+import from EPTF_SIP_Transport_Definitions all;
+import from EPTF_SIP_Transport_Functions all;
+import from EPTF_SIP_MessageHandler_Functions all;
+
+modulepar
+{
+ charstring tsp_MBT_Tester_LocalIP := "159.107.193.33";
+ integer tsp_MBT_Tester_LocalPort := 15000;
+ charstring tsp_MBT_Tester_RemoteIP := "159.107.193.33";
+ integer tsp_MBT_Tester_RemotePort := 20000;
+
+ charstring tsp_MBT_SIP_Transport := "udp";
+}
+
+type component MBT_Qtronic_Demo_Main_CT
+ extends
+ EPTF_Base_CT,
+ EPTF_MBT_Tester_CT
+{
+ var MBT_Qtronic_Demo_LGen_CT vc_lgen;
+}
+
+function f_MBT_Qtronic_Demo_beginTestCase() runs on Qtronic_CT
+{
+ log(%definitionId, " started");
+
+ f_EPTF_Base_init_CT("mtc");
+
+ log(%definitionId, " Creating SUT");
+ var MBT_Qtronic_Demo_SUT_CT vc_sut := MBT_Qtronic_Demo_SUT_CT.create;
+ connect(self:userIn, vc_sut:userIn);
+ connect(self:userOut, vc_sut:userOut);
+ connect(self:EPTF_MBT_TESTER_PCO,vc_sut:EPTF_MBT_PCO);
+ vc_sut.start(f_MBT_Qtronic_Demo_SUT_behavior());
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_CommandResponse:?) from vc_sut;
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "SUT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "Behavior_SIP", "SUT_Behavior"},
+ fsmName := "MBT_Qtronic_Demo_SUT_FSM"
+ }
+ ) to vc_sut;
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_ConfigResponse:?) from vc_sut;
+ log(%definitionId, " SUT ready");
+
+ log(%definitionId, " Creating LGen");
+ vc_lgen := MBT_Qtronic_Demo_LGen_CT.create;
+ connect(self:EPTF_MBT_TESTER_PCO,vc_lgen:EPTF_MBT_PCO);
+ vc_lgen.start(f_MBT_Qtronic_Demo_LGen_behavior());
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_CommandResponse:?) from vc_lgen;
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "MBT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "Behavior_SIP"},
+ fsmName := "FSM_MBT"
+ }
+ ) to vc_lgen;
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_ConfigResponse:?) from vc_lgen;
+
+ log(%definitionId, " LGen ready");
+
+
+ log(%definitionId, " finished");
+}
+
+
+function f_MBT_Qtronic_Demo_endTestCase() runs on Qtronic_CT
+{
+ log("### MAIN: END TESTCASE started");
+
+ f_EPTF_Base_stopAll(none, true);
+
+ log("### MAIN: END TESTCASE finished");
+}
+
+/////////////////////////////////////////////////////////////////////////
+//
+// M B T Applib
+//
+/////////////////////////////////////////////////////////////////////////
+
+type component MBT_Qtronic_Demo_LGen_CT
+ extends
+ EPTF_MBT_LGen_CT,
+ EPTF_SIP_LGen_CT, EPTF_SIP_LocalTransport_CT
+{
+}
+
+function f_MBT_Qtronic_Demo_LGen_behavior() runs on MBT_Qtronic_Demo_LGen_CT
+{
+ //map(self:IPL4_PCO, system:IPL4_PCO);
+
+ f_SIP_applibInit("MBT_Demo_LGen");
+
+ f_EPTF_SIP_LocalTransport_init(tsp_MBT_SIP_Transport);
+ vf_EPTF_SIP_LocalTransport_receive := refers(f_EPTF_SIP_Message_MsgHandler); //receive callback function on LocalTransport
+ vf_EPTF_SIP_LGen_msgSender := refers(f_EPTF_SIP_LocalTransport_sendSIPMessage); //send callback function on LGen
+ v_removeUAS := refers(fcb_EPTF_SIP_LocalTransport_removeUAS);
+
+ f_EPTF_MBT_init("MBT_Demo_LGen",0, "MBT_");
+
+ f_EPTF_MBT_initLGenFsm
+ (
+ null,
+ refers(f_MBT_Qtronic_Demo_LGen_fillInDB)
+ );
+
+ EPTF_MBT_PCO.send(EPTF_MBT_CommandResponse:{ ready := {}}) to mtc;
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+function f_MBT_Qtronic_Demo_LGen_fillInDB(in EPTF_MBT_ConfigRequest p_req) runs on MBT_Qtronic_Demo_LGen_CT
+{
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(p_req.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ for (var integer i:=0; i<p_req.noEntities; i:=i+1)
+ {
+ var EPTF_IntegerList vl_bCtx := f_EPTF_LGenBase_getBehaviorCtx(i + vl_entityIdx, v_SIP_myBIdx);
+ f_EPTF_SIP_IPL4asp_SetUserData
+ (
+ vl_bCtx[0],
+ tsp_MBT_Tester_LocalIP, // local IP
+ {tsp_MBT_Tester_LocalPort, tsp_MBT_Tester_LocalPort+1},
+ tsp_MBT_SIP_Transport,
+ tsp_MBT_Tester_RemoteIP, // proxy ip
+ tsp_MBT_Tester_RemotePort // proxy port
+ );
+
+ f_EPTF_SIP_User_SetUserData(
+ vl_bCtx[0],
+ {
+ {
+ addr := {
+ nameAddr := {
+ displayName := "titansim_user_7465000",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465000",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := tsp_MBT_Tester_LocalPort
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ },
+ password := "pass2ICS"
+ }
+ },
+ tsp_MBT_Tester_LocalIP,
+ {tsp_MBT_Tester_LocalPort, tsp_MBT_Tester_LocalPort+1},
+ i + vl_entityIdx //entity index
+ );
+
+ f_EPTF_SIP_Session_AddData(vl_bCtx[0], f_EPTF_SIP_getTransport(tsp_MBT_SIP_Transport),345600);
+
+ f_EPTF_SIP_IPL4asp_startListening(vl_bCtx[0], true); // Both UDP and TCP
+ }
+}
+
+}
diff --git a/demo/direct/MBT_Qtronic_TestHarness.ttcn b/demo/direct/MBT_Qtronic_TestHarness.ttcn
new file mode 100644
index 0000000..ff16af0
--- /dev/null
+++ b/demo/direct/MBT_Qtronic_TestHarness.ttcn
@@ -0,0 +1,86 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_TestHarness.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+
+/* -*- ttcn3 -*- */
+
+/** @file C:\Users\eantwuh\workspace\SIPsim\MBT_Qtronic_TestHarness.ttcn
+ *
+ * @author Conformiq TTCN3 Script Backend 0.1
+ * @date Thu Sep 30 14:15:28 CEST 2010
+ *
+ * WARNING! This file has been automatically generated using
+ * Ericsson Qtronic TTCN3 Script Backend (based on the original Conformiq Backend).DO NOT EDIT.
+ */
+
+module MBT_Qtronic_TestHarness
+{
+ import from MBT_Qtronic_Types all;
+/* User provided imports begin */
+import from MBT_Qtronic_Demo all; import from EPTF_MBT_LGen_Definitions all;
+/* User provided imports end */
+ altstep QtronicDefaultAlt() runs on Qtronic_CT
+ {
+ [] any port.receive
+ {
+ harnessTimer.stop;
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ [] harnessTimer.timeout
+ {
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ }
+ function qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(template EPTF_MBT_TestStepRequest msgToSend) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'msgToSend'
+ // before it is delivered to the SUT through the real test interface.
+ // This can include addition of fields not present in the model or
+ // manipulation of unique identifiers in the messages that Qtronic
+ // cannot possible know at the time of test generation.
+ EPTF_MBT_TESTER_PCO.send(msgToSend) to vc_lgen;
+ }
+ function qtronic_send_UserInput_to_userIn(template UserInput msgToSend) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'msgToSend'
+ // before it is delivered to the SUT through the real test interface.
+ // This can include addition of fields not present in the model or
+ // manipulation of unique identifiers in the messages that Qtronic
+ // cannot possible know at the time of test generation.
+ userIn.send(msgToSend);
+ }
+ function qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(template EPTF_MBT_TestStepResponse tmplToMatch) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'tmplToMatch'
+ // before matching it against the expected value template.
+ // This manipulation typically means removing fields not present
+ // in the abstract model system interface.
+ EPTF_MBT_TESTER_PCO.receive(tmplToMatch) from vc_lgen;
+ }
+ function qtronic_receive_TimeOutIndication_from_userOut(template TimeOutIndication tmplToMatch) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'tmplToMatch'
+ // before matching it against the expected value template.
+ // This manipulation typically means removing fields not present
+ // in the abstract model system interface.
+ userOut.receive(tmplToMatch);
+ }
+}
diff --git a/demo/direct/MBT_Qtronic_Testcases.ttcn b/demo/direct/MBT_Qtronic_Testcases.ttcn
new file mode 100644
index 0000000..05d7025
--- /dev/null
+++ b/demo/direct/MBT_Qtronic_Testcases.ttcn
@@ -0,0 +1,1448 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Testcases.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+/* -*- ttcn3 -*- */
+
+/** @file C:\Users\eantwuh\workspace\SIPsim\MBT_Qtronic_Testcases.ttcn
+ *
+ * @author Conformiq TTCN3 Script Backend 0.1
+ * @date Thu Sep 30 14:32:36 CEST 2010
+ *
+ * WARNING! This file has been automatically generated using
+ * Ericsson Qtronic TTCN3 Script Backend (based on the original Conformiq Backend).DO NOT EDIT.
+ */
+
+module MBT_Qtronic_Testcases
+{
+ import from MBT_Qtronic_Types all;
+ import from MBT_Qtronic_TestHarness all;
+ /* User provided imports begin */
+ import from MBT_Qtronic_Demo all; import from EPTF_MBT_LGen_Definitions all;
+ /* User provided imports end */
+ /* Qtronic generated alt step */
+ altstep QtronicDefaultAlt() runs on Qtronic_CT
+ {
+ [] any port.receive
+ {
+ harnessTimer.stop;
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ [] harnessTimer.timeout
+ {
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ }
+ /* Generated test case #1 */
+ testcase Test_Case_1() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicDefaultAlt());
+ log("Structural feature: method: main()");
+ log("Structural feature: method: SIPClient.SIPClient()");
+ log("Structural feature: method: SIPClient.run()");
+ log("Structural feature: state: SIPClient.initial-state-0");
+ log("Structural feature: transition: SIPClient.initial-state-0->SIPClient.Init-9");
+ log("Structural feature: state: SIPClient.Init");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate1);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Init->SIPClient.Calling-0");
+ log("Structural feature: method: SIPClient.Invite()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate2);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate3);
+ oldtimer := 0.0;
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate4);
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Calling");
+ log("Structural feature: state: SIPClient.Calling.initial-state-7");
+ log("Structural feature: transition: SIPClient.Calling.initial-state-7->SIPClient.Calling.Wait-16");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate5);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Calling->SIPClient.Ringing-1");
+ log("Structural feature: state: SIPClient.Ringing");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate6);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Ringing->SIPClient.final-state-6-7");
+ log("Structural feature: method: SIPClient.Ack()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate7);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.final-state-6");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate1 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate2 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "INVITE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := -1
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate3 :=
+ {
+ stepName := "SIPAppLib: StepFunction_init",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate4 :=
+ {
+ stepName := "SIPAppLib: StepFunction_handleINVITE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate5 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 1
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate6 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 37
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate7 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "ACK",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ /* Generated test case #2 */
+ testcase Test_Case_2() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicDefaultAlt());
+ log("Structural feature: method: main()");
+ log("Structural feature: method: SIPClient.SIPClient()");
+ log("Structural feature: method: SIPClient.run()");
+ log("Structural feature: state: SIPClient.initial-state-0");
+ log("Structural feature: transition: SIPClient.initial-state-0->SIPClient.Init-9");
+ log("Structural feature: state: SIPClient.Init");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate8);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Init->SIPClient.Calling-0");
+ log("Structural feature: method: SIPClient.Invite()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate9);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate10);
+ oldtimer := 0.0;
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate11);
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Calling");
+ log("Structural feature: state: SIPClient.Calling.initial-state-7");
+ log("Structural feature: transition: SIPClient.Calling.initial-state-7->SIPClient.Calling.Wait-16");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate12);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Calling->SIPClient.Ringing-1");
+ log("Structural feature: state: SIPClient.Ringing");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate13);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Ringing->SIPClient.Ready-2");
+ log("Structural feature: method: SIPClient.Ack()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate14);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Requirement: requirement: Acknowledge established call with ACK");
+ log("Structural feature: state: SIPClient.Ready");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate15);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingRequest(String)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: transition: SIPClient.Ready->SIPClient.final-state-3-6");
+ log("Structural feature: method: SIPClient.SendOK(String)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate16);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Requirement: requirement: Terminating/Send OK in response to BYE");
+ log("Structural feature: state: SIPClient.final-state-3");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate8 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate9 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "INVITE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := -1
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate10 :=
+ {
+ stepName := "SIPAppLib: StepFunction_init",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate11 :=
+ {
+ stepName := "SIPAppLib: StepFunction_handleINVITE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate12 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 1
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate13 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 5
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate14 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "ACK",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate15 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createBYE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate16 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "200",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ /* Generated test case #3 */
+ testcase Test_Case_3() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicDefaultAlt());
+ log("Structural feature: method: main()");
+ log("Structural feature: method: SIPClient.SIPClient()");
+ log("Structural feature: method: SIPClient.run()");
+ log("Structural feature: state: SIPClient.initial-state-0");
+ log("Structural feature: transition: SIPClient.initial-state-0->SIPClient.Init-9");
+ log("Structural feature: state: SIPClient.Init");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate17);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Init->SIPClient.Calling-0");
+ log("Structural feature: method: SIPClient.Invite()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate18);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate19);
+ oldtimer := 0.0;
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate20);
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Calling");
+ log("Structural feature: state: SIPClient.Calling.initial-state-7");
+ log("Structural feature: transition: SIPClient.Calling.initial-state-7->SIPClient.Calling.Wait-16");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ log("Structural feature: transition: SIPClient.Calling.Wait->SIPClient.Calling.junction-state-8-14");
+ log("Structural feature: method: SIPClient.RetransmittedRequest()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate21);
+ harnessTimer.stop;
+ oldtimer := 0.500000000;
+ log("Requirement: requirement: 17.1.1.2 INVITE timers/Resends INVITE after A timeout");
+ log("Structural feature: state: SIPClient.Calling.junction-state-8");
+ log("Structural feature: transition: SIPClient.Calling.junction-state-8->SIPClient.Calling.Wait-15");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ log("Structural feature: transition: SIPClient.Calling.Wait->SIPClient.Calling.junction-state-8-14");
+ log("Structural feature: method: SIPClient.RetransmittedRequest()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((1.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate22);
+ harnessTimer.stop;
+ oldtimer := 1.500000000;
+ log("Requirement: requirement: 17.1.1.2 INVITE timers/Resends INVITE after A timeout");
+ log("Structural feature: state: SIPClient.Calling.junction-state-8");
+ log("Structural feature: transition: SIPClient.Calling.junction-state-8->SIPClient.Calling.Wait-15");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ log("Structural feature: transition: SIPClient.Calling.Wait->SIPClient.Calling.junction-state-8-14");
+ log("Structural feature: method: SIPClient.RetransmittedRequest()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((3.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate23);
+ harnessTimer.stop;
+ oldtimer := 3.500000000;
+ log("Requirement: requirement: 17.1.1.2 INVITE timers/Resends INVITE after A timeout");
+ log("Structural feature: state: SIPClient.Calling.junction-state-8");
+ log("Structural feature: transition: SIPClient.Calling.junction-state-8->SIPClient.Calling.Wait-15");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ log("Structural feature: transition: SIPClient.Calling.Wait->SIPClient.Calling.junction-state-8-14");
+ log("Structural feature: method: SIPClient.RetransmittedRequest()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((7.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate24);
+ harnessTimer.stop;
+ oldtimer := 7.500000000;
+ log("Requirement: requirement: 17.1.1.2 INVITE timers/Resends INVITE after A timeout");
+ log("Structural feature: state: SIPClient.Calling.junction-state-8");
+ log("Structural feature: transition: SIPClient.Calling.junction-state-8->SIPClient.Calling.Wait-15");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ log("Structural feature: transition: SIPClient.Calling->SIPClient.final-state-1-3");
+ log("Requirement: requirement: 17.1.1.2 INVITE timers/Terminates INVITE cycle after B timeout");
+ log("Structural feature: method: SIPClient.TimeOut()");
+ harnessTimer.start((8.0 - oldtimer) + SLACK);
+ qtronic_receive_TimeOutIndication_from_userOut(TimeOutIndicationTemplate25);
+ harnessTimer.stop;
+ oldtimer := 8.0;
+ log("Structural feature: state: SIPClient.final-state-1");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate17 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate18 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "INVITE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := -1
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate19 :=
+ {
+ stepName := "SIPAppLib: StepFunction_init",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate20 :=
+ {
+ stepName := "SIPAppLib: StepFunction_handleINVITE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate21 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "Retransmitted request",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate22 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "Retransmitted request",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate23 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "Retransmitted request",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate24 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "Retransmitted request",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template TimeOutIndication TimeOutIndicationTemplate25 :=
+ {
+
+ }
+ /* Generated test case #4 */
+ testcase Test_Case_4() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicDefaultAlt());
+ log("Structural feature: method: main()");
+ log("Structural feature: method: SIPClient.SIPClient()");
+ log("Structural feature: method: SIPClient.run()");
+ log("Structural feature: state: SIPClient.initial-state-0");
+ log("Structural feature: transition: SIPClient.initial-state-0->SIPClient.Init-9");
+ log("Structural feature: state: SIPClient.Init");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate26);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Init->SIPClient.Calling-0");
+ log("Structural feature: method: SIPClient.Invite()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate27);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate28);
+ oldtimer := 0.0;
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate29);
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Calling");
+ log("Structural feature: state: SIPClient.Calling.initial-state-7");
+ log("Structural feature: transition: SIPClient.Calling.initial-state-7->SIPClient.Calling.Wait-16");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate30);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Calling->SIPClient.Ringing-1");
+ log("Structural feature: state: SIPClient.Ringing");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate31);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Ringing->SIPClient.Canceling-12");
+ log("Structural feature: state: SIPClient.Canceling");
+ log("Structural feature: state: SIPClient.Canceling.initial-state-11");
+ log("Structural feature: transition: SIPClient.Canceling.initial-state-11->SIPClient.Canceling.Wait-20");
+ log("Structural feature: method: SIPClient.Cancel()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate32);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Canceling.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate33);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int,int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Canceling->SIPClient.Waiting Response-10");
+ log("Structural feature: state: SIPClient.Waiting Response");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate34);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int,int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Waiting Response->SIPClient.final-state-4-8");
+ log("Structural feature: method: SIPClient.Ack()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate35);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.final-state-4");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate26 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate27 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "INVITE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := -1
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate28 :=
+ {
+ stepName := "SIPAppLib: StepFunction_init",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate29 :=
+ {
+ stepName := "SIPAppLib: StepFunction_handleINVITE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate30 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 1
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template UserInput UserInputTemplate31 :=
+ {
+ input1 := "cancel",
+ input2 := ""
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate32 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "CANCEL",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate33 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 5,
+2 },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate34 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 38,
+4 },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate35 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "ACK",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ /* Generated test case #5 */
+ testcase Test_Case_5() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicDefaultAlt());
+ log("Structural feature: method: main()");
+ log("Structural feature: method: SIPClient.SIPClient()");
+ log("Structural feature: method: SIPClient.run()");
+ log("Structural feature: state: SIPClient.initial-state-0");
+ log("Structural feature: transition: SIPClient.initial-state-0->SIPClient.Init-9");
+ log("Structural feature: state: SIPClient.Init");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate36);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Init->SIPClient.Calling-0");
+ log("Structural feature: method: SIPClient.Invite()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate37);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate38);
+ oldtimer := 0.0;
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate39);
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Calling");
+ log("Structural feature: state: SIPClient.Calling.initial-state-7");
+ log("Structural feature: transition: SIPClient.Calling.initial-state-7->SIPClient.Calling.Wait-16");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate40);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Calling->SIPClient.Ringing-1");
+ log("Structural feature: state: SIPClient.Ringing");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate41);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Ringing->SIPClient.Ready-2");
+ log("Structural feature: method: SIPClient.Ack()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate42);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Requirement: requirement: Acknowledge established call with ACK");
+ log("Structural feature: state: SIPClient.Ready");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate43);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Ready->SIPClient.Terminating-4");
+ log("Structural feature: state: SIPClient.Terminating");
+ log("Structural feature: state: SIPClient.Terminating.initial-state-9");
+ log("Structural feature: transition: SIPClient.Terminating.initial-state-9->SIPClient.Terminating.Wait-17");
+ log("Structural feature: method: SIPClient.Bye()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate44);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Terminating.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate45);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Terminating->SIPClient.final-state-5-5");
+ log("Requirement: requirement: Terminating/Wait for OK in response to BYE");
+ log("Structural feature: state: SIPClient.final-state-5");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate36 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate37 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "INVITE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := -1
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate38 :=
+ {
+ stepName := "SIPAppLib: StepFunction_init",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate39 :=
+ {
+ stepName := "SIPAppLib: StepFunction_handleINVITE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate40 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 1
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate41 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 5
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate42 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "ACK",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template UserInput UserInputTemplate43 :=
+ {
+ input1 := "bye",
+ input2 := ""
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate44 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "BYE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate45 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 5
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ /* Generated test case #6 */
+ testcase Test_Case_6() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicDefaultAlt());
+ log("Structural feature: method: main()");
+ log("Structural feature: method: SIPClient.SIPClient()");
+ log("Structural feature: method: SIPClient.run()");
+ log("Structural feature: state: SIPClient.initial-state-0");
+ log("Structural feature: transition: SIPClient.initial-state-0->SIPClient.Init-9");
+ log("Structural feature: state: SIPClient.Init");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate46);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Init->SIPClient.Calling-0");
+ log("Structural feature: method: SIPClient.Invite()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate47);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate48);
+ oldtimer := 0.0;
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate49);
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Calling");
+ log("Structural feature: state: SIPClient.Calling.initial-state-7");
+ log("Structural feature: transition: SIPClient.Calling.initial-state-7->SIPClient.Calling.Wait-16");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate50);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Calling->SIPClient.Ringing-1");
+ log("Structural feature: state: SIPClient.Ringing");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate51);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Ringing->SIPClient.Canceling-12");
+ log("Structural feature: state: SIPClient.Canceling");
+ log("Structural feature: state: SIPClient.Canceling.initial-state-11");
+ log("Structural feature: transition: SIPClient.Canceling.initial-state-11->SIPClient.Canceling.Wait-20");
+ log("Structural feature: method: SIPClient.Cancel()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate52);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Canceling.Wait");
+ log("Structural feature: transition: SIPClient.Canceling.Wait->SIPClient.Canceling.junction-state-12-21");
+ log("Structural feature: method: SIPClient.Cancel()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate53);
+ harnessTimer.stop;
+ oldtimer := 0.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends CANCEL after E timeout");
+ log("Structural feature: state: SIPClient.Canceling.junction-state-12");
+ log("Structural feature: transition: SIPClient.Canceling.junction-state-12->SIPClient.Canceling.Wait-22");
+ log("Structural feature: state: SIPClient.Canceling.Wait");
+ log("Structural feature: transition: SIPClient.Canceling.Wait->SIPClient.Canceling.junction-state-12-21");
+ log("Structural feature: method: SIPClient.Cancel()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((1.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate54);
+ harnessTimer.stop;
+ oldtimer := 1.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends CANCEL after E timeout");
+ log("Structural feature: state: SIPClient.Canceling.junction-state-12");
+ log("Structural feature: transition: SIPClient.Canceling.junction-state-12->SIPClient.Canceling.Wait-22");
+ log("Structural feature: state: SIPClient.Canceling.Wait");
+ log("Structural feature: transition: SIPClient.Canceling.Wait->SIPClient.Canceling.junction-state-12-21");
+ log("Structural feature: method: SIPClient.Cancel()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((3.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate55);
+ harnessTimer.stop;
+ oldtimer := 3.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends CANCEL after E timeout");
+ log("Structural feature: state: SIPClient.Canceling.junction-state-12");
+ log("Structural feature: transition: SIPClient.Canceling.junction-state-12->SIPClient.Canceling.Wait-22");
+ log("Structural feature: state: SIPClient.Canceling.Wait");
+ log("Structural feature: transition: SIPClient.Canceling.Wait->SIPClient.Canceling.junction-state-12-21");
+ log("Structural feature: method: SIPClient.Cancel()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((7.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate56);
+ harnessTimer.stop;
+ oldtimer := 7.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends CANCEL after E timeout");
+ log("Structural feature: state: SIPClient.Canceling.junction-state-12");
+ log("Structural feature: transition: SIPClient.Canceling.junction-state-12->SIPClient.Canceling.Wait-22");
+ log("Structural feature: state: SIPClient.Canceling.Wait");
+ log("Structural feature: transition: SIPClient.Canceling->SIPClient.final-state-2-13");
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Terminates CANCEL cycle after F timeout");
+ log("Structural feature: method: SIPClient.TimeOut()");
+ harnessTimer.start((8.0 - oldtimer) + SLACK);
+ qtronic_receive_TimeOutIndication_from_userOut(TimeOutIndicationTemplate57);
+ harnessTimer.stop;
+ oldtimer := 8.0;
+ log("Structural feature: state: SIPClient.final-state-2");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate46 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate47 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "INVITE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := -1
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate48 :=
+ {
+ stepName := "SIPAppLib: StepFunction_init",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate49 :=
+ {
+ stepName := "SIPAppLib: StepFunction_handleINVITE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate50 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 1
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template UserInput UserInputTemplate51 :=
+ {
+ input1 := "cancel",
+ input2 := ""
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate52 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "CANCEL",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate53 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "CANCEL",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate54 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "CANCEL",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate55 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "CANCEL",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate56 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "CANCEL",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template TimeOutIndication TimeOutIndicationTemplate57 :=
+ {
+
+ }
+ /* Generated test case #7 */
+ testcase Test_Case_7() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicDefaultAlt());
+ log("Structural feature: method: main()");
+ log("Structural feature: method: SIPClient.SIPClient()");
+ log("Structural feature: method: SIPClient.run()");
+ log("Structural feature: state: SIPClient.initial-state-0");
+ log("Structural feature: transition: SIPClient.initial-state-0->SIPClient.Init-9");
+ log("Structural feature: state: SIPClient.Init");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate58);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Init->SIPClient.Calling-0");
+ log("Structural feature: method: SIPClient.Invite()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate59);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate60);
+ oldtimer := 0.0;
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate61);
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Calling");
+ log("Structural feature: state: SIPClient.Calling.initial-state-7");
+ log("Structural feature: transition: SIPClient.Calling.initial-state-7->SIPClient.Calling.Wait-16");
+ log("Structural feature: state: SIPClient.Calling.Wait");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate62);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Calling->SIPClient.Ringing-1");
+ log("Structural feature: state: SIPClient.Ringing");
+ qtronic_send_EPTF_MBT_TestStepRequest_to_fwIn(EPTF_MBT_TestStepRequestTemplate63);
+ oldtimer := 0.0;
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: method: SIPClient.incomingResponse(int)");
+ log("Structural feature: method: c_EPTF_MBT_TestStepRequest_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ log("Structural feature: method: f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int)");
+ log("Structural feature: transition: SIPClient.Ringing->SIPClient.Ready-2");
+ log("Structural feature: method: SIPClient.Ack()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate64);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Requirement: requirement: Acknowledge established call with ACK");
+ log("Structural feature: state: SIPClient.Ready");
+ qtronic_send_UserInput_to_userIn(UserInputTemplate65);
+ oldtimer := 0.0;
+ log("Structural feature: transition: SIPClient.Ready->SIPClient.Terminating-4");
+ log("Structural feature: state: SIPClient.Terminating");
+ log("Structural feature: state: SIPClient.Terminating.initial-state-9");
+ log("Structural feature: transition: SIPClient.Terminating.initial-state-9->SIPClient.Terminating.Wait-17");
+ log("Structural feature: method: SIPClient.Bye()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate66);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ log("Structural feature: state: SIPClient.Terminating.Wait");
+ log("Structural feature: transition: SIPClient.Terminating.Wait->SIPClient.Terminating.junction-state-10-18");
+ log("Structural feature: method: SIPClient.Bye()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((0.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate67);
+ harnessTimer.stop;
+ oldtimer := 0.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends BYE after E timeout");
+ log("Structural feature: state: SIPClient.Terminating.junction-state-10");
+ log("Structural feature: transition: SIPClient.Terminating.junction-state-10->SIPClient.Terminating.Wait-19");
+ log("Structural feature: state: SIPClient.Terminating.Wait");
+ log("Structural feature: transition: SIPClient.Terminating.Wait->SIPClient.Terminating.junction-state-10-18");
+ log("Structural feature: method: SIPClient.Bye()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((1.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate68);
+ harnessTimer.stop;
+ oldtimer := 1.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends BYE after E timeout");
+ log("Structural feature: state: SIPClient.Terminating.junction-state-10");
+ log("Structural feature: transition: SIPClient.Terminating.junction-state-10->SIPClient.Terminating.Wait-19");
+ log("Structural feature: state: SIPClient.Terminating.Wait");
+ log("Structural feature: transition: SIPClient.Terminating.Wait->SIPClient.Terminating.junction-state-10-18");
+ log("Structural feature: method: SIPClient.Bye()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((3.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate69);
+ harnessTimer.stop;
+ oldtimer := 3.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends BYE after E timeout");
+ log("Structural feature: state: SIPClient.Terminating.junction-state-10");
+ log("Structural feature: transition: SIPClient.Terminating.junction-state-10->SIPClient.Terminating.Wait-19");
+ log("Structural feature: state: SIPClient.Terminating.Wait");
+ log("Structural feature: transition: SIPClient.Terminating.Wait->SIPClient.Terminating.junction-state-10-18");
+ log("Structural feature: method: SIPClient.Bye()");
+ log("Structural feature: method: c_EPTF_MBT_TestStepResponse_empty()");
+ log("Structural feature: method: c_EPTF_FsmAddr_empty()");
+ harnessTimer.start((7.500000000 - oldtimer) + SLACK);
+ qtronic_receive_EPTF_MBT_TestStepResponse_from_fwOut(EPTF_MBT_TestStepResponseTemplate70);
+ harnessTimer.stop;
+ oldtimer := 7.500000000;
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Resends BYE after E timeout");
+ log("Structural feature: state: SIPClient.Terminating.junction-state-10");
+ log("Structural feature: transition: SIPClient.Terminating.junction-state-10->SIPClient.Terminating.Wait-19");
+ log("Structural feature: state: SIPClient.Terminating.Wait");
+ log("Structural feature: transition: SIPClient.Terminating->SIPClient.final-state-1-11");
+ log("Requirement: requirement: 17.1.2.2 Non-INVITE timers/Terminates BYE cycle after F timeout");
+ log("Structural feature: method: SIPClient.TimeOut()");
+ harnessTimer.start((8.0 - oldtimer) + SLACK);
+ qtronic_receive_TimeOutIndication_from_userOut(TimeOutIndicationTemplate71);
+ harnessTimer.stop;
+ oldtimer := 8.0;
+ log("Structural feature: state: SIPClient.final-state-1");
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate58 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate59 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "INVITE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := -1
+ }
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate60 :=
+ {
+ stepName := "SIPAppLib: StepFunction_init",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate61 :=
+ {
+ stepName := "SIPAppLib: StepFunction_handleINVITE",
+ stepArgs := {
+
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate62 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 1
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepRequest EPTF_MBT_TestStepRequestTemplate63 :=
+ {
+ stepName := "SIPAppLib: StepFunction_createResponse",
+ stepArgs := {
+ 5
+ },
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ },
+ lock := -1
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate64 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "ACK",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template UserInput UserInputTemplate65 :=
+ {
+ input1 := "bye",
+ input2 := ""
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate66 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "BYE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate67 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "BYE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate68 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "BYE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate69 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "BYE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template EPTF_MBT_TestStepResponse EPTF_MBT_TestStepResponseTemplate70 :=
+ {
+ bName := "Behavior_SIP",
+ iName := "BYE",
+ addr := {
+ entityGroupName := "MBT_EntityType",
+ eIdx := 0,
+ fIdx := 0
+ }
+ }
+ template TimeOutIndication TimeOutIndicationTemplate71 :=
+ {
+
+ }
+ control
+ {
+ execute(Test_Case_1());
+ execute(Test_Case_2());
+ execute(Test_Case_3());
+ execute(Test_Case_4());
+ execute(Test_Case_5());
+ execute(Test_Case_6());
+ execute(Test_Case_7());
+ }
+}
diff --git a/demo/direct/MBT_Qtronic_Types.ttcn b/demo/direct/MBT_Qtronic_Types.ttcn
new file mode 100644
index 0000000..b721553
--- /dev/null
+++ b/demo/direct/MBT_Qtronic_Types.ttcn
@@ -0,0 +1,71 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Types.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+/* -*- ttcn3 -*- */
+
+/** @file C:\Users\eantwuh\workspace\SIPsim\MBT_Qtronic_Types.ttcn
+ *
+ * @author Conformiq TTCN3 Script Backend 0.1
+ * @date Thu Sep 30 14:15:29 CEST 2010
+ *
+ * WARNING! This file has been automatically generated using
+ * Ericsson Qtronic TTCN3 Script Backend (based on the original Conformiq Backend).DO NOT EDIT.
+ */
+
+module MBT_Qtronic_Types
+{
+ /* User provided imports begin */
+ import from MBT_Qtronic_Demo all; import from EPTF_MBT_LGen_Definitions all;
+ /* User provided imports end */
+ type port userInPort message
+ {
+ inout UserInput;
+ } with {extension "internal"}
+ type port userOutPort message
+ {
+ inout TimeOutIndication;
+ } with {extension "internal"}
+ type record SIPReq
+ {
+ charstring op,
+ charstring param_
+ }
+ type record SIPResp
+ {
+ integer status,
+ charstring cseq
+ }
+ type record UserInput
+ {
+ charstring input1,
+ charstring input2
+ }
+ type record AnyRecord
+ {
+
+ }
+ type record TimeOutIndication
+ {
+
+ }
+ type component Qtronic_CT extends MBT_Qtronic_Demo_Main_CT
+ {
+ port userInPort userIn;
+ port userOutPort userOut;
+ timer harnessTimer := 0.0;
+ }
+}
diff --git a/demo/direct/model/EPTF_MBT_Framework.java b/demo/direct/model/EPTF_MBT_Framework.java
new file mode 100644
index 0000000..bd2b266
--- /dev/null
+++ b/demo/direct/model/EPTF_MBT_Framework.java
@@ -0,0 +1,55 @@
+/* ====================================================
+ * MBT Applib API
+ */
+
+record EPTF_MBT_TestStepRequest
+{
+ public String stepName;
+ int[] stepArgs;
+ EPTF_FsmAddr addr;
+ int lock;
+}
+
+EPTF_MBT_TestStepRequest c_EPTF_MBT_TestStepRequest_empty()
+{
+ EPTF_MBT_TestStepRequest ret;
+ ret.stepName = "";
+ ret.stepArgs = {};
+ ret.addr = c_EPTF_FsmAddr_empty();
+ ret.lock = -1;
+ return ret;
+};
+
+record EPTF_MBT_TestStepResponse
+{
+ public String bName;
+ public String iName;
+ EPTF_FsmAddr addr;
+}
+
+EPTF_MBT_TestStepResponse c_EPTF_MBT_TestStepResponse_empty()
+{
+ EPTF_MBT_TestStepResponse ret;
+ ret.bName = "";
+ ret.iName = "";
+ ret.addr = c_EPTF_FsmAddr_empty();
+ return ret;
+};
+
+record EPTF_FsmAddr
+{
+ public String entityGroupName;
+ public int eIdx;
+ public int fIdx;
+}
+
+EPTF_FsmAddr c_EPTF_FsmAddr_empty()
+{
+ EPTF_FsmAddr ret;
+ ret.entityGroupName = "MBT_EntityType";
+ ret.eIdx = 0;
+ ret.fIdx = 0;
+ return ret;
+};
+
+record EPTF_IntegerList {}
diff --git a/demo/direct/model/EPTF_MBT_SIP_Applib.java b/demo/direct/model/EPTF_MBT_SIP_Applib.java
new file mode 100644
index 0000000..8df3b39
--- /dev/null
+++ b/demo/direct/model/EPTF_MBT_SIP_Applib.java
@@ -0,0 +1,30 @@
+String c_SIP_Behavior = "Behavior_SIP";
+
+// Events
+String c_SIP_eventName_INVITE = "INVITE";
+String c_SIP_eventName_CANCEL = "CANCEL";
+String c_SIP_eventName_ACK = "ACK";
+String c_SIP_eventName_BYE = "BYE";
+String c_SIP_eventName_RetransmittedRequest = "Retransmitted request";
+
+// TestSteps
+String c_SIP_stepFunction_createResponse = "SIPAppLib: StepFunction_createResponse";
+String c_SIP_stepFunction_createBYE = "SIPAppLib: StepFunction_createBYE";
+String c_SIP_stepFunction_init = "SIPAppLib: StepFunction_init";
+String c_SIP_stepFunction_handleINVITE = "SIPAppLib: StepFunction_handleINVITE";
+
+// Methods
+int c_SIP_Method_CANCEL = 2;
+int c_SIP_Method_INVITE = 4;
+
+int f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int p_answerCode)
+{
+ if (p_answerCode == 180)
+ return 1;
+ else if (p_answerCode == 486)
+ return 37;
+ else if (p_answerCode == 200)
+ return 5;
+ else if (p_answerCode == 487)
+ return 38;
+}
\ No newline at end of file
diff --git a/demo/direct/model/SIPClient.java b/demo/direct/model/SIPClient.java
new file mode 100644
index 0000000..0e0330f
--- /dev/null
+++ b/demo/direct/model/SIPClient.java
@@ -0,0 +1,185 @@
+system
+{
+ Inbound userIn : UserInput;
+ Outbound userOut : TimeOutIndication;
+ Inbound fwIn : EPTF_MBT_TestStepRequest;
+ Outbound fwOut : EPTF_MBT_TestStepResponse;
+}
+
+/* ====================================================
+ * Message Definitions
+ */
+record TimeOutIndication { }
+
+record UserInput
+{
+ public String input1;
+ public String input2;
+}
+
+record SIPResp
+{
+ public int status;
+ public String cseq;
+}
+
+record SIPReq
+{
+ public String op;
+ public String param;
+}
+
+
+/* ====================================================
+ * SIPClient
+ */
+
+class SIPClient extends StateMachine {
+
+ const float T1 = 0.5; // For UDP transport
+
+ public float timeoutA = T1; // 17.1.1.2
+ public float timeoutB = 16 * T1; // 17.1.1.2
+ public float timeoutE = T1; // 17.1.2.2
+ public float timeoutF = 16 * T1; // 17.1.2.2
+
+ public boolean initialized = false;
+
+
+ /* -----------------------------------------
+ * SIP addresses
+ * src = caller, dst = callee
+ */
+
+ public String src = "sip:127.0.0.1";
+ public String dst = "sip:127.0.0.1:5061";
+
+ /* -----------------------------------------
+ * Methods to send SIP messages to network.
+ */
+
+ public EPTF_MBT_TestStepRequest incomingRequest(String p_stepName)
+ {
+ EPTF_MBT_TestStepRequest r = c_EPTF_MBT_TestStepRequest_empty();
+ r.stepName = p_stepName;
+ r.stepArgs = {};
+ r.addr.entityGroupName = "MBT_EntityType";
+ r.addr.eIdx = 0;
+ r.addr.fIdx = 0;
+
+ return r;
+ }
+
+ public EPTF_MBT_TestStepRequest incomingResponse(int p_answerCode)
+ {
+ EPTF_MBT_TestStepRequest r = c_EPTF_MBT_TestStepRequest_empty();
+ r.stepName = c_SIP_stepFunction_createResponse;
+ r.stepArgs = {f_EPTF_SIP_mapAnswerCode2SipTemplateCode(p_answerCode)};
+ r.addr.entityGroupName = "MBT_EntityType";
+ r.addr.eIdx = 0;
+ r.addr.fIdx = 0;
+
+ return r;
+ }
+
+ public EPTF_MBT_TestStepRequest incomingResponse(int p_answerCode, int p_methodCode)
+ {
+ EPTF_MBT_TestStepRequest r = c_EPTF_MBT_TestStepRequest_empty();
+ r.stepName = c_SIP_stepFunction_createResponse;
+ r.stepArgs = {f_EPTF_SIP_mapAnswerCode2SipTemplateCode(p_answerCode), p_methodCode};
+ r.addr.entityGroupName = "MBT_EntityType";
+ r.addr.eIdx = 0;
+ r.addr.fIdx = 0;
+
+ return r;
+ }
+
+ public void Invite() {
+ EPTF_MBT_TestStepResponse r = c_EPTF_MBT_TestStepResponse_empty();
+ r.bName = c_SIP_Behavior;
+ r.iName = c_SIP_eventName_INVITE;
+ r.addr.fIdx = -1;
+ fwOut.send(r, 1.0);
+
+ if (!initialized)
+ {
+ EPTF_MBT_TestStepRequest req = c_EPTF_MBT_TestStepRequest_empty();;
+ req.stepName = c_SIP_stepFunction_init;
+ req.stepArgs = {};
+ req.addr.entityGroupName = "MBT_EntityType";
+ req.addr.eIdx = 0;
+ req.addr.fIdx = 0;
+ AnyRecord a = fwIn.receive();
+ require a == req;
+
+ req.stepName = c_SIP_stepFunction_handleINVITE;
+ req.stepArgs = {};
+ req.addr.entityGroupName = "MBT_EntityType";
+ req.addr.eIdx = 0;
+ req.addr.fIdx = 0;
+ a = fwIn.receive();
+ require a == req;
+
+ initialized = true;
+ }
+ }
+
+ protected void Cancel() {
+ EPTF_MBT_TestStepResponse r = c_EPTF_MBT_TestStepResponse_empty();
+ r.bName = c_SIP_Behavior;
+ r.iName = c_SIP_eventName_CANCEL;
+ fwOut.send(r, 1.0);
+ }
+
+ protected void Ack() {
+ EPTF_MBT_TestStepResponse r = c_EPTF_MBT_TestStepResponse_empty();
+ r.bName = c_SIP_Behavior;
+ r.iName = c_SIP_eventName_ACK;
+ fwOut.send(r, 1.0);
+ }
+
+ protected void Bye() {
+ EPTF_MBT_TestStepResponse r = c_EPTF_MBT_TestStepResponse_empty();
+ r.bName = c_SIP_Behavior;
+ r.iName = c_SIP_eventName_BYE;
+ fwOut.send(r, 1.0);
+ }
+
+ protected void RetransmittedRequest()
+ {
+ EPTF_MBT_TestStepResponse r = c_EPTF_MBT_TestStepResponse_empty();
+ r.bName = c_SIP_Behavior;
+ r.iName = c_SIP_eventName_RetransmittedRequest;
+ fwOut.send(r, 1.0);
+ }
+
+ protected void SendOK(String cseq) {
+ EPTF_MBT_TestStepResponse r = c_EPTF_MBT_TestStepResponse_empty();
+ r.bName = c_SIP_Behavior;
+ r.iName = "200";
+ fwOut.send(r, 1.0);
+ }
+
+
+ /* -----------------------------------------
+ * Methods to provide indications to the
+ * user interface.
+ */
+ private void TimeOut()
+ {
+ // Indicate timeout
+ TimeOutIndication timeout;
+ userOut.send(timeout);
+ }
+}
+
+
+/* ====================================================
+ * main() - Starting Point
+ */
+
+void main()
+{
+ var a = new SIPClient();
+ a.start();
+}
\ No newline at end of file
diff --git a/demo/direct/model/SIPClient.xmi b/demo/direct/model/SIPClient.xmi
new file mode 100644
index 0000000..976f300
--- /dev/null
+++ b/demo/direct/model/SIPClient.xmi
@@ -0,0 +1,326 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<n1:Project xmlns:n1="http://www.conformiq.com/EMF/SimpleStatechart" xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <statemachine name="SIPClient">
+ <transitions body="userIn:UserInput
[msg.input1=="invite" && msg.input2==dst]
/
Invite();" from="//@statemachine.0/@states.0" to="//@statemachine.0/@states.1"/>
+ <transitions body="fwIn:EPTF_MBT_TestStepRequest
[msg==incomingResponse(180)]/
require true;" from="//@statemachine.0/@states.1" to="//@statemachine.0/@states.12"/>
+ <transitions body="fwIn:EPTF_MBT_TestStepRequest
[msg == incomingResponse(200)]
/Ack();
requirement "Acknowledge established call with ACK";" from="//@statemachine.0/@states.12" to="//@statemachine.0/@states.2"/>
+ <transitions body="after(timeoutB)/
requirement "17.1.1.2 INVITE timers/Terminates INVITE cycle after B timeout";
TimeOut();" from="//@statemachine.0/@states.1" to="//@statemachine.0/@states.5"/>
+ <transitions body="userIn:UserInput
[msg.input1=="bye"]/" from="//@statemachine.0/@states.2" to="//@statemachine.0/@states.3"/>
+ <transitions body="fwIn:EPTF_MBT_TestStepRequest
[msg==incomingResponse(200)]/
requirement "Terminating/Wait for OK in response to BYE";" from="//@statemachine.0/@states.3" to="//@statemachine.0/@states.10"/>
+ <transitions body="fwIn:EPTF_MBT_TestStepRequest
[msg==incomingRequest(c_SIP_stepFunction_createBYE)]
/SendOK("BYE");
requirement "Terminating/Send OK in response to BYE";" from="//@statemachine.0/@states.2" to="//@statemachine.0/@states.8"/>
+ <transitions body="fwIn:EPTF_MBT_TestStepRequest
[msg==incomingResponse(486)]
/Ack();" from="//@statemachine.0/@states.12" to="//@statemachine.0/@states.11"/>
+ <transitions body="fwIn:EPTF_MBT_TestStepRequest
[msg==incomingResponse(487, c_SIP_Method_INVITE)]
/
Ack();" from="//@statemachine.0/@states.13" to="//@statemachine.0/@states.9"/>
+ <transitions body="/ setThreadName("SIP UAC");" from="//@statemachine.0/@states.4" to="//@statemachine.0/@states.0"/>
+ <transitions body="fwIn:EPTF_MBT_TestStepRequest
[msg==incomingResponse(200, c_SIP_Method_CANCEL)]
/" from="//@statemachine.0/@states.6" to="//@statemachine.0/@states.13"/>
+ <transitions body="after(timeoutF)/
requirement "17.1.2.2 Non-INVITE timers/Terminates BYE cycle after F timeout";
TimeOut();" from="//@statemachine.0/@states.3" to="//@statemachine.0/@states.5"/>
+ <transitions body="userIn:UserInput
[msg.input1=="cancel"]/" from="//@statemachine.0/@states.12" to="//@statemachine.0/@states.6"/>
+ <transitions body="after(timeoutF)/
requirement "17.1.2.2 Non-INVITE timers/Terminates CANCEL cycle after F timeout";
TimeOut();" from="//@statemachine.0/@states.6" to="//@statemachine.0/@states.7"/>
+ <states internal="" name="Init" xsi:type="n1:BasicState"/>
+ <states internal="" name="Calling" xsi:type="n1:BasicState">
+ <transitions body="after(timeoutA)/
//Invite();
RetransmittedRequest();
timeoutA = timeoutA * 2.0;
requirement "17.1.1.2 INVITE timers/Resends INVITE after A timeout";" from="//@statemachine.0/@states.1/@states.1" to="//@statemachine.0/@states.1/@states.2"/>
+ <transitions body="" from="//@statemachine.0/@states.1/@states.2" to="//@statemachine.0/@states.1/@states.1"/>
+ <transitions body="/timeoutA = T1;" from="//@statemachine.0/@states.1/@states.0" to="//@statemachine.0/@states.1/@states.1"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="" name="Wait" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:Junction"/>
+ </states>
+ <states internal="" name="Ready" xsi:type="n1:BasicState"/>
+ <states internal="" name="Terminating" xsi:type="n1:BasicState">
+ <transitions body="/Bye();
timeoutE = T1;" from="//@statemachine.0/@states.3/@states.0" to="//@statemachine.0/@states.3/@states.1"/>
+ <transitions body="after(timeoutE)/
Bye();
//RetransmittedRequest();
timeoutE = timeoutE * 2.0;
requirement "17.1.2.2 Non-INVITE timers/Resends BYE after E timeout";" from="//@statemachine.0/@states.3/@states.1" to="//@statemachine.0/@states.3/@states.2"/>
+ <transitions body="" from="//@statemachine.0/@states.3/@states.2" to="//@statemachine.0/@states.3/@states.1"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="" name="Wait" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:Junction"/>
+ </states>
+ <states xsi:type="n1:InitialState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states internal="" name="Canceling" xsi:type="n1:BasicState">
+ <transitions body="/Cancel();
timeoutE = T1;" from="//@statemachine.0/@states.6/@states.0" to="//@statemachine.0/@states.6/@states.1"/>
+ <transitions body="after(timeoutE)/
Cancel();
timeoutE = timeoutE * 2.0;
requirement "17.1.2.2 Non-INVITE timers/Resends CANCEL after E timeout";" from="//@statemachine.0/@states.6/@states.1" to="//@statemachine.0/@states.6/@states.2"/>
+ <transitions body="" from="//@statemachine.0/@states.6/@states.2" to="//@statemachine.0/@states.6/@states.1"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="" name="Wait" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:Junction"/>
+ </states>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states internal="" name="Ringing" xsi:type="n1:BasicState"/>
+ <states internal="" name="Waiting Response" xsi:type="n1:BasicState"/>
+ </statemachine>
+
+ <diagrams statemachine="//@statemachine.0">
+ <items height="50" state="//@statemachine.0/@states.0" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-600" y="-300"/>
+ </items>
+ <items height="50" state="//@statemachine.0/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-603" y="-102"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.2" width="200" xsi:type="n1:DiagramBasicState">
+ <location x="100" y="150"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.3" width="150" xsi:type="n1:DiagramBasicState">
+ <location x="-250" y="250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-540" y="-176"/>
+ <route x="-550" y="-250"/>
+ <route x="-550" y="-102"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-314.5" y="-78"/>
+ <route x="-503" y="-77"/>
+ <route x="-100" y="-77"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="0" x="417.917" y="3.888"/>
+ <route x="0" y="0"/>
+ <route x="200" y="0"/>
+ <route x="200" y="150"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.3" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-540" y="112.953"/>
+ <route x="-550" y="-52"/>
+ <route x="-550" y="277.906"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.4" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="0" x="-15.5" y="216"/>
+ <route x="100" y="200"/>
+ <route x="-175" y="200"/>
+ <route x="-175" y="250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.5" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-172" y="416"/>
+ <route x="-182" y="350"/>
+ <route x="-182" y="482"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.6" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="210" y="315"/>
+ <route x="200" y="250"/>
+ <route x="200" y="380"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.7" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-228" y="21"/>
+ <route x="-100" y="50"/>
+ <route x="-330" y="50"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.8" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="685" y="202.5"/>
+ <route x="675" y="150"/>
+ <route x="675" y="255"/>
+ </items>
+ <items state="//@statemachine.0/@states.4" xsi:type="n1:DiagramInitialState">
+ <location x="-550" y="-350"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.9" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-540" y="-315"/>
+ <route x="-550" y="-330"/>
+ <route x="-550" y="-300"/>
+ </items>
+ <items state="//@statemachine.0/@states.5" xsi:type="n1:DiagramFinalState">
+ <location x="-550" y="297.906"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.10" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="685" y="25"/>
+ <route x="675" y="-50"/>
+ <route x="675" y="100"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.11" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-425.57" y="400.906"/>
+ <route x="-250" y="298.763"/>
+ <route x="-530" y="297.963"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.6" width="150" xsi:type="n1:DiagramBasicState">
+ <location x="600" y="-150"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.12" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="300" y="-87.5"/>
+ <route x="0" y="-77.5"/>
+ <route x="600" y="-77.5"/>
+ </items>
+ <items state="//@statemachine.0/@states.7" xsi:type="n1:DiagramFinalState">
+ <location x="675" y="-275.13"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.13" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="536.844" y="-195.261"/>
+ <route x="675" y="-150"/>
+ <route x="675" y="-255.13"/>
+ </items>
+ <items state="//@statemachine.0/@states.8" xsi:type="n1:DiagramFinalState">
+ <location x="200" y="400"/>
+ </items>
+ <items state="//@statemachine.0/@states.9" xsi:type="n1:DiagramFinalState">
+ <location x="675" y="275"/>
+ </items>
+ <items state="//@statemachine.0/@states.10" xsi:type="n1:DiagramFinalState">
+ <location x="-182" y="502"/>
+ </items>
+ <items state="//@statemachine.0/@states.11" xsi:type="n1:DiagramFinalState">
+ <location x="-350" y="50"/>
+ </items>
+ <items height="250" state="//@statemachine.0/@states.12" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-100" y="-150"/>
+ </items>
+ <items height="50" state="//@statemachine.0/@states.13" width="150" xsi:type="n1:DiagramBasicState">
+ <location x="600" y="100"/>
+ </items>
+ <items height="120" note="Triggered by user action, send INVITE request. (We are initiating a new call.)" width="161" xsi:type="n1:DiagramNote">
+ <location x="-838" y="-142"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.1" note="//@diagrams.0/@items.28" xsi:type="n1:DiagramNoteConnector">
+ <route x="-677" y="-77"/>
+ <route x="-603" y="-77"/>
+ </items>
+ <items height="76" note="21.1.2 180 Ringing
waiting for other end to answer" width="174" xsi:type="n1:DiagramNote">
+ <location x="-100" y="-300"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.26" note="//@diagrams.0/@items.30" xsi:type="n1:DiagramNoteConnector">
+ <route x="-50" y="-224"/>
+ <route x="-50" y="-150"/>
+ </items>
+ <items height="131" note="It is ringing, but we want to cancel (hang-up) before other end answers" width="169" xsi:type="n1:DiagramNote">
+ <location x="250" y="-321"/>
+ </items>
+ <items autolayout="false" note="//@diagrams.0/@items.32" xsi:type="n1:DiagramNoteConnector">
+ <route x="327" y="-190"/>
+ <route x="327" y="-80"/>
+ </items>
+ <items height="84" note="Now we can speak with other end" width="143" xsi:type="n1:DiagramNote">
+ <location x="-35" y="275"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.2" note="//@diagrams.0/@items.34" xsi:type="n1:DiagramNoteConnector">
+ <route x="88" y="275"/>
+ <route x="120" y="250"/>
+ </items>
+ <items height="66" note="21.4.24 486 Busy Here
Callee rejects call" width="179" xsi:type="n1:DiagramNote">
+ <location x="-536" y="-44"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.25" note="//@diagrams.0/@items.36" xsi:type="n1:DiagramNoteConnector">
+ <route x="-377" y="22"/>
+ <route x="-363.883" y="35.6031"/>
+ </items>
+ <items height="52" note="2.1.4.25 487 Request Terminated
call is now terminated" width="257" xsi:type="n1:DiagramNote">
+ <location x="370" y="168"/>
+ </items>
+ <items autolayout="false" note="//@diagrams.0/@items.38" xsi:type="n1:DiagramNoteConnector">
+ <route x="627" y="200"/>
+ <route x="675" y="202"/>
+ </items>
+ <items height="69" note="Paragraph numbers in comments and requiremnts refer to RFC 3261 SIP: Session Initiation Protocol" width="307" xsi:type="n1:DiagramNote">
+ <location x="-238" y="-433"/>
+ </items>
+ </diagrams>
+
+ <diagrams substate="//@statemachine.0/@states.3">
+ <items state="//@statemachine.0/@states.3/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="-1200" y="-200"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.3/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-1000" y="-250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.3/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-1090" y="-210"/>
+ <route x="-1180" y="-200"/>
+ <route x="-1000" y="-200"/>
+ </items>
+ <items state="//@statemachine.0/@states.3/@states.2" xsi:type="n1:DiagramJunction">
+ <location x="-599" y="-64"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.3/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="-94" constraintLeft="-880" valign="0" x="-749.5" y="-190"/>
+ <route x="-900" y="-200"/>
+ <route x="-599" y="-200"/>
+ <route x="-599" y="-74"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.3/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintRight="-629" constraintTop="-130" valign="1" x="-779.5" y="-74"/>
+ <route x="-609" y="-64"/>
+ <route x="-950" y="-64"/>
+ <route x="-950" y="-150"/>
+ </items>
+ <items height="150" note="Re-send BYE message after time-out and increase value of timer E according to RFC 3261 17.1.2 Non-INVITE Client Transaction." width="350" xsi:type="n1:DiagramNote">
+ <location x="-1100" y="-50"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.1/@items.3" note="//@diagrams.1/@items.6" xsi:type="n1:DiagramNoteConnector">
+ <route x="-750" y="-30"/>
+ <route x="-608.756" y="-61.8033"/>
+ </items>
+ </diagrams>
+
+ <diagrams selected="//@diagrams.2/@items.2" substate="//@statemachine.0/@states.1">
+ <items state="//@statemachine.0/@states.1/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="-1200" y="-300"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.1/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-1000" y="-350"/>
+ </items>
+ <items state="//@statemachine.0/@states.1/@states.2" xsi:type="n1:DiagramJunction">
+ <location x="-613" y="-163"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.1/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="-193" constraintLeft="-880" valign="0" x="-756.5" y="-290"/>
+ <route x="-900" y="-300"/>
+ <route x="-613" y="-300"/>
+ <route x="-613" y="-173"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.1/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintRight="-643" constraintTop="-230" valign="1" x="-786.5" y="-173"/>
+ <route x="-623" y="-163"/>
+ <route x="-950" y="-163"/>
+ <route x="-950" y="-250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.1/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-1090" y="-310"/>
+ <route x="-1180" y="-300"/>
+ <route x="-1000" y="-300"/>
+ </items>
+ <items height="150" note="Re-send INVITE message after time-out and increase value of timer A according to RFC 3261 17.1.1 INVITE Client Transaction." width="350" xsi:type="n1:DiagramNote">
+ <location x="-1100" y="-150"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.2/@items.2" note="//@diagrams.2/@items.6" xsi:type="n1:DiagramNoteConnector">
+ <route x="-750" y="-130"/>
+ <route x="-622.722" y="-160.658"/>
+ </items>
+ </diagrams>
+
+ <diagrams selected="//@diagrams.3/@items.3" substate="//@statemachine.0/@states.6">
+ <items state="//@statemachine.0/@states.6/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="-1300" y="-300"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.6/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-1100" y="-350"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.6/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-1190" y="-310"/>
+ <route x="-1280" y="-300"/>
+ <route x="-1100" y="-300"/>
+ </items>
+ <items state="//@statemachine.0/@states.6/@states.2" xsi:type="n1:DiagramJunction">
+ <location x="-698" y="-179"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.6/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="-209" constraintLeft="-980" valign="0" x="-849" y="-290"/>
+ <route x="-1000" y="-300"/>
+ <route x="-698" y="-300"/>
+ <route x="-698" y="-189"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.6/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintRight="-728" constraintTop="-230" valign="1" x="-879" y="-189"/>
+ <route x="-708" y="-179"/>
+ <route x="-1050" y="-179"/>
+ <route x="-1050" y="-250"/>
+ </items>
+ <items height="150" note="Re-send CANCEL message after time-out and increase value of timer E according to RFC 3261 17.1.2 Non-INVITE Client Transaction." width="350" xsi:type="n1:DiagramNote">
+ <location x="-1200" y="-150"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.3/@items.3" note="//@diagrams.3/@items.6" xsi:type="n1:DiagramNoteConnector">
+ <route x="-850" y="-130"/>
+ <route x="-707.518" y="-175.932"/>
+ </items>
+ </diagrams>
+
+</n1:Project>
diff --git a/demo/ggsn/MBT_Qtronic_Demo.cfg b/demo/ggsn/MBT_Qtronic_Demo.cfg
new file mode 100644
index 0000000..aea2253
--- /dev/null
+++ b/demo/ggsn/MBT_Qtronic_Demo.cfg
@@ -0,0 +1,181 @@
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Copyright Test Competence Center (TCC) ETH 2009 //
+// //
+// The copyright to the computer program(s) herein is the property of TCC. //
+// The program(s) may be used and/or copied only with the written permission //
+// of TCC or in accordance with the terms and conditions stipulated in the //
+// agreement/contract under which the program(s) have been supplied //
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Demo.cfg
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+[DEFINE]
+//num_entities := 1
+//Number of simulated entities
+
+[LOGGING]
+ConsoleMask := TTCN_ERROR | TTCN_STATISTICS | TTCN_ACTION | TTCN_WARNING
+#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_USER | TTCN_PORTEVENT
+FileMask := TTCN_USER | TTCN_ERROR | TTCN_WARNING
+#FileMask := ERROR | STATISTICS | PARALLEL | ACTION | WARNING
+#LogFile := "%l/%e.%h-%t%r.%s"
+LogEntityName := Yes
+LogEventTypes := Yes//Subcategories;
+SourceInfoFormat := Stack
+
+[TESTPORT_PARAMETERS]
+//*.*.debug := "YES";
+
+[MODULE_PARAMETERS]
+
+
+/////////////////////////////////////////////////
+// Logging settings
+/////////////////////////////////////////////////
+tsp_Mapper_enableDebug := false;
+
+tsp_debug_EPTF_SchedulerFunctions := false;
+tsp_debugVerbose_EPTF_SchedulerFunctions := false;
+
+tsp_EPTF_LGenBaseDebugTraffic := false;
+tsp_EPTF_LGenBaseDebug := false;
+
+tsp_EPTF_MBT_LGen_debug := false;
+
+tsp_EPTF_GTP_loggingEnable := false;
+tsp_EPTF_GTP_Transport_loggingDebug := false;
+tsp_EPTF_GTP_Transport_loggingIO := true;
+
+tsp_EPTF_LANL2_loggingEnable := false;
+tsp_EPTF_LANL2_Transport_loggingEnable := false;
+
+/////////////////////////////////////////////////
+// GTP settings
+/////////////////////////////////////////////////
+#tsp_EPTF_GTP_localIP := "127.0.0.1";
+tsp_EPTF_GTP_localIP := "10.160.46.161";
+tsp_EPTF_GTP_localControlPort := 2123;
+tsp_EPTF_GTP_localDataPort := 2152;
+
+#tsp_EPTF_GTP_remoteIP := "127.0.0.1";
+tsp_EPTF_GTP_remoteIP := "10.161.46.161";
+tsp_EPTF_GTP_remoteControlPort := 2123;
+tsp_EPTF_GTP_remoteDataPort := 2152;
+
+/////////////////////////////////////////////////
+// LANL2 settings
+/////////////////////////////////////////////////
+tsp_EPTF_LANL2_connectionInfoList :=
+{
+ {
+ locHost := "10.160.46.1",
+ locPort := 40000,
+ remHost := "20.46.0.2",
+ remPort := 50000,
+ proto := udp,
+ payload := '00000000'O
+ }
+}
+
+tsp_EPTF_LANL2_Transport_srcMacAddr := '18a9053b9b32'O
+tsp_EPTF_LANL2_Transport_dstMacAddr := '001db55bcff0'O //'002159b2dff0'O
+
+/////////////////////////////////////////////////
+// TELNET settings
+/////////////////////////////////////////////////
+tsp_EPTF_TELNET_remoteHost:="10.132.1.220"
+tsp_EPTF_TELNET_remotePort := 23;
+tsp_EPTF_TELNET_localHost:="10.132.250.26"
+tsp_EPTF_TELNET_localPort:= 60201
+
+tsp_EPTF_TELNET_loggingEnable := true;
+tsp_EPTF_TELNET_Transport_loggingEnable := true;
+
+tsp_EPTF_TELNET_Transport_loginSkipped := false
+tsp_EPTF_TELNET_Transport_userName := "erv"
+tsp_EPTF_TELNET_Transport_password := "ggsn"
+
+//tsp_EPTF_TELNET_Transport_PlayListDB := {{{msg:="echo me",resp:=omit}}};
+tsp_EPTF_TELNET_PlayListDB := {{
+ {msg:="show chassis hardware\n",resp:="*j20-46-[01][>] "}
+ //,{msg:="op tc_2589_33_Dynamic_filter_rules_over_Gx_shall_be_ignored\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="show services ggsn apn | match ""apn.*.com {""\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn1.com pdp-context creation blocked\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn2.com pdp-context creation blocked\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn3.com pdp-context creation blocked\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn4.com pdp-context creation blocked\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn5.com pdp-context creation blocked\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="show services ggsn apn | match ""apn.*.com {""\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="request services ggsn pdp terminate apn apn1.com\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="request services ggsn pdp terminate apn apn2.com\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="request services ggsn pdp terminate apn apn3.com\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="request services ggsn pdp terminate apn apn4.com\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="request services ggsn pdp terminate apn apn5.com\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="load override ft-j20-46.ttcn.mpg.conf\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn1.com pdp-context creation blocked\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="delete services ggsn apn apn1.com pdp-context pdp-type\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="delete services ggsn apn apn1.com pdp-context ipv6-address\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="delete services ggsn apn apn1.com pdp-context ipv6-address-allocation\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn1.com pdp-context address-allocation local-pool\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+ ,{msg:="edit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="set services ggsn apn apn1.com pdp-context creation unblocked\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="commit\n",resp:="*j20-46-[01][#] "}
+ ,{msg:="exit\n",resp:="*j20-46-[01][>] "}
+
+ }};
+tsp_EPTF_TELNET_Transport_PromptList := {"etibben","j20-46-[01][>#%]"}
+
+[TESTPORT_PARAMETERS]
+*.IPL4_PCO.debug := "NO"
+*.LANL2_PCO.eth_interface_name := "eth1.2301"//eth1"
+*.LANL2_PCO.promiscuous_mode := "1"
+*.LANL2_PCO.packet_filter := "ip or ip6 or arp"
+
+[EXECUTE]
+MBT_Qtronic_Testcases.control
+#MBT_Qtronic_Testcases.tc_Test_Case_1
+#MBT_Qtronic_Testcases.tc_Test_Case_2
+#MBT_Qtronic_Testcases.tc_Test_Case_3
+#MBT_Qtronic_Testcases.tc_Test_Case_4
+#MBT_Qtronic_Testcases.tc_Test_Case_5
+#MBT_Qtronic_Testcases.tc_Test_Case_6
+#MBT_Qtronic_Testcases.tc_Test_Case_7
+#MBT_Qtronic_Testcases.tc_Test_Case_8
+#MBT_Qtronic_Testcases.tc_Test_Case_9
+#MBT_Qtronic_Testcases.tc_Test_Case_10
diff --git a/demo/ggsn/MBT_Qtronic_Demo.prj b/demo/ggsn/MBT_Qtronic_Demo.prj
new file mode 100644
index 0000000..65971f9
--- /dev/null
+++ b/demo/ggsn/MBT_Qtronic_Demo.prj
@@ -0,0 +1,158 @@
+<!DOCTYPE TITAN_GUI_project_file>
+<Project TITAN_version="1.8.pl1" >
+ <General>
+ <Project_Name>MBT_Qtronic_Demo</Project_Name>
+ <Executable_Path>bin/demo</Executable_Path>
+ <Working_Dir>bin</Working_Dir>
+ <Build_Host>alpha</Build_Host>
+ <Execution_Mode>Parallel</Execution_Mode>
+ <ScriptFile_AfterMake>./makefile_patch.sh</ScriptFile_AfterMake>
+ <Log_Format>yes</Log_Format>
+ <Update_Symlinks>yes</Update_Symlinks>
+ <Create_Absolute_Symlinks>no</Create_Absolute_Symlinks>
+ <Update_Makefile>yes</Update_Makefile>
+ <Localhost_Execute>yes</Localhost_Execute>
+ <Execute_Command>rsh %host "cd %project_working_dir ; "%executable" %localhost %mctr_port"</Execute_Command>
+ <Execute_Hosts>alfa, beta, gamma</Execute_Hosts>
+ <UnUsed_List></UnUsed_List>
+ </General>
+ <Modules>
+ <Module>MBT_Qtronic_Main.ttcn</Module>
+ <Module>MBT_Qtronic_TestHarness.ttcn</Module>
+ <Module>MBT_Qtronic_TestSystem.ttcn</Module>
+ <Module>MBT_Qtronic_Testcases.ttcn</Module>
+ <Module>MBT_Qtronic_Types.ttcn</Module>
+ </Modules>
+ <Configs>
+ <Config>MBT_Qtronic_Demo.cfg</Config>
+ </Configs>
+ <File_Group name="MainFileGroup" >
+ <File_Groups>
+ <File_Group name="EPTF_Applib_MBT_CNL113659" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Applib_MBT_CNL113659/src/LoadGen/EPTF_MBT_LoadGen.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="EPTF_Applib_GTP_CNL113696" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Applib_GTP_CNL113696/src/LoadGen/EPTF_GTP_LoadGen.grp" />
+ <File_Group path="../../../EPTF_Applib_GTP_CNL113696/src/Logger/EPTF_GTP_Logger.grp" />
+ <File_Group path="../../../EPTF_Applib_GTP_CNL113696/src/Transport/EPTF_GTP_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="EPTF_Applib_TELNET_CNL113697" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Applib_TELNET_CNL113697/src/LoadGen/EPTF_TELNET_LoadGen.grp" />
+ <File_Group path="../../../EPTF_Applib_TELNET_CNL113697/src/Logger/EPTF_TELNET_Logger.grp" />
+ <File_Group path="../../../EPTF_Applib_TELNET_CNL113697/src/Transport/EPTF_TELNET_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="EPTF_Applib_LANL2_CNL113698" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Applib_LANL2_CNL113698/src/LoadGen/EPTF_LANL2_LoadGen.grp" />
+ <File_Group path="../../../EPTF_Applib_LANL2_CNL113698/src/Logger/EPTF_LANL2_Logger.grp" />
+ <File_Group path="../../../EPTF_Applib_LANL2_CNL113698/src/Transport/EPTF_LANL2_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="TCCUsefulFunctions_CNL113472" >
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/digcalc.c" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/digcalc.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Definitions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.c" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_GenericTypes.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_ip.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCConversion.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCConversion_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCTemplate_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="GTP_v8.1.0_CNL113617">
+ <File path="../../../../ProtocolModules/GTP_v8.1.0_CNL113617/src/GTPC_EncDec.cc" />
+ <File path="../../../../ProtocolModules/GTP_v8.1.0_CNL113617/src/GTPC_Types.ttcn" />
+ <File path="../../../../ProtocolModules/GTP_v8.1.0_CNL113617/src/GTPU_EncDec.cc" />
+ <File path="../../../../ProtocolModules/GTP_v8.1.0_CNL113617/src/GTPU_Types.ttcn" />
+ </File_Group>
+ <File_Group name="GTPP_v7.0.0_CNL113579">
+ <File path="../../../../ProtocolModules/GTPP_v7.0.0_CNL113579/src/GTPP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="UDP_CNL113420">
+ <File path="../../../../ProtocolModules/UDP_CNL113420/src/UDP_Types.ttcn" />
+ <File path="../../../../ProtocolModules/UDP_CNL113420/src/UDP_EncDec.cc" />
+ </File_Group>
+ <File_Group name="UDPasp_CNL113346" >
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PortType.ttcn" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.cc" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.hh" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="IPL4asp_CNL113531" >
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_discovery.cc" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Functions.ttcn" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PortType.ttcn" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_protocol_L234.hh" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.cc" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.hh" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="Abstract_Socket_CNL113384" >
+ <File path="../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.cc" />
+ <File path="../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.hh" />
+ </File_Group>
+ <File_Group name="IP_CNL113418" >
+ <File path="../../../../ProtocolModules/IP_CNL113418/src/IP_EncDec.cc" />
+ <File path="../../../../ProtocolModules/IP_CNL113418/src/IP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="LANL2asp_CNL113519" >
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PortType.ttcn" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.cc" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.hh" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="TCP_CNL113675" >
+ <File path="../../../../ProtocolModules/TCP_CNL113675/src/TCP_EncDec.cc" />
+ <File path="../../../../ProtocolModules/TCP_CNL113675/src/TCP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="GeneralTypes" >
+ <File path="../../../../ProtocolModules/COMMON/src/General_Types.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Core_Library_CNL113512" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Base/EPTF_CLL_Base.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Common/EPTF_CLL_Common.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/FreeBusyQueue/EPTF_CLL_FreeBusyQueue.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/HashMap/EPTF_CLL_HashMap.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Logging/EPTF_CLL_Logging.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/RedBlackTree/EPTF_CLL_RBtree_Float.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Scheduler/EPTF_CLL_Scheduler_RBT.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Variable/EPTF_CLL_Variable.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/StatMeasure/EPTF_CLL_StatMeasure.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_Transport.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportCommPortIPL4.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportMessageBufferManager.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportRouting.grp" />
+ <File_Group path="../../../../TestPorts/Common_Components/Socket_API_CNL113686/src/Socket_API.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/RandomNArray/EPTF_CLL_RNA.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Semaphore/EPTF_CLL_Semaphore.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/StatHandler/EPTF_CLL_StatHandler.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/LGenBase/EPTF_CLL_LGenBase.grp" />
+ </File_Groups>
+ </File_Group>
+ </File_Groups>
+ </File_Group>
+</Project>
diff --git a/demo/ggsn/MBT_Qtronic_Main.ttcn b/demo/ggsn/MBT_Qtronic_Main.ttcn
new file mode 100644
index 0000000..d29e43c
--- /dev/null
+++ b/demo/ggsn/MBT_Qtronic_Main.ttcn
@@ -0,0 +1,456 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Main.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+module MBT_Qtronic_Main
+{
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_MBT_LGen_Functions all;
+
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Base_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+
+import from EPTF_GTP_LGen_Definitions all;
+import from EPTF_GTP_LGen_Functions all;
+import from EPTF_GTP_Transport_Definitions all;
+import from EPTF_GTP_Transport_Functions all;
+
+import from EPTF_TELNET_Transport_Definitions all;
+import from EPTF_TELNET_Transport_Functions all;
+import from EPTF_TELNET_LGen_Definitions all;
+import from EPTF_TELNET_LGen_Functions all;
+
+import from EPTF_LANL2_Transport_Definitions all;
+import from EPTF_LANL2_Transport_Functions all;
+import from EPTF_LANL2_LGen_Definitions all;
+import from EPTF_LANL2_LGen_Functions all;
+
+import from MBT_Qtronic_Types all;
+import from MBT_Qtronic_TestSystem all;
+
+modulepar
+{
+ boolean tsp_Mapper_enableDebug := false;
+}
+
+function f_Mapper_log(in charstring p_log)
+{
+ if (tsp_Mapper_enableDebug) { log(p_log); }
+}
+
+type component MBT_Demo_LGen_CT extends EPTF_MBT_LGen_CT,
+ EPTF_GTP_LGen_CT, EPTF_GTP_LocalTransport_CT,
+ EPTF_TELNET_LGen_CT, EPTF_TELNET_LocalTransport_CT,
+ EPTF_LANL2_LGen_CT, EPTF_LANL2_LocalTransport_CT
+{
+}
+
+type component MBT_Demo_Tester_CT extends EPTF_MBT_Tester_CT
+{
+ port GnInPort GN_IN_LGEN_PCO;
+ port GnOutPort GN_OUT_LGEN_PCO;
+ port GiInPort GI_IN_LGEN_PCO;
+ port GiOutPort GI_OUT_LGEN_PCO;
+}
+
+type component MBT_Qtronic_Main_CT extends MBT_Demo_Tester_CT, MBT_Demo_LGen_CT
+{
+}
+
+type component MBT_Demo_Main_CT extends EPTF_Base_CT {}
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// Initialization
+///////////////////////////////////////////////////////////////////////////////////
+
+function f_cq_beginTestcase()
+runs on QtronicCT
+{
+ f_Mapper_log(log2str(%definitionId, " enter"));
+
+ // MBT Applib initialization
+ f_EPTF_MBT_Tester_init("MBT_Demo");
+ f_EPTF_MBT_init("MBT_Demo",0, "MBT_");
+ f_EPTF_MBT_initLGenFsm(refers(f_MBT_Demo_LGen_createUserMessage), null);
+
+ // GTP Applib initialization
+ f_EPTF_GTP_init(
+ pl_selfName:="GTP_LoadGen",
+ pl_selfId:=0,
+ pl_entityNamePrefix:="GTP_AppLib_",
+ pl_numEntities:=0);
+ f_EPTF_GTP_LocalTransport_init_CT();
+
+ vf_EPTF_GTP_sendMessage:=refers(f_EPTF_GTP_LocalTransport_sendMessage);
+ vf_EPTF_GTP_handleMessage:=refers(f_EPTF_GTP_LocalTransport_handleMessage);
+ vf_EPTF_GTP_cleanUpTransport:=refers(f_EPTF_GTP_LocalTransport_cleanUpTransport);
+ vf_EPTF_GTP_LocalTransport_receive:=refers(f_EPTF_GTP_messageHandler);
+
+ // TELNET Applib initialization
+ f_EPTF_TELNET_init(
+ pl_selfName := "TELNET_AppLib",
+ pl_selfId := 0,
+ pl_entityNamePrefix := "TELNET_",
+ pl_numEntities := 0,
+ pl_bind := refers(f_EPTF_TELNET_bindEntity4Behavior)
+ );
+
+ f_EPTF_TELNET_LocalTransport_init_CT(
+ pl_selfName:= "EPTF_TELNET_LocalTransport",
+ pl_receiveFunction:= refers(f_EPTF_TELNET_messageReceived),
+ pl_eventReceiveFunction:= refers(f_EPTF_TELNET_eventReceived)
+ );
+
+ vf_EPTF_TELNET_newTransportUser:=refers( f_EPTF_TELNET_LocalTransport_newTransportUser);
+ vf_EPTF_TELNET_sendMessage := refers(f_EPTF_TELNET_LocalTransport_sendMessage)
+ vf_EPTF_TELNET_playList:=refers(f_EPTF_TELNET_LocalTransport_playListElement)
+
+ // LANL2 Applib initialization
+ f_EPTF_LANL2_init(
+ pl_selfName := "IPL2_AppLib",
+ pl_selfId := 0,
+ pl_entityNamePrefix := "IPL2_",
+ pl_numEntities := 0,
+ pl_bind := refers(f_EPTF_LANL2_bindEntity4Behavior)
+ );
+
+ f_EPTF_LANL2_LocalTransport_init_CT(
+ pl_selfName:= c_EPTF_LANL2_Transport_LGenType,
+ pl_receiveFunction:= refers(f_EPTF_LANL2_messageReceived),
+ pl_eventReceiveFunction:= refers(f_EPTF_LANL2_eventReceived)
+ );
+
+ f_EPTF_LANL2_setSendMessageFunction(plf_sendMessageFunction := refers(f_EPTF_LANL2_LocalTransport_sendMessage));
+ f_EPTF_LANL2_setEchoMessageFunction(plf_echoMessageFunction := refers(f_EPTF_LANL2_LocalTransport_echoMessage));
+ f_EPTF_LANL2_setListenFunction(plf_listenFunction := refers(f_EPTF_LANL2_LocalTransport_listen));
+ f_EPTF_LANL2_setCloseFunction(plf_closeFunction := refers(f_EPTF_LANL2_LocalTransport_close));
+
+ // Connecting the MBT Test Harness with the Tester component
+ connect(self:EPTF_MBT_PCO, self:EPTF_MBT_TESTER_PCO);
+ connect(self:GN_IN_LGEN_PCO, self:GnIn);
+ connect(self:GN_OUT_LGEN_PCO, self:GnOut);
+ connect(self:GI_IN_LGEN_PCO, self:GiIn);
+ connect(self:GI_OUT_LGEN_PCO, self:GiOut);
+
+ // Creating 1 entity with 1 MBT_FSM
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "MBT_EntityType",
+ noEntities := 1,
+ behaviors := {c_EPTF_MBT_myBName, c_EPTF_GTP_behavior, c_EPTF_TELNET_behavior},
+ fsmName := "FSM_MBT"
+ }
+ );
+
+ // TODO: activate default altstep, with timeout handling
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_ConfigResponse:?);
+
+ //Activating GTP Echo Handler
+ f_MBT_Demo_LGen_activateEchoHandler();
+
+ f_Mapper_log(log2str(%definitionId, " finished"));
+}
+
+function f_cq_endTestcase()
+runs on MBT_Qtronic_Main_CT
+{
+ f_Mapper_log(log2str(%definitionId, " enter"));
+
+ f_EPTF_Base_stopAll(none);
+
+ f_Mapper_log(log2str(%definitionId, " finished"));
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+// Mapping Testcase -> Test Harness
+///////////////////////////////////////////////////////////////////////////////////
+
+function f_Model_sendCreatePDPContext(in CreatePDPcontext p_CreatePDPcontext)
+runs on MBT_Qtronic_Main_CT
+{
+ f_Mapper_log(log2str(%definitionId, " enter ", p_CreatePDPcontext));
+
+ // Creating a GTP session in the test harness
+ f_MBT_execute(c_EPTF_GTP_stepName_init, valueof(t_addr(0)));
+
+ // Start listening on Gi
+ f_MBT_execute(c_EPTF_LANL2_stepName_init, valueof(t_addr(0)), {0});
+ f_MBT_execute(c_EPTF_LANL2_stepName_listen, valueof(t_addr(0)));
+
+ // Example of setting the parameters for the GTP session
+ var EPTF_GTP_FSM_Ctx p_client_ctx;
+ f_EPTF_GTP_getContext(f_convert_FsmAddr2TestStepArgs(valueof(t_addr(0))), p_client_ctx);
+
+ p_client_ctx.primaryCtx.imsi := f_getIMSI_str2hex(p_CreatePDPcontext.imsi);
+ p_client_ctx.primaryCtx.apn := f_getAPN_char2oct(p_CreatePDPcontext.apn);
+ p_client_ctx.primaryCtx.msisdn := f_getMSISDN_str2hex(p_CreatePDPcontext.imsi);
+ f_EPTF_GTP_setContext(f_convert_FsmAddr2TestStepArgs(valueof(t_addr(0))), p_client_ctx);
+ // Example ends
+
+ // Generating a PDP context request
+ f_MBT_execute(c_EPTF_GTP_stepName_createPDPContextRequest, valueof(t_addr(0)));
+
+ // Example of how to update the generated message
+ f_EPTF_GTP_getContext(f_convert_FsmAddr2TestStepArgs(valueof(t_addr(0))), p_client_ctx);
+ p_client_ctx.gtpcMsgToSend.gtpc_pdu.createPDPContextRequest.charging_char.chargingChar := '0800'O;
+ f_EPTF_GTP_setContext(f_convert_FsmAddr2TestStepArgs(valueof(t_addr(0))), p_client_ctx);
+ // Example ends
+
+ // Sending the message
+ f_MBT_execute(c_EPTF_GTP_stepName_sendMessage, valueof(t_addr(0)));
+
+ f_Mapper_log(log2str(%definitionId, " finished"));
+}
+
+function f_Model_sendUpdatePDPContext(in UpdatePDPcontext p_UpdatePDPcontext)
+runs on MBT_Qtronic_Main_CT
+{
+ f_Mapper_log(log2str(%definitionId, " enter ", p_UpdatePDPcontext));
+
+ // Generating an update PDP context message by the test harness
+ f_MBT_execute(c_EPTF_GTP_stepName_updatePDPContextRequest, valueof(t_addr(0)));
+ // Sending the message
+ f_MBT_execute(c_EPTF_GTP_stepName_sendMessage, valueof(t_addr(0)));
+
+ f_Mapper_log(log2str(%definitionId, " finished"));
+}
+
+function f_Model_sendDeletePDPContext(in DeletePDPcontext p_DeletePDPcontext)
+runs on MBT_Qtronic_Main_CT
+{
+ f_Mapper_log(log2str(%definitionId, " enter ", p_DeletePDPcontext));
+
+ f_MBT_execute(c_EPTF_GTP_stepName_deletePDPContextRequest, valueof(t_addr(0)));
+ f_MBT_execute(c_EPTF_GTP_stepName_sendMessage, valueof(t_addr(0)));
+
+ f_Mapper_log(log2str(%definitionId, " finished"));
+}
+
+function f_Model_sendGPDU(in GPDU p_gpdu)
+runs on MBT_Qtronic_Main_CT
+{
+ f_Mapper_log(log2str(%definitionId, " enter ", p_gpdu));
+
+ // First we load the Payload we want to send in the GTP tunnel into the GTP Context
+ var EPTF_GTP_FSM_Ctx p_client_ctx;
+ f_EPTF_GTP_getContext(f_convert_FsmAddr2TestStepArgs(valueof(t_addr(0))), p_client_ctx);
+ p_client_ctx.primaryCtx.payload :=
+ f_EPTF_GTP_createUDPpacket(
+ f_EPTF_GTP_convertIP_oct2str(p_client_ctx.primaryCtx.end_user_address), //"20.46.0.2",
+ tsp_EPTF_LANL2_connectionInfoList[0].remPort,
+ tsp_EPTF_LANL2_connectionInfoList[0].locHost,
+ tsp_EPTF_LANL2_connectionInfoList[0].locPort,
+ tsp_EPTF_LANL2_connectionInfoList[0].payload
+ );
+ f_EPTF_GTP_setContext(f_convert_FsmAddr2TestStepArgs(valueof(t_addr(0))), p_client_ctx);
+
+ // Then we generate the GPDU. The previously loaded payload will be in the generated PDU.
+ f_MBT_execute(c_EPTF_GTP_stepName_createGTPU, valueof(t_addr(0)));
+
+ // It can be now sent out.
+ f_MBT_execute(c_EPTF_GTP_stepName_sendGTPU, valueof(t_addr(0)));
+
+ f_Mapper_log(log2str(%definitionId, " finished"));
+}
+
+function f_Model_sendUDPpdu(in UDPpdu p_UDPpdu)
+runs on MBT_Qtronic_Main_CT
+{
+ f_Mapper_log(log2str(%definitionId, " enter ", p_UDPpdu));
+
+ f_MBT_execute(c_EPTF_LANL2_stepName_sendMessage, valueof(t_addr(0)), {0});
+
+ f_Mapper_log(log2str(%definitionId, " finished"));
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+// Message handling: Test Harness -> Testcase
+///////////////////////////////////////////////////////////////////////////////////
+
+function f_MBT_Demo_LGen_createUserMessage(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_Qtronic_Main_CT
+return boolean
+{
+ // This function catches the events that are generated by the test harness when a message is received.
+ // The purpose of this function to create the message structure that is expected by the model (and thus by the generated test case code)
+
+ f_Mapper_log(log2str(%definitionId & " creating message for:\n", pl_ptr, "\n", pl_ptr.reportedEvent));
+
+ // CreatePDPContextResponse
+ if (pl_ptr.reportedEvent.event.bIdx == v_EPTF_GTP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_EPTF_GTP_inputIdx_createPDPContextResponse)
+ {
+ f_MBT_execute(c_EPTF_GTP_stepName_handleIncomingMessage, valueof(t_addr(0)));
+
+ var integer vl_cause :=
+ oct2int(v_EPTF_GTP_lastReceived.msg.gtpc.gtpc_pdu.createPDPContextResponse.cause.causevalue);
+
+ GN_OUT_LGEN_PCO.send(CreatePDPresponse:{vl_cause});
+ }
+ // UpdatePDPContextResponse
+ else if (pl_ptr.reportedEvent.event.bIdx == v_EPTF_GTP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_EPTF_GTP_inputIdx_updatePDPContextResponse)
+ {
+ f_MBT_execute(c_EPTF_GTP_stepName_handleIncomingMessage, valueof(t_addr(0)));
+
+ var integer vl_cause :=
+ oct2int(v_EPTF_GTP_lastReceived.msg.gtpc.gtpc_pdu.updatePDPContextResponse.updatePDPContextResponseSGSN.cause.causevalue);
+
+ GN_OUT_LGEN_PCO.send(UpdatePDPresponse:{vl_cause});
+ }
+ // DeletePDPContextResponse
+ else if (pl_ptr.reportedEvent.event.bIdx == v_EPTF_GTP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_EPTF_GTP_inputIdx_deletePDPContextResponse)
+ {
+ f_MBT_execute(c_EPTF_GTP_stepName_handleIncomingMessage, valueof(t_addr(0)));
+
+ var integer vl_cause :=
+ oct2int(v_EPTF_GTP_lastReceived.msg.gtpc.gtpc_pdu.deletePDPContextResponse.cause.causevalue);
+
+ GN_OUT_LGEN_PCO.send(DeletePDPresponse:{vl_cause});
+ f_MBT_execute(c_EPTF_GTP_stepName_cleanUp, valueof(t_addr(0)));
+ }
+ // Incoming GTPU
+ else if (pl_ptr.reportedEvent.event.bIdx == v_EPTF_GTP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_EPTF_GTP_inputIdx_GTPU)
+ {
+ // Access and convert the payload here
+ var octetstring vl_payload := ''O;
+ var integer vl_data := 0;
+ if (f_EPTF_GTP_getUDPpayload(vl_payload))
+ {
+ vl_data := oct2int(vl_payload);
+ }
+ GN_OUT_LGEN_PCO.send(GPDU:{data := vl_data});
+ }
+ // Incmoing LANL2
+ else if (pl_ptr.reportedEvent.event.bIdx == v_EPTF_LANL2_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_EPTF_LANL2_inputIdx_incomingMessage)
+ {
+ // Access and convert the payload here
+ var octetstring vl_payload := ''O;
+ var integer vl_data := 0;
+ if (f_EPTF_LANL2_getLastUDP(f_convert_FsmAddr2TestStepArgs(valueof(t_addr(0))), vl_payload))
+ {
+ vl_data := oct2int(vl_payload);
+ }
+ GI_OUT_LGEN_PCO.send(UDPpdu:{data := vl_data});
+ }
+ else
+ {
+ f_Mapper_log(log2str(%definitionId & "(): unhandled incoming message"));
+ return false;
+ }
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+// FSM Activation
+///////////////////////////////////////////////////////////////////////////////////
+
+function f_MBT_Demo_LGen_activateEchoHandler() runs on MBT_Qtronic_Main_CT
+{
+ f_EPTF_GTP_declareEchoHandlerFsm();
+
+ var EPTF_MBT_LGen_Definitions.FsmAddr vl_addr;
+
+ f_MBT_activateFsm("MBT_EntityType", 0, "FSM_GTP_EchoHandler", vl_addr);
+
+ f_MBT_dispatch(c_EPTF_LGenBase_behavior, c_EPTF_LGenBase_inputIdx_testMgmt_startTC, vl_addr);
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+// Utility functions
+///////////////////////////////////////////////////////////////////////////////////
+
+function f_EPTF_TELNET_bindEntity4Behavior(
+ in integer pl_eIdx)
+runs on QtronicCT
+return EPTF_IntegerList
+{
+ return {pl_eIdx};
+}
+
+function f_getAPN_char2oct(in charstring p_apn)
+return octetstring
+{
+ var octetstring vl_ret := '04'O & char2oct(p_apn)
+ for (var integer i:=0; i<lengthof(vl_ret); i:=i+1){ if (vl_ret[i]=='2E'O) { vl_ret[i] := '03'O } }
+ f_Mapper_log(log2str(%definitionId, " in ", p_apn, " -> ", vl_ret));
+ return vl_ret;
+}
+
+function f_getIMSI_str2hex(in charstring p_imsi_str)
+return hexstring
+{
+ var hexstring vl_ret := f_str2tbcd(p_imsi_str);
+ f_Mapper_log(log2str(%definitionId, " in ", p_imsi_str, " -> ", vl_ret));
+ return vl_ret;
+}
+
+function f_getMSISDN_str2hex(in charstring p_imsi_str)
+return octetstring
+{
+ var octetstring vl_ret := ''O;
+ var hexstring vl_imsi := f_str2tbcd(p_imsi_str);
+ vl_imsi := substr(vl_imsi, lengthof(vl_imsi)-6, 6);
+ vl_ret := '916464'O & f_encodeTBCD_hex2oct(vl_imsi);
+
+ f_Mapper_log(log2str(%definitionId, " in ", p_imsi_str, " -> ", vl_ret));
+ return vl_ret;
+}
+
+function f_str2tbcd(in charstring p_str)
+return hexstring
+{
+ var hexstring vl_ret := ''H;
+
+ for (var integer i:=0; i<lengthof(p_str); i:=i+1)
+ {
+ vl_ret[i] := int2hex(str2int(p_str[i]),1);
+ }
+
+ return vl_ret;
+}
+
+function f_encodeTBCD_hex2oct( in hexstring pl_hex )
+return octetstring
+{
+ var integer vl_size:= lengthof(pl_hex);
+ if((vl_size mod 2) == 1)
+ {
+ pl_hex := pl_hex & 'F'H;
+ vl_size := vl_size + 1;
+ }
+ vl_size := vl_size / 2;
+
+ var integer vl_i;
+ var octetstring vl_oct := ''O;
+
+ for (vl_i := 0; vl_i < vl_size; vl_i := vl_i + 1)
+ {
+ vl_oct := vl_oct & hex2oct(pl_hex[(2*vl_i) + 1] & pl_hex[2*vl_i]);
+ }
+
+ return vl_oct;
+}
+
+template EPTF_MBT_LGen_Definitions.FsmAddr t_addr(integer eIdx) :=
+{
+ entityGroupName := "MBT_EntityType",
+ eIdx := eIdx,
+ fIdx := 0
+}
+
+}
diff --git a/demo/ggsn/MBT_Qtronic_TestHarness.ttcn b/demo/ggsn/MBT_Qtronic_TestHarness.ttcn
new file mode 100644
index 0000000..4fe49b0
--- /dev/null
+++ b/demo/ggsn/MBT_Qtronic_TestHarness.ttcn
@@ -0,0 +1,456 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_TestHarness.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+/* -*- ttcn-3 -*- */
+
+/**
+* @file
+* C:\Users\eantwuh\workspace\GGSN_Goteborg\MBT_Qtronic_TestHarness.ttcn
+* @author
+* Conformiq TTCN-3 scripting backend
+* @version
+* Tue Sep 14 14:48:48 CEST 2010
+* @desc
+* This is a template file with TTCN-3 function stubs for the implementation
+* of test harness code for the test suites generated from the Conformiq '
+* GGSN_Goteborg' project.
+* @remark
+* All function definitions must be edited as instructed in their comments in
+* order for the test suite to execute properly.
+*/
+module MBT_Qtronic_TestHarness
+{
+ import from MBT_Qtronic_Types all;
+ import from MBT_Qtronic_TestSystem all;
+ import from MBT_Qtronic_Main all;
+ import from EPTF_MBT_LGen_Definitions all;
+ import from EPTF_MBT_LGen_Functions all;
+ import from EPTF_TELNET_LGen_Definitions all;
+
+ modulepar
+ {
+ boolean tsp_enableLogging := true;
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_Restart
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_Restart Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_Restart_to_CLIin(template Restart p_Restart) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_Restart); }
+
+ // Steps that need to be implemented here are:
+ // (modify and uncomment example code as needed)
+ // 1. transform data from a Restart to the TTCN-3 data value used by the test harness (if needed)
+ // var <T3RestartType> v_T3Restart := f_transformRestartCQtoT3(p_Restart);
+ // 2. replace symbolic values (if any) with real values in TTCN-3 data value
+ // 3. send TTCN-3 data value via TTCN-3 port which corresponds toCLIinmodel port
+ // CLIin.send(v_T3Restart);
+ //CLIin.send(p_Restart);
+ // Remove or comment the following generated code
+ log("CQ_INFO: Warning: f_cq_send_Restart_to_CLIin: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_Configure
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_Configure Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_Configure_to_CLIin(template Configure p_Configure) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_Configure); }
+ // Steps that need to be implemented here are:
+ // (modify and uncomment example code as needed)
+ // 1. transform data from a Configure to the TTCN-3 data value used by the test harness (if needed)
+ // var <T3ConfigureType> v_T3Configure := f_transformConfigureCQtoT3(p_Configure);
+ // 2. replace symbolic values (if any) with real values in TTCN-3 data value
+ // 3. send TTCN-3 data value via TTCN-3 port which corresponds toCLIinmodel port
+ // CLIin.send(v_T3Configure);
+ //CLIin.send(p_Configure);
+ // Remove or comment the following generated code
+ log("CQ_INFO: Warning: f_cq_send_Configure_to_CLIin: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_OverrideConfiguration
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_OverrideConfiguration Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_OverrideConfiguration_to_CLIin(template OverrideConfiguration p_OverrideConfiguration) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_OverrideConfiguration); }
+ // Steps that need to be implemented here are:
+ // (modify and uncomment example code as needed)
+ // 1. transform data from a OverrideConfiguration to the TTCN-3 data value used by the test harness (if needed)
+ // var <T3OverrideConfigurationType> v_T3OverrideConfiguration := f_transformOverrideConfigurationCQtoT3(p_OverrideConfiguration);
+ // 2. replace symbolic values (if any) with real values in TTCN-3 data value
+ // 3. send TTCN-3 data value via TTCN-3 port which corresponds toCLIinmodel port
+ // CLIin.send(v_T3OverrideConfiguration);
+ //CLIin.send(p_OverrideConfiguration);
+ // Remove or comment the following generated code
+ log("CQ_INFO: Warning: f_cq_send_OverrideConfiguration_to_CLIin: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_Prepare
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_Prepare Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_Prepare_to_CLIin(template Prepare p_Prepare) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_Prepare); }
+
+ f_MBT_execute(c_EPTF_TELNET_stepName_init, valueof(t_addr(0)), {0});
+ f_MBT_execute(c_EPTF_TELNET_stepName_connect, valueof(t_addr(0)), {0});
+ f_MBT_waitFor(c_EPTF_TELNET_behavior, c_EPTF_TELNET_inputName_autoLoginFinished, valueof(t_addr(0)));
+
+ timer t_wait := 30.0;
+
+ f_MBT_execute(c_EPTF_TELNET_stepName_playList, valueof(t_addr(0)));
+ t_wait.start;
+
+ alt
+ {
+ [] EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := c_EPTF_TELNET_behavior, iName := c_EPTF_TELNET_inputName_matchingPlayListResp, addr := valueof(t_addr(0))})
+ {
+ t_wait.stop;
+ action(%definitionId, "Received: matchingPlayListRespReceived");
+ f_MBT_execute(c_EPTF_TELNET_stepName_playList, valueof(t_addr(0)));
+ t_wait.start;
+ repeat;
+ }
+ [] EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := c_EPTF_TELNET_behavior, iName := c_EPTF_TELNET_inputName_lastMatchingPlayListResp, addr := valueof(t_addr(0))})
+ {
+ action(%definitionId, "Received: lastMatchingPlayListRespReceived");
+ t_wait.stop;
+ }
+ [] EPTF_MBT_TESTER_PCO.receive
+ {
+ log(%definitionId, "Dropping unexpected message!");
+ repeat;
+ }
+ [] t_wait.timeout
+ {
+ action(%definitionId, "Timeout!");
+ }
+ }
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_Restore
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_Restore Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_Restore_to_CLIin(template Restore p_Restore) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_Restore); }
+ // Steps that need to be implemented here are:
+ // (modify and uncomment example code as needed)
+ // 1. transform data from a Restore to the TTCN-3 data value used by the test harness (if needed)
+ // var <T3RestoreType> v_T3Restore := f_transformRestoreCQtoT3(p_Restore);
+ // 2. replace symbolic values (if any) with real values in TTCN-3 data value
+ // 3. send TTCN-3 data value via TTCN-3 port which corresponds toCLIinmodel port
+ // CLIin.send(v_T3Restore);
+ //CLIin.send(p_Restore);
+ // Remove or comment the following generated code
+ log("CQ_INFO: Warning: f_cq_send_Restore_to_CLIin: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_UDPpdu
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_UDPpdu Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_UDPpdu_to_GiIn(template UDPpdu p_UDPpdu) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_UDPpdu); }
+ // Steps that need to be implemented here are:
+ // (modify and uncomment example code as needed)
+ // 1. transform data from a UDPpdu to the TTCN-3 data value used by the test harness (if needed)
+ // var <T3UDPpduType> v_T3UDPpdu := f_transformUDPpduCQtoT3(p_UDPpdu);
+ // 2. replace symbolic values (if any) with real values in TTCN-3 data value
+ // 3. send TTCN-3 data value via TTCN-3 port which corresponds toGiInmodel port
+ // GiIn.send(v_T3UDPpdu);
+ //GiIn.send(p_UDPpdu);
+ // Remove or comment the following generated code
+ //log("CQ_INFO: Warning: f_cq_send_UDPpdu_to_GiIn: function is not implemented)");
+ f_Model_sendUDPpdu(valueof(p_UDPpdu));
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_RadiusAccessAccept
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_RadiusAccessAccept Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_RadiusAccessAccept_to_GiRadiusIn(template RadiusAccessAccept p_RadiusAccessAccept) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_RadiusAccessAccept); }
+ // Steps that need to be implemented here are:
+ // (modify and uncomment example code as needed)
+ // 1. transform data from a RadiusAccessAccept to the TTCN-3 data value used by the test harness (if needed)
+ // var <T3RadiusAccessAcceptType> v_T3RadiusAccessAccept := f_transformRadiusAccessAcceptCQtoT3(p_RadiusAccessAccept);
+ // 2. replace symbolic values (if any) with real values in TTCN-3 data value
+ // 3. send TTCN-3 data value via TTCN-3 port which corresponds toGiRadiusInmodel port
+ // GiRadiusIn.send(v_T3RadiusAccessAccept);
+ //GiRadiusIn.send(p_RadiusAccessAccept);
+ // Remove or comment the following generated code
+ log("CQ_INFO: Warning: f_cq_send_RadiusAccessAccept_to_GiRadiusIn: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_CreatePDPcontext
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_CreatePDPcontext Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_CreatePDPcontext_to_GnIn(template CreatePDPcontext p_CreatePDPcontext) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_CreatePDPcontext); }
+ f_Model_sendCreatePDPContext(valueof(p_CreatePDPcontext));
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_UpdatePDPcontext
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_UpdatePDPcontext Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_UpdatePDPcontext_to_GnIn(template UpdatePDPcontext p_UpdatePDPcontext) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_UpdatePDPcontext); }
+ f_Model_sendUpdatePDPContext(valueof(p_UpdatePDPcontext));
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_DeletePDPcontext
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_DeletePDPcontext Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_DeletePDPcontext_to_GnIn(template DeletePDPcontext p_DeletePDPcontext) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_DeletePDPcontext); }
+ f_Model_sendDeletePDPContext(valueof(p_DeletePDPcontext));
+ }
+
+ /**
+ * @desc
+ * This function performs manipulation needed and sends a p_GPDU
+ * via the abstract test interface to the SUT.
+ * @param
+ * p_GPDU Message data generated by CQ Designerto be sent to the SUT
+ */
+ function f_cq_send_GPDU_to_GnIn(template GPDU p_GPDU) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_GPDU); }
+ // Steps that need to be implemented here are:
+ // (modify and uncomment example code as needed)
+ // 1. transform data from a GPDU to the TTCN-3 data value used by the test harness (if needed)
+ // var <T3GPDUType> v_T3GPDU := f_transformGPDUCQtoT3(p_GPDU);
+ // 2. replace symbolic values (if any) with real values in TTCN-3 data value
+ // 3. send TTCN-3 data value via TTCN-3 port which corresponds toGnInmodel port
+ // GnIn.send(v_T3GPDU);
+ //GnIn.send(p_GPDU);
+ // Remove or comment the following generated code
+ //log("CQ_INFO: Warning: f_cq_send_GPDU_to_GnIn: function is not implemented)");
+ f_Model_sendGPDU(valueof(p_GPDU));
+ }
+
+ /**
+ * @desc
+ * This function receives a TTCN-3 value corresponding to a UDPpdu
+ * via the abstract test system interface from the SUT, performs any
+ * manipulation and transformation needed to convert it to a UDPpdu
+ * value, and then attempts to match it to the p_expectedUDPpdu generated by CQ Designer
+ * @param
+ * p_expectedUDPpduExpected data generated by CQ Designer
+ */
+ function f_cq_receive_UDPpdu_from_GiOut(template UDPpdu p_expectedUDPpdu) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_expectedUDPpdu); }
+ //Steps that need to be implemented here are:
+ //1. receive and store (any) TTCN-3 data value via TTCN-3 port which corresponds to the GiOut model port
+ // var <T3_UDPpduType> v_recvT3UDPpdu;
+ // GiOut.receive(<T3_UDPpduType>:?) -> value v_recvT3UDPpdu;
+ // 2. replace real with symbolic values (if any) in the received TTCN-3 data value
+ // 3. transform data from a TTCN-3 to UDPpdu data value (if needed)
+ // varUDPpduv_recvUDPpdu = f_transformUDPpduT3toCQ(v_recvT3UDPpdu);
+ // 4. set the verdict to fail if if there is a mismatch of the transformed value and p_expectedUDPpdu
+ // if ( !match( v_recvUDPpdu p_expectedUDPpdu) {
+ // log(CQ_INFO: f_cq_receive_UDPpdu_from_GiOut: FAIL: Mismatch in received and expected UDPpdu values. Stopping test case.â?);
+ // setverdict(fail);
+ // f_cq_f_MBT_Qtronic_endTestcase();
+ // stop; }
+ GiOut.receive(p_expectedUDPpdu);
+ // Remove or comment the following generated code
+ //log("CQ_INFO: Warning: f_cq_receive_UDPpdu_from_GiOut: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function receives a TTCN-3 value corresponding to a RadiusAccessRequest
+ * via the abstract test system interface from the SUT, performs any
+ * manipulation and transformation needed to convert it to a RadiusAccessRequest
+ * value, and then attempts to match it to the p_expectedRadiusAccessRequest generated by CQ Designer
+ * @param
+ * p_expectedRadiusAccessRequestExpected data generated by CQ Designer
+ */
+ function f_cq_receive_RadiusAccessRequest_from_GiRadiusOut(template RadiusAccessRequest p_expectedRadiusAccessRequest) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_expectedRadiusAccessRequest); }
+ //Steps that need to be implemented here are:
+ //1. receive and store (any) TTCN-3 data value via TTCN-3 port which corresponds to the GiRadiusOut model port
+ // var <T3_RadiusAccessRequestType> v_recvT3RadiusAccessRequest;
+ // GiRadiusOut.receive(<T3_RadiusAccessRequestType>:?) -> value v_recvT3RadiusAccessRequest;
+ // 2. replace real with symbolic values (if any) in the received TTCN-3 data value
+ // 3. transform data from a TTCN-3 to RadiusAccessRequest data value (if needed)
+ // varRadiusAccessRequestv_recvRadiusAccessRequest = f_transformRadiusAccessRequestT3toCQ(v_recvT3RadiusAccessRequest);
+ // 4. set the verdict to fail if if there is a mismatch of the transformed value and p_expectedRadiusAccessRequest
+ // if ( !match( v_recvRadiusAccessRequest p_expectedRadiusAccessRequest) {
+ // log(CQ_INFO: f_cq_receive_RadiusAccessRequest_from_GiRadiusOut: FAIL: Mismatch in received and expected RadiusAccessRequest values. Stopping test case.â?);
+ // setverdict(fail);
+ // f_cq_f_MBT_Qtronic_endTestcase();
+ // stop; }
+ //GiRadiusOut.receive(p_expectedRadiusAccessRequest);
+ // Remove or comment the following generated code
+ log("CQ_INFO: Warning: f_cq_receive_RadiusAccessRequest_from_GiRadiusOut: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function receives a TTCN-3 value corresponding to a CreatePDPresponse
+ * via the abstract test system interface from the SUT, performs any
+ * manipulation and transformation needed to convert it to a CreatePDPresponse
+ * value, and then attempts to match it to the p_expectedCreatePDPresponse generated by CQ Designer
+ * @param
+ * p_expectedCreatePDPresponseExpected data generated by CQ Designer
+ */
+ function f_cq_receive_CreatePDPresponse_from_GnOut(template CreatePDPresponse p_expectedCreatePDPresponse) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_expectedCreatePDPresponse); }
+ GnOut.receive(p_expectedCreatePDPresponse);
+ }
+
+ /**
+ * @desc
+ * This function receives a TTCN-3 value corresponding to a UpdatePDPresponse
+ * via the abstract test system interface from the SUT, performs any
+ * manipulation and transformation needed to convert it to a UpdatePDPresponse
+ * value, and then attempts to match it to the p_expectedUpdatePDPresponse generated by CQ Designer
+ * @param
+ * p_expectedUpdatePDPresponseExpected data generated by CQ Designer
+ */
+ function f_cq_receive_UpdatePDPresponse_from_GnOut(template UpdatePDPresponse p_expectedUpdatePDPresponse) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_expectedUpdatePDPresponse); }
+ GnOut.receive(p_expectedUpdatePDPresponse);
+ }
+
+ /**
+ * @desc
+ * This function receives a TTCN-3 value corresponding to a DeletePDPresponse
+ * via the abstract test system interface from the SUT, performs any
+ * manipulation and transformation needed to convert it to a DeletePDPresponse
+ * value, and then attempts to match it to the p_expectedDeletePDPresponse generated by CQ Designer
+ * @param
+ * p_expectedDeletePDPresponseExpected data generated by CQ Designer
+ */
+ function f_cq_receive_DeletePDPresponse_from_GnOut(template DeletePDPresponse p_expectedDeletePDPresponse) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_expectedDeletePDPresponse); }
+ GnOut.receive(p_expectedDeletePDPresponse);
+ }
+
+ /**
+ * @desc
+ * This function receives a TTCN-3 value corresponding to a GPDU
+ * via the abstract test system interface from the SUT, performs any
+ * manipulation and transformation needed to convert it to a GPDU
+ * value, and then attempts to match it to the p_expectedGPDU generated by CQ Designer
+ * @param
+ * p_expectedGPDUExpected data generated by CQ Designer
+ */
+ function f_cq_receive_GPDU_from_GnOut(template GPDU p_expectedGPDU) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_expectedGPDU); }
+ //Steps that need to be implemented here are:
+ //1. receive and store (any) TTCN-3 data value via TTCN-3 port which corresponds to the GnOut model port
+ // var <T3_GPDUType> v_recvT3GPDU;
+ // GnOut.receive(<T3_GPDUType>:?) -> value v_recvT3GPDU;
+ // 2. replace real with symbolic values (if any) in the received TTCN-3 data value
+ // 3. transform data from a TTCN-3 to GPDU data value (if needed)
+ // varGPDUv_recvGPDU = f_transformGPDUT3toCQ(v_recvT3GPDU);
+ // 4. set the verdict to fail if if there is a mismatch of the transformed value and p_expectedGPDU
+ // if ( !match( v_recvGPDU p_expectedGPDU) {
+ // log(CQ_INFO: f_cq_receive_GPDU_from_GnOut: FAIL: Mismatch in received and expected GPDU values. Stopping test case.â?);
+ // setverdict(fail);
+ // f_cq_f_MBT_Qtronic_endTestcase();
+ // stop; }
+
+ GnOut.receive(p_expectedGPDU);
+ // Remove or comment the following generated code
+ //log("CQ_INFO: Warning: f_cq_receive_GPDU_from_GnOut: function is not implemented)");
+ }
+
+ /**
+ * @desc
+ * This function receives a TTCN-3 value corresponding to a CDRinfo
+ * via the abstract test system interface from the SUT, performs any
+ * manipulation and transformation needed to convert it to a CDRinfo
+ * value, and then attempts to match it to the p_expectedCDRinfo generated by CQ Designer
+ * @param
+ * p_expectedCDRinfoExpected data generated by CQ Designer
+ */
+ function f_cq_receive_CDRinfo_from_GnOut(template CDRinfo p_expectedCDRinfo) runs on QtronicCT
+ {
+ if (tsp_enableLogging) { log(%definitionId, " enter: ", p_expectedCDRinfo); }
+ //Steps that need to be implemented here are:
+ //1. receive and store (any) TTCN-3 data value via TTCN-3 port which corresponds to the GnOut model port
+ // var <T3_CDRinfoType> v_recvT3CDRinfo;
+ // GnOut.receive(<T3_CDRinfoType>:?) -> value v_recvT3CDRinfo;
+ // 2. replace real with symbolic values (if any) in the received TTCN-3 data value
+ // 3. transform data from a TTCN-3 to CDRinfo data value (if needed)
+ // varCDRinfov_recvCDRinfo = f_transformCDRinfoT3toCQ(v_recvT3CDRinfo);
+ // 4. set the verdict to fail if if there is a mismatch of the transformed value and p_expectedCDRinfo
+ // if ( !match( v_recvCDRinfo p_expectedCDRinfo) {
+ // log(CQ_INFO: f_cq_receive_CDRinfo_from_GnOut: FAIL: Mismatch in received and expected CDRinfo values. Stopping test case.â?);
+ // setverdict(fail);
+ // f_cq_f_MBT_Qtronic_endTestcase();
+ // stop; }
+ //GnOut.receive(p_expectedCDRinfo);
+ // Remove or comment the following generated code
+ log("CQ_INFO: Warning: f_cq_receive_CDRinfo_from_GnOut: function is not implemented)");
+ }
+}
diff --git a/demo/ggsn/MBT_Qtronic_TestSystem.ttcn b/demo/ggsn/MBT_Qtronic_TestSystem.ttcn
new file mode 100644
index 0000000..f64069f
--- /dev/null
+++ b/demo/ggsn/MBT_Qtronic_TestSystem.ttcn
@@ -0,0 +1,92 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_TestSystem.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+/* -*- ttcn-3 -*- */
+
+/**
+* @file
+* C:\Users\eantwuh\workspace\GGSN_Goteborg\MBT_Qtronic_Types.ttcn
+* @author
+* Conformiq TTCN-3 scripting backend
+* @version
+* Wed Sep 29 11:27:25 CEST 2010
+* @desc
+* This file contains port type definitions and test component generated by Conformiq
+* with 'DC 1' design configuration for 'GGSN_Goteborg' project.
+* @remark
+* WARNING! This file has been automatically generated using the
+* Conformiq TTCN-3 scripting backend. DO NOT EDIT.
+*/
+module MBT_Qtronic_TestSystem
+{
+ import from MBT_Qtronic_Types all; import from MBT_Qtronic_Main all;
+
+ type port CLIinPort message
+ {
+ inout Restart;
+ inout Configure;
+ inout OverrideConfiguration;
+ inout Prepare;
+ inout Restore;
+ } with {extension "internal"}
+ type port GiInPort message
+ {
+ inout UDPpdu;
+ } with {extension "internal"}
+ type port GiRadiusInPort message
+ {
+ inout RadiusAccessAccept;
+ } with {extension "internal"}
+ type port GnInPort message
+ {
+ inout CreatePDPcontext;
+ inout UpdatePDPcontext;
+ inout DeletePDPcontext;
+ inout GPDU;
+ } with {extension "internal"}
+ type port GiOutPort message
+ {
+ inout UDPpdu;
+ } with {extension "internal"}
+ type port GiRadiusOutPort message
+ {
+ inout RadiusAccessRequest;
+ } with {extension "internal"}
+ type port GnOutPort message
+ {
+ inout CreatePDPresponse;
+ inout UpdatePDPresponse;
+ inout DeletePDPresponse;
+ inout GPDU;
+ inout CDRinfo;
+ } with {extension "internal"}
+
+ /**
+ * @desc
+ * The test component (MTC) on which all generated test cases run on
+ */
+ type component QtronicCT extends MBT_Qtronic_Main_CT
+ {
+ port CLIinPort CLIin;
+ port GiInPort GiIn;
+ port GiRadiusInPort GiRadiusIn;
+ port GnInPort GnIn;
+ port GiOutPort GiOut;
+ port GiRadiusOutPort GiRadiusOut;
+ port GnOutPort GnOut;
+ timer t_cq_timer := 0.0;
+ }
+}
diff --git a/demo/ggsn/MBT_Qtronic_Testcases.ttcn b/demo/ggsn/MBT_Qtronic_Testcases.ttcn
new file mode 100644
index 0000000..9c79fd1
--- /dev/null
+++ b/demo/ggsn/MBT_Qtronic_Testcases.ttcn
@@ -0,0 +1,1282 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Testcases.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+/* -*- ttcn-3 -*- */
+
+/**
+* @file
+* C:\Users\eantwuh\workspace\GGSN_Goteborg\MBT_Qtronic_Testcases.ttcn
+* @author
+* Conformiq TTCN-3 scripting backend
+* @version
+* Wed Sep 29 11:27:25 CEST 2010
+* @desc
+* This file contains all test cases generated from the Conformiq 'GGSN_Goteborg' project
+* with 'DC 1' design configuration.
+* @remark
+* WARNING! This file has been automatically generated using the
+* Conformiq TTCN-3 scripting backend. DO NOT EDIT.
+*/
+module MBT_Qtronic_Testcases
+{
+ import from MBT_Qtronic_TestSystem all;
+ import from MBT_Qtronic_Types all;
+ /* Customized imports begin */
+ import from MBT_Qtronic_TestHarness all; import from MBT_Qtronic_Main all; import from EPTF_MBT_LGen_Definitions all;
+ /* Customized imports end */
+
+ modulepar float mp_max_response_time := 10.0;
+
+ /***** Logging verbosity flags *****/
+ /**
+ * @desc
+ * When this module parameter value is set to true all requirements
+ * targeted in each test case will be logged.
+ * The default value of this module parameter is true.
+ */
+ modulepar boolean mp_log_targeted_requirements := true;
+
+ /**
+ * @desc
+ * Generated test case #1
+ */
+ testcase tc_Test_Case_1()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_1'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_1: Step 1");
+ f_cq_send_Prepare_to_CLIin(m_PrepareTemplate1);
+ f_cq_log_target("Covered requirement: PrepareRestore/Prepare", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_1");
+ }
+ /***** Template definitions generated for tc_Test_Case_1*****/
+ template Prepare m_PrepareTemplate1 :=
+ {
+ cmds := {
+ "f_TELNET_Init",
+ "f_sr_TELNET_OverrideConfiguration"
+ }
+ }
+
+ /**
+ * @desc
+ * Generated test case #2
+ */
+ testcase tc_Test_Case_2()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_2'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_2: Step 1");
+ f_cq_send_Restore_to_CLIin(m_RestoreTemplate2);
+ f_cq_log_target("Covered requirement: PrepareRestore/Restore", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_2");
+ }
+ /***** Template definitions generated for tc_Test_Case_2*****/
+ template Restore m_RestoreTemplate2 :=
+ {
+ cmds := {
+ "f_TELNET_Init",
+ "f_sr_TELNET_OverrideConfiguration"
+ }
+ }
+
+ /**
+ * @desc
+ * Generated test case #3
+ */
+ testcase tc_Test_Case_3()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_3'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_3: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate3);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_3: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate4);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_3: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate5);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_3: Step 4");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_UDPpdu_to_GiIn(m_UDPpduTemplate6);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_3: Step 5");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_GPDU_from_GnOut(m_expectedGPDUTemplate7);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_3: Step 6");
+ f_cq_log_target("Covered requirement: Payload/Forward downlink", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate8);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_3: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate9);
+ t_cq_timer.stop;
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Configuration/Groups/Default - no options", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_3");
+ }
+ /***** Template definitions generated for tc_Test_Case_3*****/
+ template Configure m_ConfigureTemplate3 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := false,
+ enableRadiusAuth := false
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate4 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate5 :=
+ {
+ causevalue := 128
+ }
+
+ template UDPpdu m_UDPpduTemplate6 :=
+ {
+ data := 0
+ }
+
+ template GPDU m_expectedGPDUTemplate7 :=
+ {
+ data := 0
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate8 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate9 :=
+ {
+ causevalue := 128
+ }
+
+ /**
+ * @desc
+ * Generated test case #4
+ */
+ testcase tc_Test_Case_4()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_4'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate10);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate11);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate12);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 4");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate13);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 5");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate14);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 6");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_UDPpdu_to_GiIn(m_UDPpduTemplate15);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_GPDU_from_GnOut(m_expectedGPDUTemplate16);
+ t_cq_timer.stop;
+
+ /***** Step 8; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 8");
+ f_cq_log_target("Covered requirement: Payload/Forward downlink", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate17);
+
+ /***** Step 9; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_4: Step 9");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate18);
+ t_cq_timer.stop;
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Payload/Bidirectional payload", e_requirement);
+ f_cq_log_target("Covered requirement: Configuration/Groups/Default - no options", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_4");
+ }
+ /***** Template definitions generated for tc_Test_Case_4*****/
+ template Configure m_ConfigureTemplate10 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := false,
+ enableRadiusAuth := false
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate11 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate12 :=
+ {
+ causevalue := 128
+ }
+
+ template GPDU m_GPDUTemplate13 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate14 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_UDPpduTemplate15 :=
+ {
+ data := 0
+ }
+
+ template GPDU m_expectedGPDUTemplate16 :=
+ {
+ data := 0
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate17 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate18 :=
+ {
+ causevalue := 128
+ }
+
+ /**
+ * @desc
+ * Generated test case #5
+ */
+ testcase tc_Test_Case_5()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_5'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate19);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate20);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate21);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 4");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate22);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 5");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate23);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 6");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_UpdatePDPcontext_to_GnIn(m_UpdatePDPcontextTemplate24);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UpdatePDPresponse_from_GnOut(m_expectedUpdatePDPresponseTemplate25);
+ t_cq_timer.stop;
+
+ /***** Step 8; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 8");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful update", e_requirement);
+ f_cq_log_target("Covered requirement: PDP context/Update/After data transfer", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate26);
+
+ /***** Step 9; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_5: Step 9");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate27);
+ t_cq_timer.stop;
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Configuration/Groups/Default - no options", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_5");
+ }
+ /***** Template definitions generated for tc_Test_Case_5*****/
+ template Configure m_ConfigureTemplate19 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := false,
+ enableRadiusAuth := false
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate20 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate21 :=
+ {
+ causevalue := 128
+ }
+
+ template GPDU m_GPDUTemplate22 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate23 :=
+ {
+ data := 0
+ }
+
+ template UpdatePDPcontext m_UpdatePDPcontextTemplate24 :=
+ {
+ nsapi := 5
+ }
+
+ template UpdatePDPresponse m_expectedUpdatePDPresponseTemplate25 :=
+ {
+ causevalue := 128
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate26 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate27 :=
+ {
+ causevalue := 128
+ }
+
+ /**
+ * @desc
+ * Generated test case #6
+ */
+ testcase tc_Test_Case_6()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_6'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate28);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate29);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate30);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 4");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_UpdatePDPcontext_to_GnIn(m_UpdatePDPcontextTemplate31);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 5");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UpdatePDPresponse_from_GnOut(m_expectedUpdatePDPresponseTemplate32);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 6");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful update", e_requirement);
+ f_cq_log_target("Covered requirement: PDP context/Update/Before data transfer", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate33);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate34);
+ t_cq_timer.stop;
+
+ /***** Step 8; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 8");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate35);
+
+ /***** Step 9; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_6: Step 9");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate36);
+ t_cq_timer.stop;
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Configuration/Groups/Default - no options", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_6");
+ }
+ /***** Template definitions generated for tc_Test_Case_6*****/
+ template Configure m_ConfigureTemplate28 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := false,
+ enableRadiusAuth := false
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate29 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate30 :=
+ {
+ causevalue := 128
+ }
+
+ template UpdatePDPcontext m_UpdatePDPcontextTemplate31 :=
+ {
+ nsapi := 5
+ }
+
+ template UpdatePDPresponse m_expectedUpdatePDPresponseTemplate32 :=
+ {
+ causevalue := 128
+ }
+
+ template GPDU m_GPDUTemplate33 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate34 :=
+ {
+ data := 0
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate35 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate36 :=
+ {
+ causevalue := 128
+ }
+
+ /**
+ * @desc
+ * Generated test case #7
+ */
+ testcase tc_Test_Case_7()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_7'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate37);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate38);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate39);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 4");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate40);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 5");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate41);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 6");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate42);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate43);
+ t_cq_timer.stop;
+
+ /***** Step 8; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 8");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Charging/Single data", e_requirement);
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CDRinfo_from_GnOut(m_expectedCDRinfoTemplate44);
+ t_cq_timer.stop;
+
+ /***** Step 9; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_7: Step 9");
+ f_cq_log_target("Covered requirement: Configuration/Groups/Only Charging", e_requirement);
+ f_cq_send_OverrideConfiguration_to_CLIin(m_OverrideConfigurationTemplate45);
+ f_cq_log_target("Covered requirement: Configuration/Clean up if configuration changed", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_7");
+ }
+ /***** Template definitions generated for tc_Test_Case_7*****/
+ template Configure m_ConfigureTemplate37 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := true,
+ enableRadiusAuth := false
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate38 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate39 :=
+ {
+ causevalue := 128
+ }
+
+ template GPDU m_GPDUTemplate40 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate41 :=
+ {
+ data := 0
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate42 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate43 :=
+ {
+ causevalue := 128
+ }
+
+ template CDRinfo m_expectedCDRinfoTemplate44 :=
+ {
+ data := 1
+ }
+
+ template OverrideConfiguration m_OverrideConfigurationTemplate45 :=
+ {
+ overrideCharging := true,
+ overrideRadiusAuth := false
+ }
+
+ /**
+ * @desc
+ * Generated test case #8
+ */
+ testcase tc_Test_Case_8()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_8'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate46);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate47);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_RadiusAccessRequest_from_GiRadiusOut(m_expectedRadiusAccessRequestTemplate48);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 4");
+ f_cq_log_target("Covered requirement: Radius/Authentication/Send Access Request", e_requirement);
+ f_cq_send_RadiusAccessAccept_to_GiRadiusIn(m_RadiusAccessAcceptTemplate49);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 5");
+ f_cq_log_target("Covered requirement: Radius/Authentication/Wait for Access Accept", e_requirement);
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate50);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 6");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate51);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate52);
+ t_cq_timer.stop;
+
+ /***** Step 8; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 8");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate53);
+
+ /***** Step 9; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 9");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate54);
+ t_cq_timer.stop;
+
+ /***** Step 10; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_8: Step 10");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Configuration/Groups/Only Radius Auth", e_requirement);
+ f_cq_send_OverrideConfiguration_to_CLIin(m_OverrideConfigurationTemplate55);
+ f_cq_log_target("Covered requirement: Configuration/Clean up if configuration changed", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_8");
+ }
+ /***** Template definitions generated for tc_Test_Case_8*****/
+ template Configure m_ConfigureTemplate46 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := false,
+ enableRadiusAuth := true
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate47 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template RadiusAccessRequest m_expectedRadiusAccessRequestTemplate48 :=
+ {
+
+ }
+
+ template RadiusAccessAccept m_RadiusAccessAcceptTemplate49 :=
+ {
+
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate50 :=
+ {
+ causevalue := 128
+ }
+
+ template GPDU m_GPDUTemplate51 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate52 :=
+ {
+ data := 0
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate53 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate54 :=
+ {
+ causevalue := 128
+ }
+
+ template OverrideConfiguration m_OverrideConfigurationTemplate55 :=
+ {
+ overrideCharging := false,
+ overrideRadiusAuth := true
+ }
+
+ /**
+ * @desc
+ * Generated test case #9
+ */
+ testcase tc_Test_Case_9()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_9'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate56);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate57);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_RadiusAccessRequest_from_GiRadiusOut(m_expectedRadiusAccessRequestTemplate58);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 4");
+ f_cq_log_target("Covered requirement: Radius/Authentication/Send Access Request", e_requirement);
+ f_cq_send_RadiusAccessAccept_to_GiRadiusIn(m_RadiusAccessAcceptTemplate59);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 5");
+ f_cq_log_target("Covered requirement: Radius/Authentication/Wait for Access Accept", e_requirement);
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate60);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 6");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate61);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate62);
+ t_cq_timer.stop;
+
+ /***** Step 8; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 8");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate63);
+
+ /***** Step 9; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 9");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate64);
+ t_cq_timer.stop;
+
+ /***** Step 10; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 10");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Charging/Single data", e_requirement);
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CDRinfo_from_GnOut(m_expectedCDRinfoTemplate65);
+ t_cq_timer.stop;
+
+ /***** Step 11; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_9: Step 11");
+ f_cq_log_target("Covered requirement: Configuration/Groups/Both Charging and Radius Auth", e_requirement);
+ f_cq_send_OverrideConfiguration_to_CLIin(m_OverrideConfigurationTemplate66);
+ f_cq_log_target("Covered requirement: Configuration/Clean up if configuration changed", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_9");
+ }
+ /***** Template definitions generated for tc_Test_Case_9*****/
+ template Configure m_ConfigureTemplate56 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := true,
+ enableRadiusAuth := true
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate57 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template RadiusAccessRequest m_expectedRadiusAccessRequestTemplate58 :=
+ {
+
+ }
+
+ template RadiusAccessAccept m_RadiusAccessAcceptTemplate59 :=
+ {
+
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate60 :=
+ {
+ causevalue := 128
+ }
+
+ template GPDU m_GPDUTemplate61 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate62 :=
+ {
+ data := 0
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate63 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate64 :=
+ {
+ causevalue := 128
+ }
+
+ template CDRinfo m_expectedCDRinfoTemplate65 :=
+ {
+ data := 1
+ }
+
+ template OverrideConfiguration m_OverrideConfigurationTemplate66 :=
+ {
+ overrideCharging := true,
+ overrideRadiusAuth := true
+ }
+
+ /**
+ * @desc
+ * Generated test case #10
+ */
+ testcase tc_Test_Case_10()
+ runs on QtronicCT
+ {
+ log("CQ_DEBUG: Starting execution of test case: 'tc_Test_Case_10'");
+ var float v_last_wait_timeout := 0.0;
+ var default v_cq_default;
+
+ /***** set up test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_beginTestcase();
+ // default handles waiting beyond maximum response time and reception of any
+ // other than the expected message with setting a fail verdict and stopping the test
+ v_cq_default := activate(a_cq_default());
+
+ /***** Step 1; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 1");
+ f_cq_send_Configure_to_CLIin(m_ConfigureTemplate67);
+
+ /***** Step 2; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 2");
+ f_cq_send_CreatePDPcontext_to_GnIn(m_CreatePDPcontextTemplate68);
+
+ /***** Step 3; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 3");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CreatePDPresponse_from_GnOut(m_expectedCreatePDPresponseTemplate69);
+ t_cq_timer.stop;
+
+ /***** Step 4; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 4");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful creation", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate70);
+
+ /***** Step 5; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 5");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate71);
+ t_cq_timer.stop;
+
+ /***** Step 6; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 6");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_GPDU_to_GnIn(m_GPDUTemplate72);
+
+ /***** Step 7; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 7");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_UDPpdu_from_GiOut(m_expectedUDPpduTemplate73);
+ t_cq_timer.stop;
+
+ /***** Step 8; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 8");
+ f_cq_log_target("Covered requirement: Payload/Forward uplink", e_requirement);
+ f_cq_send_DeletePDPcontext_to_GnIn(m_DeletePDPcontextTemplate74);
+
+ /***** Step 9; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 9");
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_DeletePDPresponse_from_GnOut(m_expectedDeletePDPresponseTemplate75);
+ t_cq_timer.stop;
+
+ /***** Step 10; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 10");
+ f_cq_log_target("Covered requirement: PDP context/Confirm successful deletion", e_requirement);
+ f_cq_log_target("Covered requirement: Charging/Multiple data", e_requirement);
+ t_cq_timer.start(mp_max_response_time);
+ // Note: In below receive v_cq_default() is active!
+ f_cq_receive_CDRinfo_from_GnOut(m_expectedCDRinfoTemplate76);
+ t_cq_timer.stop;
+
+ /***** Step 11; t = 0.0 *****/
+ log("CQ_DEBUG: tc_Test_Case_10: Step 11");
+ f_cq_log_target("Covered requirement: Configuration/Groups/Only Charging", e_requirement);
+ f_cq_send_OverrideConfiguration_to_CLIin(m_OverrideConfigurationTemplate77);
+ f_cq_log_target("Covered requirement: Configuration/Clean up if configuration changed", e_requirement);
+
+ setverdict(pass);
+ deactivate(v_cq_default);
+
+ /***** tear down test configuration, TTCN-3 harness, and adapter *****/
+ f_cq_endTestcase();
+
+ log("CQ_DEBUG: Ending execution of tc_Test_Case_10");
+ }
+ /***** Template definitions generated for tc_Test_Case_10*****/
+ template Configure m_ConfigureTemplate67 :=
+ {
+ cmds := {
+ "DEFAULT_CONFIG"
+ },
+ enableCharging := true,
+ enableRadiusAuth := false
+ }
+
+ template CreatePDPcontext m_CreatePDPcontextTemplate68 :=
+ {
+ imsi := "240001111231411",
+ nsapi := 5,
+ apn := "apn1.com"
+ }
+
+ template CreatePDPresponse m_expectedCreatePDPresponseTemplate69 :=
+ {
+ causevalue := 128
+ }
+
+ template GPDU m_GPDUTemplate70 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate71 :=
+ {
+ data := 0
+ }
+
+ template GPDU m_GPDUTemplate72 :=
+ {
+ data := 0
+ }
+
+ template UDPpdu m_expectedUDPpduTemplate73 :=
+ {
+ data := 0
+ }
+
+ template DeletePDPcontext m_DeletePDPcontextTemplate74 :=
+ {
+ nsapi := 5
+ }
+
+ template DeletePDPresponse m_expectedDeletePDPresponseTemplate75 :=
+ {
+ causevalue := 128
+ }
+
+ template CDRinfo m_expectedCDRinfoTemplate76 :=
+ {
+ data := 2
+ }
+
+ template OverrideConfiguration m_OverrideConfigurationTemplate77 :=
+ {
+ overrideCharging := true,
+ overrideRadiusAuth := false
+ }
+
+
+ /**
+ * @desc
+ * This altstep handles terminating after waiting up to
+ * the maximum response time and receiving any other
+ * than the expected message with setting a fail
+ * verdict and stopping the test
+ */
+ altstep a_cq_default() runs on QtronicCT
+ {
+ [] t_cq_timer.timeout
+ {
+ setverdict(fail);
+ log("CQ_DEBUG: a_cq_default(): FAIL: Stopping test case after time out of timer: t_cq_timer!");
+ f_cq_endTestcase();
+ stop;
+ }
+ }
+ /**
+ * @desc
+ * This function blocks the execution for the specified time
+ * @param
+ * p_duration The specified time in seconds
+ */
+ function f_cq_sleep(float p_duration)
+ {
+ timer t;
+ t.start(p_duration);
+ t.timeout; // Note that any active default behavior may interrupt this waiting!
+ }
+
+ type enumerated target_type
+ {
+ e_requirement
+ }
+
+ /**
+ * @desc
+ * This function logs target description if the module parameter
+ * related to the target type is set to true.
+ * Module parameters and target type dependencies are as follows:
+ * mp_log_targeted_requirements controls logging of targets type e_requirement
+ * @param
+ * p_description The textual target description to be logged
+ * @param
+ * p_target_type The type of target covered by a test
+ */
+ function f_cq_log_target (charstring p_description, target_type p_target_type) runs on QtronicCT
+ {
+ if ((p_target_type == e_requirement) and mp_log_targeted_requirements)
+ {
+ log("CQ_INFO: " & p_description);
+ }
+ }
+ control
+ {
+ execute(tc_Test_Case_1());
+ execute(tc_Test_Case_2());
+ execute(tc_Test_Case_3());
+ execute(tc_Test_Case_4());
+ execute(tc_Test_Case_5());
+ execute(tc_Test_Case_6());
+ execute(tc_Test_Case_7());
+ execute(tc_Test_Case_8());
+ execute(tc_Test_Case_9());
+ execute(tc_Test_Case_10());
+ }
+
+}
diff --git a/demo/ggsn/MBT_Qtronic_Types.ttcn b/demo/ggsn/MBT_Qtronic_Types.ttcn
new file mode 100644
index 0000000..2ec8b61
--- /dev/null
+++ b/demo/ggsn/MBT_Qtronic_Types.ttcn
@@ -0,0 +1,105 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Types.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+/* -*- ttcn-3 -*- */
+
+/**
+* @file
+* C:\Users\eantwuh\workspace\GGSN_Goteborg\MBT_Qtronic_Types.ttcn
+* @author
+* Conformiq TTCN-3 scripting backend
+* @version
+* Wed Sep 29 11:27:25 CEST 2010
+* @desc
+* This file contains all data type definitions exported from the Conformiq GGSN_Goteborg' project.
+* with 'DC 1' design configuration.'
+* @remark
+* WARNING! This file has been automatically generated using the
+* Conformiq TTCN-3 scripting backend. DO NOT EDIT.
+*/
+module MBT_Qtronic_Types
+{
+ type record Restart
+ {
+
+ }
+ type record Configure
+ {
+ charstringArray cmds,
+ boolean enableCharging,
+ boolean enableRadiusAuth
+ }
+ type record OverrideConfiguration
+ {
+ boolean overrideCharging,
+ boolean overrideRadiusAuth
+ }
+ type record Prepare
+ {
+ charstringArray cmds
+ }
+ type record Restore
+ {
+ charstringArray cmds
+ }
+ type record UDPpdu
+ {
+ integer data
+ }
+ type record RadiusAccessAccept
+ {
+
+ }
+ type record CreatePDPcontext
+ {
+ charstring imsi,
+ integer nsapi,
+ charstring apn
+ }
+ type record UpdatePDPcontext
+ {
+ integer nsapi
+ }
+ type record DeletePDPcontext
+ {
+ integer nsapi
+ }
+ type record GPDU
+ {
+ integer data
+ }
+ type record RadiusAccessRequest
+ {
+
+ }
+ type record CreatePDPresponse
+ {
+ integer causevalue
+ }
+ type record UpdatePDPresponse
+ {
+ integer causevalue
+ }
+ type record DeletePDPresponse
+ {
+ integer causevalue
+ }
+ type record CDRinfo
+ {
+ integer data
+ }
+ type record of charstring charstringArray;
+}
diff --git a/demo/ggsn/makefile_patch.sh b/demo/ggsn/makefile_patch.sh
new file mode 100755
index 0000000..51e24e4
--- /dev/null
+++ b/demo/ggsn/makefile_patch.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+sed -e '
+s/OPENSSL_DIR =/#OPENSSL_DIR =/g
+
+s/CPPFLAGS = .*/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I$(OPENSSL_DIR)\/include -DNO_IPV6/g
+
+s/SOLARIS8_LIBS = -lsocket -lnsl/SOLARIS8_LIBS = -lpcap -lsocket -lnsl -lresolv/g
+
+s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lxml2 -lpcap/g
+
+s/COMPILER_FLAGS = -L/COMPILER_FLAGS = -L -w/g
+' <$1 >$2
+
+
diff --git a/demo/ggsn/model/CDRrecords.java b/demo/ggsn/model/CDRrecords.java
new file mode 100644
index 0000000..61094c1
--- /dev/null
+++ b/demo/ggsn/model/CDRrecords.java
@@ -0,0 +1,9 @@
+/**
+ * CDRrecords.java
+ *
+ * CDR (charging date) related records
+ */
+
+record CDRinfo {
+ int data;
+}
diff --git a/demo/ggsn/model/CLIrecords.java b/demo/ggsn/model/CLIrecords.java
new file mode 100644
index 0000000..35c157f
--- /dev/null
+++ b/demo/ggsn/model/CLIrecords.java
@@ -0,0 +1,59 @@
+/**
+ * CLIrecords.java
+ *
+ * Ericsson CLI interface records/messages
+ */
+
+// Restart - restart node, for instance after changing
+// the node configuraion
+record Restart { }
+
+record Prepare {
+ String[] cmds;
+}
+
+record Restore {
+ String[] cmds;
+}
+
+/**
+ * Configuration
+ *
+ * Sample GGSN configuration from test_basic.ttcn :
+ *
+ f_sr_TELNET_Configuration(
+ { "set services ggsn charging charging-format 6",
+ "set services ggsn charging cdr-attribute record-extension",
+ "set services ggsn charging characteristics profile8 transfer-type gtp-prime",
+ "set services ggsn charging characteristics profile8 gtp-prime gateway " & tsp_CGF_IpAddr,
+ "set services ggsn charging characteristics profile8 change-limit 1",
+ "set services ggsn charging characteristics default profile8"
+ });
+ *
+ * 4th command above relies on an IP address taken from TTCN configuration item "tsp_CGF_IpAddr"
+ * For the pilot we define all configuration commands at the harness level.
+ * Only use "configuration identifiers" at model level, for instance "DEFAULT_CONFIG"??
+ *
+ * It would be possible to define (alternative) configuration at the model level,
+ * and still apply variable substitution on the TTCN level.
+**/
+
+record Configure {
+ String[] cmds;
+
+ // 100222: Feature based configuration
+ // On the model level we only take care that certain things assume the
+ // node is configured in a certain way. For instance, the part of the
+ // model describing how a CDR is sent out can only be done if the node
+ // has been set up with charging enabled;
+
+ boolean enableCharging;
+ boolean enableRadiusAuth;
+}
+
+record OverrideConfiguration {
+ // If we want to tailor the cleanup we can add data items
+ // here to control the cleanup.
+ boolean overrideCharging;
+ boolean overrideRadiusAuth;
+}
diff --git a/demo/ggsn/model/GGSN.java b/demo/ggsn/model/GGSN.java
new file mode 100644
index 0000000..ac20fd4
--- /dev/null
+++ b/demo/ggsn/model/GGSN.java
@@ -0,0 +1,169 @@
+/**
+ * GGSN.java
+ *
+ * Core logic of GGSN
+ **/
+
+class PDPcontext {
+ public int nsapi;
+ public String imsi;
+ //public int uplinkDataTeid;
+ //public int downlinkDataTeid;
+}
+
+class GGSN extends StateMachine
+{
+ private Charging charging;
+ private CLI cli;
+ private NodeConfiguration nodeConfiguration;
+ private int uplinkData;
+ private int downlinkData;
+ private PDPcontext pdpContext;
+
+ public GGSN(Charging charging, CLI cli, NodeConfiguration nodeConfiguration)
+ {
+ this.charging = charging;
+ this.cli = cli;
+ this.nodeConfiguration = nodeConfiguration;
+ uplinkData = 0;
+ downlinkData = 0;
+
+ // NB: In our simplified view (for now) we only handle a single context,
+ // but the model can be easily enhanced to handle multiple contexts.
+ pdpContext = new PDPcontext();
+ }
+
+ private void createPDPcontext(CreatePDPcontext request)
+ {
+ // Control incoming data values - Qtronic specific to
+ // control test data generated for test suite.
+
+ /**
+ * Snippet of how it may look with a more or less
+ * one-to-one mapping between model and GTPC data:
+ require request.imsi_digits != null;
+ require request.imsi_digits.length == IMSI_OCTETS;
+ for (int i = 0; i < request.imsi_digits.length; i++)
+ require request.imsi_digits[i] == imsi1[i];
+
+ require request.teidDataI != null;
+ require request.teidDataI.length == TEID_OCTETS;
+ for (int i = 0; i < request.teidDataI.length; i++)
+ require request.teidDataI[i] == teid1[i];
+ **/
+
+ // Our simplified view on data
+ require request.imsi == "240001111231411";
+ //require request.downlinkDataTeid == 1;
+ require request.nsapi == 5;
+ require request.apn == "apn1.com";
+
+ // Handle request - in our simplified view we handle
+ // only one single PDP context. The state machine is
+ // laid out so that a createPDPcontext will always be
+ // done before any update, delete, or sending of payload.
+ pdpContext.imsi = request.imsi;
+ pdpContext.nsapi = request.nsapi;
+ //pdpContext.downlinkDataTeid = request.downlinkDataTeid;
+
+ //pdpContext.uplinkDataTeid = 3;
+ }
+
+ private void sendRadiusAuthRequest()
+ {
+ RadiusAccessRequest request;
+ GiRadiusOut.send(request);
+ requirement "Radius/Authentication/Send Access Request";
+ }
+
+ private void confirmCreatePDPcontext()
+ {
+ // Send response back
+ CreatePDPresponse response;
+ response.causevalue = REQUEST_ACCEPTED;
+ //response.uplinkDataTeid = pdpContext.uplinkDataTeid;
+ GnOut.send(response);
+ requirement "PDP context/Confirm successful creation";
+ }
+
+ private void updatePDPcontext(UpdatePDPcontext request)
+ {
+ // TODO: what to do with update??
+ // Currently it seems TTCN libraries take care of both update
+ // details and receiving the correct response, as well as doing
+ // the pass/fail verdict.
+ // We can have an "empty" update request in the model to just
+ // trigger a call to the existing library update function, or
+ // we can add more detail to the model and NOT use the existing
+ // library update function.
+
+ // 100114: we can handle the response to the update on the
+ // model level for understanding, but regard it as a NOP on
+ // the QtronicHarness level.
+
+
+ require request.nsapi == pdpContext.nsapi;
+ //require request.downlinkDataTeid == pdpContext.downlinkDataTeid;
+
+ // Send response
+ UpdatePDPresponse response;
+
+ response.causevalue = REQUEST_ACCEPTED;
+ GnOut.send(response);
+ requirement "PDP context/Confirm successful update";
+ }
+
+ private void deletePDPcontext(DeletePDPcontext request)
+ {
+ // Take care of request parameters
+ require request.nsapi == pdpContext.nsapi;
+
+ // Send response back
+ DeletePDPresponse response;
+ response.causevalue = REQUEST_ACCEPTED;
+ GnOut.send(response);
+ requirement "PDP context/Confirm successful deletion";
+ }
+
+ // forwardGPDUtoGi() - when a GPDU is recieved on the Gn interface
+ // the payload should be forwarded to the Gi interface
+ private void forwardGPDUtoGi(GPDU pdu)
+ {
+ //require pdu.header.teid == pdpContext.uplinkDataTeid;
+
+ // TODO: how much detail on model level?
+ uplinkData++;
+ charging.payload(pdu);
+
+ // Forward payload
+ UDPpdu udpPdu;
+ udpPdu.data = pdu.data;
+ GiOut.send(udpPdu);
+ }
+
+ // forwardUdpPduToGn() - when a UDP pdu is recieved on the Gi interface
+ // it should be forwarded/tunneled to the Gn interface
+ private void forwardUdpPduToGn(UDPpdu udpPdu)
+ {
+ // Forward/tunnel payload
+ GPDU pdu;
+
+ //pdu.header.teid = pdpContext.downlinkDataTeid;
+ pdu.data = udpPdu.data;
+ GnOut.send(pdu);
+
+ // TODO: how much detail on model level?
+ downlinkData++;
+ charging.payload(pdu);
+ }
+}
+
+void main()
+{
+ NodeConfiguration nodeConfiguration = new NodeConfiguration();
+ Charging charging = new Charging();
+ CLI cli = new CLI(nodeConfiguration);
+
+ GGSN ggsn = new GGSN(charging, cli, nodeConfiguration);
+ ggsn.start("GGSN");
+}
diff --git a/demo/ggsn/model/GGSN.xmi b/demo/ggsn/model/GGSN.xmi
new file mode 100644
index 0000000..0745df4
--- /dev/null
+++ b/demo/ggsn/model/GGSN.xmi
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<n1:Project xmlns:n1="http://www.conformiq.com/EMF/SimpleStatechart" xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <statemachine name="GGSN">
+ <transitions body="" from="//@statemachine.0/@states.0" to="//@statemachine.0/@states.1"/>
+ <transitions body="CLIin:Configure[]/
cli.configure(msg);" from="//@statemachine.0/@states.1" to="//@statemachine.0/@states.2"/>
+ <transitions body="GnIn:CreatePDPcontext[]/
createPDPcontext(msg);" from="//@statemachine.0/@states.2" to="//@statemachine.0/@states.4"/>
+ <transitions body="GnIn:DeletePDPcontext[]/
deletePDPcontext(msg);
require ((uplinkData > 0) || (downlinkData > 0));
if ((uplinkData > 0) && (downlinkData > 0))
 requirement "Payload/Bidirectional payload";" from="//@statemachine.0/@states.5" to="//@statemachine.0/@states.3"/>
+ <transitions body="[nodeConfiguration.chargingEnabled]/
charging.sendInfo(GnOut);" from="//@statemachine.0/@states.3" to="//@statemachine.0/@states.10"/>
+ <transitions body="" from="//@statemachine.0/@states.4" to="//@statemachine.0/@states.5"/>
+ <transitions body="GnIn:UpdatePDPcontext[]/
{
 updatePDPcontext(msg);
 if ((uplinkData > 0) || (downlinkData > 0))
 requirement "PDP context/Update/After data transfer";
 else
 requirement "PDP context/Update/Before data transfer";
}" from="//@statemachine.0/@states.5" to="//@statemachine.0/@states.5"/>
+ <transitions body="[else]/" from="//@statemachine.0/@states.3" to="//@statemachine.0/@states.10"/>
+ <transitions body="[else]/" from="//@statemachine.0/@states.9" to="//@statemachine.0/@states.6"/>
+ <transitions body="[nodeConfiguration.configurationChanged()]/" from="//@statemachine.0/@states.9" to="//@statemachine.0/@states.7"/>
+ <transitions body="CLIin:Prepare[]/
handlePrepare(msg);
requirement "PrepareRestore/Prepare";" from="//@statemachine.0/@states.1" to="//@statemachine.0/@states.8"/>
+ <transitions body="CLIin:Restore[]/
handleRestore(msg);
requirement "PrepareRestore/Restore";" from="//@statemachine.0/@states.1" to="//@statemachine.0/@states.8"/>
+ <transitions body="[]/nodeConfiguration.checkConfiguration();" from="//@statemachine.0/@states.10" to="//@statemachine.0/@states.9"/>
+ <transitions body="CLIin: OverrideConfiguration[]/
require ((msg.overrideCharging == nodeConfiguration.chargingEnabled)
 && (msg.overrideRadiusAuth == nodeConfiguration.radiusAuthEnabled));
requirement "Configuration/Clean up if configuration changed";" from="//@statemachine.0/@states.7" to="//@statemachine.0/@states.6"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="
" name="Init" xsi:type="n1:BasicState"/>
+ <states internal="
" name="Operational" xsi:type="n1:BasicState"/>
+ <states internal="
" name="ContextDeleted" xsi:type="n1:BasicState"/>
+ <states internal="" name="CreateContext" xsi:type="n1:BasicState">
+ <transitions body="[]/" from="//@statemachine.0/@states.4/@states.0" to="//@statemachine.0/@states.4/@states.3"/>
+ <transitions body="GiRadiusIn:RadiusAccessAccept []/
requirement "Radius/Authentication/Wait for Access Accept";" from="//@statemachine.0/@states.4/@states.1" to="//@statemachine.0/@states.4/@states.4"/>
+ <transitions body="[nodeConfiguration.radiusAuthEnabled]/
sendRadiusAuthRequest();" from="//@statemachine.0/@states.4/@states.3" to="//@statemachine.0/@states.4/@states.1"/>
+ <transitions body="[]/
confirmCreatePDPcontext();" from="//@statemachine.0/@states.4/@states.4" to="//@statemachine.0/@states.4/@states.2"/>
+ <transitions body="[else]/" from="//@statemachine.0/@states.4/@states.3" to="//@statemachine.0/@states.4/@states.4"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="" name="Wait For Radius Accept" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:Junction"/>
+ <states xsi:type="n1:Junction"/>
+ </states>
+ <states internal="GnIn:GPDU[]/
{ forwardGPDUtoGi(msg);
 requirement "Payload/Forward uplink"; }

GiIn:UDPpdu[]/
{ forwardUdpPduToGn(msg);
 requirement "Payload/Forward downlink"; }" name="DataForwarding" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states internal="" name="Cleanup" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:Junction"/>
+ <states xsi:type="n1:Junction"/>
+ </statemachine>
+
+ <diagrams statemachine="//@statemachine.0">
+ <items state="//@statemachine.0/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="400" y="40"/>
+ </items>
+ <items height="70" state="//@statemachine.0/@states.1" width="199" xsi:type="n1:DiagramBasicState">
+ <location x="300" y="176"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="410" y="118"/>
+ <route x="400" y="60"/>
+ <route x="400" y="176"/>
+ </items>
+ <items height="114" note="Interfaces/ports:

CLIin		CLI commands
GnIn/GnOut	i/f to SGSN
GiIn/GiOut		i/f to internet" width="288" xsi:type="n1:DiagramNote">
+ <location x="263" y="-117"/>
+ </items>
+ <items height="70" state="//@statemachine.0/@states.2" width="199" xsi:type="n1:DiagramBasicState">
+ <location x="278" y="363"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.3" width="200" xsi:type="n1:DiagramBasicState">
+ <location x="800" y="700"/>
+ </items>
+ <items height="89" state="//@statemachine.0/@states.4" width="202" xsi:type="n1:DiagramBasicState">
+ <location x="798" y="158"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="409.5" y="304.5"/>
+ <route x="399.5" y="246"/>
+ <route x="399.5" y="363"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="910" y="113.5"/>
+ <route x="477" y="400"/>
+ <route x="600" xsi:type="n1:DiagramLayoutMarker" y="400"/>
+ <route x="600" xsi:type="n1:DiagramLayoutMarker" y="42"/>
+ <route x="900" y="42"/>
+ <route x="900" xsi:type="n1:DiagramLayoutMarker" y="69"/>
+ <route x="900" y="158"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.3" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="915.5" y="631.5"/>
+ <route x="905.5" y="563"/>
+ <route x="905.5" y="700"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.4" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="843" constraintLeft="1020" valign="0" x="1194.5" y="760"/>
+ <route x="1000" y="750"/>
+ <route x="1389" y="750"/>
+ <route x="1389" xsi:type="n1:DiagramLayoutMarker" y="863"/>
+ <route x="900" y="863"/>
+ <route x="900" y="890"/>
+ </items>
+ <items height="108" note="GGSN Rule No. 1 – Payload 
Payload shall always be transmitted in a test case whenever a successful PDP Context Activation has been performed.
" width="374" xsi:type="n1:DiagramNote">
+ <location x="1297" y="552"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.5" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="909" y="288"/>
+ <route x="899" y="247"/>
+ <route x="899" y="329"/>
+ </items>
+ <items height="234" state="//@statemachine.0/@states.5" width="307" xsi:type="n1:DiagramBasicState">
+ <location x="752" y="329"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.6" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintLeft="1207" constraintTop="268" valign="1" x="1364.5" y="453"/>
+ <route x="1059" y="463"/>
+ <route x="1187" xsi:type="n1:DiagramLayoutMarker" y="463"/>
+ <route x="1544" y="463"/>
+ <route x="1544" xsi:type="n1:DiagramLayoutMarker" y="248"/>
+ <route x="1032" y="248"/>
+ <route x="1032" y="329"/>
+ </items>
+ <items state="//@statemachine.0/@states.6" xsi:type="n1:DiagramFinalState">
+ <location x="1209" y="1234"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.7" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="599.5" y="744"/>
+ <route x="800" y="754"/>
+ <route x="399" xsi:type="n1:DiagramLayoutMarker" y="754"/>
+ <route x="402" y="754"/>
+ <route x="402" xsi:type="n1:DiagramLayoutMarker" y="862"/>
+ <route x="900" y="862"/>
+ <route x="900" y="890"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.7" width="200" xsi:type="n1:DiagramBasicState">
+ <location x="1561" y="1017"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.8" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="910" y="1122"/>
+ <route x="900" y="1010"/>
+ <route x="900" xsi:type="n1:DiagramLayoutMarker" y="1234"/>
+ <route x="1189" y="1234"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.9" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="1006" constraintLeft="930" valign="0" x="1214" y="1010"/>
+ <route x="910" y="1000"/>
+ <route x="1661" y="1000"/>
+ <route x="1661" y="1017"/>
+ </items>
+ <items height="53" note="Restore default configuration only if needed" width="236" xsi:type="n1:DiagramNote">
+ <location x="1485" y="1152"/>
+ </items>
+ <items state="//@statemachine.0/@states.8" xsi:type="n1:DiagramFinalState">
+ <location x="-100" y="200"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.10" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-90" y="140"/>
+ <route x="300" y="200"/>
+ <route x="246" xsi:type="n1:DiagramLayoutMarker" y="200"/>
+ <route x="246" xsi:type="n1:DiagramLayoutMarker" y="100"/>
+ <route x="-100" xsi:type="n1:DiagramLayoutMarker" y="100"/>
+ <route x="-100" y="180"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.11" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="73.5" y="290"/>
+ <route x="300" y="223"/>
+ <route x="246" xsi:type="n1:DiagramLayoutMarker" y="223"/>
+ <route x="247" y="223"/>
+ <route x="247" xsi:type="n1:DiagramLayoutMarker" y="300"/>
+ <route x="-100" xsi:type="n1:DiagramLayoutMarker" y="300"/>
+ <route x="-100" y="220"/>
+ </items>
+ <items state="//@statemachine.0/@states.9" xsi:type="n1:DiagramJunction">
+ <location x="900" y="1000"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.12" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="910" y="950"/>
+ <route x="900" y="910"/>
+ <route x="900" y="990"/>
+ </items>
+ <items state="//@statemachine.0/@states.10" xsi:type="n1:DiagramJunction">
+ <location x="900" y="900"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.13" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="1194" constraintRight="1541" valign="0" x="1385" y="1077"/>
+ <route x="1561" y="1067"/>
+ <route x="1209" y="1067"/>
+ <route x="1209" y="1214"/>
+ </items>
+ </diagrams>
+
+ <diagrams substate="//@statemachine.0/@states.4">
+ <items state="//@statemachine.0/@states.4/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="198" y="68"/>
+ </items>
+ <items height="80" state="//@statemachine.0/@states.4/@states.1" width="223" xsi:type="n1:DiagramBasicState">
+ <location x="387" y="284"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.4/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="138" constraintLeft="238" valign="0" x="359.5" y="78"/>
+ <route x="218" y="68"/>
+ <route x="501" y="68"/>
+ <route x="501" y="158"/>
+ </items>
+ <items state="//@statemachine.0/@states.4/@states.2" xsi:type="n1:DiagramFinalState">
+ <location x="500" y="600"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.4/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="510" y="417"/>
+ <route x="500" y="364"/>
+ <route x="500" y="470"/>
+ </items>
+ <items state="//@statemachine.0/@states.4/@states.3" xsi:type="n1:DiagramJunction">
+ <location x="501" y="168"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.4/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="511" y="231"/>
+ <route x="501" y="178"/>
+ <route x="501" y="284"/>
+ </items>
+ <items state="//@statemachine.0/@states.4/@states.4" xsi:type="n1:DiagramJunction">
+ <location x="500" y="480"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.4/@transitions.3" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="510" y="535"/>
+ <route x="500" y="490"/>
+ <route x="500" y="580"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.4/@transitions.4" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="458" constraintRight="281" valign="0" x="300.5" y="177"/>
+ <route x="501" y="167"/>
+ <route x="301" xsi:type="n1:DiagramLayoutMarker" y="167"/>
+ <route x="300" y="167"/>
+ <route x="300" xsi:type="n1:DiagramLayoutMarker" y="478"/>
+ <route x="500" y="478"/>
+ </items>
+ </diagrams>
+
+</n1:Project>
diff --git a/demo/ggsn/model/GTPrecords.java b/demo/ggsn/model/GTPrecords.java
new file mode 100644
index 0000000..5518a16
--- /dev/null
+++ b/demo/ggsn/model/GTPrecords.java
@@ -0,0 +1,116 @@
+/**
+ * GTPrecords.java
+ *
+ * GTP and GTP-U records/messages
+**/
+
+// References to 3GPP TS 29.060 V8.7.0
+
+// IMSI 7.7.2
+record IMSI_gtpc
+{
+ int type_gtpc; // type = 2 (Decimal)
+ int[] imsi_digits; // 8 octets (15 BCD digits + padding)
+}
+
+//TEI Data I - 7.7.13
+// Tunnel Endpoint Identifier Data
+// Returned by a successful Create PDP Context request,
+// shall be used for all subsequent uplink G-PDUs related
+// to the PDP context.
+record TeidDataI
+{
+ int type_gtpc; // type = 16 (Decimal)
+ int[] teidDataI; // 4 octets
+}
+
+//NSAPI - 7.7.17
+// Only used if/when multiple contexts are created for a PDP and APN ??
+record NSAPI_GTPC {
+ int type_gtpc; // type = 20 (Decimal)
+ int nsapi; // 4 bits [xxxx : NSAPI]
+}
+
+//Charging ID - 7.7.26
+record ChargingID {
+ int type_gtpc; // type = 127 (Decimal)
+ int[] chargingID; // 4 octets
+}
+
+
+// Response cause values
+
+const int REQUEST_ACCEPTED = 128;
+const int SYSTEM_FAILURE = 204;
+
+
+// ===================================================
+// Requests and responses
+
+
+// ---- Create PDP context ----
+
+// a) request
+record CreatePDPcontext
+{
+// int[] imsi_digits;
+// int[] teidDataI;
+// 100114: use a more abstract representation at model level and
+// reuse functions in existing TTCN support libraries. For a single
+// context imsi/teid/nsapi can be handled entirely at TTCN level...
+
+ String imsi;
+ //int downlinkDataTeid;
+ int nsapi;
+ String apn;
+}
+
+const int IMSI_OCTETS = 8;
+const int TEID_OCTETS = 4;
+
+// b) response
+record CreatePDPresponse
+{
+ int causevalue;
+ //int uplinkDataTeid; // Only applicable if SUCCESS
+}
+
+
+// ---- Delete PDU context ----
+
+// a) request
+record DeletePDPcontext
+{
+ int nsapi;
+}
+
+// b) response
+record DeletePDPresponse
+{
+ int causevalue;
+}
+
+
+
+record UpdatePDPcontext
+{
+ int nsapi;
+ //int downlinkDataTeid;
+}
+
+
+record UpdatePDPresponse
+{
+ int causevalue;
+}
+
+// G-PDU
+record GTPUheader
+{
+ int teid; // Date teid of receiving side
+}
+
+record GPDU
+{
+ int data; // TODO: representation of payload on model level?
+}
diff --git a/demo/ggsn/model/RadiusRecords.java b/demo/ggsn/model/RadiusRecords.java
new file mode 100644
index 0000000..73ff02a
--- /dev/null
+++ b/demo/ggsn/model/RadiusRecords.java
@@ -0,0 +1,9 @@
+/**
+ * Radius.java
+ *
+ * Radius records/messages
+**/
+
+record RadiusAccessRequest { }
+
+record RadiusAccessAccept { }
diff --git a/demo/ggsn/model/UDPrecords.java b/demo/ggsn/model/UDPrecords.java
new file mode 100644
index 0000000..4cdf3b0
--- /dev/null
+++ b/demo/ggsn/model/UDPrecords.java
@@ -0,0 +1,10 @@
+/**
+ * UDPrecords.java
+ *
+ * UDP records/messages
+**/
+
+record UDPpdu
+{
+ int data; // TODO: representation of payload on model level?
+}
diff --git a/demo/ggsn/model/charging.java b/demo/ggsn/model/charging.java
new file mode 100644
index 0000000..9c157bb
--- /dev/null
+++ b/demo/ggsn/model/charging.java
@@ -0,0 +1,35 @@
+/**
+ * charging.java
+ *
+ * Charging related functions
+ **/
+
+
+class Charging
+{
+ private int dataCounter;
+
+ public Charging()
+ {
+ dataCounter = 0;
+ }
+
+ public void payload(GPDU pdu)
+ {
+ dataCounter++;
+ }
+
+ public void sendInfo(CQPort port)
+ {
+ CDRinfo info;
+
+ if (dataCounter == 0)
+ assert false; // Design rule 1: Payload shall always be transmitted
+ else if (dataCounter == 1)
+ requirement "Charging/Single data";
+ else
+ requirement "Charging/Multiple data";
+ info.data = dataCounter;
+ port.send(info);
+ }
+}
diff --git a/demo/ggsn/model/cli.java b/demo/ggsn/model/cli.java
new file mode 100644
index 0000000..fc8188f
--- /dev/null
+++ b/demo/ggsn/model/cli.java
@@ -0,0 +1,38 @@
+/**
+ * cli.java
+ *
+ * GGSN CLI
+ **/
+
+class CLI {
+ NodeConfiguration nodeConfiguration;
+
+ public CLI(NodeConfiguration nodeConfiguration)
+ {
+ this.nodeConfiguration = nodeConfiguration;
+ }
+
+ public void configure(Configure cmd)
+ {
+ require cmd.cmds != null;
+ require cmd.cmds.length == configurationCmds1.length;
+ for (int i = 0; i < configurationCmds1.length; i++)
+ require cmd.cmds[i] == configurationCmds1[i];
+
+ // 100222 : feature based configuration
+ /**
+ if ((cmd.enableCharging) && (cmd.enableRadiusAuth))
+ requirement "Configuration/Both Charging and Radius Auth";
+ else if (cmd.enableCharging)
+ requirement "Configuration/Only Charging";
+ else if (cmd.enableRadiusAuth)
+ requirement "Configuration/Only Radius Auth";
+ else
+ requirement "Configuration/Default - no options";
+ **/
+ nodeConfiguration.chargingEnabled = cmd.enableCharging;
+ nodeConfiguration.radiusAuthEnabled = cmd.enableRadiusAuth;
+
+
+ }
+}
diff --git a/demo/ggsn/model/configuration.java b/demo/ggsn/model/configuration.java
new file mode 100644
index 0000000..d627787
--- /dev/null
+++ b/demo/ggsn/model/configuration.java
@@ -0,0 +1,34 @@
+/**
+ * configuration.java
+ *
+ * GGSN node configuration
+ */
+
+class NodeConfiguration {
+ public boolean chargingEnabled;
+ public boolean radiusAuthEnabled;
+
+ public NodeConfiguration()
+ {
+ chargingEnabled = false;
+ radiusAuthEnabled = false;
+ }
+
+ public boolean configurationChanged()
+ {
+ return ((chargingEnabled == true) ||
+ (radiusAuthEnabled == true));
+ }
+
+ public void checkConfiguration()
+ {
+ if ((chargingEnabled) && (radiusAuthEnabled))
+ requirement "Configuration/Groups/Both Charging and Radius Auth";
+ else if (chargingEnabled)
+ requirement "Configuration/Groups/Only Charging";
+ else if (radiusAuthEnabled)
+ requirement "Configuration/Groups/Only Radius Auth";
+ else
+ requirement "Configuration/Groups/Default - no options";
+ }
+}
diff --git a/demo/ggsn/model/globals.java b/demo/ggsn/model/globals.java
new file mode 100644
index 0000000..28f983f
--- /dev/null
+++ b/demo/ggsn/model/globals.java
@@ -0,0 +1,18 @@
+/**
+ * globals.java
+ *
+ * Misc global definitions/constants
+ **/
+
+
+
+const String[] configurationCmds1 =
+ { "DEFAULT_CONFIG"
+ };
+
+
+// GTP message data
+// TODO: which imsi and teid should be used?
+
+const int[] imsi1 = {1,2,3,4,5,6,7,8};
+const int[] teid1 = {1,2,3,4};
diff --git a/demo/ggsn/model/prepareRestore.java b/demo/ggsn/model/prepareRestore.java
new file mode 100644
index 0000000..c2296a8
--- /dev/null
+++ b/demo/ggsn/model/prepareRestore.java
@@ -0,0 +1,50 @@
+/**
+ * prepareRestore.java
+ *
+ * GGSN node configuration
+ */
+
+/* Prepare/Restore commands supported by test harness
+ *
+ * f_TELNET_Init
+ * f_sr_TELNET_OverrideConfiguration
+ * ...more TBD...
+ */
+
+/* ----------------------------------------------------------- */
+
+/* prepareCmds []
+ * Put your prepare commands here.
+ * Pick from the list above.
+ */
+const String[] prepareCmds =
+ { "f_TELNET_Init",
+ "f_sr_TELNET_OverrideConfiguration"
+ };
+
+/* restoreCmds []
+ * Put your restore commands here.
+ * Pick from the list above.
+ */
+const String[] restoreCmds =
+ { "f_TELNET_Init",
+ "f_sr_TELNET_OverrideConfiguration"
+ };
+
+/* ----------------------------------------------------------- */
+
+void handlePrepare(Prepare msg)
+{
+ require msg.cmds != null;
+ require msg.cmds.length == prepareCmds.length;
+ for (int i = 0; i < prepareCmds.length; i++)
+ require msg.cmds[i] == prepareCmds[i];
+}
+
+void handleRestore(Restore msg)
+{
+ require msg.cmds != null;
+ require msg.cmds.length == restoreCmds.length;
+ for (int i = 0; i < restoreCmds.length; i++)
+ require msg.cmds[i] == restoreCmds[i];
+}
diff --git a/demo/ggsn/model/system.java b/demo/ggsn/model/system.java
new file mode 100644
index 0000000..d88d0d6
--- /dev/null
+++ b/demo/ggsn/model/system.java
@@ -0,0 +1,22 @@
+/**
+ * system.java
+ *
+ * Interfaces/ports:
+ * CLIin/CLIout proprietary CLI commands/responses
+ * GnIn/GnOut i/f to SGSN
+ * GiIn/GiOut i/f to internet
+**/
+
+system {
+ Inbound CLIin : Restart, Configure, OverrideConfiguration, Prepare, Restore;
+
+ Inbound GnIn : CreatePDPcontext, UpdatePDPcontext, DeletePDPcontext, GPDU;
+ Outbound GnOut : CreatePDPresponse, UpdatePDPresponse, DeletePDPresponse,
+ GPDU, CDRinfo;
+
+ Inbound GiIn : UDPpdu;
+ Outbound GiOut : UDPpdu;
+
+ Inbound GiRadiusIn : RadiusAccessAccept;
+ Outbound GiRadiusOut : RadiusAccessRequest;
+}
diff --git a/demo/makefile_patch.sh b/demo/makefile_patch.sh
new file mode 100755
index 0000000..51e24e4
--- /dev/null
+++ b/demo/makefile_patch.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+sed -e '
+s/OPENSSL_DIR =/#OPENSSL_DIR =/g
+
+s/CPPFLAGS = .*/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include -I$(OPENSSL_DIR)\/include -DNO_IPV6/g
+
+s/SOLARIS8_LIBS = -lsocket -lnsl/SOLARIS8_LIBS = -lpcap -lsocket -lnsl -lresolv/g
+
+s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lxml2 -lpcap/g
+
+s/COMPILER_FLAGS = -L/COMPILER_FLAGS = -L -w/g
+' <$1 >$2
+
+
diff --git a/demo/mapped/MBT_Qtronic_Demo.cfg b/demo/mapped/MBT_Qtronic_Demo.cfg
new file mode 100644
index 0000000..94fd3e1
--- /dev/null
+++ b/demo/mapped/MBT_Qtronic_Demo.cfg
@@ -0,0 +1,55 @@
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Copyright Test Competence Center (TCC) ETH 2009 //
+// //
+// The copyright to the computer program(s) herein is the property of TCC. //
+// The program(s) may be used and/or copied only with the written permission //
+// of TCC or in accordance with the terms and conditions stipulated in the //
+// agreement/contract under which the program(s) have been supplied //
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Demo.cfg
+// Rev: <RnXnn>
+// Prodnr: CNL 113 522
+// Updated: 2009-04-20
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+[LOGGING]
+ConsoleMask := ERROR | STATISTICS | ACTION | TESTCASE
+FileMask := LOG_ALL | DEBUG
+#FileMask := ERROR | STATISTICS | PARALLEL | ACTION | WARNING
+#LogFile := "%l/%e.%h-%t%r.%s"
+LogEntityName := Yes
+LogEventTypes := Yes//Subcategories;
+SourceInfoFormat := Stack
+
+[MODULE_PARAMETERS]
+
+tsp_debug_EPTF_SchedulerFunctions := false
+tsp_debugVerbose_EPTF_SchedulerFunctions := false
+tsp_EPTF_LGenBaseDebugTraffic := false
+tsp_EPTF_LGenBaseDebug := false
+
+tsp_SIP_TransactionTimerValues :=
+{
+ 0.5,//T1
+ 0.0,//no max
+ 8.0,//64*T1
+ 8.0,//Timer D, >= 32.0
+ 0.5,//T1
+ 4.0,//T2
+ 8.0,//64*T1
+ 5.0,//T4
+ 0.5,//T1
+ 4.0,//T2,
+ 8.0,//64*T1
+ 5.0,//T4
+ 8.0//64*T1
+};
+
+[EXECUTE]
+MBT_Qtronic_Testcases.control
+
+[TESTPORT_PARAMETERS]
+*.IPL4_PCO.debug := "NO"
diff --git a/demo/mapped/MBT_Qtronic_Demo.prj b/demo/mapped/MBT_Qtronic_Demo.prj
new file mode 100644
index 0000000..94d0b64
--- /dev/null
+++ b/demo/mapped/MBT_Qtronic_Demo.prj
@@ -0,0 +1,150 @@
+<!DOCTYPE TITAN_GUI_project_file>
+<Project TITAN_version="1.8.pl1" >
+ <General>
+ <Project_Name>MBT_Qtronic_Demo</Project_Name>
+ <Executable_Path>bin/demo</Executable_Path>
+ <Working_Dir>bin</Working_Dir>
+ <Build_Host>alpha</Build_Host>
+ <Execution_Mode>Parallel</Execution_Mode>
+ <ScriptFile_AfterMake>../makefile_patch.sh</ScriptFile_AfterMake>
+ <Log_Format>yes</Log_Format>
+ <Update_Symlinks>yes</Update_Symlinks>
+ <Create_Absolute_Symlinks>no</Create_Absolute_Symlinks>
+ <Update_Makefile>yes</Update_Makefile>
+ <Localhost_Execute>yes</Localhost_Execute>
+ <Execute_Command>rsh %host "cd %project_working_dir ; "%executable" %localhost %mctr_port"</Execute_Command>
+ <Execute_Hosts>alfa, beta, gamma</Execute_Hosts>
+ <UnUsed_List></UnUsed_List>
+ </General>
+ <Modules>
+ <Module>../sut/MBT_SUT_SIP_Phone.ttcn</Module>
+ <Module>MBT_Qtronic_Demo.ttcn</Module>
+ <Module>MBT_Qtronic_TestHarness.ttcn</Module>
+ <Module>MBT_Qtronic_Testcases.ttcn</Module>
+ <Module>MBT_Qtronic_Types.ttcn</Module>
+ </Modules>
+ <Configs>
+ <Config>MBT_Qtronic_Demo.cfg</Config>
+ </Configs>
+ <Test_Cases>
+ <Test_Case>MBT_Qtronic_Testcases.control</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_1</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_2</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_3</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_4</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_5</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_6</Test_Case>
+ <Test_Case>MBT_Qtronic_Testcases.Test_Case_7</Test_Case>
+ </Test_Cases>
+ <File_Group name="MainFileGroup" >
+ <File_Groups>
+ <File_Group name="EPTF_Applib_MBT_CNL113659" >
+ <File path="../../src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn" />
+ <File path="../../src/LoadGen/EPTF_MBT_LGen_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Applib_SIP_CNL113522" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Applib_SIP_CNL113522/src/LoadGen/EPTF_SIP_LoadGen.grp" />
+ <File_Group path="../../../EPTF_Applib_SIP_CNL113522/src/Logger/EPTF_SIP_Logger.grp" />
+ <File_Group path="../../../EPTF_Applib_SIP_CNL113522/src/Transport/EPTF_SIP_Transport.grp" />
+ </File_Groups>
+ </File_Group>
+ <File_Group name="TCCUsefulFunctions_CNL113472" >
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/digcalc.c" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/digcalc.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMessageHandling_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCSecurity_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Definitions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCIPsec_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCEncoding_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.c" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/aka_algorythm_set.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCFileIO_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCDateTime_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCMaths_GenericTypes.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCInterface_ip.h" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCConversion.cc" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCConversion_Functions.ttcn" />
+ <File path="../../../TCCUsefulFunctions_CNL113472/src/TCCTemplate_Functions.ttcn" />
+ </File_Group>
+ <File_Group name="SIPmsg_CNL113319" >
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/lex.SIP_parse_.c" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse.h" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.c" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIP_parse_.tab.h" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PortType.ttcn" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.cc" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_PT.hh" />
+ <File path="../../../../TestPorts/SIPmsg_CNL113319/src/SIPmsg_Types.ttcn" />
+ </File_Group>
+ <File_Group name="UDPasp_CNL113346" >
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PortType.ttcn" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.cc" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_PT.hh" />
+ <File path="../../../../TestPorts/UDPasp_CNL113346/src/UDPasp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="IPL4asp_CNL113531" >
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_discovery.cc" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Functions.ttcn" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PortType.ttcn" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_protocol_L234.hh" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.cc" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_PT.hh" />
+ <File path="../../../../TestPorts/IPL4asp_CNL113531/src/IPL4asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="Abstract_Socket_CNL113384" >
+ <File path="../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.cc" />
+ <File path="../../../../TestPorts/Common_Components/Abstract_Socket_CNL113384/src/Abstract_Socket.hh" />
+ </File_Group>
+ <File_Group name="IP_CNL113418" >
+ <File path="../../../../ProtocolModules/IP_CNL113418/src/IP_EncDec.cc" />
+ <File path="../../../../ProtocolModules/IP_CNL113418/src/IP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="LANL2asp_CNL113519" >
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PortType.ttcn" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.cc" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_PT.hh" />
+ <File path="../../../../TestPorts/LANL2asp_CNL113519/src/LANL2asp_Types.ttcn" />
+ </File_Group>
+ <File_Group name="TCP_CNL113675" >
+ <File path="../../../../ProtocolModules/TCP_CNL113675/src/TCP_EncDec.cc" />
+ <File path="../../../../ProtocolModules/TCP_CNL113675/src/TCP_Types.ttcn" />
+ </File_Group>
+ <File_Group name="GeneralTypes" >
+ <File path="../../../../ProtocolModules/COMMON/src/General_Types.ttcn" />
+ </File_Group>
+ <File_Group name="EPTF_Core_Library_CNL113512" >
+ <File_Groups>
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Base/EPTF_CLL_Base.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Common/EPTF_CLL_Common.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/FreeBusyQueue/EPTF_CLL_FreeBusyQueue.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/HashMap/EPTF_CLL_HashMap.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Logging/EPTF_CLL_Logging.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/RedBlackTree/EPTF_CLL_RBtree_Float.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Scheduler/EPTF_CLL_Scheduler_RBT.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Variable/EPTF_CLL_Variable.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/StatMeasure/EPTF_CLL_StatMeasure.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_Transport.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportCommPortIPL4.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportMessageBufferManager.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Transport/EPTF_CLL_TransportRouting.grp" />
+ <File_Group path="../../../../TestPorts/Common_Components/Socket_API_CNL113686/src/Socket_API.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/RandomNArray/EPTF_CLL_RNA.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/Semaphore/EPTF_CLL_Semaphore.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/StatHandler/EPTF_CLL_StatHandler.grp" />
+ <File_Group path="../../../EPTF_Core_Library_CNL113512/src/LGenBase/EPTF_CLL_LGenBase.grp" />
+ </File_Groups>
+ </File_Group>
+ </File_Groups>
+ </File_Group>
+</Project>
diff --git a/demo/mapped/MBT_Qtronic_Demo.ttcn b/demo/mapped/MBT_Qtronic_Demo.ttcn
new file mode 100644
index 0000000..0e8e33d
--- /dev/null
+++ b/demo/mapped/MBT_Qtronic_Demo.ttcn
@@ -0,0 +1,338 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Demo.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-12-14
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+module MBT_Qtronic_Demo
+{
+
+import from MBT_Qtronic_Testcases all;
+import from MBT_Qtronic_Types all;
+import from MBT_Qtronic_TestHarness all;
+
+import from MBT_SUT_SIP_Phone all;
+
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Base_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_RBTScheduler_Functions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+import from EPTF_CLL_LGenBase_ConfigFunctions all;
+import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_MBT_LGen_Functions all;
+
+import from EPTF_SIP_LGen_Definitions all;
+import from EPTF_SIP_LGen_Functions all;
+import from EPTF_SIP_Common_Functions all;
+import from EPTF_SIP_UserDatabase_Functions all;
+import from EPTF_SIP_Transport_Definitions all;
+import from EPTF_SIP_Transport_Functions all;
+import from EPTF_SIP_MessageHandler_Functions all;
+
+import from EPTF_SIP_TestSteps all;
+import from EPTF_SIP_Templates all;
+import from EPTF_SIP_Events all;
+import from EPTF_SIP_Transaction_Definitions all;
+
+import from TCCFileIO_Functions all;
+import from TCCDateTime_Functions all;
+
+modulepar
+{
+ charstring tsp_MBT_Tester_LocalIP := "159.107.193.33";
+ integer tsp_MBT_Tester_LocalPort := 15000;
+ charstring tsp_MBT_Tester_RemoteIP := "159.107.193.33";
+ integer tsp_MBT_Tester_RemotePort := 20000;
+
+ charstring tsp_MBT_SIP_Transport := "udp";
+}
+
+type component MBT_Qtronic_Demo_Main_CT
+ extends
+ EPTF_Base_CT,
+ EPTF_MBT_Tester_CT
+{}
+
+function f_MBT_Qtronic_Demo_beginTestCase() runs on Qtronic_CT
+{
+ log(%definitionId, " started");
+
+ f_EPTF_Base_init_CT("mtc");
+
+ log(%definitionId, " Creating SUT");
+ var MBT_Qtronic_Demo_SUT_CT vc_sut := MBT_Qtronic_Demo_SUT_CT.create;
+ connect(self:userIn, vc_sut:userIn);
+ connect(self:userOut, vc_sut:userOut);
+ connect(self:EPTF_MBT_TESTER_PCO,vc_sut:EPTF_MBT_PCO);
+ vc_sut.start(f_MBT_Qtronic_Demo_SUT_behavior());
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_CommandResponse:?) from vc_sut;
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "SUT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "Behavior_SIP", "SUT_Behavior"},
+ fsmName := "MBT_Qtronic_Demo_SUT_FSM"
+ }
+ ) to vc_sut;
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_ConfigResponse:?) from vc_sut;
+ log(%definitionId, " SUT ready");
+
+ log(%definitionId, " Creating LGen");
+ var MBT_Qtronic_Demo_LGen_CT vc_lgen := MBT_Qtronic_Demo_LGen_CT.create;
+ connect(self:netIn, vc_lgen:netOut);
+ connect(self:netOut, vc_lgen:netIn);
+ connect(self:EPTF_MBT_TESTER_PCO,vc_lgen:EPTF_MBT_PCO);
+ vc_lgen.start(f_MBT_Qtronic_Demo_LGen_behavior());
+
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_CommandResponse:?) from vc_lgen;
+
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_ConfigRequest:
+ {
+ entityGroupName := "MBT_EntityType",
+ noEntities := 1,
+ behaviors := {"MBT_behavior", "Behavior_SIP"},
+ fsmName := "FSM_MBT"
+ }
+ ) to vc_lgen;
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_ConfigResponse:?) from vc_lgen;
+
+ log(%definitionId, " LGen ready");
+
+ log(%definitionId, " finished");
+}
+
+
+function f_MBT_Qtronic_Demo_endTestCase() runs on Qtronic_CT
+{
+ log("### MAIN: END TESTCASE started");
+
+ f_EPTF_Base_stopAll(none, true);
+
+ log("### MAIN: END TESTCASE finished");
+}
+
+/////////////////////////////////////////////////////////////////////////
+//
+// M B T Applib
+//
+/////////////////////////////////////////////////////////////////////////
+
+type component MBT_Qtronic_Demo_LGen_CT
+ extends
+ EPTF_MBT_LGen_CT,
+ EPTF_SIP_LGen_CT, EPTF_SIP_LocalTransport_CT
+{
+ port netInPort netIn;
+ port netOutPort netOut;
+}
+
+function f_MBT_Qtronic_Demo_LGen_behavior() runs on MBT_Qtronic_Demo_LGen_CT
+{
+ //map(self:IPL4_PCO, system:IPL4_PCO);
+
+ activate(as_MBT_Qtronic_Demo_LGen_userMessageHandler());
+
+ f_EPTF_MBT_init("MBT_Demo_LGen",0, "MBT_")
+
+ f_SIP_applibInit("MBT_Demo_LGen");
+
+ f_EPTF_SIP_LocalTransport_init(tsp_MBT_SIP_Transport);
+ vf_EPTF_SIP_LocalTransport_receive := refers(f_EPTF_SIP_Message_MsgHandler); //receive callback function on LocalTransport
+ vf_EPTF_SIP_LGen_msgSender := refers(f_EPTF_SIP_LocalTransport_sendSIPMessage); //send callback function on LGen
+ v_removeUAS := refers(fcb_EPTF_SIP_LocalTransport_removeUAS);
+
+ f_EPTF_MBT_initLGenFsm
+ (
+ refers(f_MBT_Qtronic_Demo_LGen_createUserMessage),
+ refers(f_MBT_Qtronic_Demo_LGen_fillInDB)
+ );
+
+ EPTF_MBT_PCO.send(EPTF_MBT_CommandResponse:{ ready := {}}) to mtc;
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+altstep as_MBT_Qtronic_Demo_LGen_userMessageHandler()
+runs on MBT_Qtronic_Demo_LGen_CT
+{
+ var SIPResp vl_SIPResp;
+ var SIPReq vl_SIPReq;
+
+ var EPTF_LGenBase_TestStepArgs vl_stepArgs :=
+ { eIdx := 0, refContext := { fCtxIdx := 0, fRefArgs := { } }, stepArgs := { } };
+
+ [] netOut.receive(SIPResp:?) -> value vl_SIPResp
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ log(%definitionId & "(): incoming ", vl_SIPResp);
+
+ if (vl_SIPResp.status == 180)
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_180Ringing_idx};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else if (vl_SIPResp.status == 200)
+ {
+ if (vl_SIPResp.cseq == "INVITE")
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_200OK_idx, c_SIP_Method_INVITE};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else if (vl_SIPResp.cseq == "CANCEL")
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_200OK_idx, c_SIP_Method_CANCEL};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ }
+ else if (vl_SIPResp.status == 486)
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_486BusyHere_idx};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else if (vl_SIPResp.status == 487)
+ {
+ vl_stepArgs.refContext.fRefArgs := {c_status_487RequestTerminated_idx, c_SIP_Method_INVITE};
+ f_SIP_step_createResponse(vl_stepArgs);
+ }
+ else
+ {
+ log(%definitionId & "(): unhandled SIPResp");
+ }
+
+ repeat;
+ }
+ [] netOut.receive(SIPReq:?) -> value vl_SIPReq
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ log(%definitionId & "(): incoming ", vl_SIPReq);
+
+ if (vl_SIPReq.op == "BYE")
+ {
+ f_SIP_step_createBYE(vl_stepArgs);
+ }
+ else
+ {
+ log(%definitionId & "(): unhandled SIPResp");
+ }
+ repeat;
+ }
+}
+
+function f_MBT_Qtronic_Demo_LGen_createUserMessage(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_Qtronic_Demo_LGen_CT
+return boolean
+{
+ log(%definitionId & " creating message for:\n", pl_ptr, "\n", pl_ptr.reportedEvent);
+
+ var charstring vl_param := "sip:127.0.0.1:5061";
+
+ if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_INVITE)
+ {
+ var integer vl_FSMIdx := -1;
+ pl_ptr.refContext.fCtxIdx := 0;
+
+ if (not f_EPTF_SIP_FSMInitialized(pl_ptr.eIdx, pl_ptr.refContext.fCtxIdx, vl_FSMIdx))
+ {
+ f_SIP_step_init(pl_ptr);
+ f_SIP_step_handleINVITE(pl_ptr);
+ }
+ netIn.send(SIPReq:{"INVITE", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_ACK)
+ {
+ netIn.send(SIPReq:{"ACK", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_BYE)
+ {
+ netIn.send(SIPReq:{"BYE", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_CANCEL)
+ {
+ netIn.send(SIPReq:{"CANCEL", vl_param});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == 200)
+ {
+ netIn.send(SIPResp:{200, v_msgToProcess.response.msgHeader.cSeq.method});
+ }
+ else if (pl_ptr.reportedEvent.event.bIdx == v_SIP_myBIdx and pl_ptr.reportedEvent.event.iIdx == c_SIP_eventIdx_retransmittedRequest)
+ {
+ netIn.send(SIPReq:{v_msgToProcess.request.msgHeader.cSeq.method, vl_param});
+ }
+ else
+ {
+ log(%definitionId & "(): unhandled incoming message");
+ return false;
+ }
+ return true;
+}
+
+function f_MBT_Qtronic_Demo_LGen_fillInDB(in EPTF_MBT_ConfigRequest p_req) runs on MBT_Qtronic_Demo_LGen_CT
+{
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(p_req.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ for (var integer i:=0; i<p_req.noEntities; i:=i+1)
+ {
+ var EPTF_IntegerList vl_bCtx := f_EPTF_LGenBase_getBehaviorCtx(i + vl_entityIdx, v_SIP_myBIdx);
+ f_EPTF_SIP_IPL4asp_SetUserData
+ (
+ vl_bCtx[0],
+ tsp_MBT_Tester_LocalIP, // local IP
+ {tsp_MBT_Tester_LocalPort, tsp_MBT_Tester_LocalPort+1},
+ tsp_MBT_SIP_Transport,
+ tsp_MBT_Tester_RemoteIP, // proxy ip
+ tsp_MBT_Tester_RemotePort // proxy port
+ );
+
+ f_EPTF_SIP_User_SetUserData(
+ vl_bCtx[0],
+ {
+ {
+ addr := {
+ nameAddr := {
+ displayName := "titansim_user_7465000",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465000",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := tsp_MBT_Tester_LocalPort
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ },
+ password := "pass2ICS"
+ }
+ },
+ tsp_MBT_Tester_LocalIP,
+ {tsp_MBT_Tester_LocalPort, tsp_MBT_Tester_LocalPort+1},
+ i + vl_entityIdx //entity index
+ );
+
+ f_EPTF_SIP_Session_AddData(vl_bCtx[0], f_EPTF_SIP_getTransport(tsp_MBT_SIP_Transport),345600);
+
+ f_EPTF_SIP_IPL4asp_startListening(vl_bCtx[0], true); // Both UDP and TCP
+ }
+}
+
+}
diff --git a/demo/mapped/MBT_Qtronic_TestHarness.ttcn b/demo/mapped/MBT_Qtronic_TestHarness.ttcn
new file mode 100644
index 0000000..e85bb42
--- /dev/null
+++ b/demo/mapped/MBT_Qtronic_TestHarness.ttcn
@@ -0,0 +1,101 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_TestHarness.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-04-14
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+/* -*- ttcn3 -*- */
+
+/** @file C:\Users\eantwuh\workspace\SIPeval\MBT_Qtronic_TestHarness.ttcn
+ *
+ * @author Conformiq TTCN3 Script Backend
+ * @date Wed Apr 14 13:17:47 CEST 2010
+ *
+ * WARNING! This file has been automatically generated using
+ * Ericsson Qtronic TTCN3 Script Backend (based on the original Conformiq Backend).DO NOT EDIT.
+ */
+
+module MBT_Qtronic_TestHarness
+{
+ import from MBT_Qtronic_Types all;
+/* User provided imports begin */
+import from MBT_Qtronic_Demo all; import from EPTF_MBT_LGen_Definitions all;
+/* User provided imports end */
+ altstep QtronicHarnessAlt() runs on Qtronic_CT
+ {
+ [] any port.receive
+ {
+ harnessTimer.stop;
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ [] harnessTimer.timeout
+ {
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ }
+ function qtronic_send_SIPResp_to_netIn(template SIPResp msgToSend) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'msgToSend'
+ // before it is delivered to the SUT through the real test interface.
+ // This can include addition of fields not present in the model or
+ // manipulation of unique identifiers in the messages that Qtronic
+ // cannot possible know at the time of test generation.
+ netIn.send(msgToSend);
+ }
+ function qtronic_send_SIPReq_to_netIn(template SIPReq msgToSend) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'msgToSend'
+ // before it is delivered to the SUT through the real test interface.
+ // This can include addition of fields not present in the model or
+ // manipulation of unique identifiers in the messages that Qtronic
+ // cannot possible know at the time of test generation.
+ netIn.send(msgToSend);
+ }
+ function qtronic_send_UserInput_to_userIn(template UserInput msgToSend) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'msgToSend'
+ // before it is delivered to the SUT through the real test interface.
+ // This can include addition of fields not present in the model or
+ // manipulation of unique identifiers in the messages that Qtronic
+ // cannot possible know at the time of test generation.
+ userIn.send(msgToSend);
+ }
+ function qtronic_receive_SIPResp_from_netOut(template SIPResp tmplToMatch) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'tmplToMatch'
+ // before matching it against the expected value template.
+ // This manipulation typically means removing fields not present
+ // in the abstract model system interface.
+ netOut.receive(tmplToMatch);
+ }
+ function qtronic_receive_SIPReq_from_netOut(template SIPReq tmplToMatch) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'tmplToMatch'
+ // before matching it against the expected value template.
+ // This manipulation typically means removing fields not present
+ // in the abstract model system interface.
+ netOut.receive(tmplToMatch);
+ }
+ function qtronic_receive_TimeOutIndication_from_userOut(template TimeOutIndication tmplToMatch) runs on Qtronic_CT
+ {
+ // Do whatever manipulation is needed to 'tmplToMatch'
+ // before matching it against the expected value template.
+ // This manipulation typically means removing fields not present
+ // in the abstract model system interface.
+ userOut.receive(tmplToMatch);
+ }
+}
diff --git a/demo/mapped/MBT_Qtronic_Testcases.ttcn b/demo/mapped/MBT_Qtronic_Testcases.ttcn
new file mode 100644
index 0000000..b9c1272
--- /dev/null
+++ b/demo/mapped/MBT_Qtronic_Testcases.ttcn
@@ -0,0 +1,606 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Testcases.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-04-14
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+/* -*- ttcn3 -*- */
+
+/** @file C:\Users\eantwuh\workspace\SIPeval\MBT_Qtronic_Testcases.ttcn
+ *
+ * @author Conformiq TTCN3 Script Backend
+ * @date Wed Apr 14 13:17:47 CEST 2010
+ *
+ * WARNING! This file has been automatically generated using
+ * Ericsson Qtronic TTCN3 Script Backend (based on the original Conformiq Backend).DO NOT EDIT.
+ */
+
+module MBT_Qtronic_Testcases
+{
+ import from MBT_Qtronic_Types all;
+ import from MBT_Qtronic_TestHarness all;
+ /* User provided imports begin */
+ import from MBT_Qtronic_Demo all; import from EPTF_MBT_LGen_Definitions all;
+ /* User provided imports end */
+ /* Qtronic generated alt step */
+ altstep QtronicDefaultAlt() runs on Qtronic_CT
+ {
+ [] any port.receive
+ {
+ harnessTimer.stop;
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ [] harnessTimer.timeout
+ {
+ setverdict(fail);
+ f_MBT_Qtronic_Demo_endTestCase();
+ stop;
+ }
+ }
+ /* Generated test case #1 */
+ testcase Test_Case_1() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicHarnessAlt());
+ qtronic_send_UserInput_to_userIn(UserInputTemplate1);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate2);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate3);
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate4);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate5);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate1 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate2 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate3 :=
+ {
+ status := 180,
+ cseq := ""
+ }
+ template SIPResp SIPRespTemplate4 :=
+ {
+ status := 486,
+ cseq := "INVITE"
+ }
+ template SIPReq SIPReqTemplate5 :=
+ {
+ op := "ACK",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ /* Generated test case #2 */
+ testcase Test_Case_2() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicHarnessAlt());
+ qtronic_send_UserInput_to_userIn(UserInputTemplate6);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate7);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate8);
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate9);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate10);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPReq_to_netIn(SIPReqTemplate11);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPResp_from_netOut(SIPRespTemplate12);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate6 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate7 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate8 :=
+ {
+ status := 180,
+ cseq := ""
+ }
+ template SIPResp SIPRespTemplate9 :=
+ {
+ status := 200,
+ cseq := "INVITE"
+ }
+ template SIPReq SIPReqTemplate10 :=
+ {
+ op := "ACK",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate11 :=
+ {
+ op := "BYE",
+ param_ := "sip:127.0.0.1"
+ }
+ template SIPResp SIPRespTemplate12 :=
+ {
+ status := 200,
+ cseq := "BYE"
+ }
+ /* Generated test case #3 */
+ testcase Test_Case_3() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicHarnessAlt());
+ qtronic_send_UserInput_to_userIn(UserInputTemplate13);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate14);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ harnessTimer.start((0.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate15);
+ harnessTimer.stop;
+ oldtimer := 0.500000000;
+ harnessTimer.start((1.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate16);
+ harnessTimer.stop;
+ oldtimer := 1.500000000;
+ harnessTimer.start((3.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate17);
+ harnessTimer.stop;
+ oldtimer := 3.500000000;
+ harnessTimer.start((7.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate18);
+ harnessTimer.stop;
+ oldtimer := 7.500000000;
+ harnessTimer.start((8.0 - oldtimer) + SLACK);
+ qtronic_receive_TimeOutIndication_from_userOut(TimeOutIndicationTemplate19);
+ harnessTimer.stop;
+ oldtimer := 8.0;
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate13 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate14 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate15 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate16 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate17 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate18 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template TimeOutIndication TimeOutIndicationTemplate19 :=
+ {
+
+ }
+ /* Generated test case #4 */
+ testcase Test_Case_4() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicHarnessAlt());
+ qtronic_send_UserInput_to_userIn(UserInputTemplate20);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate21);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate22);
+ oldtimer := 0.0;
+ qtronic_send_UserInput_to_userIn(UserInputTemplate23);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate24);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate25);
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate26);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate27);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate20 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate21 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate22 :=
+ {
+ status := 180,
+ cseq := ""
+ }
+ template UserInput UserInputTemplate23 :=
+ {
+ input1 := "cancel",
+ input2 := ""
+ }
+ template SIPReq SIPReqTemplate24 :=
+ {
+ op := "CANCEL",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate25 :=
+ {
+ status := 200,
+ cseq := "CANCEL"
+ }
+ template SIPResp SIPRespTemplate26 :=
+ {
+ status := 487,
+ cseq := "INVITE"
+ }
+ template SIPReq SIPReqTemplate27 :=
+ {
+ op := "ACK",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ /* Generated test case #5 */
+ testcase Test_Case_5() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicHarnessAlt());
+ qtronic_send_UserInput_to_userIn(UserInputTemplate28);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate29);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate30);
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate31);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate32);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_UserInput_to_userIn(UserInputTemplate33);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate34);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate35);
+ oldtimer := 0.0;
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate28 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate29 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate30 :=
+ {
+ status := 180,
+ cseq := ""
+ }
+ template SIPResp SIPRespTemplate31 :=
+ {
+ status := 200,
+ cseq := "INVITE"
+ }
+ template SIPReq SIPReqTemplate32 :=
+ {
+ op := "ACK",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template UserInput UserInputTemplate33 :=
+ {
+ input1 := "bye",
+ input2 := ""
+ }
+ template SIPReq SIPReqTemplate34 :=
+ {
+ op := "BYE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate35 :=
+ {
+ status := 200,
+ cseq := ""
+ }
+ /* Generated test case #6 */
+ testcase Test_Case_6() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicHarnessAlt());
+ qtronic_send_UserInput_to_userIn(UserInputTemplate36);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate37);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate38);
+ oldtimer := 0.0;
+ qtronic_send_UserInput_to_userIn(UserInputTemplate39);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate40);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ harnessTimer.start((0.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate41);
+ harnessTimer.stop;
+ oldtimer := 0.500000000;
+ harnessTimer.start((1.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate42);
+ harnessTimer.stop;
+ oldtimer := 1.500000000;
+ harnessTimer.start((3.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate43);
+ harnessTimer.stop;
+ oldtimer := 3.500000000;
+ harnessTimer.start((7.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate44);
+ harnessTimer.stop;
+ oldtimer := 7.500000000;
+ harnessTimer.start((8.0 - oldtimer) + SLACK);
+ qtronic_receive_TimeOutIndication_from_userOut(TimeOutIndicationTemplate45);
+ harnessTimer.stop;
+ oldtimer := 8.0;
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate36 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate37 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate38 :=
+ {
+ status := 180,
+ cseq := ""
+ }
+ template UserInput UserInputTemplate39 :=
+ {
+ input1 := "cancel",
+ input2 := ""
+ }
+ template SIPReq SIPReqTemplate40 :=
+ {
+ op := "CANCEL",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate41 :=
+ {
+ op := "CANCEL",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate42 :=
+ {
+ op := "CANCEL",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate43 :=
+ {
+ op := "CANCEL",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate44 :=
+ {
+ op := "CANCEL",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template TimeOutIndication TimeOutIndicationTemplate45 :=
+ {
+
+ }
+ /* Generated test case #7 */
+ testcase Test_Case_7() runs on Qtronic_CT
+ {
+ var float oldtimer := 0.0;
+ var float SLACK := 10.0;
+ var default default_behaviour_ref;
+ f_MBT_Qtronic_Demo_beginTestCase();
+ default_behaviour_ref := activate(QtronicHarnessAlt());
+ qtronic_send_UserInput_to_userIn(UserInputTemplate46);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate47);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate48);
+ oldtimer := 0.0;
+ qtronic_send_SIPResp_to_netIn(SIPRespTemplate49);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate50);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ qtronic_send_UserInput_to_userIn(UserInputTemplate51);
+ oldtimer := 0.0;
+ harnessTimer.start((0.0 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate52);
+ harnessTimer.stop;
+ oldtimer := 0.0;
+ harnessTimer.start((0.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate53);
+ harnessTimer.stop;
+ oldtimer := 0.500000000;
+ harnessTimer.start((1.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate54);
+ harnessTimer.stop;
+ oldtimer := 1.500000000;
+ harnessTimer.start((3.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate55);
+ harnessTimer.stop;
+ oldtimer := 3.500000000;
+ harnessTimer.start((7.500000000 - oldtimer) + SLACK);
+ qtronic_receive_SIPReq_from_netOut(SIPReqTemplate56);
+ harnessTimer.stop;
+ oldtimer := 7.500000000;
+ harnessTimer.start((8.0 - oldtimer) + SLACK);
+ qtronic_receive_TimeOutIndication_from_userOut(TimeOutIndicationTemplate57);
+ harnessTimer.stop;
+ oldtimer := 8.0;
+ setverdict(pass);
+ deactivate(default_behaviour_ref);
+ f_MBT_Qtronic_Demo_endTestCase();
+ }
+ template UserInput UserInputTemplate46 :=
+ {
+ input1 := "invite",
+ input2 := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate47 :=
+ {
+ op := "INVITE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPResp SIPRespTemplate48 :=
+ {
+ status := 180,
+ cseq := ""
+ }
+ template SIPResp SIPRespTemplate49 :=
+ {
+ status := 200,
+ cseq := "INVITE"
+ }
+ template SIPReq SIPReqTemplate50 :=
+ {
+ op := "ACK",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template UserInput UserInputTemplate51 :=
+ {
+ input1 := "bye",
+ input2 := ""
+ }
+ template SIPReq SIPReqTemplate52 :=
+ {
+ op := "BYE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate53 :=
+ {
+ op := "BYE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate54 :=
+ {
+ op := "BYE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate55 :=
+ {
+ op := "BYE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template SIPReq SIPReqTemplate56 :=
+ {
+ op := "BYE",
+ param_ := "sip:127.0.0.1:5061"
+ }
+ template TimeOutIndication TimeOutIndicationTemplate57 :=
+ {
+
+ }
+ control
+ {
+ execute(Test_Case_1());
+ execute(Test_Case_2());
+ execute(Test_Case_3());
+ execute(Test_Case_4());
+ execute(Test_Case_5());
+ execute(Test_Case_6());
+ execute(Test_Case_7());
+ }
+}
diff --git a/demo/mapped/MBT_Qtronic_Types.ttcn b/demo/mapped/MBT_Qtronic_Types.ttcn
new file mode 100644
index 0000000..3ebc47f
--- /dev/null
+++ b/demo/mapped/MBT_Qtronic_Types.ttcn
@@ -0,0 +1,78 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_Qtronic_Types.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-04-14
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+/* -*- ttcn3 -*- */
+
+/** @file C:\Users\eantwuh\workspace\SIPeval\MBT_Qtronic_Types.ttcn
+ *
+ * @author Conformiq TTCN3 Script Backend
+ * @date Wed Apr 14 13:17:47 CEST 2010
+ *
+ * WARNING! This file has been automatically generated using
+ * Ericsson Qtronic TTCN3 Script Backend (based on the original Conformiq Backend).DO NOT EDIT.
+ */
+
+module MBT_Qtronic_Types
+{
+ /* User provided imports begin */
+ import from MBT_Qtronic_Demo all; import from EPTF_MBT_LGen_Definitions all;
+ /* User provided imports end */
+ type port netInPort message
+ {
+ inout SIPResp;
+ inout SIPReq;
+ } with {extension "internal"}
+ type port userInPort message
+ {
+ inout UserInput;
+ } with {extension "internal"}
+ type port netOutPort message
+ {
+ inout SIPResp;
+ inout SIPReq;
+ } with {extension "internal"}
+ type port userOutPort message
+ {
+ inout TimeOutIndication;
+ } with {extension "internal"}
+ type record SIPResp
+ {
+ integer status,
+ charstring cseq
+ }
+ type record UserInput
+ {
+ charstring input1,
+ charstring input2
+ }
+ type record TimeOutIndication
+ {
+
+ }
+ type record SIPReq
+ {
+ charstring op,
+ charstring param_
+ }
+ type component Qtronic_CT extends MBT_Qtronic_Demo_Main_CT
+ {
+ port netInPort netIn;
+ port userInPort userIn;
+ port netOutPort netOut;
+ port userOutPort userOut;
+ timer harnessTimer := 0.0;
+ }
+}
diff --git a/demo/mapped/model/SIPClient.java b/demo/mapped/model/SIPClient.java
new file mode 100644
index 0000000..36c7abd
--- /dev/null
+++ b/demo/mapped/model/SIPClient.java
@@ -0,0 +1,124 @@
+// -*- cqa -*-
+
+
+/* System Description
+ * Defines input/output ports,
+ * and valid messages per port.
+ */
+system
+{
+ Inbound userIn : UserInput;
+ Inbound netIn : SIPResp, SIPReq;
+ Outbound netOut : SIPResp, SIPReq;
+ Outbound userOut : TimeOutIndication;
+}
+
+
+/* ====================================================
+ * Message Definitions
+ */
+record TimeOutIndication { }
+
+record UserInput
+{
+ public String input1;
+ public String input2;
+}
+
+record SIPResp
+{
+ public int status;
+ public String cseq;
+}
+
+record SIPReq
+{
+ public String op;
+ public String param;
+}
+
+
+/* ====================================================
+ * SIPClient
+ */
+
+class SIPClient extends StateMachine {
+
+ const float T1 = 0.5; // For UDP transport
+
+ public float timeoutA = T1; // 17.1.1.2
+ public float timeoutB = 16 * T1; // 17.1.1.2
+ public float timeoutE = T1; // 17.1.2.2
+ public float timeoutF = 16 * T1; // 17.1.2.2
+
+
+ /* -----------------------------------------
+ * SIP addresses
+ * src = caller, dst = callee
+ */
+
+ public String src = "sip:127.0.0.1";
+ public String dst = "sip:127.0.0.1:5061";
+
+
+ /* -----------------------------------------
+ * Methods to send SIP messages to network.
+ */
+ public void Invite() {
+ SIPReq r;
+ r.op = "INVITE";
+ r.param = dst;
+ netOut.send(r, 1.0);
+ }
+
+ protected void Cancel() {
+ SIPReq r;
+ r.op = "CANCEL";
+ r.param = dst;
+ netOut.send(r, 1.0);
+ }
+
+ protected void Ack() {
+ SIPReq r;
+ r.op = "ACK";
+ r.param = dst;
+ netOut.send(r, 1.0);
+ }
+
+ protected void Bye() {
+ SIPReq r;
+ r.op = "BYE";
+ r.param = dst;
+ netOut.send(r, 1.0);
+ }
+
+ protected void SendOK(String cseq) {
+ SIPResp r;
+ r.status = 200;
+ r.cseq = cseq;
+ netOut.send(r, 1.0);
+ }
+
+
+ /* -----------------------------------------
+ * Methods to provide indications to the
+ * user interface.
+ */
+ private void TimeOut()
+ {
+ // Indicate timeout
+ TimeOutIndication timeout;
+ userOut.send(timeout);
+ }
+}
+
+
+/* ====================================================
+ * main() - Starting Point
+ */
+
+void main()
+{
+ var a = new SIPClient();
+ a.start();
+}
diff --git a/demo/mapped/model/SIPClient.xmi b/demo/mapped/model/SIPClient.xmi
new file mode 100644
index 0000000..86e3ceb
--- /dev/null
+++ b/demo/mapped/model/SIPClient.xmi
@@ -0,0 +1,326 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<n1:Project xmlns:n1="http://www.conformiq.com/EMF/SimpleStatechart" xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <statemachine name="SIPClient">
+ <transitions body="userIn:UserInput
[msg.input1=="invite" && msg.input2==dst]
/
Invite();" from="//@statemachine.0/@states.0" to="//@statemachine.0/@states.1"/>
+ <transitions body="netIn:SIPResp[msg.status==180]/
require true;" from="//@statemachine.0/@states.1" to="//@statemachine.0/@states.12"/>
+ <transitions body="netIn:SIPResp
[msg.status==200 &&
 msg.cseq == "INVITE"]
/Ack();
requirement "Acknowledge established call with ACK";" from="//@statemachine.0/@states.12" to="//@statemachine.0/@states.2"/>
+ <transitions body="after(timeoutB)/
requirement "17.1.1.2 INVITE timers/Terminates INVITE cycle after B timeout";
TimeOut();" from="//@statemachine.0/@states.1" to="//@statemachine.0/@states.5"/>
+ <transitions body="userIn:UserInput
[msg.input1=="bye"]/" from="//@statemachine.0/@states.2" to="//@statemachine.0/@states.3"/>
+ <transitions body="netIn:SIPResp
[msg.status==200]/
requirement "Terminating/Wait for OK in response to BYE";" from="//@statemachine.0/@states.3" to="//@statemachine.0/@states.10"/>
+ <transitions body="netIn:SIPReq
[msg.op=="BYE" &&
 msg.param==src]
/SendOK("BYE");
requirement "Terminating/Send OK in response to BYE";" from="//@statemachine.0/@states.2" to="//@statemachine.0/@states.8"/>
+ <transitions body="netIn:SIPResp
[msg.status==486 &&
 msg.cseq == "INVITE"]
/Ack();" from="//@statemachine.0/@states.12" to="//@statemachine.0/@states.11"/>
+ <transitions body="netIn:SIPResp
[msg.status==487 &&
msg.cseq=="INVITE"]/
Ack();" from="//@statemachine.0/@states.13" to="//@statemachine.0/@states.9"/>
+ <transitions body="/ setThreadName("SIP UAC");" from="//@statemachine.0/@states.4" to="//@statemachine.0/@states.0"/>
+ <transitions body="netIn:SIPResp
[msg.status==200 &&
msg.cseq=="CANCEL"]/" from="//@statemachine.0/@states.6" to="//@statemachine.0/@states.13"/>
+ <transitions body="after(timeoutF)/
requirement "17.1.2.2 Non-INVITE timers/Terminates BYE cycle after F timeout";
TimeOut();" from="//@statemachine.0/@states.3" to="//@statemachine.0/@states.5"/>
+ <transitions body="userIn:UserInput
[msg.input1=="cancel"]/" from="//@statemachine.0/@states.12" to="//@statemachine.0/@states.6"/>
+ <transitions body="after(timeoutF)/
requirement "17.1.2.2 Non-INVITE timers/Terminates CANCEL cycle after F timeout";
TimeOut();" from="//@statemachine.0/@states.6" to="//@statemachine.0/@states.7"/>
+ <states internal="" name="Init" xsi:type="n1:BasicState"/>
+ <states internal="" name="Calling" xsi:type="n1:BasicState">
+ <transitions body="after(timeoutA)/
Invite();
timeoutA = timeoutA * 2.0;
requirement "17.1.1.2 INVITE timers/Resends INVITE after A timeout";" from="//@statemachine.0/@states.1/@states.1" to="//@statemachine.0/@states.1/@states.2"/>
+ <transitions body="" from="//@statemachine.0/@states.1/@states.2" to="//@statemachine.0/@states.1/@states.1"/>
+ <transitions body="/timeoutA = T1;" from="//@statemachine.0/@states.1/@states.0" to="//@statemachine.0/@states.1/@states.1"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="" name="Wait" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:Junction"/>
+ </states>
+ <states internal="" name="Ready" xsi:type="n1:BasicState"/>
+ <states internal="" name="Terminating" xsi:type="n1:BasicState">
+ <transitions body="/Bye();
timeoutE = T1;" from="//@statemachine.0/@states.3/@states.0" to="//@statemachine.0/@states.3/@states.1"/>
+ <transitions body="after(timeoutE)/
Bye();
timeoutE = timeoutE * 2.0;
requirement "17.1.2.2 Non-INVITE timers/Resends BYE after E timeout";" from="//@statemachine.0/@states.3/@states.1" to="//@statemachine.0/@states.3/@states.2"/>
+ <transitions body="" from="//@statemachine.0/@states.3/@states.2" to="//@statemachine.0/@states.3/@states.1"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="" name="Wait" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:Junction"/>
+ </states>
+ <states xsi:type="n1:InitialState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states internal="" name="Canceling" xsi:type="n1:BasicState">
+ <transitions body="/Cancel();
timeoutE = T1;" from="//@statemachine.0/@states.6/@states.0" to="//@statemachine.0/@states.6/@states.1"/>
+ <transitions body="after(timeoutE)/
Cancel();
timeoutE = timeoutE * 2.0;
requirement "17.1.2.2 Non-INVITE timers/Resends CANCEL after E timeout";" from="//@statemachine.0/@states.6/@states.1" to="//@statemachine.0/@states.6/@states.2"/>
+ <transitions body="" from="//@statemachine.0/@states.6/@states.2" to="//@statemachine.0/@states.6/@states.1"/>
+ <states xsi:type="n1:InitialState"/>
+ <states internal="" name="Wait" xsi:type="n1:BasicState"/>
+ <states xsi:type="n1:Junction"/>
+ </states>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states xsi:type="n1:FinalState"/>
+ <states internal="" name="Ringing" xsi:type="n1:BasicState"/>
+ <states internal="" name="Waiting Response" xsi:type="n1:BasicState"/>
+ </statemachine>
+
+ <diagrams statemachine="//@statemachine.0">
+ <items height="50" state="//@statemachine.0/@states.0" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-600" y="-300"/>
+ </items>
+ <items height="50" state="//@statemachine.0/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-600" y="-100"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.2" width="200" xsi:type="n1:DiagramBasicState">
+ <location x="100" y="150"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.3" width="150" xsi:type="n1:DiagramBasicState">
+ <location x="-250" y="250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-540" y="-175"/>
+ <route x="-550" y="-250"/>
+ <route x="-550" y="-100"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-300" y="-85"/>
+ <route x="-500" y="-75"/>
+ <route x="-100" y="-75"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="0" x="417.917" y="3.888"/>
+ <route x="0" y="0"/>
+ <route x="200" y="0"/>
+ <route x="200" y="150"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.3" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-540" y="113.953"/>
+ <route x="-550" y="-50"/>
+ <route x="-550" y="277.906"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.4" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="230" constraintRight="80" valign="0" x="-37.5" y="210"/>
+ <route x="100" y="200"/>
+ <route x="-175" y="200"/>
+ <route x="-175" y="250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.5" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-172" y="416"/>
+ <route x="-182" y="350"/>
+ <route x="-182" y="482"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.6" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="210" y="315"/>
+ <route x="200" y="250"/>
+ <route x="200" y="380"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.7" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-215" y="40"/>
+ <route x="-100" y="50"/>
+ <route x="-330" y="50"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.8" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="685" y="202.5"/>
+ <route x="675" y="150"/>
+ <route x="675" y="255"/>
+ </items>
+ <items state="//@statemachine.0/@states.4" xsi:type="n1:DiagramInitialState">
+ <location x="-550" y="-350"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.9" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="-540" y="-315"/>
+ <route x="-550" y="-330"/>
+ <route x="-550" y="-300"/>
+ </items>
+ <items state="//@statemachine.0/@states.5" xsi:type="n1:DiagramFinalState">
+ <location x="-550" y="297.906"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.10" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="685" y="25"/>
+ <route x="675" y="-50"/>
+ <route x="675" y="100"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.11" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-425.57" y="400.906"/>
+ <route x="-250" y="298.763"/>
+ <route x="-530" y="297.963"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.6" width="150" xsi:type="n1:DiagramBasicState">
+ <location x="600" y="-150"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@transitions.12" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="300" y="-87.5"/>
+ <route x="0" y="-77.5"/>
+ <route x="600" y="-77.5"/>
+ </items>
+ <items state="//@statemachine.0/@states.7" xsi:type="n1:DiagramFinalState">
+ <location x="675" y="-275.13"/>
+ </items>
+ <items autolayout="false" transition="//@statemachine.0/@transitions.13" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0" valign="0.5" x="536.844" y="-195.261"/>
+ <route x="675" y="-150"/>
+ <route x="675" y="-255.13"/>
+ </items>
+ <items state="//@statemachine.0/@states.8" xsi:type="n1:DiagramFinalState">
+ <location x="200" y="400"/>
+ </items>
+ <items state="//@statemachine.0/@states.9" xsi:type="n1:DiagramFinalState">
+ <location x="675" y="275"/>
+ </items>
+ <items state="//@statemachine.0/@states.10" xsi:type="n1:DiagramFinalState">
+ <location x="-182" y="502"/>
+ </items>
+ <items state="//@statemachine.0/@states.11" xsi:type="n1:DiagramFinalState">
+ <location x="-350" y="50"/>
+ </items>
+ <items height="250" state="//@statemachine.0/@states.12" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-100" y="-150"/>
+ </items>
+ <items height="50" state="//@statemachine.0/@states.13" width="150" xsi:type="n1:DiagramBasicState">
+ <location x="600" y="100"/>
+ </items>
+ <items height="120" note="Triggered by user action, send INVITE request. (We are initiating a new call.)" width="161" xsi:type="n1:DiagramNote">
+ <location x="-838" y="-142"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.1" note="//@diagrams.0/@items.28" xsi:type="n1:DiagramNoteConnector">
+ <route x="-677" y="-75"/>
+ <route x="-600" y="-75"/>
+ </items>
+ <items height="76" note="21.1.2 180 Ringing
waiting for other end to answer" width="174" xsi:type="n1:DiagramNote">
+ <location x="-100" y="-300"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.26" note="//@diagrams.0/@items.30" xsi:type="n1:DiagramNoteConnector">
+ <route x="-50" y="-224"/>
+ <route x="-50" y="-150"/>
+ </items>
+ <items height="131" note="It is ringing, but we want to cancel (hang-up) before other end answers" width="169" xsi:type="n1:DiagramNote">
+ <location x="250" y="-321"/>
+ </items>
+ <items autolayout="false" note="//@diagrams.0/@items.32" xsi:type="n1:DiagramNoteConnector">
+ <route x="327" y="-190"/>
+ <route x="327" y="-80"/>
+ </items>
+ <items height="84" note="Now we can speak with other end" width="143" xsi:type="n1:DiagramNote">
+ <location x="-35" y="275"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.2" note="//@diagrams.0/@items.34" xsi:type="n1:DiagramNoteConnector">
+ <route x="88" y="275"/>
+ <route x="120" y="250"/>
+ </items>
+ <items height="66" note="21.4.24 486 Busy Here
Callee rejects call" width="179" xsi:type="n1:DiagramNote">
+ <location x="-494" y="-57"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.0/@items.25" note="//@diagrams.0/@items.36" xsi:type="n1:DiagramNoteConnector">
+ <route x="-350" y="9"/>
+ <route x="-350" y="30"/>
+ </items>
+ <items height="52" note="2.1.4.25 487 Request Terminated
call is now terminated" width="257" xsi:type="n1:DiagramNote">
+ <location x="370" y="168"/>
+ </items>
+ <items autolayout="false" note="//@diagrams.0/@items.38" xsi:type="n1:DiagramNoteConnector">
+ <route x="627" y="200"/>
+ <route x="675" y="202"/>
+ </items>
+ <items height="69" note="Paragraph numbers in comments and requiremnts refer to RFC 3261 SIP: Session Initiation Protocol" width="307" xsi:type="n1:DiagramNote">
+ <location x="-238" y="-433"/>
+ </items>
+ </diagrams>
+
+ <diagrams cursorItem="after(timeoutE)/
Bye();
timeoutE = timeoutE * 2.0;
requirement "17.1.2.2 Non-INVITE timers/Resends BYE after E timeout";" cursorOffset="14" selected="//@diagrams.1/@items.4" substate="//@statemachine.0/@states.3">
+ <items state="//@statemachine.0/@states.3/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="-1200" y="-200"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.3/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-1000" y="-250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.3/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-1090" y="-210"/>
+ <route x="-1180" y="-200"/>
+ <route x="-1000" y="-200"/>
+ </items>
+ <items state="//@statemachine.0/@states.3/@states.2" xsi:type="n1:DiagramJunction">
+ <location x="-600" y="-100"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.3/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="-130" constraintLeft="-880" valign="0" x="-750" y="-190"/>
+ <route x="-900" y="-200"/>
+ <route x="-600" y="-200"/>
+ <route x="-600" y="-110"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.3/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintRight="-630" constraintTop="-130" valign="1" x="-780" y="-110"/>
+ <route x="-610" y="-100"/>
+ <route x="-950" y="-100"/>
+ <route x="-950" y="-150"/>
+ </items>
+ <items height="150" note="Re-send BYE message after time-out and increase value of timer E according to RFC 3261 17.1.2 Non-INVITE Client Transaction." width="350" xsi:type="n1:DiagramNote">
+ <location x="-1100" y="-50"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.1/@items.3" note="//@diagrams.1/@items.6" xsi:type="n1:DiagramNoteConnector">
+ <route x="-750" y="-30"/>
+ <route x="-609.062" y="-95.7711"/>
+ </items>
+ </diagrams>
+
+ <diagrams cursorItem="after(timeoutA)/
Invite();
timeoutA = timeoutA * 2.0;
requirement "17.1.1.2 INVITE timers/Resends INVITE after A timeout";" cursorOffset="46" selected="//@diagrams.2/@items.3" substate="//@statemachine.0/@states.1">
+ <items state="//@statemachine.0/@states.1/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="-1200" y="-300"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.1/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-1000" y="-350"/>
+ </items>
+ <items state="//@statemachine.0/@states.1/@states.2" xsi:type="n1:DiagramJunction">
+ <location x="-600" y="-200"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.1/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="-230" constraintLeft="-880" valign="0" x="-750" y="-290"/>
+ <route x="-900" y="-300"/>
+ <route x="-600" y="-300"/>
+ <route x="-600" y="-210"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.1/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintRight="-630" constraintTop="-230" valign="1" x="-780" y="-210"/>
+ <route x="-610" y="-200"/>
+ <route x="-950" y="-200"/>
+ <route x="-950" y="-250"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.1/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-1090" y="-310"/>
+ <route x="-1180" y="-300"/>
+ <route x="-1000" y="-300"/>
+ </items>
+ <items height="150" note="Re-send INVITE message after time-out and increase value of timer A according to RFC 3261 17.1.1 INVITE Client Transaction." width="350" xsi:type="n1:DiagramNote">
+ <location x="-1100" y="-150"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.2/@items.2" note="//@diagrams.2/@items.6" xsi:type="n1:DiagramNoteConnector">
+ <route x="-750" y="-130"/>
+ <route x="-609.062" y="-195.771"/>
+ </items>
+ </diagrams>
+
+ <diagrams substate="//@statemachine.0/@states.6">
+ <items state="//@statemachine.0/@states.6/@states.0" xsi:type="n1:DiagramInitialState">
+ <location x="-1300" y="-300"/>
+ </items>
+ <items height="100" state="//@statemachine.0/@states.6/@states.1" width="100" xsi:type="n1:DiagramBasicState">
+ <location x="-1100" y="-350"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.6/@transitions.0" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" valign="1" x="-1190" y="-310"/>
+ <route x="-1280" y="-300"/>
+ <route x="-1100" y="-300"/>
+ </items>
+ <items state="//@statemachine.0/@states.6/@states.2" xsi:type="n1:DiagramJunction">
+ <location x="-700" y="-200"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.6/@transitions.1" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintBottom="-230" constraintLeft="-980" valign="0" x="-850" y="-290"/>
+ <route x="-1000" y="-300"/>
+ <route x="-700" y="-300"/>
+ <route x="-700" y="-210"/>
+ </items>
+ <items autolayout="true" transition="//@statemachine.0/@states.6/@transitions.2" xsi:type="n1:DiagramTransition">
+ <bodylocation align="0.5" constraintRight="-730" constraintTop="-230" valign="1" x="-880" y="-210"/>
+ <route x="-710" y="-200"/>
+ <route x="-1050" y="-200"/>
+ <route x="-1050" y="-250"/>
+ </items>
+ <items height="150" note="Re-send CANCEL message after time-out and increase value of timer E according to RFC 3261 17.1.2 Non-INVITE Client Transaction." width="350" xsi:type="n1:DiagramNote">
+ <location x="-1200" y="-150"/>
+ </items>
+ <items autolayout="false" item="//@diagrams.3/@items.3" note="//@diagrams.3/@items.6" xsi:type="n1:DiagramNoteConnector">
+ <route x="-850" y="-130"/>
+ <route x="-709.062" y="-195.771"/>
+ </items>
+ </diagrams>
+
+</n1:Project>
diff --git a/demo/sut/MBT_SUT_SIP_Phone.ttcn b/demo/sut/MBT_SUT_SIP_Phone.ttcn
new file mode 100644
index 0000000..504c2e6
--- /dev/null
+++ b/demo/sut/MBT_SUT_SIP_Phone.ttcn
@@ -0,0 +1,403 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: MBT_SUT_SIP_Phone.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2009-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+module MBT_SUT_SIP_Phone
+{
+import from MBT_Qtronic_Types all;
+
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_RBTScheduler_Functions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+import from EPTF_CLL_LGenBase_ConfigFunctions all;
+import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_MBT_LGen_Functions all;
+
+import from EPTF_SIP_LGen_Definitions all;
+import from EPTF_SIP_LGen_Functions all;
+import from EPTF_SIP_Common_Functions all;
+import from EPTF_SIP_UserDatabase_Functions all;
+import from EPTF_SIP_Transport_Definitions all;
+import from EPTF_SIP_Transport_Functions all;
+import from EPTF_SIP_MessageHandler_Functions all;
+
+import from EPTF_SIP_TestSteps all;
+import from EPTF_SIP_Templates all;
+import from EPTF_SIP_Events all;
+
+modulepar
+{
+ charstring tsp_MBT_SUT_LocalIP := "159.107.193.33";
+ integer tsp_MBT_SUT_LocalPort := 20000;
+ charstring tsp_MBT_SUT_RemoteIP := "159.107.193.33";
+ integer tsp_MBT_SUT_RemotePort := 15000;
+
+ charstring tsp_MBT_SUT_SIP_Transport := "udp";
+}
+
+type component MBT_Qtronic_Demo_SUT_CT
+ extends
+ EPTF_MBT_LGen_CT,
+ EPTF_SIP_LGen_CT, EPTF_SIP_LocalTransport_CT
+{
+ port userInPort userIn;
+ port userOutPort userOut;
+
+ var integer v_SUT_myBIdx := -1;
+}
+
+function f_MBT_Qtronic_Demo_SUT_behavior() runs on MBT_Qtronic_Demo_SUT_CT
+{
+ // map(self:IPL4_PCO, system:IPL4_PCO);
+
+ activate(as_MBT_Qtronic_Demo_SUT_userMessageHandler());
+
+ f_EPTF_MBT_init("MBT_Demo_SUT",0, "MBT_")
+
+ f_SIP_applibInit("MBT_Demo_SUT");
+
+ f_EPTF_SIP_LocalTransport_init(tsp_MBT_SUT_SIP_Transport);
+ vf_EPTF_SIP_LocalTransport_receive := refers(f_EPTF_SIP_Message_MsgHandler); //receive callback function on LocalTransport
+ vf_EPTF_SIP_LGen_msgSender := refers(f_EPTF_SIP_LocalTransport_sendSIPMessage); //send callback function on LGen
+ v_removeUAS := refers(fcb_EPTF_SIP_LocalTransport_removeUAS);
+
+ v_SUT_myBIdx := f_EPTF_LGenBase_declareBehaviorType("SUT_Behavior", -1, null, null, null);
+
+ var integer vl_temp := -1;
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent("SUT_Behavior", "SUT_INVITE");
+ f_EPTF_Base_assert(%definitionId&": Error during registration of SUT_INVITE", vl_temp == c_MBT_Qtronic_Demo_SUT_Event_invite);
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent("SUT_Behavior", "SUT_CANCEL");
+ f_EPTF_Base_assert(%definitionId&": Error during registration of SUT_CANCEL", vl_temp == c_MBT_Qtronic_Demo_SUT_Event_cancel);
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent("SUT_Behavior", "SUT_BYE");
+ f_EPTF_Base_assert(%definitionId&": Error during registration of SUT_BYE", vl_temp == c_MBT_Qtronic_Demo_SUT_Event_bye);
+
+
+ f_EPTF_LGenBase_declareCompactFsmTable(f_IMBT_Qtronic_Demo_SUT_getFSM());
+
+ f_EPTF_MBT_initLGenFsm
+ (
+ refers(f_MBT_Qtronic_Demo_SUT_createUserMessage),
+ refers(f_MBT_Qtronic_Demo_SUT_fillInDB)
+ );
+
+ EPTF_MBT_PCO.send(EPTF_MBT_CommandResponse:{ ready := {}}) to mtc;
+
+ f_EPTF_Base_wait4Shutdown();
+}
+
+altstep as_MBT_Qtronic_Demo_SUT_userMessageHandler()
+runs on MBT_Qtronic_Demo_SUT_CT
+{
+ var UserInput vl_UserInput;
+
+ [] userIn.receive(UserInput:?) -> value vl_UserInput
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ action(%definitionId, " incoming: ", vl_UserInput);
+
+ if (vl_UserInput.input1 == "invite")
+ {
+ f_EPTF_LGenBase_dispatchEvent({{v_SUT_myBIdx, c_MBT_Qtronic_Demo_SUT_Event_invite,{ 0, 0}, omit},{}});
+ }
+ else if (vl_UserInput.input1 == "cancel")
+ {
+ f_EPTF_LGenBase_dispatchEvent({{v_SUT_myBIdx, c_MBT_Qtronic_Demo_SUT_Event_cancel,{ 0, 0}, omit},{}});
+ }
+ else if (vl_UserInput.input1 == "bye")
+ {
+ f_EPTF_LGenBase_dispatchEvent({{v_SUT_myBIdx, c_MBT_Qtronic_Demo_SUT_Event_bye,{ 0, 0}, omit},{}});
+ }
+ else
+ {
+ action(%definitionId & "(): UserInput not recognized: ", vl_UserInput);
+ }
+
+ repeat;
+ }
+}
+
+function f_MBT_Qtronic_Demo_SUT_createUserMessage(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_Qtronic_Demo_SUT_CT
+return boolean
+{
+ action(%definitionId & "(): creating message for: ", pl_ptr, "\n", pl_ptr.reportedEvent);
+ return true;
+}
+
+function f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication(in EPTF_LGenBase_TestStepArgs pl_ptr)
+runs on MBT_Qtronic_Demo_SUT_CT
+{
+ userOut.send(TimeOutIndication:{});
+}
+
+function f_MBT_Qtronic_Demo_SUT_fillInDB(in EPTF_MBT_ConfigRequest p_req) runs on MBT_Qtronic_Demo_SUT_CT
+{
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(p_req.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ for (var integer i:=0; i<p_req.noEntities; i:=i+1)
+ {
+ var EPTF_IntegerList vl_bCtx := f_EPTF_LGenBase_getBehaviorCtx(i + vl_entityIdx, v_SIP_myBIdx);
+ f_EPTF_SIP_IPL4asp_SetUserData
+ (
+ vl_bCtx[0],
+ tsp_MBT_SUT_LocalIP, // local IP
+ {tsp_MBT_SUT_LocalPort, tsp_MBT_SUT_LocalPort+1},
+ tsp_MBT_SUT_SIP_Transport,
+ tsp_MBT_SUT_RemoteIP, // proxy ip
+ tsp_MBT_SUT_RemotePort // proxy port
+ );
+
+ f_EPTF_SIP_User_SetUserData(
+ vl_bCtx[0],
+ {
+ {
+ addr := {
+ nameAddr := {
+ displayName := "titansim_user_7465001",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465001",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := tsp_MBT_SUT_LocalPort
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ },
+ password := "pass2ICS"
+ }
+ },
+ tsp_MBT_SUT_LocalIP,
+ {tsp_MBT_SUT_LocalPort, tsp_MBT_SUT_LocalPort+1},
+ i + vl_entityIdx //entity index
+ );
+
+ f_EPTF_SIP_Session_AddData(vl_bCtx[0], f_EPTF_SIP_getTransport(tsp_MBT_SUT_SIP_Transport),345600);
+
+ f_EPTF_SIP_Session_addCalledUser(
+ i,
+ {
+ nameAddr := {
+ displayName := "titansim_user_7465000",
+ addrSpec := {
+ scheme := "sip",
+ userInfo := {
+ userOrTelephoneSubscriber := "titansim_user_7465000",
+ password := omit
+ },
+ hostPort := {
+ host := "tcj.ics.se",
+ portField := tsp_MBT_SUT_RemotePort
+ },
+ urlParameters := omit,
+ headers := omit
+ }
+ }
+ }
+ );
+
+ f_EPTF_SIP_IPL4asp_startListening(vl_bCtx[0], true); // Both UDP and TCP
+ }
+}
+
+const integer c_MBT_Qtronic_Demo_SUT_Event_invite := 0;
+const integer c_MBT_Qtronic_Demo_SUT_Event_cancel := 1;
+const integer c_MBT_Qtronic_Demo_SUT_Event_bye := 2;
+
+const integer c_MBT_Qtronic_Demo_SUT_State_idle := 0;
+const integer c_MBT_Qtronic_Demo_SUT_State_initiated := 1;
+const integer c_MBT_Qtronic_Demo_SUT_State_canceling := 2;
+const integer c_MBT_Qtronic_Demo_SUT_State_established := 3;
+const integer c_MBT_Qtronic_Demo_SUT_State_closing := 4;
+
+function f_IMBT_Qtronic_Demo_SUT_getFSM()
+ runs on MBT_Qtronic_Demo_SUT_CT
+ return EPTF_LGenBase_CompactFsmTable
+{
+ return
+ {
+ //DOT: digraph c_MBT_Qtronic_Demo_SUT_FSM {
+ name := "MBT_Qtronic_Demo_SUT_FSM",
+ stateList := {"idle", "initiated", "canceling", "established", "closing"},
+ timerList := {},
+ table :=
+ {
+ {eventToListen := {v_SUT_myBIdx, c_MBT_Qtronic_Demo_SUT_Event_invite, entity},
+ cellRow := {
+ //state=idle
+ { {
+ //DOT: idle -> initiated [label="i:invite\n o:INVITE"]
+ {refers(f_SIP_step_init), {}},
+ {refers(f_SIP_step_createINVITE),{0,0}}
+ },omit, c_MBT_Qtronic_Demo_SUT_State_initiated},
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SUT_myBIdx, c_MBT_Qtronic_Demo_SUT_Event_cancel, entity},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { {
+ //DOT: initiated -> canceling [label="i:cancel\n o:CANCEL"]
+ {refers(f_SIP_step_createCANCEL),{}}
+ },omit, c_MBT_Qtronic_Demo_SUT_State_canceling},
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SUT_myBIdx, c_MBT_Qtronic_Demo_SUT_Event_bye, entity},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { {
+ //DOT: established -> closing [label="i:bye\n o:BYE"]
+ {refers(f_SIP_step_createBYE),{}}
+ },omit, c_MBT_Qtronic_Demo_SUT_State_closing},
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, 200, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { {
+ //DOT: initiated -> established [label="i:200\n o:ACK"]
+ {refers(f_SIP_step_createACK),{}}
+ },omit, c_MBT_Qtronic_Demo_SUT_State_established},
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { {
+ //DOT: closing -> idle [label="i:200"]
+ },omit, c_MBT_Qtronic_Demo_SUT_State_idle }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, 486, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { {
+ //DOT: initiated -> idle [label="i:486\n o:ACK"]
+ {refers(f_SIP_step_createACK),{}}
+ },omit, c_MBT_Qtronic_Demo_SUT_State_idle},
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, 487, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { {
+ //DOT: canceling -> idle [label="i:487\n o:ACK"]
+ {refers(f_SIP_step_createACK),{}}
+ },omit, c_MBT_Qtronic_Demo_SUT_State_idle},
+ //state=established
+ { omit, omit, omit },
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, c_SIP_eventIdx_BYE, fsm},
+ cellRow := {
+ //state=idle
+ { omit, omit, omit },
+ //state=initiated
+ { omit, omit, omit },
+ //state=canceling
+ { omit, omit, omit },
+ //state=established
+ { {
+ //DOT: canceling -> idle [label="i:487\n o:ACK"]
+ {refers(f_SIP_step_handleBYE), {}},
+ {refers(f_SIP_step_createResponse),{c_status_200OK_idx}}
+ },omit, c_MBT_Qtronic_Demo_SUT_State_idle},
+ //state=closing
+ { omit, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, c_SIP_eventIdx_UACTransactionTimeout, fsm},
+ cellRow := {
+ //state=idle
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=initiated
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=canceling
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=established
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=closing
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit }
+ }
+ },
+ {eventToListen := {v_SIP_myBIdx, c_SIP_eventIdx_UASTransactionTimeout, fsm},
+ cellRow := {
+ //state=idle
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=initiated
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=canceling
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=established
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit },
+ //state=closing
+ { { {refers(f_MBT_Qtronic_Demo_SUT_stepSendTimeoutIndication), {}} }, omit, omit }
+ }
+ }//row
+ }//table
+ }//fsm
+ //DOT: }
+}
+
+}
diff --git a/doc/EPTF_Applib_MBT_CNL113659_FS.doc b/doc/EPTF_Applib_MBT_CNL113659_FS.doc
new file mode 100644
index 0000000..fdd45a5
--- /dev/null
+++ b/doc/EPTF_Applib_MBT_CNL113659_FS.doc
Binary files differ
diff --git a/doc/EPTF_Applib_MBT_CNL113659_PRI.doc b/doc/EPTF_Applib_MBT_CNL113659_PRI.doc
new file mode 100644
index 0000000..b86ff91
--- /dev/null
+++ b/doc/EPTF_Applib_MBT_CNL113659_PRI.doc
Binary files differ
diff --git a/doc/EPTF_Applib_MBT_CNL113659_UG_2.doc b/doc/EPTF_Applib_MBT_CNL113659_UG_2.doc
new file mode 100644
index 0000000..5e20f69
--- /dev/null
+++ b/doc/EPTF_Applib_MBT_CNL113659_UG_2.doc
Binary files differ
diff --git a/src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn b/src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn
new file mode 100755
index 0000000..92ffacd
--- /dev/null
+++ b/src/LoadGen/EPTF_MBT_LGen_Definitions.ttcn
@@ -0,0 +1,641 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: EPTF_MBT_LGen_Definitions.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////
+// Module: EPTF_MBT_LGen_Definitions
+//
+// Purpose:
+// Type definitions for the MBT Applib
+//
+// Module paramters:
+// - tsp_EPTF_MBT_LGen_debug - *boolean* - Enable/disable verbose debugging
+// - tsp_EPTG_MBT_execute_lockTimeout - *float* - Maximum waiting time for
+// the f_EPTF_MBT_execute function when locking is used.
+//
+// Module depends on:
+// <EPTF_CLL_Base_Definitions>
+//
+// <EPTF_CLL_Common_Definitions>
+//
+// <EPTF_CLL_Scheduler_Definitions>
+//
+// <EPTF_CLL_RBTScheduler_Definitions>
+//
+// <EPTF_CLL_LGenBase_Definitions>
+//
+// <EPTF_CLL_FBQ_Definitions>
+//
+// <EPTF_CLL_Logging_Definitions>
+//
+////////////////////////////////////////////////////
+module EPTF_MBT_LGen_Definitions
+{
+import from EPTF_CLL_Base_Definitions all;
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Scheduler_Definitions all;
+import from EPTF_CLL_RBTScheduler_Definitions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+import from EPTF_CLL_FBQ_Definitions all;
+import from EPTF_CLL_Logging_Definitions all;
+import from EPTF_CLL_Semaphore_Definitions all;
+
+modulepar
+{
+ boolean tsp_EPTF_MBT_LGen_debug := false;
+ float tsp_EPTG_MBT_execute_lockTimeout := 5.0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_myBName
+//
+// Purpose:
+// constant for the behavior name
+//
+///////////////////////////////////////////////////////////////////////////////
+const charstring c_EPTF_MBT_myBName:="MBT_behavior";
+
+//*******************************************************************************************************
+// Events
+//*******************************************************************************************************
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_inputIdx_incomingUserRequest
+//
+// Purpose:
+// constant for the input index of incomming user request
+//
+///////////////////////////////////////////////////////////////////////////////
+const integer c_EPTF_MBT_inputIdx_incomingUserRequest := 0;
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_inputIdx_incomingUserRequest
+//
+// Purpose:
+// constant for the input name of incomming request
+//
+///////////////////////////////////////////////////////////////////////////////
+const charstring c_EPTF_MBT_inputName_incomingUserRequest := "EPTF_MBT_inputName_incomingUserRequest";
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_inputIdx_incomingTestStepRequest
+//
+// Purpose:
+// constant for the input index of incomming TesStep request
+//
+///////////////////////////////////////////////////////////////////////////////
+const integer c_EPTF_MBT_inputIdx_incomingTestStepRequest := 1;
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_inputName_incomingTestStepRequest
+//
+// Purpose:
+// constant for the input name of TEstStep Request
+//
+///////////////////////////////////////////////////////////////////////////////
+const charstring c_EPTF_MBT_inputName_incomingTestStepRequest := "EPTF_MBT_inputName_incomingTestStepRequest";
+
+
+
+//*******************************************************************************************************
+// TestSteps
+//*******************************************************************************************************
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_stepIdx_invokeTestStep
+//
+// Purpose:
+// constant for the step index of invoke TestStep
+//
+///////////////////////////////////////////////////////////////////////////////
+const integer c_EPTF_MBT_stepIdx_invokeTestStep:=0;
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_stepIdx_invokeTestStep
+//
+// Purpose:
+// constant for the step name of invoke TestStep
+//
+///////////////////////////////////////////////////////////////////////////////
+const charstring c_EPTF_MBT_stepName_invokeTestStep :="EPTF_MBT_stepName_invokeTestStep";
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_stepIdx_sendUserResponse
+//
+// Purpose:
+// constant for the step index of send user response
+//
+///////////////////////////////////////////////////////////////////////////////
+const integer c_EPTF_MBT_stepIdx_sendUserResponse:=2;
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_stepName_sendUserResponse
+//
+// Purpose:
+// constant for the step name of send user response
+//
+///////////////////////////////////////////////////////////////////////////////
+const charstring c_EPTF_MBT_stepName_sendUserResponse :="EPTF_MBT_stepName_sendUserResponse";
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_stepIdx_invokeUserFunction
+//
+// Purpose:
+// constant for the step index of invoke user function
+//
+///////////////////////////////////////////////////////////////////////////////
+const integer c_EPTF_MBT_stepIdx_invokeUserFunction:=1;
+
+///////////////////////////////////////////////////////////////////////////////
+// const: c_EPTF_MBT_stepName_invokeUserFunction
+//
+// Purpose:
+// constant for the step name of invoke user function
+//
+///////////////////////////////////////////////////////////////////////////////
+const charstring c_EPTF_MBT_stepName_invokeUserFunction :="EPTF_MBT_stepName_invokeUserFunction";
+
+
+//*******************************************************************************************************
+// Component Type
+//*******************************************************************************************************
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_LGen_CT
+//
+// Purpose:
+// MBT application library component type
+//
+// Extensions:
+// EPTF_LGenBase_CT
+//
+// EPTF_Scheduler_CT
+//
+// EPTF_Logging_CT
+//
+// Variables:
+// v_EPTF_MBT_initialized - *boolean* - component initialization state
+//
+// v_EPTF_MBT_myName - *charstring* - component's self name
+//
+// vf_EPTF_MBT_entityGroupCreated - <fcb_EPTF_MBT_entityGroupCreated> - Entity Group created callback function
+//
+// vf_EPTF_MBT_createUserResponse - <fcb_EPTF_MBT_customUserFunction> - Custom User function
+//
+// v_EPTF_MBT_myBIdx - *integer* - self behavior index
+//
+// v_EPTF_MBT_LoggingMaskId - *integer* - logging mask id
+//
+// Timers:
+// -
+//
+// Ports:
+// EPTF_MBT_PCO <EPTF_MBT_PortType>
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type component EPTF_MBT_LGen_CT extends EPTF_LGenBase_CT, EPTF_Scheduler_CT, EPTF_Logging_CT, EPTF_Semaphore_CT
+{
+
+ var boolean v_EPTF_MBT_initialized := false;
+ var integer v_EPTF_MBT_myBIdx := -1;
+ var charstring v_EPTF_MBT_myName := "";
+ var integer v_EPTF_MBT_LoggingMaskId := -1;
+
+ var EPTF_MBT_TestStepRequest v_EPTF_MBT_TestStepRequest;
+ var EPTF_MBT_EventDispatchRequest v_EPTF_MBT_EventDispatchRequest;
+ var EPTF_MBT_ConfigRequest v_EPTF_MBT_ConfigRequest;
+ var EPTF_MBT_CommandRequest v_EPTF_MBT_CommandRequest;
+ var EPTF_MBT_UserRequest v_EPTF_MBT_UserRequest;
+ var EPTF_MBT_CreateFSMRequest v_EPTF_MBT_CreateFSMRequest;
+ var EPTF_MBT_RemoveFSMRequest v_EPTF_MBT_RemoveFSMRequest;
+
+ var fcb_EPTF_MBT_entityGroupCreated vf_EPTF_MBT_entityGroupCreated := null;
+ var fcb_EPTF_MBT_customUserFunction vf_EPTF_MBT_createUserResponse := null;
+
+ port EPTF_MBT_PortType EPTF_MBT_PCO;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_Tester_CT
+//
+// Purpose:
+// MBT tester component type
+//
+// Extensions:
+// EPTF_LGenBase_CT
+//
+// EPTF_Scheduler_CT
+//
+// EPTF_Logging_CT
+//
+// Variables:
+// -
+//
+// Timers:
+// -
+//
+// Ports:
+// EPTF_MBT_PCO <EPTF_MBT_PortType>
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type component EPTF_MBT_Tester_CT extends EPTF_Base_CT, EPTF_Semaphore_CT
+{
+ port EPTF_MBT_PortType EPTF_MBT_TESTER_PCO;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_PortType
+//
+// Purpose:
+// Messages based port to connect the Tester comopnent to the loadGen component.
+//
+// Handled messages:
+// inout EPTF_MBT_TestStepRequest, EPTF_MBT_TestStepResponse;
+// inout EPTF_MBT_ConfigRequest, EPTF_MBT_ConfigResponse;
+// inout EPTF_MBT_CommandRequest, EPTF_MBT_CommandResponse;
+// inout EPTF_MBT_UserRequest, EPTF_MBT_UserResponse;
+// inout EPTF_MBT_CreateFSMRequest, EPTF_MBT_CreateFSMResponse;
+// inout EPTF_MBT_RemoveFSMRequest, EPTF_MBT_RemoveFSMResponse;
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type port EPTF_MBT_PortType message
+{
+ inout EPTF_MBT_TestStepRequest, EPTF_MBT_TestStepResponse;
+ inout EPTF_MBT_ConfigRequest, EPTF_MBT_ConfigResponse;
+ inout EPTF_MBT_CommandRequest, EPTF_MBT_CommandResponse;
+ inout EPTF_MBT_UserRequest, EPTF_MBT_UserResponse;
+ inout EPTF_MBT_CreateFSMRequest,EPTF_MBT_CreateFSMResponse;
+ inout EPTF_MBT_RemoveFSMRequest,EPTF_MBT_RemoveFSMResponse;
+ inout EPTF_MBT_EventDispatchRequest;
+}
+with { extension "internal" }
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_TestStepRequest
+//
+// Purpose:
+// Describes the TestStep request
+//
+// Elements:
+// stepname - *charstring* - Name of the requested TestStep
+// stepArgs - <EPTF_IntegerList> - Container for the TestStep arguments
+// addr - <FsmAddr> - Address of the FSM
+// lock - integer - After the test step was executed the semaphor with this
+// id will be unlocked by the applib.
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_TestStepRequest
+{
+ charstring stepName,
+ EPTF_IntegerList stepArgs,
+ FsmAddr addr optional,
+ integer lock optional
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_UserRequest
+//
+// Purpose:
+// Describes the User Request request
+//
+// Elements:
+// functionName - *charstring* - Name of the requested function
+// functionArgs - <EPTF_IntegerList> - Container for the function arguments
+// addr - <FsmAddr> - Address of the FSM
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_UserRequest
+{
+ charstring functionName,
+ EPTF_IntegerList functionArgs,
+ FsmAddr addr optional
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_UserResponse
+//
+// Purpose:
+// Describes the UserResponse
+//
+// Elements:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_UserResponse {};
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_CreateFSMRequest
+//
+// Purpose:
+// Describes the Create FSM request
+//
+// Elements:
+// entityGroupName - *charstring* - Name of the target entity group
+// eIdx - *integer* - Index of the target entity
+// fsmName - *charstring* - Name of the FSM to be activated
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_CreateFSMRequest
+{
+ charstring entityGroupName,
+ integer eIdx,
+ charstring fsmName
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_CreateFSMResponse
+//
+// Purpose:
+// Describes the Create FSM response
+//
+// Elements:
+// result - *integer* - The result (-1 in case of error)
+// addr - <FsmAddr> - The address of the activated FSM
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_CreateFSMResponse
+{
+ integer result,
+ FsmAddr addr
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_RemoveFSMRequest
+//
+// Purpose:
+// Describes the Remove FSM request
+//
+// Elements:
+// addr - <FsmAddr> - The address of the FSM to be removed
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_RemoveFSMRequest
+{
+ FsmAddr addr
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_CreateFSMResponse
+//
+// Purpose:
+// Describes the Remove FSM response
+//
+// Elements:
+// result - *integer* - The result (-1 in case of error)
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_RemoveFSMResponse
+{
+ integer result
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: FsmAddr
+//
+// Purpose:
+// Describes the FSM address
+//
+// Elements:
+// entityGroupName - *charstring* - Name of the entity group
+// eIdx - *integer* - entity index
+// fIdx - *integer* - fsm index
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record FsmAddr
+{
+ charstring entityGroupName,
+ integer eIdx optional,
+ integer fIdx optional
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_TestStepResponse
+//
+// Purpose:
+// Describes the TestStep Response]
+//
+// Elements:
+// bName - *charstring* - Name of the behavior
+// iName - *charstring* - Name of the Event
+// addr - <FsmAddr> - Address of the FSM, where the event was reported.
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_TestStepResponse
+{
+ charstring bName,
+ charstring iName,
+ FsmAddr addr optional
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_EventDispatchRequest
+//
+// Purpose:
+// Describes the Event Dispatch Request
+//
+// Elements:
+// bName - *charstring* - Name of the behavior
+// iName - *integer* - Index of the Event
+// addr - <FsmAddr> - Address of the FSM, where the event was reported.
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_EventDispatchRequest
+{
+ charstring bName,
+ integer iName,
+ FsmAddr addr
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_ConfigRequest
+//
+// Purpose:
+// Describes the ConfigRequest
+//
+// Elements:
+// entityGroupName - *charstring* - Name of the behavior
+// noEntities - *integer* - Number of entities within the group
+// behaviors - <EPTF_CharstringList> - List of behavior that should be allocate to the group
+// fsmName - *charstring* - Name of the FSM to be assignedto teh entity group
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_ConfigRequest
+{
+ charstring entityGroupName,
+ integer noEntities,
+ EPTF_CharstringList behaviors,
+ charstring fsmName
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_ConfigResponse
+//
+// Purpose:
+// Describes the ConfigResponse
+//
+// Elements:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record EPTF_MBT_ConfigResponse {}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_CommandRequest
+//
+// Purpose:
+// Describes the Command Request
+//
+// Elements:
+// quit comamnd that terminates the execution
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type union EPTF_MBT_CommandRequest
+{
+ QuitCommand quit
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: EPTF_MBT_CommandResponse
+//
+// Purpose:
+// Describes the Command Response
+//
+// Elements:
+// - ready - <ReadyResponse> - Ready indication
+// - quitAck - <QuitAckResponse> - Ack for the quit command
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type union EPTF_MBT_CommandResponse
+{
+ ReadyResponse ready,
+ QuitAckResponse quitAck
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: QuitCommand
+//
+// Purpose:
+// Describes the Command Response
+//
+// Elements:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record QuitCommand {}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: ReadyResponse
+//
+// Purpose:
+// Describes the Ready Response
+//
+// Elements:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record ReadyResponse {}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: QuitAckResponse
+//
+// Purpose:
+// Describes the Ready Response
+//
+// Elements:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type record QuitAckResponse {}
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: fcb_EPTF_MBT_entityGroupCreated
+//
+// Purpose:
+// Describes the function signature for entity Group created callback function
+//
+// Elements:
+// p_req - <EPTF_MBT_ConfigRequest> - describes the requetsed configuration
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type function fcb_EPTF_MBT_entityGroupCreated(in EPTF_MBT_ConfigRequest p_req) runs on self;
+
+///////////////////////////////////////////////////////////////////////////////
+// Type: fcb_EPTF_MBT_customUserFunction
+//
+// Purpose:
+// Describes the function signature for custom user function
+//
+// Elements:
+// pl_ptr - <EPTF_LGenBase_TestStepArgs> - describes the requetsed configuration
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+type function fcb_EPTF_MBT_customUserFunction (in EPTF_LGenBase_TestStepArgs pl_ptr) runs on self return boolean;
+
+}
diff --git a/src/LoadGen/EPTF_MBT_LGen_Functions.ttcn b/src/LoadGen/EPTF_MBT_LGen_Functions.ttcn
new file mode 100644
index 0000000..843025d
--- /dev/null
+++ b/src/LoadGen/EPTF_MBT_LGen_Functions.ttcn
@@ -0,0 +1,1161 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: EPTF_MBT_LGen_Functions.ttcn
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+module EPTF_MBT_LGen_Functions
+{
+
+import from EPTF_MBT_LGen_Definitions all;
+import from EPTF_CLL_Logging_Definitions all;
+import from EPTF_CLL_Logging_Functions all;
+import from EPTF_CLL_Common_Definitions all;
+import from EPTF_CLL_Variable_Definitions all;
+import from EPTF_CLL_Variable_Functions all;
+import from EPTF_CLL_Scheduler_Definitions all;
+import from EPTF_CLL_Base_Definitions all;
+import from EPTF_CLL_Base_Functions all;
+import from EPTF_CLL_LGenBase_ConfigDefinitions all;
+import from EPTF_CLL_LGenBase_ConfigFunctions all;
+import from EPTF_CLL_LGenBase_Functions all;
+import from EPTF_CLL_LGenBase_Definitions all;
+import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
+import from EPTF_CLL_LGenBase_StepFunctions all;
+import from EPTF_CLL_RBTScheduler_Functions all;
+import from EPTF_CLL_Semaphore_Functions all;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_init
+//
+// Purpose:
+// Function to initialize MBT behaviour
+//
+// Parameters:
+// pl_selfName - *in* *charstring* - the components self name
+// pl_selfId - *in* *integer* - component self id
+// pl_entityNamePrefix - *in* *charstring* - entity name prefix
+// pl_numEntities - *in* *integer* - number of entities
+// pl_bind - *in* <EPTF_LGenBase_BehaviorContextBinder_FT> - behaviour
+// context bind callback function
+// pl_reset - *in* <EPTF_LGenBase_BehaviorContextHandler_FT> - behaviour
+// context reset callback function
+// pl_unbind - *in* <EPTF_LGenBase_BehaviorContextHandler_FT> - behaviour
+// context unbind callback function
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_init
+(
+ in charstring pl_selfName,
+ in integer pl_selfId,
+ in charstring pl_entityNamePrefix,
+ in integer pl_numEntities := 0,
+ in EPTF_LGenBase_BehaviorContextBinder_FT pl_bind := refers(f_EPTF_MBT_bindEntity),
+ in EPTF_LGenBase_BehaviorContextHandler_FT pl_reset := refers(f_EPTF_MBT_resetEntity),
+ in EPTF_LGenBase_BehaviorContextHandler_FT pl_unbind := refers(f_EPTF_MBT_unbindEntity)
+)
+runs on EPTF_MBT_LGen_CT
+{
+ if(v_EPTF_MBT_initialized)
+ {
+ f_EPTF_Logging_warning(true,%definitionId&": The FTD applib on this component is already initialized!");
+ return;
+ }
+
+ f_EPTF_LGenBase_init(pl_selfName);
+ f_EPTF_Logging_init_CT(pl_selfName);
+ f_EPTF_Semaphore_init_CT(pl_selfName);
+
+ f_EPTF_Base_registerCleanup(refers(f_EPTF_MBT_cleanup_CT));
+
+ v_EPTF_MBT_myBIdx :=
+ f_EPTF_LGenBase_declareBehaviorType
+ (c_EPTF_MBT_myBName,
+ -1,
+ pl_reset,
+ pl_bind,
+ pl_unbind
+ );
+
+ f_EPTF_MBT_declareEvents();
+ f_EPTF_MBT_declareTestSteps();
+
+ v_EPTF_MBT_LoggingMaskId := f_EPTF_Logging_registerComponentMasks("FTD_Logging", {"ERROR", "WARNING", "DEBUG"}, EPTF_Logging_CLL);
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, %definitionId & ": myBIdx is " & int2str(v_EPTF_MBT_myBIdx));
+
+ activate(as_EPTF_MBT_PCO_Handler());
+
+ map(self:EPTF_MBT_PCO, system:EPTF_MBT_PCO);
+
+ v_EPTF_MBT_initialized := true;
+}
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_cleanup_CT
+//
+// Purpose:
+// Cleanup function of the MBT Applib
+//
+// Parameters:
+// -
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// Unmaps the TestPorts from teh System
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_cleanup_CT()
+runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, "### " & %definitionId);
+
+ if (v_EPTF_MBT_initialized)
+ {
+ unmap(self:EPTF_MBT_PCO, system:EPTF_MBT_PCO);
+
+ v_EPTF_MBT_initialized := false;
+ }
+}
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_declareEvents
+//
+// Purpose:
+// Register the EVents used by the MBT AppLib
+//
+// Parameters:
+// -
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_declareEvents()
+runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, "### " & %definitionId);
+ var integer vl_temp := -1;
+
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent(c_EPTF_MBT_myBName,c_EPTF_MBT_inputName_incomingUserRequest);
+ f_EPTF_Base_assert(%definitionId&": Error during registration of "&c_EPTF_MBT_inputName_incomingUserRequest, vl_temp == c_EPTF_MBT_inputIdx_incomingUserRequest);
+ vl_temp := f_EPTF_LGenBase_declareFsmEvent(c_EPTF_MBT_myBName,c_EPTF_MBT_inputName_incomingTestStepRequest);
+ f_EPTF_Base_assert(%definitionId&": Error during registration of "&c_EPTF_MBT_inputName_incomingTestStepRequest, vl_temp == c_EPTF_MBT_inputIdx_incomingTestStepRequest);
+
+}
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_declareTestSteps
+//
+// Purpose:
+// Register the TestSteps used by the MBT AppLib
+//
+// Parameters:
+// -
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_declareTestSteps()
+runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, "### " & %definitionId);
+
+ f_EPTF_LGenBase_declareStep(
+ pl_bName:=c_EPTF_MBT_myBName,
+ pl_step:={name:=c_EPTF_MBT_stepName_invokeTestStep,
+ step:=refers(f_EPTF_MBT_TestStep_invokeTestStep)});
+ f_EPTF_LGenBase_declareStep(
+ pl_bName:=c_EPTF_MBT_myBName,
+ pl_step:={name:=c_EPTF_MBT_stepName_invokeUserFunction,
+ step:=refers(f_EPTF_MBT_TestStep_invokeUserFunction)});
+ f_EPTF_LGenBase_declareStep(
+ pl_bName:=c_EPTF_MBT_myBName,
+ pl_step:={name:=c_EPTF_MBT_stepName_sendUserResponse,
+ step:=refers(f_EPTF_MBT_TestStep_sendUserResponse)});
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_bindEntity
+//
+// Purpose:
+// Bind function of the MBT AppLib
+//
+// Parameters:
+// -
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_bindEntity(in integer pl_eIdx)
+runs on EPTF_MBT_LGen_CT
+return EPTF_IntegerList
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, "### " & %definitionId & "() with eIdx: " & int2str(pl_eIdx));
+
+ //var integer v_EPTF_MBT_index := sizeof(v_EPTF_MBT_Contexts);
+ //v_EPTF_MBT_Contexts[v_EPTF_MBT_index] := c_MBT_DefaultCtx;
+ //v_EPTF_MBT_Contexts[v_EPTF_MBT_index].eIdx := pl_eIdx;
+ //return {v_EPTF_MBT_index};
+
+ return {-1};
+}
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_unbindEntity
+//
+// Purpose:
+// Unbind function of the MBT AppLib
+//
+// Parameters:
+// -
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_unbindEntity(in integer pl_eIdx)
+runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, "### " & %definitionId & "() with eIdx: " & int2str(pl_eIdx));
+}
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_resetEntity
+//
+// Purpose:
+// Reset function of the MBT AppLib
+//
+// Parameters:
+// -
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+//////////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_resetEntity(
+ in integer pl_eIdx)
+runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, "### " & %definitionId & "() with eIdx: " & int2str(pl_eIdx));
+}
+
+
+//*****************************************************************************
+// TestSteps of the MBT AppLib
+//*****************************************************************************
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_TestStep_invokeTestStep
+//
+// Purpose:
+// General Purpose wrapper TestStep to select the Proper TestStep based on its
+// actual parameters and invokes it. Otherwise generates a log&console statement
+//
+// Parameters:
+// in EPTF_LGenBase_TestStepArgs pl_ptr
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_TestStep_invokeTestStep(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "() "));
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() pl_ptr: ", pl_ptr));
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() v_EPTF_MBT_TestStepRequest: ", v_EPTF_MBT_TestStepRequest));
+
+ //var integer vl_fnIdx := f_EPTF_LGenBase_functionNameIndex(v_EPTF_MBT_TestStepRequest.stepName);
+ //var EPTF_LGenBase_TestStepFunction_FT vl_fn:=null;
+ var EPTF_LGenBase_RegisteredFunctions vl_fn;
+
+ if (f_EPTF_LGenBase_functionReferenceByName(v_EPTF_MBT_TestStepRequest.stepName, vl_fn))
+ {
+ pl_ptr.refContext.fRefArgs := v_EPTF_MBT_TestStepRequest.stepArgs;
+ if (ispresent(v_EPTF_MBT_TestStepRequest.addr))
+ {
+ pl_ptr.eIdx := v_EPTF_MBT_TestStepRequest.addr.eIdx;
+ pl_ptr.refContext.fCtxIdx := v_EPTF_MBT_TestStepRequest.addr.fIdx;
+ }
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() executing ", v_EPTF_MBT_TestStepRequest.stepName));
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() with pl_ptr: ", pl_ptr));
+
+ //f_EPTF_LGenBase_getTesStepFunctionRef(v_EPTF_MBT_TestStepRequest.stepName, vl_fn);
+ f_EPTF_LGenBase_functionReferenceByName(v_EPTF_MBT_TestStepRequest.stepName, vl_fn);
+ if (ischosen(vl_fn.testStepFunction))
+ {
+ vl_fn.testStepFunction.apply(pl_ptr);
+ if(ispresent(v_EPTF_MBT_TestStepRequest.lock) and v_EPTF_MBT_TestStepRequest.lock > -1)
+ {
+ f_EPTF_Semaphore_unlock(v_EPTF_MBT_TestStepRequest.lock);
+ }
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str(%definitionId & "(): Function was found, but not a test step: " & v_EPTF_MBT_TestStepRequest.stepName));
+ }
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str(%definitionId & "(): Step was not found: " & v_EPTF_MBT_TestStepRequest.stepName));
+ }
+
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_TestStep_sendUserResponse
+//
+// Purpose:
+// TestStep function to generate the User response,. It shall be invoked in case
+// of the unhandled events (FSM description) based on the generated event it
+// sends back a response towards the Tester component
+//
+// Parameters:
+// in EPTF_LGenBase_TestStepArgs pl_ptr
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_TestStep_sendUserResponse(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "() "));
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() pl_ptr: ", pl_ptr));
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() vf_EPTF_MBT_createUserResponse: ", vf_EPTF_MBT_createUserResponse));
+
+ var boolean vl_autoResp := true;
+
+ if(vf_EPTF_MBT_createUserResponse!=null)
+ {
+ vl_autoResp := not vf_EPTF_MBT_createUserResponse.apply(pl_ptr);
+ }
+
+ if (vl_autoResp)
+ {
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() v_LGenBase_reportedEvent: ",pl_ptr.reportedEvent));
+
+
+ var integer vl_grpIdx := f_EPTF_LGenBase_getEGrpOfEntity(pl_ptr.eIdx);
+ var integer vl_eIdx := pl_ptr.eIdx - f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ var EPTF_MBT_TestStepResponse vl_resp :=
+ {
+ bName := f_EPTF_LGenBase_bIdx2Str(pl_ptr.reportedEvent.event.bIdx),
+ iName := f_EPTF_LGenBase_iIdx2Str(pl_ptr.reportedEvent.event.bIdx,pl_ptr.reportedEvent.event.iIdx), //TODO later one of the TestStep args will decsribe the events that has been dispatcehd
+ addr :=
+ {
+ entityGroupName := f_EPTF_LGenBase_entityGroupName(vl_grpIdx),
+ eIdx := pl_ptr.eIdx,
+ fIdx := pl_ptr.refContext.fCtxIdx
+ }
+ }
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() user response: ", vl_resp));
+
+ var EPTF_IntegerList vl_ctx := f_EPTF_LGenBase_getBehaviorCtx(pl_ptr.eIdx, v_EPTF_MBT_myBIdx);
+ EPTF_MBT_PCO.send(vl_resp) to f_EPTF_Base_downcast(vl_ctx[0]);
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_TestStep_invokeUserFunction
+//
+// Purpose:
+// TestStep function to invoke user specific function
+//
+// Parameters:
+// in EPTF_LGenBase_TestStepArgs pl_ptr
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// It seraches for the user declared function basedon its name
+// (stored in a component variable) and invokes it.)
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_TestStep_invokeUserFunction(in EPTF_LGenBase_TestStepArgs pl_ptr) runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "() "));
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() pl_ptr: ", pl_ptr));
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() v_EPTF_MBT_UserRequest: ", v_EPTF_MBT_UserRequest));
+
+ var integer vl_fnIdx := f_EPTF_LGenBase_functionNameIndex(v_EPTF_MBT_UserRequest.functionName);
+ var EPTF_LGenBase_RegisteredFunctions vl_fn;
+ if (vl_fnIdx > 0)
+ {
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() v_EPTF_MBT_UserRequest: ",v_EPTF_MBT_UserRequest));
+ //vl_fn.apply(pl_ptr);
+ //f_EPTF_LGenBase_getTesStepFunctionRef(v_EPTF_MBT_TestStepRequest.stepName, vl_fn);
+
+ if (f_EPTF_LGenBase_functionReferenceByName(v_EPTF_MBT_TestStepRequest.stepName, vl_fn))
+ {
+ if (ischosen(vl_fn.testStepFunction))
+ {
+ vl_fn.testStepFunction.apply(pl_ptr);
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str(%definitionId & "(): Function was found, but not a test step: " & v_EPTF_MBT_TestStepRequest.stepName));
+ }
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str(%definitionId & "(): Step was not found: " & v_EPTF_MBT_TestStepRequest.stepName));
+ }
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str(%definitionId & "(): Step was not found: " & v_EPTF_MBT_UserRequest.functionName));
+ }
+
+ var integer vl_grpIdx := f_EPTF_LGenBase_getEGrpOfEntity(pl_ptr.eIdx);
+ var integer vl_eIdx := pl_ptr.eIdx - f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+
+ var EPTF_MBT_TestStepResponse vl_resp :=
+ {
+ bName := c_EPTF_MBT_myBName,
+ iName :=f_EPTF_LGenBase_iIdx2Str(v_EPTF_MBT_myBIdx,pl_ptr.reportedEvent.event.iIdx), //TODO later one of the TestStep args will decsribe the events that has been dispatcehd
+ addr :=
+ {
+ entityGroupName := f_EPTF_LGenBase_entityGroupName(vl_grpIdx),
+ eIdx := pl_ptr.eIdx,
+ fIdx := pl_ptr.refContext.fCtxIdx
+ }
+ }
+ var EPTF_IntegerList vl_ctx := f_EPTF_LGenBase_getBehaviorCtx(pl_ptr.eIdx, v_EPTF_MBT_myBIdx);
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() user response: ", vl_resp));
+ EPTF_MBT_PCO.send(vl_resp) to f_EPTF_Base_downcast(vl_ctx[0]);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_Listener_catchEntityEvents
+//
+// Purpose:
+// This is a listener to catch all entity level events. Because unhandled
+// events in the FSM descriptor can catch only FSM level events.
+//
+// Parameters:
+// in EPTF_LGenBase_ReportedEventDescriptor pl_event
+// in EPTF_IntegerList pl_listenerArgs
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_Listener_catchEntityEvents(
+ EPTF_LGenBase_ReportedEventDescriptor pl_event,
+ EPTF_IntegerList pl_listenerArgs
+) runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "() "));
+
+ if (ispresent(pl_event.event.target) and not ispresent(pl_event.event.target.fsmCtxIdx))
+ {
+ // Only for entity level events
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() entity level event caught, calling sendUserResponse"));
+ var EPTF_LGenBase_TestStepArgs vl_args :=
+ {
+ eIdx := pl_event.event.target.eIdx,
+ refContext :=
+ {
+ fCtxIdx := -1, //related FSM context of the entity, if invoked via FSM
+ fRefArgs := {} //args supplied in the context from which the step is referenced
+ }, //FSM cell & context if invoked from FSM
+ stepArgs:= {},
+ reportedEvent:=pl_event
+ }
+ f_EPTF_MBT_TestStep_sendUserResponse(vl_args);
+ }
+ else
+ {
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() dropping"));
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_Listener_catchGenericEvents
+//
+// Purpose:
+// This is a listener to catch all generic level events. Because unhandled
+// events in the FSM descriptor can catch only FSM level events.
+//
+// Parameters:
+// in EPTF_LGenBase_ReportedEventDescriptor pl_event
+// in EPTF_IntegerList pl_listenerArgs
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_Listener_catchGenericEvents(
+ EPTF_LGenBase_ReportedEventDescriptor pl_event,
+ EPTF_IntegerList pl_listenerArgs
+) runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "() "));
+
+ if (true /*ispresent(pl_event.event.target) and not ispresent(pl_event.event.target.fsmCtxIdx)*/)
+ {
+ // Only for entity level events
+ /*
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() generic level event caught, calling sendUserResponse"));
+ var EPTF_LGenBase_TestStepArgs vl_args :=
+ {
+ eIdx := pl_event.event.target.eIdx,
+ refContext :=
+ {
+ fCtxIdx := -1, //related FSM context of the entity, if invoked via FSM
+ fRefArgs := {} //args supplied in the context from which the step is referenced
+ }, //FSM cell & context if invoked from FSM
+ stepArgs:= {},
+ reportedEvent:=pl_event
+ }
+ f_EPTF_MBT_TestStep_sendUserResponse(vl_args);
+ */
+ action("Generic caught: ", pl_event);
+ }
+ else
+ {
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "() dropping"));
+ }
+}
+
+//////////////////////////////////////////////////////////////////
+//
+//
+// Event Handler
+//
+//
+////////////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: as_EPTF_MBT_PCO_Handler
+//
+// Purpose:
+// EventHandler of the MBT AppLib
+//
+// Parameters:
+// -
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// Handles the following cases
+// In case of an incomming TestStep Request dispatches the
+// c_EPTF_MBT_inputIdx_incomingTestStepRequest event
+// incomming Config Request configure the LoadGens creates the
+// entity goups activate the fsms...etc
+// incomming Command Request executes the requested command
+// -
+// incomming User Request dispatches the
+// c_EPTF_MBT_inputIdx_incomingUserRequest event
+///////////////////////////////////////////////////////////////////////////////
+altstep as_EPTF_MBT_PCO_Handler() runs on EPTF_MBT_LGen_CT
+{
+ var EPTF_MBT_Tester_CT vc_from;
+
+ [] EPTF_MBT_PCO.receive(EPTF_MBT_TestStepRequest:?) -> value v_EPTF_MBT_TestStepRequest sender vc_from
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "(): incoming v_EPTF_FTD_TestStepRequest: ",v_EPTF_MBT_TestStepRequest));
+
+ var integer vl_eIdx := 0;
+ var integer vl_fIdx := 0;
+ if (ispresent(v_EPTF_MBT_TestStepRequest.addr))
+ {
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(v_EPTF_MBT_TestStepRequest.addr.entityGroupName);
+ vl_eIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+ if (ispresent(v_EPTF_MBT_TestStepRequest.addr.eIdx)) { vl_eIdx := vl_eIdx + v_EPTF_MBT_TestStepRequest.addr.eIdx }
+ if (ispresent(v_EPTF_MBT_TestStepRequest.addr.fIdx)) { vl_fIdx := v_EPTF_MBT_TestStepRequest.addr.fIdx }
+ }
+ f_EPTF_LGenBase_dispatchEvent({{v_EPTF_MBT_myBIdx, c_EPTF_MBT_inputIdx_incomingTestStepRequest,{vl_eIdx, vl_fIdx}, omit},{}});
+ repeat;
+ }
+ [] EPTF_MBT_PCO.receive(EPTF_MBT_EventDispatchRequest:?) -> value v_EPTF_MBT_EventDispatchRequest sender vc_from
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "(): incoming v_EPTF_MBT_EventDispatchRequest: ",v_EPTF_MBT_EventDispatchRequest));
+
+ var integer vl_eIdx := 0;
+ var integer vl_fIdx := 0;
+
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(v_EPTF_MBT_EventDispatchRequest.addr.entityGroupName);
+ vl_eIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+ if (ispresent(v_EPTF_MBT_EventDispatchRequest.addr.eIdx)) { vl_eIdx := vl_eIdx + v_EPTF_MBT_EventDispatchRequest.addr.eIdx }
+ if (ispresent(v_EPTF_MBT_EventDispatchRequest.addr.fIdx)) { vl_fIdx := v_EPTF_MBT_EventDispatchRequest.addr.fIdx }
+
+ var integer vl_bIdx := f_EPTF_LGenBase_behaviorTypeNameIndex(v_EPTF_MBT_EventDispatchRequest.bName);
+ var integer vl_iIdx := v_EPTF_MBT_EventDispatchRequest.iName
+ f_EPTF_LGenBase_dispatchEvent({{vl_bIdx, vl_iIdx,{vl_eIdx, vl_fIdx}, omit},{}});
+ repeat;
+ }
+ [] EPTF_MBT_PCO.receive(EPTF_MBT_ConfigRequest:?) -> value v_EPTF_MBT_ConfigRequest sender vc_from
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "(): incoming v_EPTF_MBT_ConfigRequest: ", v_EPTF_MBT_ConfigRequest));
+
+ var integer vl_senderInt := f_EPTF_Base_upcast(vc_from);
+ f_EPTF_LGenBase_declareEntityType
+ (
+ v_EPTF_MBT_ConfigRequest.entityGroupName & "_Type",
+ v_EPTF_MBT_ConfigRequest.behaviors
+ );
+ f_EPTF_LGenBase_createEntityGroup
+ (
+ {
+ v_EPTF_MBT_ConfigRequest.entityGroupName,
+ v_EPTF_MBT_ConfigRequest.entityGroupName & "_Type",
+ v_EPTF_MBT_ConfigRequest.noEntities
+ }
+ );
+ if (vf_EPTF_MBT_entityGroupCreated != null)
+ {
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "(): calling ", vf_EPTF_MBT_entityGroupCreated));
+ vf_EPTF_MBT_entityGroupCreated.apply(v_EPTF_MBT_ConfigRequest);
+ }
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(v_EPTF_MBT_ConfigRequest.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+ var integer vl_fsmTableIdx := f_EPTF_LGenBase_fsmNameIndex(v_EPTF_MBT_ConfigRequest.fsmName);
+ for (var integer i:=0; i<v_EPTF_MBT_ConfigRequest.noEntities; i:=i+1)
+ {
+ f_EPTF_LGenBase_activateFsm(i + vl_entityIdx, vl_fsmTableIdx, 0, -1);
+ f_EPTF_LGenBase_setBehaviorCtx(i + vl_entityIdx, v_EPTF_MBT_myBIdx, {vl_senderInt});
+ f_EPTF_LGenBase_addEntityIdxListener(i + vl_entityIdx, refers(f_EPTF_MBT_Listener_catchEntityEvents), {})
+ }
+
+ EPTF_MBT_PCO.send(EPTF_MBT_ConfigResponse:{}) to vc_from;
+ repeat;
+ }
+ [] EPTF_MBT_PCO.receive(EPTF_MBT_CreateFSMRequest:?) -> value v_EPTF_MBT_CreateFSMRequest sender vc_from
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "(): incoming v_EPTF_MBT_CreateFSMRequest: ", v_EPTF_MBT_CreateFSMRequest));
+
+ var integer vl_senderInt := f_EPTF_Base_upcast(vc_from);
+
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(v_EPTF_MBT_CreateFSMRequest.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx) + v_EPTF_MBT_CreateFSMRequest.eIdx;
+ var integer vl_fsmTableIdx := f_EPTF_LGenBase_fsmNameIndex(v_EPTF_MBT_CreateFSMRequest.fsmName);
+
+ var integer vl_fIdx := f_EPTF_LGenBase_activateFsm(vl_entityIdx, vl_fsmTableIdx, 0, -1);
+ f_EPTF_LGenBase_setBehaviorCtx(vl_entityIdx, v_EPTF_MBT_myBIdx, {vl_senderInt});
+ f_EPTF_LGenBase_addEntityIdxListener(vl_entityIdx, refers(f_EPTF_MBT_Listener_catchEntityEvents), {})
+
+ var EPTF_MBT_CreateFSMResponse vl_resp :=
+ {
+ result := 0,
+ addr :=
+ {
+ entityGroupName := v_EPTF_MBT_CreateFSMRequest.entityGroupName,
+ eIdx := v_EPTF_MBT_CreateFSMRequest.eIdx,
+ fIdx := vl_fIdx
+ }
+ }
+
+ EPTF_MBT_PCO.send(vl_resp) to vc_from;
+ repeat;
+ }
+ [] EPTF_MBT_PCO.receive(EPTF_MBT_RemoveFSMRequest:?) -> value v_EPTF_MBT_RemoveFSMRequest sender vc_from
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "(): incoming v_EPTF_MBT_RemoveFSMRequest: ", v_EPTF_MBT_RemoveFSMRequest));
+
+ var integer vl_senderInt := f_EPTF_Base_upcast(vc_from);
+
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(v_EPTF_MBT_RemoveFSMRequest.addr.entityGroupName);
+ var integer vl_entityIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx) + v_EPTF_MBT_RemoveFSMRequest.addr.eIdx;
+ var integer vl_fsmIdx := v_EPTF_MBT_RemoveFSMRequest.addr.fIdx;
+
+ f_EPTF_LGenBase_deactivateFsm(vl_entityIdx, vl_fsmIdx);
+
+ var EPTF_MBT_RemoveFSMResponse vl_resp :=
+ {
+ result := 0
+ }
+
+ EPTF_MBT_PCO.send(vl_resp) to vc_from;
+ repeat;
+ }
+ [] EPTF_MBT_PCO.receive(EPTF_MBT_CommandRequest:?) -> value v_EPTF_MBT_CommandRequest sender vc_from
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "(): incoming v_EPTF_MBT_CommandRequest: ",v_EPTF_MBT_CommandRequest));
+
+ if (ischosen(v_EPTF_MBT_CommandRequest.quit))
+ {
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str(%definitionId & "(): calling Base_stopAll"));
+ f_EPTF_Base_stopAll(pass, true); // FIXME noCleanup should be false.
+ }
+ else
+ {
+ f_EPTF_Logging_warning(true, log2str(%definitionId & "(): unhandled command: ", v_EPTF_MBT_CommandRequest));
+ repeat;
+ }
+ EPTF_MBT_PCO.send(EPTF_MBT_CommandResponse:{ quitAck := {} }) to vc_from;
+ }
+ [] EPTF_MBT_PCO.receive(EPTF_MBT_UserRequest:?) -> value v_EPTF_MBT_UserRequest sender vc_from
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "(): incoming v_EPTF_MBT_UserRequest: ",v_EPTF_MBT_UserRequest));
+
+ var integer vl_eIdx := 0;
+ var integer vl_fIdx := 0;
+
+ if (ispresent(v_EPTF_MBT_UserRequest.addr))
+ {
+ var integer vl_grpIdx := f_EPTF_LGenBase_entityGrpNameIndex(v_EPTF_MBT_UserRequest.addr.entityGroupName);
+ vl_eIdx := f_EPTF_LGenBase_getEGrpBaseOffset(vl_grpIdx);
+ if (ispresent(v_EPTF_MBT_UserRequest.addr.eIdx)) { vl_eIdx := vl_eIdx + v_EPTF_MBT_UserRequest.addr.eIdx }
+ if (ispresent(v_EPTF_MBT_UserRequest.addr.fIdx)) { vl_fIdx := v_EPTF_MBT_UserRequest.addr.fIdx }
+ }
+
+ f_EPTF_LGenBase_dispatchEvent({{v_EPTF_MBT_myBIdx, c_EPTF_MBT_inputIdx_incomingUserRequest,{vl_eIdx, vl_fIdx}, omit},{}});
+ }
+ [] EPTF_MBT_PCO.receive
+ {
+ f_EPTF_SchedulerComp_refreshSnapshotTime();
+ f_EPTF_Logging_warning(true, "### " & %definitionId & "(): dropping message");
+ repeat;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_initLGenFsm
+//
+// Purpose:
+// This function inits the MBT FSM
+//
+// Parameters:
+// in fcb_EPTF_MBT_customUserFunction p_userFunc - sets the callback that shall create the UserResponses
+// in fcb_EPTF_MBT_entityGroupCreated p_entityGroupCreateFunc - sets the callback to handle entity group created
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_initLGenFsm
+(
+ in fcb_EPTF_MBT_customUserFunction p_userFunc,
+ in fcb_EPTF_MBT_entityGroupCreated p_entityGroupCreateFunc
+)
+runs on EPTF_MBT_LGen_CT
+{
+ f_EPTF_Logging_debug(tsp_EPTF_MBT_LGen_debug, log2str("### " & %definitionId & "() "));
+
+ vf_EPTF_MBT_createUserResponse := p_userFunc;
+
+ vf_EPTF_MBT_entityGroupCreated := p_entityGroupCreateFunc;
+
+ var integer v_dummyInt := f_EPTF_LGenBase_declareFSMTable(
+ {
+ //DOT: digraph FSM_MBT {
+ name := "FSM_MBT",
+ fsmParams :=
+ {
+ {
+ stateList := { "main" }
+ }
+ },
+ table :=
+ {
+ extendedTable := {
+ {events2Listen :={
+ events:= {
+ {singleEvent:={
+ bName:=c_EPTF_LGenBase_behavior,
+ iName:=c_EPTF_LGenBase_inputName_testMgmt_startTC,
+ eventType:=fsm}
+ }}},
+ cellRow := {
+ classicCellRow := {
+ {//state[0]==main
+ //DOT: main -> main [label="i:startTC\n"]
+ actionList:=omit,
+ nextStateCalculation:=omit,
+ nextState:="main"
+ }
+ } // classicCellRow
+ } // cellRow
+ },
+ {events2Listen := {
+ events:= {
+ {singleEvent:={
+ bName:=c_EPTF_MBT_myBName,
+ iName:=c_EPTF_MBT_inputName_incomingTestStepRequest,
+ eventType:=fsm}
+ }}},
+ cellRow := {
+ classicCellRow := {
+ {//state[0]==main
+ //DOT: main -> main [label="i:incomingTestStepRequest\n a:step_invokeTestStep"]
+ actionList:={{stepOrFunctionName:=c_EPTF_MBT_stepName_invokeTestStep,contextArgs:=omit}},
+ nextStateCalculation:=omit,
+ nextState:="main"
+ }
+ } // classicCellRow
+ } // cellRow
+ },
+ {events2Listen := {
+ events:= {
+ { singleEvent:={
+ bName:=c_EPTF_MBT_myBName,
+ iName:=c_EPTF_MBT_inputName_incomingUserRequest,
+ eventType:=fsm}
+ }}},
+ cellRow := {
+ classicCellRow := {
+ {//state[0]==main
+ //DOT: main -> main [label="i:incomingUserRequest\n a:step_invokeUserFunction"]
+ actionList:={{stepOrFunctionName:=c_EPTF_MBT_stepName_invokeUserFunction,contextArgs:=omit}},
+ nextStateCalculation:=omit,
+ nextState:="main"
+ }
+ } // classicCellRow
+ } // cellRow
+ },
+ {events2Listen := {
+ unhandled:={}
+ //catchAll:={}
+ },
+ cellRow := {
+ classicCellRow := {
+ {//state[0]==main
+ //DOT: main -> main [label="i:unhandled\n a:step_sendUserResponse"]
+ actionList:={{stepOrFunctionName:=c_EPTF_MBT_stepName_sendUserResponse,contextArgs:=omit}},
+ nextStateCalculation:=omit,
+ nextState:="main"
+ }
+ } // classicCellRow
+ } // cellRow
+ }
+
+ } // extendedTable
+ } // table
+ }
+ );
+}
+
+///////// Tester part
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_EPTF_MBT_Tester_init
+//
+// Purpose:
+// This function inits the EPTF_MBT_Tester_CT
+//
+// Parameters:
+// - *in* *charstring* pl_selfName - local internal name for the MBT Tester component
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_EPTF_MBT_Tester_init
+(
+ in charstring pl_selfName
+)
+runs on EPTF_MBT_Tester_CT
+{
+ f_EPTF_Base_init_CT(pl_selfName);
+ f_EPTF_Semaphore_init_CT(pl_selfName);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_MBT_execute
+//
+// Purpose:
+// This function executes a test step on specifid FSM (which must run the FSM_MBT)
+// FSM. It is possible to make the function blocking until the test stepis executed
+// by setting the p_lock parameter to true, but it will only work in case
+// the component extends the EPTF_MBT_Tester_CT and EPTF_MBT_LGen_CT as well!
+//
+// Parameters:
+// - *in* *charstring* p_name - name of the test step
+// - *in* <FsmAddr> p_addr - address of the FSM
+// - *in* <EPTF_IntegerList> - p_params - parameters for the test step
+// - *in* *boolean* - p_lock - Enables/disables waiting for the test step to finish executing.
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_MBT_execute(in charstring p_name, in EPTF_MBT_LGen_Definitions.FsmAddr p_addr, in EPTF_IntegerList p_params := {}, in boolean p_lock := true)
+runs on EPTF_MBT_Tester_CT
+{
+ action(%definitionId, "TestStep: ", p_name)
+ if (p_lock)
+ {
+ var integer v_lock := f_EPTF_Semaphore_new();
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {p_name, p_params, p_addr, v_lock});
+ f_EPTF_Semaphore_waitForUnlock(v_lock, tsp_EPTG_MBT_execute_lockTimeout);
+ }
+ else
+ {
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_TestStepRequest: {p_name, p_params, p_addr, omit});
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_MBT_waitFor
+//
+// Purpose:
+// This function waits for specified EPTF event to arrive. Please note, that
+// until the waiting time runs out all the other incoming events are dropped.
+//
+// Parameters:
+// - *in* *charstring* p_behavior - behavior name of the expected event
+// - *in* *charstring* p_name - name of the expected event
+// - *in* <FsmAddr> - p_addr - the event must arrive from this FSM.
+// - *in* *float* - p_timeout - Maximum waiting time for the expected event
+//
+// Return Value:
+// - *boolean* - True if the expected emssage was caught.
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_MBT_waitFor(
+ in charstring p_behavior, in charstring p_name,
+ in EPTF_MBT_LGen_Definitions.FsmAddr p_addr, in float p_timeout := 3.0)
+runs on EPTF_MBT_Tester_CT
+return boolean
+{
+ timer t_wait;
+ t_wait.start(p_timeout);
+ alt
+ {
+ [] EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_TestStepResponse:{ bName := p_behavior, iName := p_name, addr := p_addr})
+ {
+ t_wait.stop;
+ action(%definitionId, "Received: ", p_name)
+ return true;
+ }
+ [] EPTF_MBT_TESTER_PCO.receive
+ {
+ action(%definitionId, "Dropping unexpected message!")
+ repeat;
+ }
+ [] t_wait.timeout
+ {
+ action(%definitionId, "Timeout!")
+ return false;
+ }
+ }
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_MBT_dispatch
+//
+// Purpose:
+// This function sends an EPTF event to an FSM.
+//
+// Parameters:
+// - *in* *charstring* p_bName - behavior name of the event
+// - *in* *integer* p_iIndex - index of the event
+// - *in* <FsmAddr> - p_addr - the event will be sent to this FSM.
+//
+// Return Value:
+// -
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_MBT_dispatch(in charstring p_bName, in integer p_iIndex, in EPTF_MBT_LGen_Definitions.FsmAddr p_addr)
+runs on EPTF_MBT_Tester_CT
+{
+ action(%definitionId, "Dispatching: ", p_bName, ":",p_iIndex, " to ",p_addr)
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_EventDispatchRequest: {p_bName, p_iIndex, p_addr});
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_MBT_activateFsm
+//
+// Purpose:
+// This function activates an FSM on an entity.
+//
+// Parameters:
+// - *in* *charstring* p_entityGroupName - entity group name of the entity
+// - *in* *integer* p_eIdx - index of the entity
+// - *in* *charstring* - p_fsmName - the event will be sent to this FSM.
+// - *out* *FsmAddr* - p_fsmAddr - The address of the activated FSM if succesful
+//
+// Return Value:
+// - *integer* - the result of the FSM activation (-1 if unsuccesful)
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_MBT_activateFsm(in charstring p_entityGroupName, in integer p_eIdx, in charstring p_fsmName, out FsmAddr p_fsmAddr)
+runs on EPTF_MBT_Tester_CT
+return integer
+{
+ EPTF_MBT_TESTER_PCO.send(EPTF_MBT_CreateFSMRequest:
+ {
+ entityGroupName := p_entityGroupName,
+ eIdx := 0,
+ fsmName := p_fsmName
+ }
+ )
+
+ var EPTF_MBT_CreateFSMResponse vl_resp;
+ EPTF_MBT_TESTER_PCO.receive(EPTF_MBT_CreateFSMResponse:?) -> value vl_resp;
+
+ p_fsmAddr := vl_resp.addr;
+ return vl_resp.result;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Function: f_convert_FsmAddr2TestStepArgs
+//
+// Purpose:
+// Utility function to convert an FsmAddr address to a TestStepArgs value.
+//
+// Parameters:
+// - *in* *FsmAddr* - p_fsmAddr - An FSM address
+//
+// Return Value:
+// - <EPTF_LGenBase_TestStepArgs> - the corresponding TestStapArgs value
+//
+// Errors:
+// -
+//
+// Detailed Comments:
+// -
+//
+///////////////////////////////////////////////////////////////////////////////
+function f_convert_FsmAddr2TestStepArgs(in EPTF_MBT_LGen_Definitions.FsmAddr p_addr)
+return EPTF_LGenBase_TestStepArgs
+{
+ // FIXME: entity group check!
+ var EPTF_LGenBase_TestStepArgs vl_ret :=
+ {
+ eIdx := p_addr.eIdx,
+ refContext :=
+ {
+ fCtxIdx := p_addr.fIdx,
+ fRefArgs := {}
+ },
+ stepArgs := {},
+ reportedEvent := c_EPTF_LGenBase_emptyReportedEventDescriptor
+ }
+ return vl_ret;
+}
+
+}
diff --git a/src/LoadGen/EPTF_MBT_LoadGen.grp b/src/LoadGen/EPTF_MBT_LoadGen.grp
new file mode 100644
index 0000000..ed66bc0
--- /dev/null
+++ b/src/LoadGen/EPTF_MBT_LoadGen.grp
@@ -0,0 +1,25 @@
+<!--
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2018 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//
+// File: EPTF_MBT_LoadGen.grp
+// Description: FileGroup file for EPTF Applib MBT LoadGen
+// Rev: <RnXnn>
+// Prodnr: CNL 113 659
+// Updated: 2010-10-01
+// Contact: http://ttcn.ericsson.se
+//
+
+-->
+<!DOCTYPE TITAN_GUI_FileGroup_file>
+<File_Group name="EPTF_MBT_LoadGen" >
+ <File path="EPTF_MBT_LGen_Definitions.ttcn" />
+ <File path="EPTF_MBT_LGen_Functions.ttcn" />
+</File_Group>
diff --git a/src/Qtronic/TTCNScripter_v211/PrettyPrinter.java b/src/Qtronic/TTCNScripter_v211/PrettyPrinter.java
new file mode 100644
index 0000000..49cefeb
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v211/PrettyPrinter.java
@@ -0,0 +1,77 @@
+/** Copyright (C) Conformiq Software Oy, Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 17:13:05 2008.
+ *
+ * @file
+ *
+ * @author Tommi Vainikainen
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.util.List;
+import java.util.Vector;
+
+class PrettyPrinter extends PrintWriter {
+ private List<String> stack;
+ private String header;
+ private boolean headerPrinted;
+
+ public PrettyPrinter(Writer out) {
+ super(out);
+ this.stack = new Vector<String>();
+ this.header = "";
+ this.headerPrinted = true;
+ }
+
+ private void printHeader() {
+ if (headerPrinted)
+ return;
+
+ for (int i = 0; i < this.stack.size(); i++) {
+ super.print(this.stack.get(i));
+ }
+ this.headerPrinted = true;
+ }
+
+ public void print(String s) {
+ printHeader();
+ this.header = this.header.concat(s);
+ super.print(s);
+ }
+
+ // Start a new block
+ public void block() {
+ this.stack.add(header);
+ this.header = "";
+ }
+
+ // Resume to previous state
+ public void resume() {
+ // remove last
+ this.stack.remove(this.stack.size() - 1);
+ }
+
+ // Print EOL char
+ public void endl() {
+ if (this.headerPrinted) { // suppress double empty lines
+ println();
+ this.header = "";
+ this.headerPrinted = false;
+ }
+ }
+
+ public void emptyline() {
+ println();
+ this.header = "";
+ this.headerPrinted = false;
+ }
+
+ public void ws() {
+ print(" ");
+ }
+}
diff --git a/src/Qtronic/TTCNScripter_v211/TTCNScripter.java b/src/Qtronic/TTCNScripter_v211/TTCNScripter.java
new file mode 100644
index 0000000..29167b8
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v211/TTCNScripter.java
@@ -0,0 +1,1910 @@
+/** Copyright (C) Conformiq Software Oy, Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file
+ *
+ * @author Tommi Vainikainen
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.io.BufferedWriter;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+import com.conformiq.qtronic2.Checkpoint;
+import com.conformiq.qtronic2.MetaDataDictionary;
+import com.conformiq.qtronic2.NotificationSink;
+import com.conformiq.qtronic2.QMLArray;
+import com.conformiq.qtronic2.QMLBoolean;
+import com.conformiq.qtronic2.QMLNumber;
+import com.conformiq.qtronic2.QMLOptional;
+import com.conformiq.qtronic2.QMLRecord;
+import com.conformiq.qtronic2.QMLRecordType;
+import com.conformiq.qtronic2.QMLRecordTypeField;
+import com.conformiq.qtronic2.QMLString;
+import com.conformiq.qtronic2.QMLValue;
+import com.conformiq.qtronic2.QMLValueVisitor;
+import com.conformiq.qtronic2.ScriptBackend;
+import com.conformiq.qtronic2.TimeStamp;
+import com.conformiq.qtronic2.Checkpoint.CheckpointStatus;
+import com.conformiq.qtronic2.Checkpoint.CheckpointType;
+
+public class TTCNScripter extends ScriptBackend
+{
+ class TemplateDefinition
+ {
+ public TemplateDefinition(final String type, final String templatename,
+ QMLRecord record)
+ {
+ this.typeName = type;
+ this.templateName = templatename;
+ this.record = record;
+ }
+
+ private String typeName;
+ private String templateName;
+
+ public String getTypeName()
+ {
+ return typeName;
+ }
+
+ public String getTemplateName()
+ {
+ return templateName;
+ }
+
+ private QMLRecord record;
+
+ public QMLRecord getRecord()
+ {
+ return record;
+ }
+ }
+
+ /** Convert adapter datums into TTCN3 code. */
+ class TTCN3PortVisitor implements QMLValueVisitor
+ {
+ public TTCN3PortVisitor(PrettyPrinter pp, boolean isInbound)
+ {
+ this.out = pp;
+ this.isInbound = isInbound;
+
+ assert (out != null);
+
+ typeNameMap = new HashMap<String, String>();
+
+ /* Booleans */
+ typeNameMap.put("boolean", "boolean");
+ /* Integers. */
+ typeNameMap.put("int", "integer");
+ typeNameMap.put("byte", "integer");
+ typeNameMap.put("char", "integer");
+ typeNameMap.put("short", "integer");
+ typeNameMap.put("long", "integer");
+ /* Floating point. */
+ typeNameMap.put("float", "float");
+ typeNameMap.put("double", "float");
+ /* Strinags. */
+ typeNameMap.put("String", "charstring");
+ }
+
+ protected PrettyPrinter out;
+ protected final boolean isInbound;
+ protected Map<String, String> typeNameMap;
+
+ @Override
+ public void visit(QMLArray x)
+ {
+ /*
+ * Port types are tuples with just Strings inside referring to
+ * types.
+ */
+ assert (x != null);
+ final int size = x.getNumberOfElements();
+
+ for (int i = 0; i < size; i++)
+ {
+ QMLString portname = (QMLString) x.getValue(i);
+ if (portname != null)
+ {
+ final String origname = portname.getValue();
+ final String name = TTCNScripter
+ .makeValidTTCN3Identifier(origname);
+
+ /* Skip AnyRecord.. */
+ if (name.equals("AnyRecord"))
+ {
+ continue;
+ }
+ /*
+ * It seems that record fields are separated using commas
+ * but ports are separated using semicolons in TTCN3..?
+ */
+ if (eptfBidirectionalPort)
+ out.print("inout");
+ else
+ out.print(isInbound ? "in" : "out");
+ out.print(" ");
+ out.print(name);
+ out.print(";");
+ out.endl();
+ }
+ }
+ }
+
+ @Override
+ public void visit(QMLBoolean b)
+ {
+ }
+
+ @Override
+ public void visit(QMLNumber n)
+ {
+ }
+
+ @Override
+ public void visit(QMLRecord r)
+ {
+ }
+
+ @Override
+ public void visit(QMLString s)
+ {
+ }
+
+ @Override
+ public void visit(QMLOptional p)
+ {
+ }
+ }
+
+ // My port visitor
+ class MyTTCN3PortVisitor implements QMLValueVisitor
+ {
+ public MyTTCN3PortVisitor(PrettyPrinter pp, boolean isInbound,
+ String port, String indent)
+ {
+ this.out = pp;
+ this.isInbound = isInbound;
+ this.port = port;
+ this.indent = indent;
+
+ assert (out != null);
+
+ typeNameMap = new HashMap<String, String>();
+
+ /* Booleans */
+ typeNameMap.put("boolean", "boolean");
+ /* Integers. */
+ typeNameMap.put("int", "integer");
+ typeNameMap.put("byte", "integer");
+ typeNameMap.put("char", "integer");
+ typeNameMap.put("short", "integer");
+ typeNameMap.put("long", "integer");
+ /* Floating point. */
+ typeNameMap.put("float", "float");
+ typeNameMap.put("double", "float");
+ /* Strinags. */
+ typeNameMap.put("String", "charstring");
+ }
+
+ protected PrettyPrinter out;
+ protected final boolean isInbound;
+ protected Map<String, String> typeNameMap;
+ private String port;
+ private String indent;
+
+ @Override
+ public void visit(QMLArray x)
+ {
+ /*
+ * Port types are tuples with just Strings inside referring to
+ * types.
+ */
+ assert (x != null);
+ final int size = x.getNumberOfElements();
+
+ for (int i = 0; i < size; i++)
+ {
+ QMLString portname = (QMLString) x.getValue(i);
+
+ if (portname != null)
+ {
+ final String origname = portname.getValue();
+ final String name = TTCNScripter
+ .makeValidTTCN3Identifier(origname);
+
+ /* Skip AnyRecord.. */
+ if (name.equals("AnyRecord"))
+ {
+ continue;
+ }
+ // Harness generation
+ out.print(indent + "function qtronic");
+ out.print(isInbound ? "_receive_" : "_send_");
+ out.print(name);
+ out.print(isInbound ? "_from_" : "_to_");
+ out.print(this.port);
+ out.print("(template " + name + " ");
+ out.print((isInbound ? "tmplToMatch" : "msgToSend")
+ + ") runs on " + runsOnName);
+ out.endl();
+ out.print(indent + "{");
+ out.endl();
+ out.print(indent + indent
+ + "// Do whatever manipulation is needed to '");
+ out.print((isInbound ? "tmplToMatch" : "msgToSend"));
+ out.print("'");
+ out.endl();
+ if (isInbound)
+ {
+ out
+ .print(indent
+ + indent
+ + "// before matching it against the expected value template.");
+ out.endl();
+ out
+ .print(indent
+ + indent
+ + "// This manipulation typically means removing fields not present");
+ out.endl();
+ out.print(indent + indent
+ + "// in the abstract model system interface.");
+ out.endl();
+
+ if (eptfEnable)
+ {
+ if (this.port.equals(eptfInboundPort)
+ || this.port.equals(eptfOutboundPort))
+ {
+ out
+ .print(indent
+ + indent
+ + "EPTF_MBT_TESTER_PCO.receive(tmplToMatch) from vc_lgen;");
+ out.endl();
+ }
+ else
+ {
+ out.print(indent + indent + this.port
+ + ".receive(tmplToMatch);");
+ out.endl();
+ }
+
+ }
+ }
+ else
+ {
+ out
+ .print(indent
+ + indent
+ + "// before it is delivered to the SUT through the real test interface.");
+ out.endl();
+ out
+ .print(indent
+ + indent
+ + "// This can include addition of fields not present in the model or");
+ out.endl();
+ out
+ .print(indent
+ + indent
+ + "// manipulation of unique identifiers in the messages that Qtronic");
+ out.endl();
+ out
+ .print(indent
+ + indent
+ + "// cannot possible know at the time of test generation.");
+ out.endl();
+
+ if (eptfEnable)
+ {
+ if (this.port.equals(eptfInboundPort)
+ || this.port.equals(eptfOutboundPort))
+ {
+ out
+ .print(indent
+ + indent
+ + "EPTF_MBT_TESTER_PCO.send(msgToSend) to vc_lgen;");
+ out.endl();
+ }
+ else
+ {
+ out.print(indent + indent + this.port
+ + ".send(msgToSend);");
+ out.endl();
+ }
+ }
+ }
+ out.print(indent + "}");
+ out.endl();
+ }
+ }
+ }
+
+ @Override
+ public void visit(QMLBoolean b)
+ {
+ }
+
+ @Override
+ public void visit(QMLNumber n)
+ {
+ }
+
+ @Override
+ public void visit(QMLRecord r)
+ {
+ }
+
+ @Override
+ public void visit(QMLString s)
+ {
+ }
+
+ @Override
+ public void visit(QMLOptional p)
+ {
+ }
+ }
+
+ private PrettyPrinter out;
+ private NotificationSink notifications;
+ private MetaDataDictionary metadata;
+ private int testCaseIndex;
+ private int templateIndex;
+ private boolean isCompact;
+ private TimeStamp timeStamp;
+ private String logCommand;
+ private boolean generateTypes;
+ private boolean generateTestComponent;
+ private String filename;
+ private String timerName;
+ private String defaultName;
+ private String startHook;
+ private String commSlack;
+ private String extraImports;
+ private String runsOnName;
+ private String systemTypeName;
+ private String endHook;
+ private String portExtensions;
+ private String moduleName;
+ private String dataTypesFile;
+ private String testHarnessFile;
+ private boolean generateTestHarness;
+ private boolean firstStep;
+ private Map<QMLRecord, Integer> generatedTemplates;
+ private Vector<TemplateDefinition> postponedTemplates;
+ private Vector<String> testCaseNames;
+ private String extendsComponent;
+ private boolean eptfEnable;
+ private String eptfInboundPort;
+ private String eptfOutboundPort;
+ private boolean eptfBidirectionalPort;
+
+ static private String SCRIPTER_NAME = "TTCN-3 scripter 0.1";
+
+ public TTCNScripter()
+ {
+ this.testCaseIndex = 0;
+ this.templateIndex = 0;
+ this.isCompact = false;
+ this.timeStamp = new TimeStamp();
+ this.timeStamp.seconds = 0;
+ this.timeStamp.nanoseconds = 0;
+ this.logCommand = "log";
+ this.generateTypes = true;
+ this.generateTestComponent = true;
+
+ this.filename = "";
+ this.timerName = "";
+ this.defaultName = "";
+ this.startHook = "";
+ this.commSlack = "";
+ this.extraImports = "";
+ this.runsOnName = "";
+ this.systemTypeName = "";
+ this.endHook = "";
+ this.portExtensions = "";
+ this.moduleName = "";
+ this.dataTypesFile = "";
+ this.testHarnessFile = "";
+ this.generateTestHarness = true;
+ this.firstStep = false;
+ this.generatedTemplates = new HashMap<QMLRecord, Integer>();
+ this.postponedTemplates = new Vector<TemplateDefinition>();
+ this.testCaseNames = new Vector<String>();
+
+ this.extendsComponent = "";
+ this.eptfEnable = false;
+ this.eptfInboundPort = "";
+ this.eptfOutboundPort = "";
+ this.eptfBidirectionalPort = false;
+ }
+
+ @Override
+ public void setNotificationSink(NotificationSink sink)
+ {
+ notifications = sink;
+ }
+
+ @Override
+ public boolean setMetaData(MetaDataDictionary dict)
+ {
+ metadata = dict;
+ return true;
+ }
+
+ @Override
+ public boolean setConfigurationOption(java.lang.String property,
+ java.lang.String value)
+ {
+ if (property.equals("Main.Generated TTCN-3 file"))
+ {
+ filename = value;
+ moduleName = getModuleName(filename);
+ }
+ else if (property.equals("Main.Generated types and test component"))
+ {
+ dataTypesFile = value;
+ }
+ else if (property.equals("Main.Generated harness template file"))
+ {
+ testHarnessFile = value;
+ }
+ else if (property.equals("Main.Generate types"))
+ {
+ generateTypes = value.equals("true");
+ }
+ else if (property.equals("Main.Generate ports and test component"))
+ {
+ generateTestComponent = value.equals("true");
+ }
+ else if (property.equals("Main.Test component extension"))
+ {
+ extendsComponent = value;
+ }
+ else if (property.equals("Main.Generate test harness template"))
+ {
+ generateTestHarness = value.equals("true");
+ }
+ else if (property.equals("Logging.Name of the 'log' command"))
+ {
+ logCommand = value;
+ }
+ else if (property.equals("Customization.Global timer name"))
+ {
+ timerName = value;
+ }
+ else if (property.equals("Customization.Activated default"))
+ {
+ defaultName = value;
+ }
+ else if (property.equals("Customization.Start test case hook call"))
+ {
+ startHook = value;
+ }
+ else if (property.equals("Timing.Communications slack limit"))
+ {
+ commSlack = value;
+ }
+ else if (property.equals("Customization.Extra import statements"))
+ {
+ extraImports = value;
+ }
+ else if (property.equals("Customization.Runs on type name"))
+ {
+ runsOnName = value;
+ }
+ else if (property.equals("Customization.System type name"))
+ {
+ systemTypeName = value;
+ }
+ else if (property.equals("Customization.End test case hook call"))
+ {
+ endHook = value;
+ }
+ else if (property.equals("Extensions.Use port type extension"))
+ {
+ portExtensions = value;
+ }
+ else if (property.equals("Logging.Log checkpoints"))
+ {
+ isCompact = !value.equals("true");
+ }
+ else if (property.equals("EPTF_MBT_Applib.Enable"))
+ {
+ eptfEnable = value.equals("true");
+ }
+ else if (property.equals("EPTF_MBT_Applib.Inbound Port"))
+ {
+ eptfInboundPort = value;
+ }
+ else if (property.equals("EPTF_MBT_Applib.Outbound Port"))
+ {
+ eptfOutboundPort = value;
+ }
+ else if (property.equals("EPTF_MBT_Applib.Bidirectional Ports"))
+ {
+ eptfBidirectionalPort = value.equals("true");
+ }
+ return true;
+ }
+
+ private String getModuleName(String path)
+ {
+ int slash = path.lastIndexOf("/");
+ int backslash = path.lastIndexOf("\\");
+ String module;
+ if (slash != -1 && backslash != -1)
+ {
+ module = path
+ .substring((slash > backslash ? slash : backslash) + 1);
+ }
+ else if (slash != -1)
+ {
+ module = path.substring(slash + 1);
+ }
+ else if (backslash != -1)
+ {
+ module = path.substring(backslash + 1);
+ }
+ else
+ {
+ module = path;
+ }
+ int size = module.length();
+ String upper = module.toUpperCase();
+
+ if (upper.lastIndexOf(".TTCN3") == (size - 6))
+ {
+ return module.substring(0, size - 6);
+ }
+ if (upper.lastIndexOf(".TTCN") == (size - 5))
+ {
+ return module.substring(0, size - 5);
+ }
+ if (upper.lastIndexOf(".3MP") == (size - 4))
+ {
+ return module.substring(0, size - 4);
+ }
+ return "QtronicTest";
+ }
+
+ @Override
+ public boolean beginScript(String testsuiteName)
+ {
+ if (notifications != null)
+ {
+ notifications.notify("info", SCRIPTER_NAME
+ + ": Export test cases for test " + "design configuration "
+ + testsuiteName);
+ }
+ String msg = null;
+ if (filename.equals(""))
+ {
+ msg = "TTCN-3 backend must be configured with a file name.";
+ }
+ else
+ {
+ try
+ {
+ out = new PrettyPrinter(new BufferedWriter(new FileWriter(
+ filename)));
+ } catch (IOException e)
+ {
+ StringBuffer msgbuf = new StringBuffer();
+ msgbuf.append("Failed to open file '");
+ msgbuf.append(filename);
+ msgbuf.append("' for writing TTCN-3 script.");
+ msg = msgbuf.toString();
+ }
+ }
+ if (msg != null)
+ {
+ if (notifications != null)
+ {
+ notifications.notify("error", SCRIPTER_NAME + ": " + msg);
+ }
+ else
+ {
+ System.err.println(msg);
+ }
+ return false;
+ }
+
+ dumpHeader(filename);
+ out.print("module ");
+ out.print(moduleName);
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+
+ out.print("import from ");
+ out.print(getModuleName(dataTypesFile));
+ out.print(" all;");
+ out.endl();
+
+ // import generated test harness
+ if (eptfEnable && generateTestHarness && !testHarnessFile.equals(""))
+ {
+ out.print("import from ");
+ out.print(getModuleName(testHarnessFile));
+ out.print(" all;");
+ out.endl();
+ }
+
+ out.print("/* User provided imports begin */");
+ out.endl();
+ out.print(extraImports);
+ out.endl();
+ out.print("/* User provided imports end */");
+ out.endl();
+
+ // print out the test harness template
+ try
+ {
+ // should the harness template be written
+ if (generateTestHarness)
+ {
+
+ // check if file already exists. If it does ask user
+ // to remove it first
+ try
+ {
+ new FileReader(testHarnessFile);
+ if (notifications != null)
+ {
+ notifications.notify("info", SCRIPTER_NAME + ": File "
+ + testHarnessFile + " exists, NOT overwriting it.");
+ }
+ return true;
+ } catch (FileNotFoundException not_found)
+ {
+ // create the template file
+ dumpTestHarness();
+ if (notifications != null)
+ {
+ notifications.notify("info", SCRIPTER_NAME
+ + ": Generated TTCN-3 test harness template to "
+ + "<hyperlink=\"" + testHarnessFile + "\">"
+ + testHarnessFile + "</hyperlink>.");
+ }
+ }
+ }
+ } catch (Exception e)
+ {
+ out.print("/* EXCEPTION CAUGHT */");
+ out.endl();
+ if (notifications != null)
+ {
+ notifications
+ .notify(
+ "error",
+ SCRIPTER_NAME
+ + ": Caught exception while "
+ + "rendering TTCN test harness template. Please reload model "
+ + "and try again (" + e.getMessage() + ")");
+ }
+ return false;
+ }
+
+ if (generateTypes)
+ {
+ // out.print("/* Qtronic generated data types begin */");
+ // out.endl();
+ /* First dump all the types used in the module. */
+ try
+ {
+ dumpTypes();
+ dumpTemplates();
+ // out.print("/* Qtronic generated data types end */");
+ // out.endl();
+ } catch (Exception e)
+ {
+ out.print("/* EXCEPTION CAUGHT */");
+ out.endl();
+ if (notifications != null)
+ {
+ notifications
+ .notify(
+ "error",
+ SCRIPTER_NAME
+ + ": Caught exception while "
+ + "rendering TTCN type definitions. Please reload model "
+ + "and try again (" + e.getMessage()
+ + ")");
+ }
+ return false;
+ }
+ }
+
+ out.print("/* Qtronic generated alt step */");
+ out.endl();
+ /*
+ * The GENERATED default is always called QtronicDefaultAlt(), but the
+ * user can use alternative default by changing configuration option. In
+ * this case the user provides the default.
+ */
+ out.print("altstep QtronicDefaultAlt() runs on ");
+ out.print(runsOnName);
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+
+ printAltStepBody();
+
+ deleteCopies();
+ templateIndex = 0;
+ testCaseIndex = 0;
+
+ firstStep = false;
+
+ return true;
+ }
+
+ private void printAltStepBody()
+ {
+ printAltStepBody("");
+ }
+
+ private void printAltStepBody(String indent)
+ {
+ out.print(indent);
+ out.block();
+ out.print("[] any port.receive");
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ out.print(timerName);
+ out.print(".stop;");
+ out.endl();
+ out.print("setverdict(fail);");
+ out.endl();
+
+ if (!endHook.equals(""))
+ {
+ out.print(endHook);
+ out.print(";");
+ out.endl();
+ }
+
+ out.print("stop;");
+ out.endl();
+ out.resume();
+ out.print("}");
+ out.endl();
+ out.print("[] ");
+ out.print(timerName);
+ out.print(".timeout");
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ out.print("setverdict(fail);");
+ out.endl();
+
+ if (!endHook.equals(""))
+ {
+ out.print(endHook);
+ out.print(";");
+ out.endl();
+ }
+
+ out.print("stop;");
+ out.endl();
+ out.resume();
+ out.print("}");
+ out.endl();
+ out.resume();
+ out.print("}");
+ out.endl();
+ }
+
+ private void dumpType(final QMLRecordType type, Set<String> arrays)
+ {
+ out.print("type record ");
+ out.print(makeValidTTCN3Identifier(type.getTypeName()));
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ for (int i = 0; i < type.getNumberOfFields(); i++)
+ {
+ final QMLRecordTypeField field = type.getField(i);
+ TTCNTypeName v = new TTCNTypeName(arrays);
+ field.getType().accept(v);
+ assert (!v.getName().equals(""));
+ if (i != 0)
+ {
+ out.print(",");
+ out.endl();
+ }
+ out.print(v.getName());
+ out.print(" ");
+ out.print(makeValidTTCN3Identifier(field.getFieldName()));
+ if (v.getOptional())
+ {
+ out.print(" optional");
+ }
+ }
+ out.endl();
+ out.resume();
+ out.print("}");
+ out.endl();
+ for (int i = 0; i < type.getNumberOfInnerRecords(); i++)
+ {
+ dumpType(type.getInnerType(i), arrays);
+ }
+ }
+
+ private void dumpTypes() throws Exception
+ {
+ assert (metadata != null);
+
+ Set<String> arrays = new HashSet<String>();
+
+ List<String> ports = new Vector<String>();
+
+ PrettyPrinter oldOut = out;
+ String msg = null;
+ Exception rethrowMe = null;
+
+ if (dataTypesFile.equals(""))
+ {
+ msg = "TTCN-3 backend must be configured with a data type file "
+ + "name.";
+ }
+ else
+ {
+ try
+ {
+ out = new PrettyPrinter(new BufferedWriter(new FileWriter(
+ dataTypesFile)));
+ } catch (IOException e)
+ {
+ StringBuffer msgbuf = new StringBuffer();
+ msgbuf.append("Failed to open file '");
+ msgbuf.append(dataTypesFile);
+ msgbuf.append("' for writing data types.");
+ msg = msgbuf.toString();
+ rethrowMe = e;
+ }
+ }
+ if (msg != null)
+ {
+ if (notifications != null)
+ {
+ notifications.notify("error", msg);
+ }
+ else
+ {
+ System.err.println(msg);
+ }
+ out = oldOut;
+ // Pass the exception forward for proper error handling further
+ // up the call stack.
+ throw (rethrowMe);
+ }
+
+ dumpHeader(dataTypesFile);
+ out.print("module ");
+ out.print(getModuleName(dataTypesFile));
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+
+ out.print("/* User provided imports begin */");
+ out.endl();
+ out.print(extraImports);
+ out.endl();
+ out.print("/* User provided imports end */");
+ out.endl();
+
+ try
+ {
+ if (generateTestComponent)
+ {
+ final String portinfo = "portinfo:";
+ String key = metadata.getNextKey(portinfo);
+ while (key != null)
+ {
+ String data = key;
+ if (data.indexOf(portinfo) != 0)
+ {
+ break;
+ }
+
+ final QMLValue definition = metadata.get(key);
+ assert (definition != null);
+
+ QMLArray tuple = (QMLArray) definition;
+ if (tuple != null)
+ {
+ String origname;
+ boolean inbound = false;
+ int pos = data.indexOf(":inbound:");
+ inbound = (pos != -1);
+ origname = data.substring(portinfo.length()
+ + (inbound ? "inbound:".length() : "outbound:"
+ .length()));
+
+ if (eptfEnable
+ && (origname.equals(eptfInboundPort) || origname
+ .equals(eptfOutboundPort)))
+ { // Port definitions is not generated for the MBT port
+ System.err.print("//Skipping port"
+ + makeValidTTCN3Identifier(origname) + "\n");
+ }
+ else
+ {
+ String name = makeValidTTCN3Identifier(origname);
+ out.print("type port ");
+ out.print(name);
+ out.print("Port message");
+ ports.add(name);
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+
+ TTCN3PortVisitor converter = new TTCN3PortVisitor(
+ out, !inbound);
+ tuple.accept(converter);
+
+ // if (converter.hasArrays()) {
+ // Iterator<String> it =
+ // converter.getArrays().keySet()
+ // .iterator();
+ // while (it.hasNext()) {
+ // arrays.add(it.next());
+ // }
+ // }
+
+ out.resume();
+ out.print("}");
+ if (!portExtensions.equals(""))
+ {
+ out.print(" with {extension \"");
+ out.print(portExtensions);
+ out.print("\"}");
+ }
+ out.endl();
+ }
+ }
+ key = metadata.getNextKey(key);
+ }
+ }
+
+ if (generateTypes)
+ {
+ Vector<QMLRecordType> types = metadata.getTypes();
+ Iterator<QMLRecordType> rit = types.iterator();
+ while (rit.hasNext())
+ {
+ QMLRecordType type = rit.next();
+
+ if (eptfEnable && type.getTypeName().length() >= 5
+ && type.getTypeName().substring(0, 5).equals("EPTF_"))
+ { // Do not generate type definitions for EPTF modules
+ }
+ else
+ {
+ dumpType(type, arrays);
+ }
+ }
+
+ Iterator<String> it = arrays.iterator();
+ while (it.hasNext())
+ {
+ String x = it.next();
+ // TODO: reconsider changing this because now both
+ // TTCNTypeName class and this piece of code here has
+ // to know how array names are constructed.
+ out.print("type record of ");
+ out.print(x);
+ out.print(" ");
+ out.print(x);
+ out.print("Array;");
+ out.endl();
+ }
+ }
+
+ if (generateTestComponent)
+ {
+ out.endl();
+ out.print("type component ");
+ out.print(runsOnName);
+ if (!extendsComponent.equals(""))
+ {
+ out.print(" extends ");
+ out.print(extendsComponent);
+ }
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ Iterator<String> it = ports.iterator();
+ while (it.hasNext())
+ {
+ String x = it.next();
+ out.print("port ");
+ out.print(x);
+ out.print("Port ");
+ out.print(x);
+ out.print(";");
+ out.endl();
+ }
+ out.print("timer ");
+ out.print(timerName);
+ out.print(" := 0.0;");
+ out.endl();
+ out.resume();
+ out.print("}");
+ out.endl();
+ }
+
+ /*
+ * altstep QtronicDefaultAlt() runs on SystemType { [] any
+ * port.receive { mytimer.stop; setverdict(fail); stop; } []
+ * mytimer.timeout { setverdict(fail); stop; } }
+ */
+ // Must close the module block.
+ out.resume();
+ out.print("}");
+ out.endl();
+ out.flush();
+ out.close();
+ out = oldOut;
+ } catch (Exception e)
+ {
+ out.flush();
+ out.close();
+ out = oldOut;
+ }
+ }
+
+ private void dumpTemplates()
+ {
+ Iterator<TemplateDefinition> it = postponedTemplates.iterator();
+ while (it.hasNext())
+ {
+ final TemplateDefinition def = it.next();
+ out.print("template ");
+ out.print(makeValidTTCN3Identifier(def.getTypeName()));
+ out.print(" ");
+ out.print(def.getTemplateName());
+ out.ws();
+ out.print(":=");
+ out.endl();
+ QMLRecord r = def.getRecord();
+
+ TemplateDumper t = new TemplateDumper(out);
+ r.accept(t);
+
+ out.endl();
+ }
+ }
+
+ /**
+ * prints out the test harness template, that contains:
+ *
+ * - import from QtronicTypes;
+ *
+ * - type component for the harness system
+ *
+ * - MTC component the tests should run on
+ *
+ * - harness alt step
+ *
+ * - start and end test hook calls
+ *
+ * - port and message mapping functions
+ */
+ private void dumpTestHarness() throws Exception
+ {
+ assert (metadata != null);
+
+ PrettyPrinter oldOut = out;
+ String msg = null;
+ Exception rethrowMe = null;
+ if (testHarnessFile.equals(""))
+ {
+ msg = "TTCN-3 backend must be configured with a test harness "
+ + " file name.";
+ }
+ else
+ {
+ try
+ {
+ out = new PrettyPrinter(new BufferedWriter(new FileWriter(
+ testHarnessFile)));
+ } catch (IOException e)
+ {
+ StringBuffer msgbuf = new StringBuffer();
+ msgbuf.append("Failed to open file '");
+ msgbuf.append(testHarnessFile);
+ msgbuf.append("' for writing test harness template.");
+ msg = msgbuf.toString();
+ rethrowMe = e;
+ }
+ }
+ if (msg != null)
+ {
+ if (notifications != null)
+ {
+ notifications.notify("error", msg);
+ }
+ else
+ {
+ System.err.println(msg);
+ }
+ out = oldOut;
+ // Pass the exception forward for proper error handling further
+ // up the call stack.
+ throw (rethrowMe);
+ }
+
+ String indent = " ";
+
+ dumpHeader(testHarnessFile);
+ out.print("module ");
+ out.print(getModuleName(testHarnessFile));
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.block();
+
+ // import all data types
+ out.print(indent);
+ out.print("import from ");
+ out.print(getModuleName(dataTypesFile));
+ out.print(" all;");
+ out.endl();
+
+ out.print("/* User provided imports begin */");
+ out.endl();
+ out.print(extraImports);
+ out.endl();
+ out.print("/* User provided imports end */");
+ out.endl();
+
+ out.block();
+
+ // system mapping
+ if (!systemTypeName.equals("") && !eptfEnable)
+ {
+ out.print(indent + "type component ");
+ out.print(systemTypeName);
+ out.endl();
+ out.print(indent + "{");
+ out.endl();
+ out.print(indent + indent
+ + "// Add port definitions for your system here");
+ out.endl();
+ out.print(indent + "}");
+ out.endl();
+ out.block();
+ }
+
+ // MTC port definitions
+ if (!runsOnName.equals(""))
+ {
+ // The component type should be already generated in the type
+ // definitions module.
+ if (!eptfEnable)
+ {
+ out.print(indent);
+ out.print("type component ");
+ out.print(runsOnName);
+ out.endl();
+ out.print(indent + "{");
+ out.endl();
+ out.print(indent + indent
+ + "// Add port definitions for your MTC here");
+ out.endl();
+ out.print(indent + indent + "timer ");
+ out.print(timerName);
+ out.print(" := 0.0;");
+ out.endl();
+ out.print(indent + "}");
+ out.endl();
+ }
+
+ // alt step
+ String moduleName = getModuleName(dataTypesFile);
+ if (!moduleName.equals(""))
+ {
+ out.print(indent);
+ out.print("altstep ");
+ out.print(defaultName);
+ out.print(" runs on ");
+ out.print(runsOnName);
+ out.endl();
+ out.block();
+ out.print(indent + "{");
+ out.endl();
+ out.print(indent);
+ out.block();
+ printAltStepBody(indent);
+ out.resume();
+ out.resume();
+ }
+
+ // default start and stop functions
+ if (!startHook.equals("") && !eptfEnable)
+ {
+ out.print(indent);
+ out.print("function ");
+ out.print(startHook);
+ out.print(" runs on ");
+ out.print(runsOnName);
+ out.endl();
+ out.print(indent + "{");
+ out.endl();
+ out.print(indent + indent
+ + "// Do port mapping between MTC and abstract"
+ + " test system interface");
+ out.endl();
+ out.print(indent + indent
+ + "// map(mtc:<someport>, system:<someport>);");
+ out.endl();
+ out.print(indent + "}");
+ out.endl();
+ out.block();
+ }
+ if (!endHook.equals("") && !eptfEnable)
+ {
+ out.print(indent);
+ out.print("function ");
+ out.print(endHook);
+ out.print(" runs on ");
+ out.print(runsOnName);
+ out.endl();
+ out.print(indent + "{");
+ out.endl();
+ out.print(indent + indent + "// Do port unmapping e.g.");
+ out.endl();
+ out.print(indent + indent
+ + "// map(mtc:<someport>, system:<someport>);");
+ out.endl();
+ out.print(indent + "}");
+ out.endl();
+ out.block();
+ }
+
+ // port mapping
+ try
+ {
+ final String portinfo = "portinfo:";
+ String key = metadata.getNextKey(portinfo);
+ while (key != null)
+ {
+ String data = key;
+ if (data.indexOf(portinfo) != 0)
+ {
+ break;
+ }
+
+ final QMLValue definition = metadata.get(key);
+ assert (definition != null);
+
+ boolean inbound = false;
+ int pos = data.indexOf(":inbound:");
+ inbound = (pos != -1);
+ String origname = data
+ .substring(portinfo.length()
+ + (inbound ? "inbound:".length() : "outbound:"
+ .length()));
+
+ String port = makeValidTTCN3Identifier(origname);
+
+ QMLArray tuple = (QMLArray) definition;
+ if (tuple != null)
+ {
+ MyTTCN3PortVisitor converter = new MyTTCN3PortVisitor(
+ out, !inbound, port, indent);
+ tuple.accept(converter);
+ }
+ key = metadata.getNextKey(key);
+ }
+ } catch (Exception e)
+ {
+ out.print("/* EXCEPTION CAUGHT in dumpTestHarness */");
+ out.flush();
+ out.close();
+ out = oldOut;
+ throw e;
+ }
+ }
+ // Must close the module block.
+ out.resume();
+ out.print("}");
+ out.endl();
+ out.flush();
+ out.close();
+ out = oldOut;
+ }
+
+ private void dumpHeader(String filename)
+ {
+ assert (out != null);
+
+ out.print("/* -*- ttcn3 -*- */");
+ out.endl();
+ out.emptyline();
+ out.print("/** ");
+ out.print("@file ");
+ out.print(filename);
+ out.endl();
+ out.print(" *");
+ out.block();
+ out.endl();
+ out.print(" @author Conformiq TTCN3 Script Backend 0.1");
+ out.endl();
+ out.print(" @date ");
+ out.print(new Date().toString());
+ out.endl();
+ out.print("");
+ out.endl();
+ out.print(" WARNING! This file has been automatically generated using");
+ out.endl();
+ out
+ .print(" Ericsson Qtronic TTCN3 Script Backend (based on the original Conformiq Backend).");
+ out.print("DO NOT EDIT.");
+ out.endl();
+ out.resume();
+ out.print(" */");
+ out.endl();
+ out.emptyline();
+ }
+
+ private void deleteCopies()
+ {
+ generatedTemplates.clear();
+ }
+
+ @Override
+ public boolean beginCase(String testcaseName)
+ {
+ firstStep = true;
+ testCaseIndex++;
+ out.print("/* Generated test case #");
+ out.print(testCaseIndex);
+ out.print(" */");
+ out.endl();
+ out.print("testcase ");
+ out.print(recordAndRenderTestCaseName(testcaseName));
+ out.print("() runs on ");
+ out.print(runsOnName);
+ if (systemTypeName != null && !systemTypeName.equals(""))
+ {
+ out.print(" system ");
+ out.print(systemTypeName);
+ }
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ out.print("var float oldtimer := 0.0;");
+ out.endl();
+ out.print("var float SLACK := ");
+ out.print(commSlack);
+ out.print(";");
+ out.endl();
+
+ if (!defaultName.equals(""))
+ {
+ out.print("var default default_behaviour_ref;");
+ out.endl();
+ }
+
+ if (!startHook.equals(""))
+ {
+ out.print(startHook);
+ out.print(";");
+ out.endl();
+ }
+
+ if (!defaultName.equals(""))
+ {
+ out.print("default_behaviour_ref := activate(");
+ out.print(defaultName);
+ out.print(");");
+ out.endl();
+ }
+
+ return true;
+ }
+
+ // @Override
+ public void caseProbability(double probability)
+ {
+ }
+
+ final private String escapeString(String s)
+ {
+ // Checkpoint strings from the model must be escaped by "backslashing"
+ // double quotations and backslashes themselves.
+ StringBuffer escaped = new StringBuffer();
+ final int size = s.length();
+ if (size == 0)
+ return s;
+ for (int i = 0; i < size; i++)
+ {
+ if (s.charAt(i) == '\\')
+ {
+ escaped.append("\\\\");
+ }
+ else if (s.charAt(i) == '"')
+ {
+ escaped.append("\\\"");
+ }
+ else
+ {
+ escaped.append(s.charAt(i));
+ }
+ }
+ return escaped.toString();
+ }
+
+ @Override
+ public boolean checkpointInfo(Checkpoint checkpoint, int status,
+ TimeStamp ts)
+ {
+ if (isCompact || !firstStep || status == CheckpointStatus.UNCOVERED
+ || status == CheckpointStatus.MAYBE_COVERED)
+ {
+ return true;
+ }
+
+ if (checkpoint.getType() == CheckpointType.USUAL_CHECKPOINT)
+ {
+ // TODO: we might want to have something configurable here or
+ // maybe something based on which CPs are selected as targets;
+ // now we just include methods, states and transtions into
+ // reports CPs to avoid "CP-bloat".
+ String cp = checkpoint.getName();
+ String method = new String("method:");
+ String transition = new String("transition:");
+ String state = new String("state:");
+ if ((cp.length() > method.length() && cp.substring(0,
+ method.length()).equals(method))
+ || (cp.length() > transition.length() && cp.substring(0,
+ transition.length()).equals(transition))
+ || (cp.length() > state.length() && cp.substring(0,
+ state.length()).equals(state)))
+ {
+ out.print(logCommand);
+ out.print("(\"Structural feature: ");
+ out.print(escapeString(cp));
+ out.print("\");");
+ out.endl();
+ }
+ }
+ else if (checkpoint.getType() == CheckpointType.REQUIREMENT)
+ {
+ out.print(logCommand);
+ out.print("(\"Requirement: ");
+ out.print(escapeString(checkpoint.getName()));
+ out.print("\");");
+ out.endl();
+ }
+ return true;
+ }
+
+ @Override
+ public boolean endCase()
+ {
+ out.print("setverdict(pass);");
+ out.endl();
+
+ /*
+ * Default is used only if the provided name is different from "", so if
+ * the default is not used let's not deactivate it either.
+ */
+ if (!defaultName.equals(""))
+ {
+ out.print("deactivate(default_behaviour_ref);");
+ out.endl();
+ }
+
+ if (!endHook.equals(""))
+ {
+ out.print(endHook);
+ out.print(";");
+ out.endl();
+ }
+
+ out.resume();
+ out.print("}");
+ out.endl();
+
+ /* Generate templates out of the datums stored in the TestStep. */
+ dumpTemplates();
+
+ postponedTemplates.clear();
+ return true;
+ }
+
+ @Override
+ public boolean endScript()
+ {
+ out.print("control");
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ for (int i = 1; i <= testCaseIndex; i++)
+ {
+ out.print("execute(");
+ out.print(getTestCaseName(i));
+ out.print("());");
+ out.endl();
+ }
+ out.resume();
+ out.print("}");
+ out.endl();
+ out.resume();
+ out.print("}");
+ out.endl();
+
+ try
+ {
+ out.flush();
+ out.close();
+ } catch (Exception e)
+ {
+ if (notifications != null)
+ {
+ notifications.notify("error", SCRIPTER_NAME + ": "
+ + e.toString());
+ }
+ }
+ out = null;
+
+ StringBuffer ss = new StringBuffer();
+ ss.append("Generated TTCN-3 script to <hyperlink=\"");
+ ss.append(filename);
+ ss.append("\">");
+ ss.append(filename);
+ ss.append("</hyperlink>.");
+ if (notifications != null)
+ {
+ notifications.notify("info", SCRIPTER_NAME + ": " + ss.toString());
+ }
+ else
+ {
+ System.out.println(ss.toString());
+ }
+ testCaseNames.clear();
+ return true;
+ }
+
+ @Override
+ public boolean testStep(QMLRecord r, String thread, String port,
+ boolean isFromTester, TimeStamp ts)
+ {
+ /*
+ * We have an altstep defined:
+ *
+ * altstep QtronicDefaultAlt() runs on SystemType { [] any port.receive
+ * { mytimer.stop; setverdict(fail); stop; } [] mytimer.timeout {
+ * setverdict(fail); stop; } }
+ *
+ * which removes the need for "[] any port.receive" and timeout from alt
+ * statements.
+ */
+
+ // Remember the datum so that we can generate a template out of it.
+ // Generate a new template only if it has not been generated before.
+ String name;
+ Integer idx = generatedTemplates.get(r);
+
+ if (idx != null)
+ {
+ StringBuffer ss = new StringBuffer();
+ ss.append(r.getName());
+ ss.append("Template");
+ ss.append(idx);
+ name = ss.toString();
+ }
+ else
+ {
+ ++templateIndex;
+
+ StringBuffer ss = new StringBuffer();
+ ss.append(r.getName());
+ ss.append("Template");
+ ss.append(templateIndex);
+ name = ss.toString();
+
+ postponedTemplates
+ .add(new TemplateDefinition(r.getName(), name, r));
+
+ generatedTemplates.put(r, templateIndex);
+ }
+
+ if (isFromTester)
+ {
+ /*
+ * Send datum to SUT. Generate:
+ *
+ * mytimer.start(<send time>); alt { [] mytimer.timeout { // OK } }
+ * <port>.send(template_<index>);
+ */
+ if (ts.seconds > timeStamp.seconds
+ || ts.nanoseconds > timeStamp.nanoseconds)
+ {
+ out.print(timerName);
+ out.print(".start(");
+ out.print(ts.seconds);
+ out.print(".");
+ out.print(ts.nanoseconds);
+ out.print(" - oldtimer);");
+ out.endl();
+ out.print("alt");
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ out.print("[] ");
+ out.print(timerName);
+ out.print(".timeout");
+ out.endl();
+ out.print("{");
+ out.endl();
+ out.print("}");
+ out.endl();
+ out.resume();
+ out.print("}");
+ out.endl();
+ ;
+
+ out.print(timerName);
+ out.print(".stop;");
+ out.endl();
+ }
+ out.print("qtronic_send_");
+ out.print(r.getName());
+ out.print("_to_");
+ out.print(port);
+ out.print("(");
+ out.print(name);
+ out.print(");");
+ out.endl();
+ }
+ else
+ {
+ out.print(timerName);
+ out.print(".start((");
+ out.print(ts.seconds);
+ out.print(".");
+ out.print(ts.nanoseconds);
+ out.print(" - oldtimer) + SLACK);");
+ out.endl();
+ out.print("qtronic_receive_");
+ out.print(r.getName());
+ out.print("_from_");
+ out.print(port);
+ out.print("(");
+ out.print(name);
+ out.print(");");
+ out.endl();
+ out.print(timerName);
+ out.print(".stop;");
+ out.endl();
+ }
+
+ out.print("oldtimer := ");
+ out.print(ts.seconds);
+ out.print(".");
+ out.print(ts.nanoseconds);
+ out.print(";");
+ out.endl();
+
+ this.timeStamp.seconds = ts.seconds;
+ this.timeStamp.nanoseconds = ts.nanoseconds;
+ return true;
+ }
+
+ private String recordAndRenderTestCaseName(String testCaseName)
+ {
+ // Remove whitespace
+ StringBuffer rendered = new StringBuffer();
+ for (int i = 0; i < testCaseName.length(); i++)
+ {
+ // Inverted the logic here to be safer by replacing everything
+ // but valid identifier chars with an underscore. According to the
+ // spec: "TTCN-3 identifiers are case sensitive and may
+ // only contain lowercase letters (a-z) uppercase letters
+ // (A-Z) and numeric digits (0-9). Use of the underscore (
+ // _ ) symbol is also allowed. An identifier shall begin
+ // with a letter (i.e., not a number and not an
+ // underscore)."
+ char c = testCaseName.substring(i, i + 1).charAt(0);
+ // If the original test case name starts with a digit, we want
+ // to preserve that but need to prefix the test case name with
+ // an underscore.
+ if (c >= '0' && c <= '9' && i == 0)
+ rendered.append('_');
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')
+ || (c >= '0' && c <= '9') || c == '_')
+ rendered.append(c);
+ else
+ rendered.append('_');
+ }
+ // Put into test case name list
+ testCaseNames.add(rendered.toString());
+ return rendered.toString();
+ }
+
+ private String getTestCaseName(int i)
+ {
+ // Get test case name at index i of the test case list
+ return testCaseNames.get(i - 1);
+ }
+
+ @Override
+ public boolean internalCommunicationsInfo(QMLRecord datum, String sender,
+ String receiver, String port, TimeStamp time)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean trace(String message, TimeStamp time)
+ {
+ return true;
+ }
+
+ private static boolean isalpha(char c)
+ {
+ return (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'));
+ }
+
+ private static boolean isalnum(char c)
+ {
+ return (isalpha(c) || ('0' <= c && c <= '9'));
+ }
+
+ public static String makeValidTTCN3Identifier(String id)
+ {
+ /* "Identifier ::= <alpha> (<alnum> | <underscore>)*" */
+ StringBuffer valid_ = new StringBuffer();
+ final int size = id.length();
+ if (size == 0)
+ {
+ System.err
+ .println("Warning: Empty string is not a valid TTCN3 identifier.");
+ return id;
+ }
+ if (isalpha(id.charAt(0)))
+ {
+ valid_.append(id.substring(0, 1));
+ }
+ else
+ {
+ valid_.append("X" + id.substring(0, 1));
+ }
+ for (int i = 1; i < size; i++)
+ {
+ if (!isalnum(id.charAt(i)) && id.charAt(i) != '_')
+ {
+ valid_.append("_");
+ }
+ else
+ {
+ valid_.append(id.charAt(i));
+ }
+ }
+ /* Postfix TTCN3 reserved words with '_' */
+ String valid = valid_.toString();
+ if (valid.equals("action") || valid.equals("fail")
+ || valid.equals("named") || valid.equals("self")
+ || valid.equals("activate") || valid.equals("false")
+ || valid.equals("none") || valid.equals("send")
+ || valid.equals("address") || valid.equals("float")
+ || valid.equals("nonrecursive") || valid.equals("sender")
+ || valid.equals("all") || valid.equals("for")
+ || valid.equals("not") || valid.equals("set")
+ || valid.equals("alt") || valid.equals("from")
+ || valid.equals("not4b") || valid.equals("signature")
+ || valid.equals("and") || valid.equals("function")
+ || valid.equals("nowait") || valid.equals("start")
+ || valid.equals("and4b") || valid.equals("null")
+ || valid.equals("stop") || valid.equals("any")
+ || valid.equals("get") || valid.equals("sut")
+ || valid.equals("getcall") || valid.equals("objid")
+ || valid.equals("system") || valid.equals("bitstring")
+ || valid.equals("getreply") || valid.equals("octetstring")
+ || valid.equals("boolean") || valid.equals("goto")
+ || valid.equals("of") || valid.equals("template")
+ || valid.equals("group") || valid.equals("omit")
+ || valid.equals("testcase") || valid.equals("call")
+ || valid.equals("on") || valid.equals("timeout")
+ || valid.equals("catch") || valid.equals("hexstring")
+ || valid.equals("optional") || valid.equals("timer")
+ || valid.equals("char") || valid.equals("or") || valid.equals("to")
+ || valid.equals("charstring") || valid.equals("if")
+ || valid.equals("or4b") || valid.equals("trigger")
+ || valid.equals("check") || valid.equals("ifpresent")
+ || valid.equals("out") || valid.equals("true")
+ || valid.equals("clear") || valid.equals("import")
+ || valid.equals("override") || valid.equals("type")
+ || valid.equals("complement") || valid.equals("in")
+ || valid.equals("component") || valid.equals("inconc")
+ || valid.equals("param") || valid.equals("union")
+ || valid.equals("connect") || valid.equals("infinity")
+ || valid.equals("pass") || valid.equals("universal")
+ || valid.equals("const") || valid.equals("inout")
+ || valid.equals("pattern") || valid.equals("unmap")
+ || valid.equals("control") || valid.equals("integer")
+ || valid.equals("port") || valid.equals("create")
+ || valid.equals("interleave") || valid.equals("procedure")
+ || valid.equals("value") || valid.equals("valueof")
+ || valid.equals("deactivate") || valid.equals("label")
+ || valid.equals("raise") || valid.equals("var")
+ || valid.equals("disconnect") || valid.equals("language")
+ || valid.equals("read") || valid.equals("verdict")
+ || valid.equals("display") || valid.equals("length")
+ || valid.equals("receive") || valid.equals("verdicttype")
+ || valid.equals("do") || valid.equals("log")
+ || valid.equals("record") || valid.equals("done")
+ || valid.equals("rem") || valid.equals("while")
+ || valid.equals("map") || valid.equals("repeat")
+ || valid.equals("with") || valid.equals("else")
+ || valid.equals("match") || valid.equals("reply")
+ || valid.equals("encode") || valid.equals("message")
+ || valid.equals("return") || valid.equals("xor")
+ || valid.equals("enumerated") || valid.equals("mixed")
+ || valid.equals("running") || valid.equals("xor4b")
+ || valid.equals("error") || valid.equals("mod")
+ || valid.equals("runs") || valid.equals("exception")
+ || valid.equals("modifies") || valid.equals("execute")
+ || valid.equals("module") || valid.equals("expand")
+ || valid.equals("mtc") || valid.equals("extension")
+ || valid.equals("external") ||
+
+ /* special identifiers reserved for the predefined functions */
+ valid.equals("int2char") || valid.equals("char2int")
+ || valid.equals("int2unichar") || valid.equals("unichar2int")
+ || valid.equals("bit2int") || valid.equals("hex2int")
+ || valid.equals("int2bit") || valid.equals("int2hex")
+ || valid.equals("int2oct") || valid.equals("int2str")
+ || valid.equals("oct2int") || valid.equals("str2int")
+ || valid.equals("lengthof") || valid.equals("sizeof")
+ || valid.equals("ischosen") || valid.equals("ispresent"))
+ {
+ return valid + "_";
+ }
+ return valid;
+ }
+}
diff --git a/src/Qtronic/TTCNScripter_v211/TTCNTypeName.java b/src/Qtronic/TTCNScripter_v211/TTCNTypeName.java
new file mode 100644
index 0000000..61c00b1
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v211/TTCNTypeName.java
@@ -0,0 +1,80 @@
+/** Copyright (C) Conformiq Software Oy, Ltd.
+ * All rights reserved.
+ *
+ * Created Thu Aug 28 11:18:26 2008.
+ *
+ * @file
+ *
+ * @author Tommi Vainikainen
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.util.Set;
+
+import com.conformiq.qtronic2.QMLArrayType;
+import com.conformiq.qtronic2.QMLBooleanType;
+import com.conformiq.qtronic2.QMLNumberType;
+import com.conformiq.qtronic2.QMLOptionalType;
+import com.conformiq.qtronic2.QMLRecordType;
+import com.conformiq.qtronic2.QMLStringType;
+import com.conformiq.qtronic2.QMLTypeVisitor;
+
+class TTCNTypeName implements QMLTypeVisitor {
+ public TTCNTypeName(Set<String> arrays) {
+ this.arrays = arrays;
+ optional = false;
+ name = "";
+ }
+
+ public void visit(QMLArrayType a) {
+ // We first visit the element type to get the correct name
+ // for it.
+ a.getType().accept(this);
+ //arrays.add(a.getType().getTypeName());
+ arrays.add(name);
+
+ optional = false;
+ name += "Array";
+ }
+
+ public void visit(QMLBooleanType b) {
+ name = "boolean";
+ }
+
+ public void visit(QMLNumberType n) {
+ if (n.isFloat() || n.isDouble()) {
+ name = "float";
+ } else {
+ name = "integer";
+ }
+ }
+
+ public void visit(QMLRecordType r) {
+ name = TTCNScripter.makeValidTTCN3Identifier(r.getTypeName());
+ }
+
+ public void visit(QMLStringType s) {
+ name = "charstring";
+ }
+
+ public void visit(QMLOptionalType p) {
+ p.getType().accept(this);
+ optional = true;
+ }
+
+ private boolean optional;
+
+ public boolean getOptional() {
+ return optional;
+ }
+
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ protected Set<String> arrays;
+};
diff --git a/src/Qtronic/TTCNScripter_v211/TemplateDumper.java b/src/Qtronic/TTCNScripter_v211/TemplateDumper.java
new file mode 100644
index 0000000..ae9420e
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v211/TemplateDumper.java
@@ -0,0 +1,150 @@
+/** Copyright (C) Conformiq Software Oy, Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:48:45 2008.
+ *
+ * @file
+ *
+ * @author Tommi Vainikainen
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import com.conformiq.qtronic2.QMLArray;
+import com.conformiq.qtronic2.QMLBoolean;
+import com.conformiq.qtronic2.QMLNumber;
+import com.conformiq.qtronic2.QMLOptional;
+import com.conformiq.qtronic2.QMLRecord;
+import com.conformiq.qtronic2.QMLRecordField;
+import com.conformiq.qtronic2.QMLString;
+import com.conformiq.qtronic2.QMLValue;
+import com.conformiq.qtronic2.QMLValueVisitor;
+
+import java.math.BigDecimal;
+
+public class TemplateDumper implements QMLValueVisitor {
+ private PrettyPrinter out;
+
+ public TemplateDumper(PrettyPrinter out) {
+ this.out = out;
+ }
+
+ @Override
+ public void visit(QMLRecord r) {
+ if (r == null) {
+ out.print("{ /* null record */ }");
+ return;
+ }
+
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ for (int i = 0; i < r.getNumberOfFields(); i++) {
+ if (i > 0) {
+ out.print(",");
+ out.endl();
+ }
+ QMLRecordField f = r.getField(i);
+ out.print(TTCNScripter.makeValidTTCN3Identifier(f.getName()));
+ out.print(" := ");
+ QMLValue v = f.getValue();
+ if (v != null)
+ v.accept(this);
+ else
+ out.print("{ /* NULL */ }");
+ }
+
+ out.endl();
+ out.resume();
+ out.print("}");
+ }
+
+ @Override
+ public void visit(QMLString x) {
+ assert (x != null);
+ String v = x.getValue();
+ out.print("\"");
+ for (int i = 0; i < v.length(); i++) {
+ switch (v.charAt(i)) {
+ case '\n':
+ out.print("\\n");
+ break;
+ case '\r':
+ out.print("\\r");
+ break;
+ case '\t':
+ out.print("\\t");
+ break;
+ case '\"':
+ case '\\':
+ out.print("\\");
+ // PASS THROUGH
+ default:
+ out.print(v.charAt(i));
+ break;
+ }
+ }
+ out.print("\"");
+ }
+
+ @Override
+ public void visit(QMLBoolean x) {
+ assert (x != null);
+ out.print((x.getValue() ? "true" : "false"));
+ }
+
+ @Override
+ public void visit(QMLNumber x) {
+ assert (x != null);
+ if (x.isBigInteger())
+ {
+ out.print(x.getBigInteger());
+ }
+ else
+ {
+ BigDecimal num = new BigDecimal(x.getNumerator()).setScale(20);
+ BigDecimal den = new BigDecimal(x.getDenominator());
+ out.print(num.divide(den, BigDecimal.ROUND_UP));
+ }
+ }
+
+ @Override
+ public void visit(QMLArray array) {
+ if (array == null) {
+ out.print("{ /* null */ }");
+ return;
+ }
+
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ for (int i = 0; i < array.getNumberOfElements(); i++) {
+ if (i > 0) {
+ out.print(",");
+ out.endl();
+ }
+ QMLValue v = array.getValue(i);
+ if (v != null)
+ v.accept(this);
+ else
+ out.print("{ /* null */ }");
+ }
+
+ out.endl();
+ out.resume();
+ out.print("}");
+ }
+
+ @Override
+ public void visit(QMLOptional o) {
+ QMLValue v = o.getValue();
+ if (v == null) {
+ out.print("omit");
+ } else {
+ v.accept(this);
+ }
+ }
+}
diff --git a/src/Qtronic/TTCNScripter_v421/Configuration.java b/src/Qtronic/TTCNScripter_v421/Configuration.java
new file mode 100644
index 0000000..89e28f0
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v421/Configuration.java
@@ -0,0 +1,379 @@
+/** Copyright (C) Conformiq Software Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file Configuration.java
+ *
+ * @author Conformiq Software Ltd.
+ *
+ *
+ */
+
+package com.conformiq.adaptation.ttcn;
+
+import java.io.File;
+
+public class Configuration
+{
+ public boolean setConfigurationOption(String property, String value)
+ {
+ if (property.equals("Main.Test suite file"))
+ {
+ mSuiteFile = new File(value);
+ mSuiteModuleName = Utils.buildModuleNameFromFileName(mSuiteFile);
+ }
+ if (property.equals("Project"))
+ {
+ this.mProjectName = value;
+ }
+ else if (property.equals("Main.Import from or generate to data types "
+ + "file"))
+ {
+ mDataTypesFile = new File(value);
+ mDataTypesModuleName =
+ Utils.buildModuleNameFromFileName(mDataTypesFile);
+ }
+ else if (property.equals("Main.Import from or generate to test system " +
+ "file"))
+ {
+ mTestSystemFile = new File(value);
+ mTestSystemModuleName =
+ Utils.buildModuleNameFromFileName(mTestSystemFile);
+ }
+ else if (property.equals("Main.Generate test system information "
+ + "(component and port types)"))
+ {
+ mGenerateTestSystemFile = value.equals("true");
+ }
+ else if (property.equals("Main.Import from or generate to harness " +
+ "template file"))
+ {
+ mTestHarnessFile = new File(value);
+ mTestHarnessModuleName =
+ Utils.buildModuleNameFromFileName(mTestHarnessFile);
+ }
+ else if (property.equals("Main.Generate protocol data types"))
+ {
+ mGenerateDataTypes = value.equals("true");
+ }
+ else if (property.equals("Main.Generate test harness function stubs"))
+ {
+ mGenerateTestHarness = value.equals("true");
+ }
+ else if (property.equals("Logging.Log function name"))
+ {
+ mLogCommand = value;
+ }
+ else if (property.equals("Customization.Component timer name"))
+ {
+ mTimerName = value;
+ }
+ else if (property.equals("Customization.Generated functions prefix"))
+ {
+ mFunctionsPrefix = value;
+ }
+ else if (property.equals("Customization.Default altstep name"))
+ {
+ mDefaultName = value;
+ }
+ else if (property.equals("Customization.Default variable name"))
+ {
+ mDefaultRefName = value;
+ }
+ else if (property.equals("Customization.Start test case hook function "
+ + "name"))
+ {
+ mStartHook = value;
+ }
+ else if (property.equals("Timing.Maximum SUT response time"))
+ {
+ mCommSlack = value;
+ }
+ else if (property.equals("Customization.Extra import statements"))
+ {
+ mExtraImports = value;
+ }
+ else if (property.equals("Customization.MTC type name"))
+ {
+ mRunsOnName = value;
+ }
+ else if (property.equals("Customization.System component type name"))
+ {
+ mSystemTypeName = value;
+ }
+ else if (property.equals("Customization.End test case hook function "
+ + "name"))
+ {
+ mEndHook = value;
+ }
+ else if (property.equals("Extensions.Use port type extension"))
+ {
+ mPortExtensions = value;
+ }
+ else if (property.equals("Logging.Log CQ debug messages"))
+ {
+ mDoLogCQDEbugMessages = value.equals("true");
+ }
+ else if (property.equals("Logging.Log CQ info messages"))
+ {
+ mDoLogCQInfoMessages = value.equals("true");
+ }
+ else if (property.equals("Customization.Generate fractions for float "
+ + "numbers"))
+ {
+ mUseFractions = value.equals("true");
+ }
+ else if (property.equals("EPTF_MBT_Applib.Enable"))
+ {
+ setEptfEnable(value.equals("true"));
+ }
+ else if (property.equals("EPTF_MBT_Applib.Test component extension"))
+ {
+ setExtendsComponent(value);
+ }
+ else if (property.equals("EPTF_MBT_Applib.Inbound Port"))
+ {
+ setEptfInboundPort(value);
+ }
+ else if (property.equals("EPTF_MBT_Applib.Outbound Port"))
+ {
+ setEptfOutboundPort(value);
+ }
+ else if (property.equals("EPTF_MBT_Applib.Bidirectional Ports"))
+ {
+ setEptfBidirectionalPort(value.equals("true"));
+ }
+ else
+ {
+ for (DebugMessageType t : DebugMessageType.values())
+ {
+ if (property.equals(t.XMLPropertyName))
+ {
+ t.enabled = value.equals("true");
+ return true;
+ }
+
+ }
+ }
+ return true;
+ }
+
+ public File getSuiteFile()
+ {
+ return mSuiteFile;
+ }
+
+ public String getSuiteModuleName()
+ {
+ return mSuiteModuleName;
+ }
+
+ public File getDataTypesFile()
+ {
+ return mDataTypesFile;
+ }
+
+ public String getDataTypesModuleName()
+ {
+ return mDataTypesModuleName;
+ }
+
+ public File getTestHarnessFile()
+ {
+ return mTestHarnessFile;
+ }
+
+ public String getTestHarnessModuleName()
+ {
+ return mTestHarnessModuleName;
+ }
+
+ public File getTestSystemFile()
+ {
+ return mTestSystemFile;
+ }
+
+ public String getTestSystemModuleName()
+ {
+ return mTestSystemModuleName;
+ }
+
+ public String getProjectName()
+ {
+ return mProjectName;
+ }
+
+ public boolean isGenerateDataTypes()
+ {
+ return mGenerateDataTypes;
+ }
+
+ public boolean isGenerateTestHarness()
+ {
+ return mGenerateTestHarness;
+ }
+
+ public String getLogCommand()
+ {
+ return mLogCommand;
+ }
+
+ public String getTimerName()
+ {
+ return mTimerName;
+ }
+
+ public String getFunctionsPrefix()
+ {
+ return mFunctionsPrefix;
+ }
+
+ public String getDefaultName()
+ {
+ return mDefaultName;
+ }
+
+ public String getDefaultRefName()
+ {
+ return mDefaultRefName;
+ }
+
+ public String getStartHook()
+ {
+ return mStartHook;
+ }
+
+ public String getCommSlack()
+ {
+ return mCommSlack;
+ }
+
+ public String getExtraImports()
+ {
+ return mExtraImports;
+ }
+
+ public String getRunsOnName()
+ {
+ return mRunsOnName;
+ }
+
+ public String getSystemTypeName()
+ {
+ return mSystemTypeName;
+ }
+
+ public String getEndHook()
+ {
+ return mEndHook;
+ }
+
+ public String getPortExtensions()
+ {
+ return mPortExtensions;
+ }
+
+ public boolean isDoLogCQDEbugMessages()
+ {
+ return mDoLogCQDEbugMessages;
+ }
+
+ public boolean isUseFractions()
+ {
+ return mUseFractions;
+ }
+
+ public boolean isDoLogCQInfoMessages()
+ {
+ return mDoLogCQInfoMessages;
+ }
+
+ public boolean isGenerateTestSystemFile()
+ {
+ return mGenerateTestSystemFile;
+ }
+
+ public void setExtendsComponent(String extendsComponent)
+ {
+ this.extendsComponent = extendsComponent;
+ }
+
+ public String getExtendsComponent()
+ {
+ return extendsComponent;
+ }
+
+ public void setEptfEnable(boolean eptfEnable)
+ {
+ this.eptfEnable = eptfEnable;
+ }
+
+ public boolean isEptfEnable()
+ {
+ return eptfEnable;
+ }
+
+ public void setEptfInboundPort(String eptfInboundPort)
+ {
+ this.eptfInboundPort = eptfInboundPort;
+ }
+
+ public String getEptfInboundPort()
+ {
+ return eptfInboundPort;
+ }
+
+ public void setEptfOutboundPort(String eptfOutboundPort)
+ {
+ this.eptfOutboundPort = eptfOutboundPort;
+ }
+
+ public String getEptfOutboundPort()
+ {
+ return eptfOutboundPort;
+ }
+
+ public void setEptfBidirectionalPort(boolean eptfBidirectionalPort)
+ {
+ this.eptfBidirectionalPort = eptfBidirectionalPort;
+ }
+
+ public boolean isEptfBidirectionalPort()
+ {
+ return eptfBidirectionalPort;
+ }
+
+ private File mSuiteFile;
+ private String mSuiteModuleName;
+ private File mDataTypesFile;
+ private String mDataTypesModuleName;
+ private File mTestHarnessFile;
+ private String mTestHarnessModuleName;
+ private File mTestSystemFile;
+ private String mTestSystemModuleName;
+ private String mProjectName;
+ private boolean mGenerateDataTypes;
+ private boolean mGenerateTestSystemFile;
+ private boolean mGenerateTestHarness;
+ private String mLogCommand;
+ private String mTimerName;
+ private String mFunctionsPrefix;
+ private String mDefaultName;
+ private String mDefaultRefName;
+ private String mStartHook;
+ private String mCommSlack;
+ private String mExtraImports;
+ private String mRunsOnName;
+ private String mSystemTypeName;
+ private String mEndHook;
+ private String mPortExtensions;
+ private boolean mDoLogCQDEbugMessages;
+ private boolean mDoLogCQInfoMessages;
+ private boolean mUseFractions;
+ private String extendsComponent = "";
+ private boolean eptfEnable = false;
+ private String eptfInboundPort = "";
+ private String eptfOutboundPort = "";
+ private boolean eptfBidirectionalPort = false;
+}
diff --git a/src/Qtronic/TTCNScripter_v421/DebugMessageType.java b/src/Qtronic/TTCNScripter_v421/DebugMessageType.java
new file mode 100644
index 0000000..6cc8771
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v421/DebugMessageType.java
@@ -0,0 +1,97 @@
+/** Copyright (C) Conformiq Software Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file DebugMessageType.java
+ *
+ * @author Conformiq Software Ltd.
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+enum DebugMessageType {
+
+ Requirement("Logging.Log targeted Requirements",
+ "mp_log_targeted_requirements", "requirement",
+ new String[] {
+ "When this module parameter value is set to true all "
+ + "requirements",
+ "targeted in each test case will be logged.",
+ "The default value of this module parameter is true." },
+ new String[] { "requirement:" }, true),
+
+ StateOrTransition("Logging.Log targeted States and Transitions",
+ "mp_log_targeted_states_and_transitions", "state_or_transition",
+ new String[] {
+ "When this module parameter value is set to true all states &",
+ "transitions targeted in each test case will be logged.",
+ "The default value of this module parameter is true." },
+ new String[] { "state:", "transition:", "2-transition:" }, true),
+
+ Branch("Logging.Log targeted Conditional and Atomic Branches",
+ "mp_log_targeted_conditional_and_atomic_branches", "branch",
+ new String[] {
+ "When this module parameter value is set to true all "
+ + "conditional",
+ "and atomic branches targeted in each test case will be "
+ + "logged.",
+ "The default value of this module parameter is true." },
+ new String[] { "branch:", "condition:" }, true),
+
+ BoundaryValueAnaysis("Logging.Log targeted Boundary Value Analysis",
+ "mp_log_targeted_boundary_value_analysis", "boundary_value",
+ new String[] {
+ "When this module parameter value is set to true all boundary",
+ "values targeted in each test case will be logged.",
+ "The default value of this module parameter is true." },
+ new String[] { "boundary:" }, true),
+
+ Method("Logging.Log targeted Methods", "mp_log_targeted_methods", "method",
+ new String[] { "When this module parameter value is set to true",
+ "all methods targeted in each test case will be logged.",
+ "The default value of this module parameter is true." },
+ new String[] { "method:" }, true);
+
+ public static DebugMessageType[] enabledValues()
+ {
+ List<DebugMessageType> ret = new LinkedList<DebugMessageType>();
+ for (DebugMessageType t : values())
+ {
+ if (t.enabled)
+ {
+ ret.add(t);
+ }
+ }
+ return ret.toArray(new DebugMessageType[0]);
+ }
+
+ DebugMessageType(String XMLPropertyName, String enablingFlag,
+ String dispatchingEnumItemName, String[] modeuleparComment,
+ String[] checkpointPrefixes, boolean defaultFlagState)
+ {
+ this.XMLPropertyName = XMLPropertyName;
+ this.enablingFlag = enablingFlag;
+ this.dispatchingEnumItemName = "e_" + dispatchingEnumItemName;
+ this.modeuleparComment = modeuleparComment;
+ this.checkpointPrefixes = new HashSet<String>();
+ this.defaultFlagState = defaultFlagState;
+ this.checkpointPrefixes.addAll(Arrays.asList(checkpointPrefixes));
+ }
+
+ public final String XMLPropertyName;
+ public final String enablingFlag;
+ public final String dispatchingEnumItemName;
+ public final String[] modeuleparComment;
+ public final Set<String> checkpointPrefixes;
+ public final boolean defaultFlagState;
+ boolean enabled;
+
+}
diff --git a/src/Qtronic/TTCNScripter_v421/PrettyPrinter.java b/src/Qtronic/TTCNScripter_v421/PrettyPrinter.java
new file mode 100644
index 0000000..76b7570
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v421/PrettyPrinter.java
@@ -0,0 +1,100 @@
+/** Copyright (C) Conformiq Software Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file PrettyPrinter.java
+ *
+ * @author Conformiq Software Ltd.
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.math.BigInteger;
+import java.util.List;
+import java.util.Vector;
+
+class PrettyPrinter extends PrintWriter
+{
+ private List<String> stack;
+ private String header;
+ private boolean headerPrinted;
+
+ public PrettyPrinter(Writer writer)
+ {
+ super(writer);
+ this.stack = new Vector<String>();
+ this.header = "";
+ this.headerPrinted = true;
+ }
+
+ private void printHeader()
+ {
+ if (headerPrinted)
+ return;
+
+ for (int i = 0; i < this.stack.size(); i++)
+ {
+ super.print(this.stack.get(i));
+ }
+ this.headerPrinted = true;
+ }
+
+ public void print(String s)
+ {
+ printHeader();
+ this.header = this.header.concat(s);
+ super.print(s);
+ }
+
+ public void println(String s)
+ {
+ print(s);
+ endl();
+ }
+
+ // Start a new block
+ public void block()
+ {
+ this.stack.add(header);
+ this.header = "";
+ }
+
+ // Resume to previous state
+ public void resume()
+ {
+ // remove last
+ this.stack.remove(this.stack.size() - 1);
+ }
+
+ // Print EOL char
+ public void endl()
+ {
+ if (this.headerPrinted)
+ { // suppress double empty lines
+ println();
+ this.header = "";
+ this.headerPrinted = false;
+ }
+ }
+
+ public void emptyline()
+ {
+ println();
+ this.header = "";
+ this.headerPrinted = false;
+ }
+
+ public void print(BigInteger bi)
+ {
+ print("" + bi.toString());
+ }
+
+ public void ws()
+ {
+ print(" ");
+ }
+}
diff --git a/src/Qtronic/TTCNScripter_v421/TTCNScripter.java b/src/Qtronic/TTCNScripter_v421/TTCNScripter.java
new file mode 100644
index 0000000..ad35fb2
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v421/TTCNScripter.java
@@ -0,0 +1,1875 @@
+/** Copyright (C) Conformiq Software Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file TTCNScripter.java
+ *
+ * @author Conformiq Software Ltd.
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import com.conformiq.adaptation.ttcn.Utils.Banner;
+import com.conformiq.adaptation.ttcn.Utils.CheckPointInfo;
+import com.conformiq.adaptation.ttcn.Utils.TemplateDefinition;
+import com.conformiq.qtronic2.Checkpoint;
+import com.conformiq.qtronic2.MetaDataDictionary;
+import com.conformiq.qtronic2.NotificationSink;
+import com.conformiq.qtronic2.QMLArray;
+import com.conformiq.qtronic2.QMLBoolean;
+import com.conformiq.qtronic2.QMLNumber;
+import com.conformiq.qtronic2.QMLOptional;
+import com.conformiq.qtronic2.QMLRecord;
+import com.conformiq.qtronic2.QMLRecordType;
+import com.conformiq.qtronic2.QMLRecordTypeField;
+import com.conformiq.qtronic2.QMLString;
+import com.conformiq.qtronic2.QMLUnionType;
+import com.conformiq.qtronic2.QMLValue;
+import com.conformiq.qtronic2.QMLValueVisitor;
+import com.conformiq.qtronic2.ScriptBackend;
+import com.conformiq.qtronic2.TimeStamp;
+import com.conformiq.qtronic2.Checkpoint.CheckpointStatus;
+
+public class TTCNScripter extends ScriptBackend
+{
+ public TTCNScripter()
+ {
+ this.mTestCaseIndex = 0;
+ this.mTemplateIndex = 0;
+ this.mTimeStamp = new TimeStamp();
+ this.mTimeStamp.seconds = 0;
+ this.mTimeStamp.nanoseconds = 0;
+ this.mIsFirstStep = false;
+ this.mGeneratedTemplates = new HashMap<QMLRecord, Integer>();
+ this.mPostponedTemplates = new Vector<TemplateDefinition>();
+ this.mTestCaseNames = new Vector<String>();
+ this.collectedCheckpoints = null;
+ }
+
+ @Override
+ public void setNotificationSink(NotificationSink sink)
+ {
+ mNotifications = sink;
+ }
+
+ @Override
+ public boolean setMetaData(MetaDataDictionary dict)
+ {
+ mMetadata = dict;
+ extractPortsMetaData();
+ return true;
+ }
+
+ @Override
+ public boolean setConfigurationOption(java.lang.String property,
+ java.lang.String value)
+ {
+ return mConfiguration.setConfigurationOption(property, value);
+ }
+
+ @Override
+ public boolean beginScript(String testsuiteName)
+ {
+ this.mTestsuiteName = testsuiteName;
+ if (mNotifications != null)
+ {
+ mNotifications.notify("info", mScripterName
+ + ": Export test cases for test design configuration "
+ + testsuiteName);
+ }
+ String msg = null;
+ if (mConfiguration.getSuiteFile().getAbsolutePath().equals(""))
+ {
+ msg = "TTCN-3 backend must be configured with a file name.";
+ }
+ else
+ {
+ try
+ {
+ mOut = new PrettyPrinter(new BufferedWriter(new FileWriter(
+ mConfiguration.getSuiteFile())));
+ } catch (IOException e)
+ {
+ StringBuffer msgbuf = new StringBuffer();
+ msgbuf.append("Failed to open file '");
+ msgbuf.append(mConfiguration.getSuiteFile());
+ msgbuf.append("' for writing TTCN-3 script.");
+ msg = msgbuf.toString();
+ }
+ }
+ if (msg != null)
+ {
+ if (mNotifications != null)
+ {
+ mNotifications.notify("error", mScripterName + ": " + msg);
+ }
+ else
+ {
+ System.err.println(msg);
+ }
+ return false;
+ }
+ {
+ String[] desc = {
+ "This file contains all test cases generated from the "
+ + "Conformiq '" + mConfiguration.getProjectName()
+ + "' project",
+ "with '" + testsuiteName + "' design configuration." };
+ String[] remark = {
+ "WARNING! This file has been automatically generated using the",
+ "Conformiq TTCN-3 scripting backend. DO NOT EDIT." };
+ printHeader(mConfiguration.getSuiteFile(), desc, remark);
+ }
+ mOut.print("module ");
+ mOut.print(mConfiguration.getSuiteModuleName());
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+
+ if (mConfiguration.getTestSystemModuleName() != null)
+ {
+ mOut.print("import from ");
+ mOut.print(mConfiguration.getTestSystemModuleName());
+ mOut.print(" all;");
+ mOut.endl();
+ }
+
+ if (mConfiguration.getDataTypesModuleName() != null)
+ {
+ mOut.print("import from ");
+ mOut.print(mConfiguration.getDataTypesModuleName());
+ mOut.print(" all;");
+ mOut.endl();
+ }
+
+ mOut.print("/* Customized imports begin */");
+ mOut.endl();
+ mOut.print(mConfiguration.getExtraImports());
+ mOut.endl();
+ mOut.println("/* Customized imports end */");
+ mOut.emptyline();
+
+ mOut.print("modulepar float " + mSlackVarName + " := ");
+ mOut.print(mConfiguration.getCommSlack());
+ mOut.println(";");
+ mOut.emptyline();
+
+ printDebugModulepars();
+
+ mOut.emptyline();
+ // print out the test harness template
+ try
+ {
+ // should the harness template be written
+ if (mConfiguration.isGenerateTestHarness())
+ {
+ PrettyPrinter harness = buildPrettyPrinter(mConfiguration
+ .getTestHarnessFile(), "harness template", false);
+ if (harness != null)
+ {
+ dumpTestHarness(harness);
+ if (mNotifications != null)
+ {
+ mNotifications.notify("info", mScripterName
+ + ": Generated TTCN-3 test harness template to "
+ + "<hyperlink=\""
+ + mConfiguration.getTestHarnessFile()
+ .getAbsolutePath()
+ + "\">"
+ + mConfiguration.getTestHarnessFile()
+ .getAbsolutePath() + "</hyperlink>.");
+ }
+ }
+ }
+ } catch (Exception e)
+ {
+ mOut.print("/* EXCEPTION CAUGHT */");
+ mOut.endl();
+ if (mNotifications != null)
+ {
+ mNotifications.notify("error", mScripterName
+ + ": Caught exception while rendering TTCN test harness"
+ + " template. Please reload model and try again ("
+ + e.getMessage() + ")");
+ }
+ return false;
+ }
+
+ if (mConfiguration.isGenerateDataTypes())
+ {
+ /* First dump all the types used in the module. */
+ try
+ {
+ dumpDataTypes();
+ } catch (Exception e)
+ {
+ mOut.print("/* EXCEPTION CAUGHT */");
+ mOut.endl();
+ if (mNotifications != null)
+ {
+ mNotifications.notify("error", mScripterName
+ + ": Caught exception while "
+ + "rendering TTCN type definitions. Please reload "
+ + "model and try again (" + e.getMessage() + ")");
+ }
+ return false;
+ }
+ }
+
+ if (mConfiguration.isGenerateTestSystemFile())
+ {
+ /* First dump all the types used in the module. */
+ try
+ {
+ dumpTestComponentFile();
+ } catch (Exception e)
+ {
+ mOut.print("/* EXCEPTION CAUGHT */");
+ mOut.endl();
+ if (mNotifications != null)
+ {
+ mNotifications.notify("error", mScripterName
+ + ": Caught exception while "
+ + "rendering TTCN type definitions. Please reload "
+ + "model and try again (" + e.getMessage() + ")");
+ }
+ return false;
+ }
+ }
+
+ deleteCopies();
+ mTemplateIndex = 0;
+ mTestCaseIndex = 0;
+ mIsFirstStep = false;
+ return true;
+ }
+
+ @Override
+ public boolean beginCase(String testcaseName)
+ {
+ collectedCheckpoints = new LinkedList<CheckPointInfo>();
+ mCaseStepIndex = 0;
+ mIsFirstStep = true;
+ mTestCaseIndex++;
+
+ Banner banner = new Banner();
+ banner.addTag("desc", "Generated test case #" + mTestCaseIndex);
+ banner.print(mOut);
+ mOut.print("testcase ");
+ mCrrentTestCaseName = recordAndRenderTestCaseName(testcaseName);
+ mOut.print(mCrrentTestCaseName);
+ mOut.println("()");
+ mOut.print("runs on ");
+ mOut.print(mConfiguration.getRunsOnName());
+ if (mConfiguration.getSystemTypeName() != null
+ && !mConfiguration.getSystemTypeName().equals(""))
+ {
+ mOut.print(" system ");
+ mOut.print(mConfiguration.getSystemTypeName());
+ }
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+
+ mOut.print(mIndent);
+ mOut.block();
+ printLog(LogMessageType.DEBUG, "Starting execution of test case: '"
+ + mCrrentTestCaseName + "'");
+
+ mOut.print("var float " + mOldTimerName + " := "
+ + Utils.TimeStampToString(mTimeStamp) + ";");
+ mOut.endl();
+
+ if (!mConfiguration.getDefaultName().equals(""))
+ {
+ mOut.print("var default " + mConfiguration.getDefaultRefName()
+ + ";");
+ mOut.endl();
+ }
+
+ if (!mConfiguration.getStartHook().equals(""))
+ {
+ mOut.emptyline();
+ mOut.print("/***** set up test configuration, TTCN-3 harness, "
+ + "and adapter *****/");
+ mOut.endl();
+ mOut.print(mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getStartHook());
+ mOut.print(";");
+ mOut.endl();
+ }
+
+ if (!mConfiguration.getDefaultName().equals(""))
+ {
+ mOut.println("// default handles waiting beyond maximum response "
+ + "time and reception of any");
+ mOut.println("// other than the expected message with setting a"
+ + " fail verdict and stopping the test");
+ mOut.print(mConfiguration.getDefaultRefName() + " := activate(");
+ mOut.print(mConfiguration.getDefaultName());
+ mOut.print(");");
+ mOut.endl();
+ }
+
+ return true;
+ }
+
+ // @Override
+ public void caseProbability(double probability)
+ {
+ }
+
+ @Override
+ public boolean checkpointInfo(Checkpoint checkpoint, int status,
+ TimeStamp ts)
+ {
+ if (!mIsFirstStep || status == CheckpointStatus.UNCOVERED
+ || status == CheckpointStatus.MAYBE_COVERED)
+ {
+ return true;
+ }
+ collectedCheckpoints.offer(new CheckPointInfo(checkpoint, status, ts));
+ return true;
+ }
+
+ @Override
+ public boolean endCase()
+ {
+ printCheckpoints();
+ mOut.emptyline();
+ mOut.println("setverdict(pass);");
+
+ /*
+ * Default is used only if the provided name is different from "", so if
+ * the default is not used let's not deactivate it either.
+ */
+ if (!mConfiguration.getDefaultName().equals(""))
+ {
+ mOut.print("deactivate(" + mConfiguration.getDefaultRefName()
+ + ");");
+ mOut.endl();
+ }
+
+ if (!mConfiguration.getEndHook().equals(""))
+ {
+ mOut.emptyline();
+ mOut.print("/***** "
+ + "tear down test configuration, TTCN-3 harness, and adapter"
+ + " *****/");
+ mOut.endl();
+ mOut.print(mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getEndHook());
+ mOut.print(";");
+ mOut.endl();
+ }
+ mOut.emptyline();
+ printLog(LogMessageType.DEBUG, "Ending execution of "
+ + mCrrentTestCaseName);
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+
+ /* Generate templates out of the datums stored in the TestStep. */
+ printTemplates();
+
+ mPostponedTemplates.clear();
+ return true;
+ }
+
+ @Override
+ public boolean endScript()
+ {
+ prindAltstepDefaultDecl();
+ printSleepFunction();
+ mOut.emptyline();
+ printDebugMessageTypeEnum();
+ mOut.emptyline();
+ printDebugFunctionDecl();
+ printControl();
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ try
+ {
+ mOut.flush();
+ mOut.close();
+ } catch (Exception e)
+ {
+ if (mNotifications != null)
+ {
+ mNotifications.notify("error", mScripterName + ": "
+ + e.toString());
+ }
+ }
+ mOut = null;
+
+ StringBuffer ss = new StringBuffer();
+ ss.append("Generated TTCN-3 script to <hyperlink=\"");
+ ss.append(mConfiguration.getSuiteFile().getAbsolutePath());
+ ss.append("\">");
+ ss.append(mConfiguration.getSuiteFile().getAbsolutePath());
+ ss.append("</hyperlink>.");
+ if (mNotifications != null)
+ {
+ mNotifications.notify("info", mScripterName + ": " + ss.toString());
+ }
+ else
+ {
+ System.out.println(ss.toString());
+ }
+ mTestCaseNames.clear();
+ return true;
+ }
+
+ @Override
+ public boolean testStep(QMLRecord r, String thread, String port,
+ boolean isFromTester, TimeStamp ts)
+ {
+ /*
+ * We have an altstep defined:
+ *
+ * altstep CQDefaultAlt() runs on SystemType { [] any port.receive {
+ * mytimer.stop; setverdict(fail); stop; } [] mytimer.timeout {
+ * setverdict(fail); stop; } }
+ *
+ * which removes the need for "[] any port.receive" and timeout from alt
+ * statements.
+ */
+ mCaseStepIndex++;
+ mOut.endl();
+ mOut.emptyline();
+ mOut.println("/***** Step " + mCaseStepIndex + "; t = "
+ + Utils.TimeStampToString(ts) + " *****/");
+ mOut.endl();
+
+ printLog(LogMessageType.DEBUG, mCrrentTestCaseName + ": Step "
+ + mCaseStepIndex);
+ printCheckpoints();
+
+ // Remember the datum so that we can generate a template out of it.
+ // Generate a new template only if it has not been generated before.
+ String name;
+ Integer idx = mGeneratedTemplates.get(r);
+ if (idx != null)
+ {
+ StringBuffer ss = new StringBuffer();
+ ss.append(r.getName());
+ ss.append("Template");
+ ss.append(idx);
+ name = ss.toString();
+ }
+ else
+ {
+ ++mTemplateIndex;
+ StringBuffer ss = new StringBuffer();
+ ss.append(r.getName());
+ ss.append("Template");
+ ss.append(mTemplateIndex);
+ name = ss.toString();
+
+ if (!isFromTester)
+ {
+ name = "expected" + name;
+ }
+ mPostponedTemplates.add(
+ new TemplateDefinition(r.getName(), name, r));
+ mGeneratedTemplates.put(r, mTemplateIndex);
+ }
+
+ if (isFromTester)
+ {
+ /*
+ * Send datum to SUT. Generate:
+ *
+ * mytimer.start(<send time>); alt { [] mytimer.timeout { // OK } }
+ * <port>.send(template_<index>);
+ */
+ if (ts.seconds > mTimeStamp.seconds
+ || ts.nanoseconds > mTimeStamp.nanoseconds)
+ {
+ mOut.print(mConfiguration.getTimerName());
+ mOut.print(".start(");
+ mOut.print(ts.seconds);
+ mOut.print(".");
+ mOut.print(ts.nanoseconds);
+ mOut.print(" - " + mOldTimerName + ");");
+ mOut.endl();
+ mOut.print("alt");
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ mOut.print("[] ");
+ mOut.print(mConfiguration.getTimerName());
+ mOut.print(".timeout");
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print("}");
+ mOut.endl();
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ mOut.print(mConfiguration.getTimerName());
+ mOut.print(".stop;");
+ mOut.endl();
+ }
+ mOut.endl();
+ mOut.print(mConfiguration.getFunctionsPrefix() + "send_");
+ mOut.print(r.getName());
+ mOut.print("_to_");
+ mOut.print(Utils.makeValidTTCN3Identifier(port));
+ mOut.print("(");
+ mOut.print("m_" + name);
+ mOut.print(");");
+ mOut.endl();
+ }
+ else
+ {
+ final String timeStamp = "" + ts.seconds + "." + ts.nanoseconds;
+ if (!Utils.EqualTimeStamps(this.mTimeStamp, ts))
+ {
+ mOut.println(mConfiguration.getFunctionsPrefix()
+ + mSleepFunctionName + "(" + timeStamp + " - "
+ + mOldTimerName + ");");
+ }
+ mOut.println(mConfiguration.getTimerName() + ".start("
+ + mSlackVarName + ");");
+ mOut.println("// Note: In below receive "
+ + mConfiguration.getDefaultRefName() + "() is active!");
+ mOut.print(mConfiguration.getFunctionsPrefix() + "receive_");
+ mOut.print(r.getName());
+ mOut.print("_from_");
+ mOut.print(Utils.makeValidTTCN3Identifier(port));
+ mOut.print("(");
+ mOut.print("m_" + name);
+ mOut.print(");");
+ mOut.endl();
+ mOut.print(mConfiguration.getTimerName());
+ mOut.print(".stop;");
+ mOut.endl();
+ }
+
+ if (!Utils.EqualTimeStamps(this.mTimeStamp, ts))
+ {
+ mOut.print(mOldTimerName + " := ");
+ mOut.print(ts.seconds);
+ mOut.print(".");
+ mOut.print(ts.nanoseconds);
+ mOut.println(";");
+ }
+
+ this.mTimeStamp.seconds = ts.seconds;
+ this.mTimeStamp.nanoseconds = ts.nanoseconds;
+ this.collectedCheckpoints = new LinkedList<CheckPointInfo>();
+ return true;
+ }
+
+ @Override
+ public boolean internalCommunicationsInfo(QMLRecord datum, String sender,
+ String receiver, String port, TimeStamp time)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean trace(String message, TimeStamp time)
+ {
+ return true;
+ }
+
+ private PrettyPrinter buildPrettyPrinter(final File f, final String desc,
+ final boolean overWrite)
+ {
+ String name = f.getAbsolutePath();
+ if (f.exists() && !f.isDirectory() && !overWrite)
+ {
+ if (mNotifications != null)
+ {
+ mNotifications.notify("info", mScripterName + ": File "
+ + "<hyperlink=\"" + name + "\">" + name + "</hyperlink>."
+ + " exists, NOT overwriting it.");
+ }
+ return null;
+ }
+ if (name.equals("") || f.isDirectory())
+ {
+ mNotifications.notify("error",
+ "TTCN-3 backend must be configured with a valid " + desc
+ + " file name.");
+ return null;
+ }
+ try
+ {
+ return new PrettyPrinter(new BufferedWriter(new FileWriter(f)));
+ } catch (IOException e)
+ {
+ mNotifications.notify("error", "Failed to open file '" + name
+ + "' for writing" + desc + ".");
+ return null;
+ }
+ }
+
+ private void dumpTestComponentFile() throws Exception
+ {
+ String msg = null;
+ Exception rethrowMe = null;
+ PrettyPrinter oldOut = mOut;
+ if (mConfiguration.getTestSystemFile().getAbsolutePath().equals(""))
+ {
+ msg = "TTCN-3 backend must be configured with a test system file "
+ + "name.";
+ }
+ else
+ {
+ try
+ {
+ mOut = new PrettyPrinter(new BufferedWriter(new FileWriter(
+ mConfiguration.getTestSystemFile())));
+ } catch (IOException e)
+ {
+ StringBuffer msgbuf = new StringBuffer();
+ msgbuf.append("Failed to open file '");
+ msgbuf.append(
+ mConfiguration.getTestSystemFile().getAbsolutePath());
+ msgbuf.append("' for writing test system information.");
+ msg = msgbuf.toString();
+ rethrowMe = e;
+ }
+ }
+ if (msg != null)
+ {
+ if (mNotifications != null)
+ {
+ mNotifications.notify("error", msg);
+ }
+ else
+ {
+ System.err.println(msg);
+ }
+ mOut = oldOut;
+ // Pass the exception forward for proper error handling further
+ // up the call stack.
+ throw (rethrowMe);
+ }
+ {
+ String[] desc = {
+ "This file contains port type definitions and test component "
+ + "generated by Conformiq",
+ "with '" + mTestsuiteName + "' design configuration for '"
+ + mConfiguration.getProjectName() + "' project." };
+ String[] remark = {
+ "WARNING! This file has been automatically generated using the",
+ "Conformiq TTCN-3 scripting backend. DO NOT EDIT." };
+ printHeader(mConfiguration.getDataTypesFile(), desc, remark);
+ }
+ mOut.print("module ");
+ mOut.print(mConfiguration.getTestSystemModuleName());
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+
+ if (mConfiguration.getDataTypesModuleName() != null)
+ {
+ mOut.println("import from "
+ + mConfiguration.getDataTypesModuleName() + " all;");
+ mOut.emptyline();
+ }
+
+ // system mapping
+ if (!mConfiguration.getSystemTypeName().equals("") && !mConfiguration.isEptfEnable())
+ {
+ mOut.emptyline();
+ Banner banner = new Banner();
+ banner.addTag("desc", new String[] {
+ "This TTCN-3 component type specifies the interface of the",
+ "test cases towards the SUT more specifically the SUT "
+ + "adapter." });
+ banner.print(mOut);
+
+ mOut.print("type component ");
+ mOut.print(mConfiguration.getSystemTypeName());
+ mOut.endl();
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+ mOut.println("// Add all port instances here");
+ mOut.resume();
+ mOut.println("}");
+ }
+
+ try
+ {
+ if (mConfiguration.isGenerateTestSystemFile())
+ {
+ for (Port p : externalPorts)
+ {
+ if (mConfiguration.isEptfEnable() &&
+ (p.name.equals(mConfiguration.getEptfInboundPort()) ||
+ p.name.equals(mConfiguration.getEptfOutboundPort()))
+ )
+ {
+ }
+ else
+ {
+ mOut.print("type port ");
+ mOut.print(p.name);
+ mOut.print("Port message");
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ for (QMLRecordType record : p.records)
+ {
+ String dir = p.isInbound ? "in" : "out";
+ if (mConfiguration.isEptfBidirectionalPort())
+ dir = "inout";
+ mOut.println(dir + " " + record.getTypeName() + ";");
+ }
+ mOut.resume();
+ mOut.print("}");
+ if (!mConfiguration.getPortExtensions().equals(""))
+ {
+ mOut.print(" with {extension \"");
+ mOut.print(mConfiguration.getPortExtensions());
+ mOut.print("\"}");
+ }
+ mOut.emptyline();
+ }
+ }
+ }
+ mOut.emptyline();
+ Banner banner = new Banner();
+ banner.addTag("desc", "The test component (MTC) on which all "
+ + "generated test cases run on");
+ banner.print(mOut);
+ mOut.print("type component ");
+ mOut.print(mConfiguration.getRunsOnName());
+ if (!mConfiguration.getExtendsComponent().equals(""))
+ {
+ mOut.print(" extends ");
+ mOut.print(mConfiguration.getExtendsComponent());
+ }
+
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ for (Port p : externalPorts)
+ {
+ mOut.print("port ");
+ mOut.print(p.name);
+ mOut.print("Port ");
+ mOut.print(p.name);
+ mOut.print(";");
+ mOut.endl();
+
+ }
+ mOut.print("timer ");
+ mOut.print(mConfiguration.getTimerName());
+ mOut.print(" := 0.0;");
+ mOut.endl();
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ mOut.resume();
+
+ mOut.print("}");
+ mOut.endl();
+ mOut.flush();
+ mOut.close();
+ mOut = oldOut;
+ } catch (Exception e)
+ {
+ mOut.flush();
+ mOut.close();
+ mOut = oldOut;
+ }
+ mNotifications.notify("info", mScripterName
+ + ": Generated TTCN-3 port and component types file "
+ + "<hyperlink=\""
+ + mConfiguration.getTestSystemFile().getAbsolutePath() + "\">"
+ + mConfiguration.getTestSystemFile().getAbsolutePath()
+ + "</hyperlink>.");
+ }
+
+ /**
+ * prints out the test harness template, that contains:
+ *
+ * - import from CQTypes;
+ *
+ * - type component for the harness system
+ *
+ * - MTC component the tests should run on
+ *
+ * - harness alt step
+ *
+ * - start and end test hook calls
+ *
+ * - port and message mapping functions
+ */
+ private void dumpTestHarness(final PrettyPrinter pp) throws Exception
+ {
+ assert (mMetadata != null);
+
+ PrettyPrinter oldOut = this.mOut;
+ this.mOut = pp;
+ {
+
+ String[] desc = {
+ "This is a template file with TTCN-3 function stubs for the "
+ + "implementation ",
+ "of test harness code for the test suites generated from the "
+ + "Conformiq '",
+ mConfiguration.getProjectName() + "' project." };
+ String[] remark = {
+ "All function definitions must be edited as instructed in "
+ + "their comments in",
+ " order for the test suite to execute properly." };
+ printHeader(mConfiguration.getTestHarnessFile(), desc, remark);
+ }
+ mOut.print("module ");
+ mOut.print(Utils.buildModuleNameFromFileName(
+ mConfiguration.getTestHarnessFile()));
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+
+ // import all data types
+ if (mConfiguration.getDataTypesModuleName() != null)
+ {
+ mOut.print(mIndent);
+ mOut.print("import from ");
+ mOut.print(mConfiguration.getDataTypesModuleName());
+ mOut.print(" all;");
+ mOut.endl();
+ }
+
+ if (mConfiguration.getTestSystemModuleName() != null)
+ {
+ mOut.print(mIndent);
+ mOut.print("import from ");
+ mOut.print(mConfiguration.getTestSystemModuleName());
+ mOut.print(" all;");
+ mOut.endl();
+ }
+ mOut.emptyline();
+ // debug function
+ mOut.print(mIndent);
+ mOut.block();
+
+ // MTC port definitions
+ if (!mConfiguration.getRunsOnName().equals(""))
+ {
+ mOut.resume();
+ // default start and stop functions
+ mOut.print(mIndent);
+ mOut.block();
+ if (!mConfiguration.getStartHook().equals("") && !mConfiguration.isEptfEnable())
+ {
+ mOut.emptyline();
+ Banner banner = new Banner();
+ banner.addTag("desc", new String[] {
+ "This function sets up the test configuration, maps all "
+ + "mtc",
+ "to system component ports, and configures (if needed)",
+ "TTCN-3 harness and test system adapter" });
+ banner.print(mOut);
+ mOut.print("function ");
+ mOut.print(mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getStartHook());
+ mOut.print(" runs on ");
+ mOut.print(mConfiguration.getRunsOnName());
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ mOut.println("// Specify here map operations between MTC and "
+ + "abstract test");
+ mOut.println("// system interface or update and uncomment "
+ + "generated code below");
+ for (Port p : externalPorts)
+ {
+ mOut.println("// map(" + mConfiguration.getRunsOnName()
+ + ": " + p.name + ", system: <some port>);");
+ }
+ if (mConfiguration.isDoLogCQInfoMessages())
+ {
+ mOut.println("// Remove or comment the following generated "
+ + "code");
+ }
+ printLog(LogMessageType.INFO, "Warning: "
+ + mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getStartHook() + ": "
+ + "function is not implemented");
+ mOut.resume();
+ mOut.println("}");
+ }
+ if (!mConfiguration.getEndHook().equals("") && !mConfiguration.isEptfEnable())
+ {
+
+ Banner banner = new Banner();
+ banner.addTag("desc", new String[] {
+ "This function tears down the test configuration",
+ "and unmaps all mtc to system component ports" });
+ banner.print(mOut);
+ mOut.print("function ");
+ mOut.print(mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getEndHook());
+ mOut.print(" runs on ");
+ mOut.println(mConfiguration.getRunsOnName());
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+ mOut.println("//Specify here unmap operations between MTC and"
+ + " abstract test");
+ mOut.println("// system interface or update and uncomment"
+ + " generated code below");
+
+ for (Port p : externalPorts)
+ {
+ mOut.println("// unmap(" + mConfiguration.getRunsOnName()
+ + ": " + p.name + ", system: <some port>);");
+ }
+ if (mConfiguration.isDoLogCQInfoMessages())
+ {
+ mOut.println("// Remove or comment the following generated "
+ + "code");
+ }
+ printLog(LogMessageType.INFO, "Warning: "
+ + mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getEndHook() + ": "
+ + "function is not implemented");
+ mOut.resume();
+ mOut.println("}");
+ }
+ mOut.resume();
+ // port mapping
+ try
+ {
+ mOut.print(mIndent);
+ mOut.block();
+
+ for (Port p : externalPorts)
+ {
+ for (QMLRecordType type : p.records)
+ {
+ String record = type.getTypeName();
+ String argName = null;
+ if (p.isInbound)
+ {
+ argName = "p_" + "expected" + record;
+ }
+ else
+ {
+ argName = "p_" + record;
+ }
+ // (p.isInbound ? "tmplToMatch" : "msgToSend");
+ String functionName =
+ mConfiguration.getFunctionsPrefix()
+ + (p.isInbound ? "receive_" : "send_")
+ + record
+ + (p.isInbound ? "_from_" : "_to_") + p.name;
+ String functionDecl = "function " + functionName
+ + "(template " + record + " " + argName + ")";
+ mOut.emptyline();
+ Banner banner = new Banner();
+ if (p.isInbound)
+ {
+ banner.addTag("desc", new String[] {
+ "This function receives a TTCN-3 value "
+ + "corresponding to a " + record,
+ "via the abstract test system interface from "
+ + "the SUT, performs any",
+ "manipulation and transformation needed to "
+ + "convert it to a " + record,
+ "value, and then attempts to match it to the "
+ + argName + " generated by CQ Designer" });
+ banner.addTag("param", new String[] { argName
+ + "Expected data generated by CQ Designer" });
+ // * from the SUT to */
+ }
+ else
+ {
+ banner.addTag("desc", new String[] {
+ "This function performs manipulation needed"
+ + " and" + " sends a " + argName,
+ "via the abstract test interface to the"
+ + " SUT." });
+ banner.addTag("param", argName
+ + " Message data generated by CQ Designer"
+ + "to be sent to the SUT");
+ }
+ banner.print(mOut);
+ mOut.println(functionDecl + " runs on "
+ + mConfiguration.getRunsOnName());
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+
+ if (p.isInbound)
+ {
+ mOut.println("//Steps that need to be implemented"
+ + " here are:");
+ mOut.println("//1. receive and store (any) TTCN-3"
+ + " data value via TTCN-3 port which "
+ + "corresponds to the " + p.name + " model "
+ + "port");
+ mOut.println("// var <T3_" + record
+ + "Type> v_recvT3" + record + ";");
+ mOut.println("// " + p.name + ".receive(<T3_"
+ + record + "Type>:?) -> value v_recvT3"
+ + record + ";");
+ mOut.println("// 2. replace real with symbolic "
+ + "values (if any) in the received TTCN-3 data"
+ + " value");
+ mOut.println("// 3. transform data from a TTCN-3 "
+ + "to " + record + " data value (if needed)");
+ mOut.println("// var" + record + "v_recv" + record
+ + " = " + "f_transform" + record
+ + "T3toCQ(v_recvT3" + record + ");");
+ mOut.println("// 4. set the verdict to fail if if"
+ + " there is a mismatch of the "
+ + "transformed value and " + argName);
+ mOut.println("// if ( !match( v_recv" + record
+ + " " + argName + ") {");
+ mOut.println("// log(CQ_INFO: " + functionName
+ + ": FAIL: Mismatch in received and expected "
+ + record + " values. Stopping test case.�);");
+ mOut.println("// setverdict(fail);");
+ mOut.println("// "
+ + mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getEndHook()
+ + ";");
+ mOut.println("// stop; }");
+ if (mConfiguration.isEptfEnable())
+ {
+ if (p.name.equals(mConfiguration.getEptfInboundPort())
+ || p.name.equals(mConfiguration.getEptfOutboundPort()))
+ {
+ mOut.println(" EPTF_MBT_TESTER_PCO.receive("+argName+") from vc_lgen;");
+ }
+ else
+ {
+ mOut.println(" " + p.name + ".receive("+argName+");");
+ }
+ }
+
+ }
+ else
+ {
+ mOut.println("// Steps that need to be implemented"
+ + " here are:");
+ mOut.println("// (modify and uncomment example "
+ + "code as needed)");
+ mOut.println("// 1. transform data from a "
+ + record + " to the TTCN-3 data value"
+ + " used by the test harness (if needed)");
+ mOut.println("// var <T3" + record + "Type> v_T3"
+ + record + " := " + "f_transform" + record
+ + "CQtoT3(" + argName + ");");
+ mOut.println("// 2. replace symbolic values "
+ + "(if any) with real values in TTCN-3"
+ + " data value");
+ mOut.println("// 3. send TTCN-3 data value via "
+ + "TTCN-3 port which corresponds to" + p.name
+ + "model port");
+ mOut.println("// " + p.name + ".send(v_T3" + record
+ + ");");
+ if (mConfiguration.isEptfEnable())
+ {
+ if (p.name.equals(mConfiguration.getEptfInboundPort())
+ || p.name.equals(mConfiguration.getEptfOutboundPort()))
+ {
+ mOut.println(" EPTF_MBT_TESTER_PCO.send("+argName+") to vc_lgen;");
+ }
+ else
+ {
+ mOut.println(" " + p.name + ".send("+argName+");");
+ }
+ }
+ }
+ if (mConfiguration.isDoLogCQInfoMessages())
+ {
+ mOut.println("// Remove or comment the following "
+ + "generated code");
+ }
+ printLog(LogMessageType.INFO, "Warning: "
+ + functionName + ": "
+ + "function is not implemented)");
+ mOut.resume();
+ mOut.println("}");
+ }
+ }
+ mOut.resume();
+ } catch (Exception e)
+ {
+ mOut.print("/* EXCEPTION CAUGHT in dumpTestHarness */");
+ mOut.flush();
+ mOut.close();
+ this.mOut = oldOut;
+ throw e;
+ }
+ }
+ // Must close the module block.
+ mOut.print("}");
+ mOut.endl();
+ mOut.flush();
+ mOut.close();
+ this.mOut = oldOut;
+ }
+
+ private void dumpDataTypes() throws Exception
+ {
+ assert (mMetadata != null);
+
+ PrettyPrinter oldOut = mOut;
+ String msg = null;
+ Exception rethrowMe = null;
+ if (mConfiguration.getDataTypesFile().getAbsolutePath().equals(""))
+ {
+ msg = "TTCN-3 backend must be configured with a data type file "
+ + "name.";
+ }
+ else
+ {
+ try
+ {
+ mOut = new PrettyPrinter(new BufferedWriter(new FileWriter(
+ mConfiguration.getDataTypesFile())));
+ } catch (IOException e)
+ {
+ StringBuffer msgbuf = new StringBuffer();
+ msgbuf.append("Failed to open file '");
+ msgbuf.append(mConfiguration.getDataTypesFile()
+ .getAbsolutePath());
+ msgbuf.append("' for writing data types.");
+ msg = msgbuf.toString();
+ rethrowMe = e;
+ }
+ }
+ if (msg != null)
+ {
+ if (mNotifications != null)
+ {
+ mNotifications.notify("error", msg);
+ }
+ else
+ {
+ System.err.println(msg);
+ }
+ mOut = oldOut;
+ // Pass the exception forward for proper error handling further
+ // up the call stack.
+ throw (rethrowMe);
+ }
+ {
+ String[] desc = {
+ "This file contains all data type definitions exported from "
+ + "the Conformiq " + mConfiguration.getProjectName()
+ + "' project.",
+ "with '" + mTestsuiteName + "' design configuration.'"};
+ String[] remark = {
+ "WARNING! This file has been automatically generated using the",
+ "Conformiq TTCN-3 scripting backend. DO NOT EDIT." };
+ printHeader(mConfiguration.getDataTypesFile(), desc, remark);
+ }
+ mOut.print("module ");
+ mOut.print(Utils.buildModuleNameFromFileName(mConfiguration
+ .getDataTypesFile()));
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ try
+ {
+ if (mConfiguration.isGenerateDataTypes())
+ {
+ final Set<QMLRecordType> alreadyDumped =
+ new HashSet<QMLRecordType>();
+ final Queue<QMLRecordType> workList =
+ new LinkedList<QMLRecordType>();
+ final Set<String> arrays = new HashSet<String>();
+
+ for (Port p : externalPorts)
+ {
+ for (QMLRecordType t : p.records)
+ {
+ workList.offer(t);
+ }
+ }
+ while (!workList.isEmpty())
+ {
+ QMLRecordType type = workList.poll();
+ if (alreadyDumped.contains(type) ||
+ (
+ mConfiguration.isEptfEnable() &&
+ type.getTypeName().length() >= 5 &&
+ type.getTypeName().substring(0, 5).equals("EPTF_")
+ )
+ )
+ {
+ // Skipping type generation
+ }
+ else
+ {
+ alreadyDumped.add(type);
+ if (type instanceof QMLUnionType)
+ {
+ mOut.print("type union ");
+ }
+ else
+ {
+ mOut.print("type record ");
+ }
+ mOut.println(type.getTypeName());
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+ for (int i = 0; i < type.getNumberOfFields(); i++)
+ {
+ QMLRecordTypeField field = type.getField(i);
+ TTCNTypeName v = new TTCNTypeName(workList,
+ alreadyDumped, arrays);
+ field.getType().accept(v);
+ if (field.getType() instanceof QMLRecordType)
+ {
+ String fieldType =
+ Utils.makeValidTTCN3Identifier(
+ field.getType().getTypeName());
+ if (!alreadyDumped.contains(fieldType))
+ {
+ workList.offer(
+ (QMLRecordType)field.getType());
+ }
+ }
+ assert (!v.getName().equals(""));
+ if (i != 0)
+ {
+ mOut.print(",");
+ mOut.endl();
+ }
+ mOut.print(v.getName());
+ mOut.print(" ");
+ mOut.print(Utils.makeValidTTCN3Identifier(
+ field.getFieldName()));
+ if (v.getOptional())
+ {
+ mOut.print(" optional");
+ }
+ }
+ mOut.resume();
+ mOut.endl();
+ mOut.print("}");
+ mOut.endl();
+ }
+
+ }
+ Iterator<String> it = arrays.iterator();
+ while (it.hasNext())
+ {
+ String x = it.next();
+ // TODO: reconsider changing this because now both
+ // TTCNTypeName class and this piece of code here has
+ // to know how array names are constructed.
+ mOut.print("type record of ");
+ mOut.print(x);
+ mOut.print(" ");
+ mOut.print(x);
+ mOut.print("Array;");
+ mOut.endl();
+ }
+ }
+ /*
+ * altstep CQDefaultAlt() runs on SystemType { [] any port.receive {
+ * mytimer.stop; setverdict(fail); stop; } [] mytimer.timeout {
+ * setverdict(fail); stop; } }
+ */
+ // Must close the module block.
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ mOut.flush();
+ mOut.close();
+ mOut = oldOut;
+ } catch (Exception e)
+ {
+ mOut.flush();
+ mOut.close();
+ mOut = oldOut;
+ }
+ mNotifications.notify("info", mScripterName
+ + ": Generated TTCN-3 type definitions " + "<hyperlink=\""
+ + mConfiguration.getDataTypesFile() + "\">"
+ + mConfiguration.getDataTypesFile() + "</hyperlink>.");
+ }
+
+ private void printControl()
+ {
+ mOut.print("control");
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ for (int i = 1; i <= mTestCaseIndex; i++)
+ {
+ mOut.print("execute(");
+ mOut.print(getTestCaseName(i));
+ mOut.print("());");
+ mOut.endl();
+ }
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ mOut.emptyline();
+ }
+
+ public void reportError(String msg)
+ {
+ mNotifications.notify("error", mScripterName + ": " + msg);
+ }
+
+ public void reportInfo(String msg)
+ {
+ mNotifications.notify("info", mScripterName + ": " + msg);
+ }
+
+ private void extractPortsMetaData()
+ {
+ final String portinfo = "portinfo:";
+ String key = mMetadata.getNextKey(portinfo);
+ externalPorts = new LinkedList<Port>();
+ while (key != null)
+ {
+ String data = key;
+ if (!data.startsWith(portinfo))
+ {
+ break;
+ }
+
+ final QMLValue definition = mMetadata.get(key);
+ assert (definition != null);
+ QMLArray tuple = (QMLArray) definition;
+ if (tuple != null)
+ {
+ Port port = new Port(key, tuple);
+ externalPorts.add(port);
+ }
+ key = mMetadata.getNextKey(key);
+ }
+ }
+
+ private void printSleepFunction()
+ {
+ Banner banner = new Banner();
+ banner.addTag("desc",
+ "This function blocks the execution for the specified time");
+ banner.addTag("param", "p_duration The specified time in seconds");
+ banner.print(mOut);
+ mOut.println("function " + mConfiguration.getFunctionsPrefix()
+ + mSleepFunctionName + "(float p_duration)");
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+ mOut.println("timer t;");
+ mOut.println("t.start(p_duration);");
+ mOut.println("t.timeout; // Note that any active default behavior "
+ + "may interrupt this waiting!");
+ mOut.endl();
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ }
+
+ private void printAltStepBody()
+ {
+ mOut.print(mIndent);
+ mOut.block();
+ if (!mConfiguration.isEptfEnable())
+ {
+ mOut.print("[] any port.receive");
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ mOut.print(mConfiguration.getTimerName());
+ mOut.print(".stop;");
+ mOut.endl();
+ mOut.print("setverdict(fail);");
+ mOut.endl();
+ printLog(LogMessageType.DEBUG, mConfiguration.getDefaultName()
+ + ": FAIL: Stopping test case after receiving unexpected "
+ + "message in default: " + mConfiguration.getDefaultName() + "!");
+ if (!mConfiguration.getEndHook().equals(""))
+ {
+ mOut.print(mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getEndHook());
+ mOut.print(";");
+ mOut.endl();
+ }
+ mOut.print("stop;");
+ mOut.endl();
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ }
+ mOut.print("[] ");
+ mOut.print(mConfiguration.getTimerName());
+ mOut.print(".timeout");
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ mOut.print("setverdict(fail);");
+ mOut.endl();
+ printLog(LogMessageType.DEBUG, mConfiguration.getDefaultName()
+ + ": FAIL: Stopping test case after " + "time out of timer: "
+ + mConfiguration.getTimerName() + "!");
+ if (!mConfiguration.getEndHook().equals(""))
+ {
+ mOut.print(mConfiguration.getFunctionsPrefix()
+ + mConfiguration.getEndHook());
+ mOut.print(";");
+ mOut.endl();
+ }
+
+ mOut.print("stop;");
+ mOut.endl();
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ mOut.resume();
+ mOut.endl();
+ }
+
+ private void printTemplates()
+ {
+ if (!mPostponedTemplates.isEmpty())
+ {
+ mOut.println("/***** Template definitions generated for "
+ + mCrrentTestCaseName + "*****/");
+ Iterator<TemplateDefinition> it = mPostponedTemplates.iterator();
+ while (it.hasNext())
+ {
+ final TemplateDefinition def = it.next();
+ mOut.print("template ");
+ mOut.print(Utils.makeValidTTCN3Identifier(def.getTypeName()));
+ mOut.print(" ");
+ mOut.print("m_" + def.getTemplateName());
+ mOut.ws();
+ mOut.print(":=");
+ mOut.endl();
+ QMLRecord r = def.getRecord();
+
+ TemplateDumper t = new TemplateDumper(mOut, mConfiguration
+ .isUseFractions());
+ r.accept(t);
+ mOut.endl();
+ mOut.emptyline();
+ }
+ }
+ }
+
+ private void prindAltstepDefaultDecl()
+ {
+ mOut.emptyline();
+ Banner banner = new Banner();
+ banner.addTag("desc", new String[] {
+ "This altstep handles terminating after waiting up to",
+ "the maximum response time and receiving any other",
+ "than the expected message with setting a fail ",
+ "verdict and stopping the test" });
+ banner.print(mOut);
+ mOut.print("altstep ");
+ mOut.print(mConfiguration.getDefaultName());
+ mOut.print(" runs on ");
+ mOut.print(mConfiguration.getRunsOnName());
+ mOut.endl();
+ mOut.print("{");
+ mOut.endl();
+ mOut.print(mIndent);
+ mOut.block();
+ printAltStepBody();
+ mOut.resume();
+ mOut.println("}");
+ }
+
+ private void printDebugModulepars()
+ {
+ mOut.println("/***** Logging verbosity flags *****/");
+ for (DebugMessageType t : DebugMessageType.enabledValues())
+ {
+ Banner banner = new Banner();
+ banner.addTag("desc", t.modeuleparComment);
+ banner.print(mOut);
+ printModulepar("boolean", t.enablingFlag, "" + t.defaultFlagState);
+ }
+ }
+
+ private void printModulepar(final String type, final String name,
+ final String init)
+ {
+ mOut.println("modulepar " + type + " " + name + " := " + init + ";");
+ }
+
+ private void printDebugMessageTypeEnum()
+ {
+ mOut.println("type enumerated " + mDebugMessageTypeEnumName);
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+ DebugMessageType[] debugMessageTypes = DebugMessageType.enabledValues();
+ for (int i = 0; i < debugMessageTypes.length; i++)
+ {
+ mOut.print(debugMessageTypes[i].dispatchingEnumItemName);
+ if (i != debugMessageTypes.length - 1)
+ {
+ mOut.print(",");
+ }
+ mOut.endl();
+ }
+ mOut.resume();
+ mOut.endl();
+ mOut.print("}");
+ mOut.endl();
+ }
+
+ private void printDebugFunctionDecl()
+ {
+ String firstArg = "p_description";
+ String secondArg = "p_" + mDebugMessageTypeEnumName;
+
+ Banner banner = new Banner();
+ List<String> descBody = new LinkedList<String>();
+ descBody.add("This function logs target description if the module"
+ + " parameter");
+ descBody.add("related to the target type is set to true.");
+ descBody.add("Module parameters and target type dependencies are"
+ + " as follows:");
+
+ for (DebugMessageType t : DebugMessageType.enabledValues())
+ {
+ descBody.add(mIndent + t.enablingFlag
+ + " controls logging of targets type "
+ + t.dispatchingEnumItemName);
+ }
+
+ banner.addTag("desc", descBody.toArray(new String[0]));
+ banner.addTag("param", new String[] { firstArg
+ + " The textual target description to be logged" });
+
+ banner.addTag("param ", new String[] { secondArg
+ + " The type of target covered by a test" });
+ banner.print(mOut);
+ mOut.print("function " + mConfiguration.getFunctionsPrefix()
+ + mSmartLogCommand + " (");
+ mOut.print("charstring " + firstArg + ", " + mDebugMessageTypeEnumName
+ + " " + secondArg);
+ mOut.print(") runs on " + mConfiguration.getRunsOnName());
+ mOut.endl();
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+
+ DebugMessageType types[] = DebugMessageType.enabledValues();
+ for (int i = 0; i < types.length; i++)
+ {
+ DebugMessageType t = types[i];
+ mOut.print("if ((" + secondArg + " == " + t.dispatchingEnumItemName
+ + ")");
+ mOut.print(" and ");
+ mOut.print(t.enablingFlag + ")");
+ mOut.endl();
+ mOut.println("{");
+ mOut.print(mIndent);
+ mOut.block();
+ printLogVar(firstArg);
+ mOut.resume();
+ mOut.println("}");
+ if (i != types.length - 1)
+ {
+ mOut.println("else");
+ }
+ }
+ mOut.resume();
+ mOut.print("}");
+ mOut.endl();
+ }
+
+ private void printLog(LogMessageType type, String msg)
+ {
+ String messageHeader;
+ switch (type) {
+ case DEBUG:
+ if (!mConfiguration.isDoLogCQDEbugMessages())
+ {
+ return;
+ }
+ messageHeader = "DEBUG";
+ break;
+
+ case INFO:
+ if (!mConfiguration.isDoLogCQInfoMessages())
+ {
+ return;
+ }
+ messageHeader = "INFO";
+ break;
+ default:
+ return;
+ }
+ mOut.print("log");
+ mOut.print("(\"CQ_" + messageHeader + ": " + msg + "\");");
+ mOut.endl();
+
+ }
+
+ private void printLogVar(String varName)
+ {
+ mOut.print("log");
+ mOut.print("(\"CQ_INFO: \" & " + varName + ");");
+ mOut.endl();
+ }
+
+ private void printHeader(File file, String[] desc, String[] remark)
+ {
+ assert (mOut != null);
+
+ mOut.print("/* -*- ttcn-3 -*- */");
+ mOut.endl();
+ mOut.emptyline();
+
+ Banner banner = new Banner();
+
+ banner.addTag("file", file.getAbsolutePath());
+ banner.addTag("author", "Conformiq TTCN-3 scripting backend");
+ banner.addTag("version", new Date().toString());
+
+ if (desc != null)
+ {
+ banner.addTag("desc", desc);
+ }
+
+ if (remark != null)
+ {
+ banner.addTag("remark", remark);
+ }
+ banner.print(mOut);
+ }
+
+ private void deleteCopies()
+ {
+ mGeneratedTemplates.clear();
+ }
+
+ private void printCheckpoints()
+ {
+ for (CheckPointInfo cp : collectedCheckpoints)
+ {
+ printCheckPoint(cp);
+ }
+ }
+
+ private void printCheckPoint(CheckPointInfo cp)
+ {
+ String name = cp.checkpoint.getName();
+ for (DebugMessageType t : DebugMessageType.values())
+ {
+ for (String p : t.checkpointPrefixes)
+ {
+ if (name.startsWith(p) && t.enabled)
+ {
+ mOut.print(mConfiguration.getFunctionsPrefix() +
+ mSmartLogCommand);
+ mOut.print("(\"Covered ");
+ mOut.print(Utils.escapeString(name));
+ mOut.print("\"");
+ mOut.print(", ");
+ mOut.print(t.dispatchingEnumItemName);
+ mOut.print(");");
+ mOut.endl();
+ return;
+ }
+ }
+ }
+ }
+
+ private String recordAndRenderTestCaseName(String testCaseName)
+ {
+ // Remove whitespace
+ StringBuffer rendered = new StringBuffer("tc_");
+ for (int i = 0; i < testCaseName.length(); i++)
+ {
+ // Inverted the logic here to be safer by replacing everything
+ // but valid identifier chars with an underscore. According to the
+ // spec: "TTCN-3 identifiers are case sensitive and may
+ // only contain lowercase letters (a-z) uppercase letters
+ // (A-Z) and numeric digits (0-9). Use of the underscore (
+ // _ ) symbol is also allowed. An identifier shall begin
+ // with a letter (i.e., not a number and not an
+ // underscore)."
+ char c = testCaseName.substring(i, i + 1).charAt(0);
+ // If the original test case name starts with a digit, we want
+ // to preserve that but need to prefix the test case name with
+ // an underscore.
+ if (c >= '0' && c <= '9' && i == 0)
+ rendered.append('_');
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')
+ || (c >= '0' && c <= '9') || c == '_')
+ rendered.append(c);
+ else
+ rendered.append('_');
+ }
+ // Put into test case name list
+ mTestCaseNames.add(rendered.toString());
+ return rendered.toString();
+ }
+
+ private String getTestCaseName(int i)
+ {
+ // Get test case name at index i of the test case list
+ return mTestCaseNames.get(i - 1);
+ }
+
+ private static final String mIndent = " ";
+ private static final String mDebugMessageTypeEnumName = "target_type";
+ private static final String mSmartLogCommand = "log_target";
+ static public final String mScripterName = "TTCN-3 scripter";
+ static private final String mSlackVarName = "mp_max_response_time";
+ static private final String mOldTimerName = "v_last_wait_timeout";
+ static private final String mSleepFunctionName = "sleep";
+ private PrettyPrinter mOut;
+ private NotificationSink mNotifications;
+ private MetaDataDictionary mMetadata;
+ private int mTestCaseIndex;
+ private int mTemplateIndex;
+ private String mCrrentTestCaseName;
+ private int mCaseStepIndex;
+
+ private TimeStamp mTimeStamp;
+ private boolean mIsFirstStep;
+ private Map<QMLRecord, Integer> mGeneratedTemplates;
+ private Vector<TemplateDefinition> mPostponedTemplates;
+ private Vector<String> mTestCaseNames;
+
+ private Configuration mConfiguration = new Configuration();
+
+ private String mTestsuiteName;
+
+ private Queue<Utils.CheckPointInfo> collectedCheckpoints;
+
+ enum LogMessageType {
+ DEBUG, INFO
+ }
+
+ public class Port
+ {
+ public Port(final String key, final QMLArray tuple)
+ {
+ final StringTokenizer tokenizer = new StringTokenizer(key, ":");
+ final String potinfo = tokenizer.nextToken();
+ assert potinfo == "portinfo";
+ final String dir = tokenizer.nextToken();
+ isInbound = !dir.equals("inbound");
+ final boolean isOutbound = !dir.equals("outbound");
+ assert isInbound != isOutbound;
+ final String origname = tokenizer.nextToken();
+ name = Utils.makeValidTTCN3Identifier(origname);
+ assert !tokenizer.hasMoreElements();
+
+ this.records = new LinkedList<QMLRecordType>();
+ tuple.accept(new PortDataExtractor());
+ }
+
+ final List<QMLRecordType> records;
+ final boolean isInbound;
+ final String name;
+
+ private class PortDataExtractor implements QMLValueVisitor
+ {
+ public PortDataExtractor()
+ {
+
+ }
+
+ @Override
+ public void visit(QMLArray x)
+ {
+ final int size = x.getNumberOfElements();
+ for (int i = 0; i < size; i++)
+ {
+ QMLString portname = (QMLString) x.getValue(i);
+ if (portname != null)
+ {
+ final String origname = portname.getValue();
+ QMLRecordType type = mMetadata.getType(origname);
+ if (type == null)
+ {
+ mNotifications.notify("info", "Warning: Nested r" +
+ "records in port declarations types are " +
+ "not yet supported by the scripter");
+ continue;
+ }
+ records.add(type);
+ }
+ }
+ }
+
+ @Override
+ public void visit(QMLBoolean b)
+ {
+ }
+
+ @Override
+ public void visit(QMLNumber n)
+ {
+ }
+
+ @Override
+ public void visit(QMLRecord r)
+ {
+ }
+
+ @Override
+ public void visit(QMLString s)
+ {
+ }
+
+ @Override
+ public void visit(QMLOptional p)
+ {
+ }
+ }
+ }
+ private List<Port> externalPorts;
+}
diff --git a/src/Qtronic/TTCNScripter_v421/TTCNTypeName.java b/src/Qtronic/TTCNScripter_v421/TTCNTypeName.java
new file mode 100644
index 0000000..b1c95f6
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v421/TTCNTypeName.java
@@ -0,0 +1,102 @@
+/** Copyright (C) Conformiq Software Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file TTCNTypeName.java
+ *
+ * @author Conformiq Software Ltd.
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.util.Queue;
+import java.util.Set;
+
+import com.conformiq.qtronic2.QMLArrayType;
+import com.conformiq.qtronic2.QMLBooleanType;
+import com.conformiq.qtronic2.QMLNumberType;
+import com.conformiq.qtronic2.QMLOptionalType;
+import com.conformiq.qtronic2.QMLRecordType;
+import com.conformiq.qtronic2.QMLStringType;
+import com.conformiq.qtronic2.QMLTypeVisitor;
+
+class TTCNTypeName implements QMLTypeVisitor
+{
+ public TTCNTypeName(final Queue<QMLRecordType> workList,
+ final Set<QMLRecordType> alreadyDumped, final Set<String> arrays)
+ {
+ this.workList = workList;
+ this.alreadyDumped = alreadyDumped;
+ this.arrays = arrays;
+ optional = false;
+ }
+
+ public void visit(QMLArrayType a)
+ {
+ // We first visit the element type to get the correct name
+ // for it.
+ a.getType().accept(this);
+ // arrays.add(a.getType().getTypeName());
+ arrays.add(name);
+
+ optional = false;
+ name += "Array";
+ }
+
+ public void visit(QMLBooleanType b)
+ {
+ name = "boolean";
+ }
+
+ public void visit(QMLNumberType n)
+ {
+ if (n.isFloat() || n.isDouble())
+ {
+ name = "float";
+ }
+ else
+ {
+ name = "integer";
+ }
+ }
+
+ public void visit(QMLRecordType r)
+ {
+ if (!alreadyDumped.contains(r))
+ {
+ workList.offer(r);
+ }
+ name = r.getTypeName();
+ }
+
+ public void visit(QMLStringType s)
+ {
+ name = "charstring";
+ }
+
+ public void visit(QMLOptionalType p)
+ {
+ p.getType().accept(this);
+ optional = true;
+ }
+
+ private boolean optional;
+
+ public boolean getOptional()
+ {
+ return optional;
+ }
+
+ private String name = "";
+
+ public String getName()
+ {
+ return name;
+ }
+
+ protected Set<String> arrays;
+ private final Queue<QMLRecordType> workList;
+ private final Set<QMLRecordType> alreadyDumped;
+};
diff --git a/src/Qtronic/TTCNScripter_v421/TemplateDumper.java b/src/Qtronic/TTCNScripter_v421/TemplateDumper.java
new file mode 100644
index 0000000..5d21e37
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v421/TemplateDumper.java
@@ -0,0 +1,309 @@
+/** Copyright (C) Conformiq Software Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file TemplateDumper.java
+ *
+ * @author Conformiq Software Ltd.
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.math.BigDecimal;
+
+import com.conformiq.qtronic2.QMLArray;
+import com.conformiq.qtronic2.QMLArrayType;
+import com.conformiq.qtronic2.QMLBoolean;
+import com.conformiq.qtronic2.QMLBooleanType;
+import com.conformiq.qtronic2.QMLNumber;
+import com.conformiq.qtronic2.QMLNumberType;
+import com.conformiq.qtronic2.QMLOptional;
+import com.conformiq.qtronic2.QMLOptionalType;
+import com.conformiq.qtronic2.QMLRecord;
+import com.conformiq.qtronic2.QMLRecordField;
+import com.conformiq.qtronic2.QMLRecordType;
+import com.conformiq.qtronic2.QMLString;
+import com.conformiq.qtronic2.QMLStringType;
+import com.conformiq.qtronic2.QMLType;
+import com.conformiq.qtronic2.QMLTypeVisitor;
+import com.conformiq.qtronic2.QMLUnion;
+import com.conformiq.qtronic2.QMLValue;
+import com.conformiq.qtronic2.QMLValueVisitor;
+
+public class TemplateDumper implements QMLValueVisitor
+{
+ private PrettyPrinter out;
+ private boolean mUseFractions;
+ private boolean mEsxpectFloat;
+
+ public TemplateDumper(PrettyPrinter out, boolean isUseFractions)
+ {
+ this.out = out;
+ this.mUseFractions = isUseFractions;
+ }
+
+ @Override
+ public void visit(QMLRecord r)
+ {
+ if (r == null)
+ {
+ out.print("{ /* null record */ }");
+ return;
+ }
+ /*
+ * TODO make a dedicated method in the visitor interface for QMLUnion
+ */
+ if (r instanceof QMLUnion)
+ {
+ QMLUnion u = (QMLUnion) r;
+ visit(u);
+ return;
+ }
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ for (int i = 0; i < r.getNumberOfFields(); i++)
+ {
+ if (i > 0)
+ {
+ out.print(",");
+ out.endl();
+ }
+ QMLRecordField f = r.getField(i);
+ out.print(Utils.makeValidTTCN3Identifier(f.getName()));
+ out.print(" := ");
+ QMLValue v = f.getValue();
+ if (v != null)
+ {
+ mEsxpectFloat =
+ FloatTypeDetector.isFloatType(f.getFieldType().getType());
+ v.accept(this);
+ }
+ else
+ out.print("{ /* NULL */ }");
+ }
+
+ out.endl();
+ out.resume();
+ out.print("}");
+ }
+
+ public void visit(QMLUnion u)
+ {
+ if (u == null)
+ {
+ out.print("{ /* null union */ }");
+ return;
+ }
+
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ for (int i = 0; i < u.getNumberOfFields(); i++)
+ {
+ if (i > 0)
+ {
+ out.print(",");
+ out.endl();
+ }
+ QMLRecordField f = u.getField(i);
+ out.print(Utils.makeValidTTCN3Identifier(f.getName()));
+ out.print(" := ");
+ QMLValue v = f.getValue();
+ if (v != null)
+ {
+ mEsxpectFloat =
+ FloatTypeDetector.isFloatType(f.getFieldType().getType());
+ v.accept(this);
+ }
+ else
+ out.print("{ /* NULL */ }");
+ }
+
+ out.endl();
+ out.resume();
+ out.print("}");
+ }
+
+ @Override
+ public void visit(QMLString x)
+ {
+ assert (x != null);
+ String v = x.getValue();
+ out.print("\"");
+ for (int i = 0; i < v.length(); i++)
+ {
+ switch (v.charAt(i)) {
+ case '\n':
+ out.print("\\n");
+ break;
+ case '\r':
+ out.print("\\r");
+ break;
+ case '\t':
+ out.print("\\t");
+ break;
+ case '\"':
+ out.print("\"\"");
+ break;
+ case '\\':
+ if ( i + 1 < v.length() && v.charAt(i + 1) != '"')
+ {
+ out.print("\\");
+ }
+ // PASS THROUGH
+ default:
+ out.print(v.charAt(i));
+ break;
+ }
+ }
+ out.print("\"");
+ }
+
+ @Override
+ public void visit(QMLBoolean x)
+ {
+ assert (x != null);
+ out.print((x.getValue() ? "true" : "false"));
+ }
+
+ @Override
+ public void visit(QMLNumber x)
+ {
+ assert (x != null);
+ if (x.isBigInteger())
+ {
+ out.print(x.getBigInteger());
+ if (mEsxpectFloat)
+ {
+ out.print(".0");
+ }
+ }
+ else
+ {
+
+ if (!mUseFractions)
+ {
+ BigDecimal num = new BigDecimal(x.getNumerator()).setScale(20);
+ BigDecimal den = new BigDecimal(x.getDenominator());
+ out.print("" + num.divide(den, BigDecimal.ROUND_UP));
+ }
+ else
+ {
+ BigDecimal num = new BigDecimal(x.getNumerator());
+ BigDecimal den = new BigDecimal(x.getDenominator());
+ out.print("" + num + ".0 / " + den + ".0");
+ }
+ }
+ }
+
+ @Override
+ public void visit(QMLArray array)
+ {
+ if (array == null)
+ {
+ out.print("{ /* null */ }");
+ return;
+ }
+
+ out.print("{");
+ out.endl();
+ out.print(" ");
+ out.block();
+ QMLArrayType arrayType= (QMLArrayType)array.getType();
+ mEsxpectFloat = FloatTypeDetector.isFloatType(arrayType.getType());
+ for (int i = 0; i < array.getNumberOfElements(); i++)
+ {
+ if (i > 0)
+ {
+ out.print(",");
+ out.endl();
+ }
+ QMLValue v = array.getValue(i);
+ if (v != null)
+ v.accept(this);
+ else
+ out.print("{ /* null */ }");
+ }
+
+ out.endl();
+ out.resume();
+ out.print("}");
+ }
+
+ @Override
+ public void visit(QMLOptional o)
+ {
+ QMLValue v = o.getValue();
+ if (v == null)
+ {
+ out.print("omit");
+ }
+ else
+ {
+ v.accept(this);
+ }
+ }
+
+ private static class FloatTypeDetector implements QMLTypeVisitor
+ {
+ private boolean mREsult;
+
+ public static boolean isFloatType(QMLType type)
+ {
+ FloatTypeDetector dtector = new FloatTypeDetector();
+ type.accept(dtector);
+ return dtector.mREsult;
+ }
+
+ @Override
+ public void visit(QMLArrayType arg0) {
+ mREsult = false;
+
+ }
+
+ @Override
+ public void visit(QMLBooleanType arg0) {
+ mREsult = false;
+
+ }
+
+ @Override
+ public void visit(QMLNumberType arg0) {
+ if (arg0.isFloat())
+ {
+ mREsult = true;
+ }
+ else
+ {
+ mREsult = false;
+ }
+
+ }
+
+ @Override
+ public void visit(QMLRecordType arg0) {
+ mREsult = false;
+
+ }
+
+ @Override
+ public void visit(QMLStringType arg0) {
+ mREsult = false;
+
+ }
+
+ @Override
+ public void visit(QMLOptionalType arg0) {
+ mREsult = isFloatType(arg0.getType());
+
+ }
+
+ }
+
+
+}
diff --git a/src/Qtronic/TTCNScripter_v421/Utils.java b/src/Qtronic/TTCNScripter_v421/Utils.java
new file mode 100644
index 0000000..fc3dc7f
--- /dev/null
+++ b/src/Qtronic/TTCNScripter_v421/Utils.java
@@ -0,0 +1,312 @@
+/** Copyright (C) Conformiq Software Ltd.
+ * All rights reserved.
+ *
+ * Created Wed Aug 27 16:49:21 2008.
+ *
+ * @file Utils.java
+ *
+ * @author Conformiq Software Ltd.
+ *
+ *
+ */
+package com.conformiq.adaptation.ttcn;
+
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.conformiq.qtronic2.Checkpoint;
+import com.conformiq.qtronic2.QMLRecord;
+import com.conformiq.qtronic2.TimeStamp;
+
+public class Utils
+{
+
+ static class TemplateDefinition
+ {
+ public TemplateDefinition(final String type, final String templatename,
+ QMLRecord record)
+ {
+ this.typeName = type;
+ this.templateName = templatename;
+ this.record = record;
+ }
+
+ private String typeName;
+ private String templateName;
+
+ public String getTypeName()
+ {
+ return typeName;
+ }
+
+ public String getTemplateName()
+ {
+ return templateName;
+ }
+
+ private QMLRecord record;
+
+ public QMLRecord getRecord()
+ {
+ return record;
+ }
+ }
+
+ static class CheckPointInfo
+ {
+ public CheckPointInfo(final Checkpoint checkpoint, final int status,
+ final TimeStamp ts)
+ {
+ this.checkpoint = checkpoint;
+ this.status = status;
+ this.ts = ts;
+ }
+
+ public final Checkpoint checkpoint;
+ public final int status;
+ public final TimeStamp ts;
+ }
+
+ public static String buildModuleNameFromFileName(File file)
+ {
+ if (file.isDirectory())
+ {
+ return null;
+ }
+ String fileName = file.getName();
+ int dot = fileName.lastIndexOf(".");
+ if (dot > -1)
+ {
+ fileName = fileName.substring(0, dot);
+ }
+ if (fileName.length() == 0)
+ {
+ return null;
+ }
+ return makeValidTTCN3Identifier(fileName);
+ }
+
+ public static String makeValidTTCN3Identifier(String id)
+ {
+ /* "Identifier ::= <alpha> (<alnum> | <underscore>)*" */
+ StringBuffer valid_ = new StringBuffer();
+ final int size = id.length();
+ if (size == 0)
+ {
+ System.err
+ .println("Warning: Empty string is not a valid TTCN3 identifier.");
+ return id;
+ }
+ if (isalpha(id.charAt(0)))
+ {
+ valid_.append(id.substring(0, 1));
+ }
+ else
+ {
+ valid_.append("X" + id.substring(0, 1));
+ }
+ for (int i = 1; i < size; i++)
+ {
+ if (!isalnum(id.charAt(i)) && id.charAt(i) != '_')
+ {
+ valid_.append("_");
+ }
+ else
+ {
+ valid_.append(id.charAt(i));
+ }
+ }
+ /* Postfix TTCN3 reserved words with '_' */
+ String valid = valid_.toString();
+ if (valid.equals("action") || valid.equals("fail")
+ || valid.equals("named") || valid.equals("self")
+ || valid.equals("activate") || valid.equals("false")
+ || valid.equals("none") || valid.equals("send")
+ || valid.equals("address") || valid.equals("float")
+ || valid.equals("nonrecursive") || valid.equals("sender")
+ || valid.equals("all") || valid.equals("for")
+ || valid.equals("not") || valid.equals("set")
+ || valid.equals("alt") || valid.equals("from")
+ || valid.equals("not4b") || valid.equals("signature")
+ || valid.equals("and") || valid.equals("function")
+ || valid.equals("nowait") || valid.equals("start")
+ || valid.equals("and4b") || valid.equals("null")
+ || valid.equals("stop") || valid.equals("any")
+ || valid.equals("get") || valid.equals("sut")
+ || valid.equals("getcall") || valid.equals("objid")
+ || valid.equals("system") || valid.equals("bitstring")
+ || valid.equals("getreply") || valid.equals("octetstring")
+ || valid.equals("boolean") || valid.equals("goto")
+ || valid.equals("of") || valid.equals("template")
+ || valid.equals("group") || valid.equals("omit")
+ || valid.equals("testcase") || valid.equals("call")
+ || valid.equals("on") || valid.equals("timeout")
+ || valid.equals("catch") || valid.equals("hexstring")
+ || valid.equals("optional") || valid.equals("timer")
+ || valid.equals("char") || valid.equals("or") || valid.equals("to")
+ || valid.equals("charstring") || valid.equals("if")
+ || valid.equals("or4b") || valid.equals("trigger")
+ || valid.equals("check") || valid.equals("ifpresent")
+ || valid.equals("out") || valid.equals("true")
+ || valid.equals("clear") || valid.equals("import")
+ || valid.equals("override") || valid.equals("type")
+ || valid.equals("complement") || valid.equals("in")
+ || valid.equals("component") || valid.equals("inconc")
+ || valid.equals("param") || valid.equals("union")
+ || valid.equals("connect") || valid.equals("infinity")
+ || valid.equals("pass") || valid.equals("universal")
+ || valid.equals("const") || valid.equals("inout")
+ || valid.equals("pattern") || valid.equals("unmap")
+ || valid.equals("control") || valid.equals("integer")
+ || valid.equals("port") || valid.equals("create")
+ || valid.equals("interleave") || valid.equals("procedure")
+ || valid.equals("value") || valid.equals("valueof")
+ || valid.equals("deactivate") || valid.equals("label")
+ || valid.equals("raise") || valid.equals("var")
+ || valid.equals("disconnect") || valid.equals("language")
+ || valid.equals("read") || valid.equals("verdict")
+ || valid.equals("display") || valid.equals("length")
+ || valid.equals("receive") || valid.equals("verdicttype")
+ || valid.equals("do") || valid.equals("log")
+ || valid.equals("record") || valid.equals("done")
+ || valid.equals("rem") || valid.equals("while")
+ || valid.equals("map") || valid.equals("repeat")
+ || valid.equals("with") || valid.equals("else")
+ || valid.equals("match") || valid.equals("reply")
+ || valid.equals("encode") || valid.equals("message")
+ || valid.equals("return") || valid.equals("xor")
+ || valid.equals("enumerated") || valid.equals("mixed")
+ || valid.equals("running") || valid.equals("xor4b")
+ || valid.equals("error") || valid.equals("mod")
+ || valid.equals("runs") || valid.equals("exception")
+ || valid.equals("modifies") || valid.equals("execute")
+ || valid.equals("module") || valid.equals("expand")
+ || valid.equals("mtc") || valid.equals("extension")
+ || valid.equals("external") ||
+
+ /* special identifiers reserved for the predefined functions */
+ valid.equals("int2char") || valid.equals("char2int")
+ || valid.equals("int2unichar") || valid.equals("unichar2int")
+ || valid.equals("bit2int") || valid.equals("hex2int")
+ || valid.equals("int2bit") || valid.equals("int2hex")
+ || valid.equals("int2oct") || valid.equals("int2str")
+ || valid.equals("oct2int") || valid.equals("str2int")
+ || valid.equals("lengthof") || valid.equals("sizeof")
+ || valid.equals("ischosen") || valid.equals("ispresent"))
+ {
+ return valid + "_";
+ }
+ return valid;
+ }
+
+ private static boolean isalpha(char c)
+ {
+ return (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'));
+ }
+
+ private static boolean isalnum(char c)
+ {
+ return (isalpha(c) || ('0' <= c && c <= '9'));
+ }
+
+ static public String escapeString(String s)
+ {
+ // Checkpoint strings from the model must be escaped by "backslashing"
+ // double quotations and backslashes themselves.
+ StringBuffer escaped = new StringBuffer();
+ final int size = s.length();
+ if (size == 0)
+ return s;
+ for (int i = 0; i < size; i++)
+ {
+ if (s.charAt(i) == '\\')
+ {
+ escaped.append("\\\\");
+ }
+ else if (s.charAt(i) == '"')
+ {
+ escaped.append("\\\"");
+ }
+ else
+ {
+ escaped.append(s.charAt(i));
+ }
+ }
+ return escaped.toString();
+ }
+
+ public static boolean EqualTimeStamps(TimeStamp ts1, TimeStamp ts2)
+ {
+ return (ts1.seconds == ts2.seconds)
+ & (ts1.nanoseconds == ts2.nanoseconds);
+ }
+
+ public static String TimeStampToString(TimeStamp ts)
+ {
+ return ts.seconds + "." + ts.nanoseconds;
+ }
+
+ public static class Tag
+ {
+ public String getmTagName()
+ {
+ return mTagName;
+ }
+
+ public String[] getmBody()
+ {
+ return mBody;
+ }
+
+ private final String mTagName;
+ private final String[] mBody;
+
+ Tag (String tagName, String[] body)
+ {
+ this.mTagName = tagName;
+ this.mBody = body;
+ }
+ }
+
+ public static class Banner
+ {
+ private List<Tag> mLines;
+ Banner()
+ {
+ mLines = new LinkedList<Tag>();
+ }
+ public void addTag(String tagName, String[] tagBody)
+ {
+ mLines.add(new Tag(tagName, tagBody));
+ }
+
+ public void addTag(String tagName, String tagBody)
+ {
+ this.addTag(tagName, new String[] {tagBody});
+ }
+
+ void print (PrettyPrinter out)
+ {
+ out.println("/**");
+ out.print("*");
+ out.block();
+ for (Tag t : mLines)
+ {
+ out.println(" @" + t.getmTagName());
+ out.print(" ");
+ out.block();
+ for (String line : t.mBody)
+ {
+ out.println(line);
+ }
+ out.resume();
+ }
+ out.resume();
+ out.println("*/");
+ }
+
+ }
+
+
+}
diff --git a/src/Qtronic/model/EPTF_MBT_Framework.java b/src/Qtronic/model/EPTF_MBT_Framework.java
new file mode 100644
index 0000000..bd2b266
--- /dev/null
+++ b/src/Qtronic/model/EPTF_MBT_Framework.java
@@ -0,0 +1,55 @@
+/* ====================================================
+ * MBT Applib API
+ */
+
+record EPTF_MBT_TestStepRequest
+{
+ public String stepName;
+ int[] stepArgs;
+ EPTF_FsmAddr addr;
+ int lock;
+}
+
+EPTF_MBT_TestStepRequest c_EPTF_MBT_TestStepRequest_empty()
+{
+ EPTF_MBT_TestStepRequest ret;
+ ret.stepName = "";
+ ret.stepArgs = {};
+ ret.addr = c_EPTF_FsmAddr_empty();
+ ret.lock = -1;
+ return ret;
+};
+
+record EPTF_MBT_TestStepResponse
+{
+ public String bName;
+ public String iName;
+ EPTF_FsmAddr addr;
+}
+
+EPTF_MBT_TestStepResponse c_EPTF_MBT_TestStepResponse_empty()
+{
+ EPTF_MBT_TestStepResponse ret;
+ ret.bName = "";
+ ret.iName = "";
+ ret.addr = c_EPTF_FsmAddr_empty();
+ return ret;
+};
+
+record EPTF_FsmAddr
+{
+ public String entityGroupName;
+ public int eIdx;
+ public int fIdx;
+}
+
+EPTF_FsmAddr c_EPTF_FsmAddr_empty()
+{
+ EPTF_FsmAddr ret;
+ ret.entityGroupName = "MBT_EntityType";
+ ret.eIdx = 0;
+ ret.fIdx = 0;
+ return ret;
+};
+
+record EPTF_IntegerList {}
diff --git a/src/Qtronic/model/EPTF_MBT_SIP_Applib.java b/src/Qtronic/model/EPTF_MBT_SIP_Applib.java
new file mode 100644
index 0000000..8df3b39
--- /dev/null
+++ b/src/Qtronic/model/EPTF_MBT_SIP_Applib.java
@@ -0,0 +1,30 @@
+String c_SIP_Behavior = "Behavior_SIP";
+
+// Events
+String c_SIP_eventName_INVITE = "INVITE";
+String c_SIP_eventName_CANCEL = "CANCEL";
+String c_SIP_eventName_ACK = "ACK";
+String c_SIP_eventName_BYE = "BYE";
+String c_SIP_eventName_RetransmittedRequest = "Retransmitted request";
+
+// TestSteps
+String c_SIP_stepFunction_createResponse = "SIPAppLib: StepFunction_createResponse";
+String c_SIP_stepFunction_createBYE = "SIPAppLib: StepFunction_createBYE";
+String c_SIP_stepFunction_init = "SIPAppLib: StepFunction_init";
+String c_SIP_stepFunction_handleINVITE = "SIPAppLib: StepFunction_handleINVITE";
+
+// Methods
+int c_SIP_Method_CANCEL = 2;
+int c_SIP_Method_INVITE = 4;
+
+int f_EPTF_SIP_mapAnswerCode2SipTemplateCode(int p_answerCode)
+{
+ if (p_answerCode == 180)
+ return 1;
+ else if (p_answerCode == 486)
+ return 37;
+ else if (p_answerCode == 200)
+ return 5;
+ else if (p_answerCode == 487)
+ return 38;
+}
\ No newline at end of file