Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Titan Java IPL4 example project(An example project how to use Java version of IPL4 testport with Titan Java version.)
Titan Java IPL4 example project [message #1846985] Mon, 11 October 2021 11:10 Go to next message
Gergo Ujhelyi is currently offline Gergo UjhelyiFriend
Messages: 3
Registered: February 2021
Junior Member
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.

java -version


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.


  1. From command line
  2. 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:
index.php/fa/41120/0/

This is my Run Configuration Arguments tab:
index.php/fa/41121/0/

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

Re: Titan Java IPL4 example project [message #1847066 is a reply to message #1846985] Wed, 13 October 2021 12:35 Go to previous message
Gustavo Gonnet is currently offline Gustavo GonnetFriend
Messages: 36
Registered: October 2015
Location: Montreal, Quebec, Canada
Member
well done, Gergo.
Thank you for posting this.
Gustavo.
Previous Topic:Certificate issues while accepting incoming connection
Next Topic:Segmentation fault occured
Goto Forum:
  


Current Time: Thu Apr 25 09:21:39 GMT 2024

Powered by FUDForum. Page generated in 0.03108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top