Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Unable to run a Java based unit test example(Trying to run a Java Unit test for Jubula and it wont work)
Unable to run a Java based unit test example [message #1824230] Fri, 10 April 2020 13:09 Go to next message
sreesowmya telikipalli is currently offline sreesowmya telikipalliFriend
Messages: 6
Registered: April 2020
Junior Member
Hi,

As part of my organization CI/CD efforts, I am trying to automate some of the Java Swing based applications using Jubula. As we wanted these tests to run part of CI/CD builds we are trying to do proof of concept using the Jubula Java API and trying to run some of the examles provided with Jubula JAVA API.

Here is the details of the envionment:

1. I have Jubula 8.7.1.046 version of the Jubula installation from the Jubula site.
2. I have cloned the corresponding vresion of the Jubula Java examples/API from Jubula Java Reposiotory here ( https://git.eclipse.org/c/jubula/org.eclipse.jubula.core.git/)
3. I have followed the instructions bredex site to run the unit tests.


4. Used the Eclipse plugin Target platform in the below project
org.eclipse.jubula.examples.api.configuration

5. I am trying to run the Swing example mentioned in the below folder.
org.eclipse.jubula.examples.api.adder.swing.osgi

However, my Junit test case fails to start the AUT. Here is the line in the Junit code it fails
AUTIdentifier id = agent.startAUT(config);

I have spent some time debugging the Java code supplied and found that to start AUT, it is finally failing at the final step of executing Runtime.exec java method. It seems to pass additional parameters to the Runtime.exec. Runtime.exec expects parameters as "java -jar <jarfile name>". However, the code seems to send some additional argument between "Java -jar" which is the directory of where the jubulua plugins exists. In StartSwingAutServerCommand class file "cmds.add(getInstallDir().getAbsolutePath())" line is adding the extra parameter.

Apart from this,I also observed that, as part of building the Server Classpath for the AUT, it uses all the libraries supplied by Jubula as "org.eclipse.jubula.tools.jar" instead of actually referring to the jar file with the appropriate version. Hence it is not able to find all the required jars.


Could you please help me on where I am going wrong in the configurations (or) any other settings to be done to run the Junit correctly.

Really appreciate your help and thanks in advance.
Re: Unable to run a Java based unit test example [message #1824372 is a reply to message #1824230] Tue, 14 April 2020 14:55 Go to previous messageGo to next message
sreesowmya telikipalli is currently offline sreesowmya telikipalliFriend
Messages: 6
Registered: April 2020
Junior Member
Hi Team,

Still stuck on this issue. Any help on this is really appreciated. Still my embedded AUT agent wont work. Not sure whether i am missign something.
Re: Unable to run a Java based unit test example [message #1826161 is a reply to message #1824372] Mon, 20 April 2020 14:04 Go to previous messageGo to next message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 223
Registered: March 2012
Senior Member
I have added a example with jubula and junit 5 which is simpler then the OSGI one.
This is a eclipse Projekt and the Test can run via the Junit 5 test execution in eclipse.

The project attached is a proof of concept to show how it can run and may have bugs. In the future it will be released in the git repositories and also the other examples might need to be reworked.

As for integrating it into CI oder CD i have only done this once with maven. This is a little bit of effort since the jars in the lib folder must be all in one directory for Jubula to run correctly.

If you want to run it via maven have a look at the maven failsafe plugin and the additionalClasspathElements. This might not be the best solution but this is the way i did it the last time.

Some Information of the project.
JubulaJunitExtension -> handles the AUT and Agent lifecycle. E.g. that on an error the application ist restarted
AUTs -> holds the information how to start the AUT
OM -> holfs the information about the Jubla Object Mapping

best regards
Marvin Mueller
Re: Unable to run a Java based unit test example [message #1826423 is a reply to message #1826161] Fri, 24 April 2020 16:30 Go to previous messageGo to next message
sreesowmya telikipalli is currently offline sreesowmya telikipalliFriend
Messages: 6
Registered: April 2020
Junior Member
Thank you.Attached example worked perfectly.Could you please let us know which version of Jubula core API is used.
Re: Unable to run a Java based unit test example [message #1826887 is a reply to message #1826423] Mon, 04 May 2020 05:57 Go to previous message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 223
Registered: March 2012
Senior Member
The API Version is from the Jubula Jubula 8.7.1 installer
Previous Topic:Executing Javafx 11
Next Topic:Jubula Connecting to backend database
Goto Forum:
  


Current Time: Thu Aug 13 06:23:15 GMT 2020

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

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

Back to the top