Hello Titan users, my name is Gergo Ujhelyi a developer from the Titan Team.
In this topic I will show you how to use Java version of IPL4 testport with the Java version of Titan.
The zero step is to check Java version and make sure your Eclipse has the latest Titan Eclipse Plugin with the Designer and Runtime Package.
At this time the minimum Java version is 9. I will lower it to 8 in the near future.
The first step is to git pull Java version of IPL4 testport. There are two options to do it.
- From command line
- From eclipse built-in git
I show you the command line option.
git clone https://gitlab.eclipse.org/eclipse/titan/titan.TestPorts.IPL4asp.git
The next step is import IPL4 project to your eclipse.
In your Eclipse:
File>Import...>Select Git>Projects from Git>Existing local repository>Add...>Select directory where you downloaded titan.TestPorts.IPL4asp project>Select .../titan.TestPorts.IPL4asp/.git>Finish
Now you can see titan.TestPorts.IPL4asp repository in the Select a Git Repository view.
Select titan.TestPorts.IPL4asp>Select Import existing Eclipse project>Select only titan.JavaTestPorts.IPL4>Finish
At the project you can find a demo folder. The tests are the same as in the original project.
For now you can use IPL4 testport for UDP and TCP connections as you can see in the test.
We will add SCTP and SSL support, but now it's not available.
Important: If you want to use the same IP address and port in several testcases, you have to close the connection at the end of the testcase.
For it use external function f_IPL4_close(
inout IPL4asp_PT portRef,
in ConnectionId connId,
in ProtoTuple proto := { unspecified := {} }
) return Result;
TTCN-3 function. There are examples in IPL4_demo.ttcn
how to use it.
The next big question is: How to use IPL4 Java testport in my Titan Java Project?
For now download the project as I mentioned before and copy user_provided/IPL4asp__PortType_externalfunctions.java and IPL4asp__PT_PROVIDER.java to your Titan Java project/user_provided/org.eclipse.titan.<<Your project name>>.user_provided package.
With the import problem the Eclipse is smart enough to help you out if you are not familiar how Java import works.
And our last topic is the execution of the demo testcases:
If you don't get any compiling error just Right-Click to Project>Run As>Java Application>Select the Project and the Main Class in the Main tab
In the Arguments tab>Add config file into the Program Arguments
This is my Run Configuration Main tab:
This is my Run Configuration Arguments tab:
And Click Run.
If you do it well you get the same output as me:
TTCN-3 Host Controller (single mode)
Using configuration file: `demo\config.cfg'
Warning: Option `SourceInfoFormat' was given more than once in section [LOGGING] of the configuration file.
.
.
.
Removing unterminated mapping between port IPL4 and system:IPL4.
Port IPL4 was unmapped from system:IPL4.
Port IPL4 was stopped.
Test case TC_connect finished. Verdict: pass
Verdict Statistics: 0 none (0 %), 4 pass (100 %), 0 inconc (0 %), 0 fail (0 %), 0 error (0 %)
Test execution summary: 4 test cases were executed. Overall verdict: pass
Best regards,
Gergo
[Updated on: Mon, 11 October 2021 13:29]
Report message to a moderator