Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot via the Command Line
SWTBot via the Command Line [message #1856705] Fri, 23 December 2022 14:47 Go to next message
Zac Hamid is currently offline Zac HamidFriend
Messages: 7
Registered: August 2022
Junior Member
We are looking to put our SWTbot Suite into CI, and for that we need to be able to run the tests via CLI. I am currently executing them via Eclipse (JUnit Test Plugin), successfully.

I have attempted copying the CLI command from the Run Configuration window and running them via the CLI and hitting this issue

/home/<username>/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_17.0.3.v20220515-1416/jre/bin/java  -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true  -Declipse.pde.launch=true  -Declipse.p2.data.area=@config.dir/p2  --add-modules=ALL-SYSTEM  -Dfile.encoding=UTF-8  -p <module,paths>  -classpath <classpath>  -XX:+ShowCodeDetailsInExceptionMessages org.eclipse.equinox.launcher.Main  -os linux  -ws gtk  -arch x86_64  -nl en_US  -consoleLog  -version 3  -port 32855  -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader  -loaderpluginname org.eclipse.jdt.junit5.runtime  -classNames <testplugin>.AllTests  -application org.eclipse.pde.junit.runtime.nonuithreadtestapplication  -product org.eclipse.platform.ide  -data /home/<username>/eclipse-workspace/../junit-workspace  -configuration file:/home/<username>/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/pde-junit/  -dev file:/home/<username>/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/pde-junit/dev.properties  -os linux  -ws gtk  -arch x86_64  -nl en_US  -consoleLog  -testpluginname <testplugin>


The error message I get is:
Could not connect to:  : 32855			
java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:633)
	at java.base/java.net.Socket.connect(Socket.java:583)
        ....


Is there a better way to run JUnit5 SWTbot tests, or should I convert them to JUnit4
Re: SWTBot via the Command Line [message #1856786 is a reply to message #1856705] Mon, 02 January 2023 12:53 Go to previous messageGo to next message
Aparna Argade is currently offline Aparna ArgadeFriend
Messages: 60
Registered: October 2010
Member
Hi Zac,
JUnit5 tests can be run from command line, it is not needed to convert them to Junit4. Use "-application org.eclipse.swtbot.eclipse.junit5.headless.swtbottestapplication"
See https://wiki.eclipse.org/SWTBot/Automate_test_execution for rest all params.
Re: SWTBot via the Command Line [message #1856808 is a reply to message #1856786] Tue, 03 January 2023 16:06 Go to previous message
Zac Hamid is currently offline Zac HamidFriend
Messages: 7
Registered: August 2022
Junior Member
Thanks Aparna, I think that is progressing nicely, although I am now getting a different error message around unresolved dependencies so I will look into that

[Updated on: Tue, 03 January 2023 16:47]

Report message to a moderator

Previous Topic:SWTBot doesn't seem to see the "Show View" Shell
Next Topic:Headless Testing on Github
Goto Forum:
  


Current Time: Fri Apr 26 17:08:37 GMT 2024

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

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

Back to the top