SWTBot Jenkins Integration for SWT Standalone App [message #741733] |
Wed, 19 October 2011 21:06 |
Steve Messages: 2 Registered: October 2011 |
Junior Member |
|
|
Hi, I wrote an application that is NOT a plug-in. It uses SWT and runs outside of eclipse as a standalone application. I downloaded SWTBot, wrote a SWTBot test case that sure-enough runs just fine inside of eclipse when I right-click on it and select "Run as...JUnit test" (so far, so good). Now I want to be able to run it as part of our build process, but when I tried to follow the documentation on running it in headless mode using ant, it complains that I have not specified the name of a plug-in. My SWT app is NOT a plugin. So, I encapsulated my test cases inside of a plug-in according to the SWTBot 5-min video, putting my SWT app (the one I want to test that's in another eclipse project) on my SWTBot plug-in's build path...and again..when I run it inside eclipse it runs just fine, BUT when I go to export the plug-in, it says (understandably) that it cannot resolve the classes from my standalone app (the one in the other eclipse project, the one i want to test with SWTBot). My next attempt was going to be to include the standalone app's jar file in the SWTBot plugin, export the plug-in, and then use the headless ant target (with my SWTBot test plugin name). But I'm not even sure that will work. Isn't there a better way for me to do this? Re-including the jar file in the plugin and re-exporting the plugin just so I can use the headless ant target each time we have a build seems ridicuously complicated and impractible. How am I supposed to integrate SWTBot with a standalone SWT app that's not a plugin or RCP(?) for inclusion in Jenkins?
|
|
|
Re: SWTBot Jenkins Integration for SWT Standalone App [message #745868 is a reply to message #741733] |
Sun, 23 October 2011 03:34 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
The SWTBot instructions to run as a headless ant script are meant for
plugin based tests. Since you're using plain old SWT+SWTBot you'd need
something similar to the script that SWTBot uses (http://goo.gl/RD4JT)
You basically need to write another java project(not plugin project) in
your workspace that contains your test sources and dependencies.
You'd of-course need some
stuff(http://ant.apache.org/manual/Tasks/javac.html) to compile your
tests before you run the tests.
-- Ketan
On 10/20/11 2:36 AM, Steve wrote:
> Hi, I wrote an application that is NOT a plug-in. It uses SWT and runs
> outside of eclipse as a standalone application. I downloaded SWTBot,
> wrote a SWTBot test case that sure-enough runs just fine inside of
> eclipse when I right-click on it and select "Run as...JUnit test" (so
> far, so good). Now I want to be able to run it as part of our build
> process, but when I tried to follow the documentation on running it in
> headless mode using ant, it complains that I have not specified the name
> of a plug-in. My SWT app is NOT a plugin. So, I encapsulated my test
> cases inside of a plug-in according to the SWTBot 5-min video, putting
> my SWT app (the one I want to test that's in another eclipse project) on
> my SWTBot plug-in's build path...and again..when I run it inside eclipse
> it runs just fine, BUT when I go to export the plug-in, it says
> (understandably) that it cannot resolve the classes from my standalone
> app (the one in the other eclipse project, the one i want to test with
> SWTBot). My next attempt was going to be to include the standalone app's
> jar file in the SWTBot plugin, export the plug-in, and then use the
> headless ant target (with my SWTBot test plugin name). But I'm not even
> sure that will work. Isn't there a better way for me to do this?
> Re-including the jar file in the plugin and re-exporting the plugin just
> so I can use the headless ant target each time we have a build seems
> ridicuously complicated and impractible. How am I supposed to integrate
> SWTBot with a standalone SWT app that's not a plugin or RCP(?) for
> inclusion in Jenkins?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03253 seconds