Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Headless Test with Maven/Tycho(Headless Test with Maven/Tycho)
Headless Test with Maven/Tycho [message #1738840] Mon, 25 July 2016 11:47 Go to next message
Vivek Veera is currently offline Vivek VeeraFriend
Messages: 18
Registered: July 2015
Junior Member
Hi,

I am trying to run SWTBot tests on my RCP application in Headless mode. I have put below configuration in pom.xml of my Tests plugin. Are there any other configuration changes I need to make to get it working.

How can I verify on the command prompt if these tests are executed or not in headless mode. I don't see any tests related logs when I run maven build. Any help is appreciated.

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>0.24.0</version>
<configuration>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<product>com.foo.bar.plugin.product</product>
<application>com.foo.bar.plugin.application</application>
</configuration>
</plugin>
</plugins>
</build>


Thanks.
Vivek
Re: Headless Test with Maven/Tycho [message #1738946 is a reply to message #1738840] Tue, 26 July 2016 09:19 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1751
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 25/07/2016 13:47, Vivek Veera wrote:
> Hi,
>
> I am trying to run SWTBot tests on my RCP application in Headless mode.
> I have put below configuration in pom.xml of my Tests plugin. Are there
> any other configuration changes I need to make to get it working.
>
> How can I verify on the command prompt if these tests are executed or
> not in headless mode. I don't see any tests related logs when I run
> maven build. Any help is appreciated.
>
> <build>
> <plugins>
> <plugin>
> <groupId>org.eclipse.tycho</groupId>
> <artifactId>tycho-surefire-plugin</artifactId>
> <version>0.24.0</version>
> <configuration>
> <useUIHarness>true</useUIHarness>
> <useUIThread>false</useUIThread>
> <product>com.foo.bar.plugin.product</product>
> <application>com.foo.bar.plugin.application</application>
> </configuration>
> </plugin>
> </plugins>
> </build>
>

How do you run the maven build?

Something like mvn clean verify?

Are your test classes named something like XXXTest.java? Because that's
the default behavior of the surefire plugin: execute all the classes
that ends with "Test".

cheers
Lorenzo

--
Prof. Lorenzo Bettini, Computer Science, DISIA, Univ. Firenze
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: Headless Test with Maven/Tycho [message #1739008 is a reply to message #1738946] Tue, 26 July 2016 18:28 Go to previous messageGo to next message
Vivek Veera is currently offline Vivek VeeraFriend
Messages: 18
Registered: July 2015
Junior Member
Thank you Lorenzo for the response.

Yes, all my Tests are named as XXXTest.java and placed them under src/test/java inside my Test plugin. I have mentioned packaging type for test plugin as 'eclipse-test-plugin'

I tried running build with 'mvn clean test' command initially but Tests are not run with this and build completes with SUCCESS.

I think Tycho surefire plugin executes tests in 'integration-test' phase therefore it does not pick SWTBot tests in 'test' phase. But I get below dependency error when I use 'mvn clean integration-test' or 'mvn clean verify' commands. I doubt if this is the correct command to use for executing my SWTBot tests using Tycho surefire plugin.

I need some help in getting the correct configuration and maven build commands for running my SWTBot tests using Tycho surefire plugin.

Here is the error it throws for my test plugin (com.foo.bar.tests)

[INFO] --- tycho-surefire-plugin:0.24.0:test (default-test) @ com.foo.bar.tests ---
[INFO] {osgi.ws=gtk, osgi.os=linux, osgi.arch=x86, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR] You requested to install 'bundle org.eclipse.ui.ide.application 0.0.0' but it could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------


Thanks.
Vivek

[Updated on: Tue, 26 July 2016 18:30]

Report message to a moderator

Re: Headless Test with Maven/Tycho [message #1739267 is a reply to message #1739008] Fri, 29 July 2016 08:28 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1751
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 26/07/2016 20:28, Vivek Veera wrote:
> Thank you Lorenzo for the response.

Hi

comments inline

>
> Yes, all my Tests are named as XXXTest.java and placed them under
> src/test/java inside my Test plugin. I have mentioned packaging type for
> test plugin as 'eclipse-test-plugin'
>
> I tried running build with 'mvn clean test' command initially but Tests
> are not run with this and build completes with SUCCESS.
>
> I think Tycho surefire plugin executes tests in 'integration-test' phase
> therefore it does not pick SWTBot tests in 'test' phase. But I get

that's right: you need to run

mvn clean verify

> below dependency error when I use 'mvn clean integration-test' or 'mvn
> clean verify' commands. I doubt if this is the correct command to use
> for executing my SWTBot tests using Tycho surefire plugin.
>
> I need some help in getting the correct configuration and maven build
> commands for running my SWTBot tests using Tycho surefire plugin.
>
> Here is the error it throws for my test plugin (com.foo.bar.tests)

well you need that in your target platform.

Are you using a target platform in your eclipse workspace?

cheers
Lorenzo

>
> [INFO] --- tycho-surefire-plugin:0.24.0:test (default-test) @
> com.foo.bar.tests ---
> [INFO] {osgi.ws=gtk, osgi.os=linux, osgi.arch=x86,
> org.eclipse.update.install.features=true}
> [ERROR] Cannot resolve project dependencies:
> [ERROR] You requested to install 'bundle
> org.eclipse.ui.ide.application 0.0.0' but it could not be found
> [ERROR]
> [ERROR] See
> http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for
> help.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
>
>


--
Prof. Lorenzo Bettini, Computer Science, DISIA, Univ. Firenze
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: Headless Test with Maven/Tycho [message #1739448 is a reply to message #1739267] Mon, 01 August 2016 17:04 Go to previous message
Vivek Veera is currently offline Vivek VeeraFriend
Messages: 18
Registered: July 2015
Junior Member
Thanks Lorenzo. Yes, I am using target platform and this bundle (org.eclipse.ui.ide.application) is included in it.

Thanks.
Vivek
Previous Topic:Combination of Parameterized and SWTBotJunit4 runners
Next Topic:Timeout Issues in SWTBot Tests
Goto Forum:
  


Current Time: Tue Sep 18 19:07:04 GMT 2018

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

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

Back to the top