Home » Eclipse Projects » SWTBot » Running SWTBot headless on Linux
Running SWTBot headless on Linux [message #545797] |
Fri, 09 July 2010 04:19  |
Eclipse User |
|
|
|
Hi,
I am trying to test a set of plugins that are packaged in an eclipse product. The test environment in a 64-bit Ubuntu machine. I am using Eclipse 3.5 and SWTBot with JUnit 4.
This is what I want to achieve: Have a nightly cronjob that tests the Eclipse product.
This is what I do:
1. I take the Linux 64-bit version of the product.
2. I copy all the SWTBot plugins ("SWTBot for Eclipse Testing" and "Headless JUnit 4.x Testing Framework (for running tests from within ant)") in the plugins directory of my product
3. Because I don't know all the dependency tree of SWTBot, I copy all the eclipse 3.5 (classic distribution) plugins in the plugins directory of my product.
4. I run the command (as instructed by the SWTBot Wiki):
xvfb-run java -Xms128M -Xmx368M -XX:MaxPermSize=256M -DPLUGIN_PATH= -classpath " $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.0.201.R 35x_v20090715.jar " org.eclipse.core.launcher.Main -application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -data test-workspace formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,/home/sausalito/eclipse_system/temp/resul ts.xml formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter -testPluginName com.28msec.sausalito.ui.tests -className $TEST_CLASS -os linux -ws gtk -arch x86_64 -consoleLog -debug
The "xvfb-run" command allows me to run in UI mode from the console line (it loads all the necessary gtk libraries for example and redirects the display to nowhere)
The problem is that i get the error: Application " org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion " could not be found in the registry
!ENTRY org.eclipse.osgi 4 0 2010-07-09 09:55:17.920
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application " org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion " could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.artifact.repository.mirrorApplication , org.eclipse.equinox.p2.director.app.application, org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.garbagecollector.application, org.eclipse.equinox.p2.metadata.generator.EclipseGenerator, org.eclipse.equinox.p2.metadata.repository.mirrorApplication , org.eclipse.equinox.p2.publisher.InstallPublisher, org.eclipse.equinox.p2.publisher.ProductPublisher, org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher , org.eclipse.equinox.p2.reconciler.application, org.eclipse.equinox.p2.repository.repo2runnable, org.eclipse.equinox.p2.updatesite.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.CategoryPublisher, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, org.eclipse.ui.ide.workbench, org.eclipse.update.core.standaloneUpdate, org.eclipse.update.core.siteOptimizer.
at org.eclipse.equinox.internal.app.EclipseAppContainer.startDe faultApp(EclipseAppContainer.java:242)
at org.eclipse.equinox.internal.app.MainApplicationLauncher.run (MainApplicationLauncher.java:29)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
at org.eclipse.core.launcher.Main.main(Main.java:34)
1. I run the eclipse/eclipse product for the first time, and I understand that the app registry is written in the configuration directory the first time you run eclipse. Why am I getting this error? (I can post more details if you need)
2. Is this the correct approach for headless UI testing in nightly/continous/integration/etc. builds?
Thanks!
[Updated on: Sun, 12 September 2010 13:22] by Moderator
|
|
|
Re: Running SWTBot headless on Linux [message #548472 is a reply to message #545797] |
Wed, 21 July 2010 22:42   |
Eclipse User |
|
|
|
Hi Gabriel,
There's quite a few things that could be wrong here:
* missing dependencies of swtbot
* missing the plugin containing
org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion
Looking at the command line, I can also see that you're missing a
-testApplication command line argument.
Here's the command line I use to run tests: http://goo.gl/f945 and it
seems to work about fine.
-- Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot | @ketanpkr
On 7/9/10 1:19 AM, Gabriel Petrovay wrote:
> Hi,
>
> I am trying to test a set of plugins that are packaged in an eclipse
> product. The test environment in a 64-bit Ubuntu machine. I am using
> Eclipse 3.5 and SWTBot with JUnit 4.
>
> This is what I want to achieve: Have a nightly cronjob that tests the
> Eclipse product.
>
> This is what I do:
> 1. I take the Linux 64-bit version of the product.
> 2. I copy all the SWTBot plugins ("SWTBot for Eclipse Testing" and
> "Headless JUnit 4.x Testing Framework (for running tests from within
> ant)") in the plugins directory of my product
> 3. Because I don't know all the dependency tree of SWTBot, I copy all
> the eclipse 3.5 (classic distribution) plugins in the plugins directory
> of my product.
> 4. I run the command (as instructed by the SWTBot Wiki):
> xvfb-run java -Xms128M -Xmx368M -XX:MaxPermSize=256M -DPLUGIN_PATH=
> -classpath "
> $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.0.201.R
> 35x_v20090715.jar " org.eclipse.core.launcher.Main -application
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -data
> test-workspace
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU
> nitResultFormatter,/home/sausalito/eclipse_system/temp/resul ts.xml
> formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain
> JUnitResultFormatter -testPluginName com.28msec.sausalito.ui.tests
> -className $TEST_CLASS -os linux -ws gtk -arch x86_64 -consoleLog -debug
>
> The "xvfb-run" command allows me to run in UI mode from the console line
> (it loads all the necessary gtk libraries for example and redirects the
> display to nowhere)
>
>
> The problem is that i get the error: Application "
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion "
> could not be found in the registry
>
> !ENTRY org.eclipse.osgi 4 0 2010-07-09 09:55:17.920
> !MESSAGE Application error
> !STACK 1
> java.lang.RuntimeException: Application "
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion "
> could not be found in the registry. The applications available are:
> org.eclipse.ant.core.antRunner, org.eclipse.equinox.app.error,
> org.eclipse.equinox.p2.artifact.repository.mirrorApplication ,
> org.eclipse.equinox.p2.director.app.application,
> org.eclipse.equinox.p2.director,
> org.eclipse.equinox.p2.garbagecollector.application,
> org.eclipse.equinox.p2.metadata.generator.EclipseGenerator,
> org.eclipse.equinox.p2.metadata.repository.mirrorApplication ,
> org.eclipse.equinox.p2.publisher.InstallPublisher,
> org.eclipse.equinox.p2.publisher.ProductPublisher,
> org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher ,
> org.eclipse.equinox.p2.reconciler.application,
> org.eclipse.equinox.p2.repository.repo2runnable,
> org.eclipse.equinox.p2.updatesite.UpdateSitePublisher,
> org.eclipse.equinox.p2.publisher.UpdateSitePublisher,
> org.eclipse.equinox.p2.publisher.CategoryPublisher,
> org.eclipse.help.base.infocenterApplication,
> org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool,
> org.eclipse.ui.ide.workbench, org.eclipse.update.core.standaloneUpdate,
> org.eclipse.update.core.siteOptimizer.
> at org.eclipse.equinox.internal.app.EclipseAppContainer.startDe
> faultApp(EclipseAppContainer.java:242)
> at org.eclipse.equinox.internal.app.MainApplicationLauncher.run
> (MainApplicationLauncher.java:29)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .runApplication(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher
> .start(EclipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:616)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
> at org.eclipse.core.launcher.Main.main(Main.java:34)
>
>
> 1. I run the eclipse/eclipse product for the first time, and I
> understand that the app registry is written in the configuration
> directory the first time you run eclipse. Why am I getting this error?
> (I can post more details if you need)
> 2. Is this the correct approach for headless UI testing in
> nightly/continous/integration/etc. builds?
>
> Thanks!
|
|
| | |
Re: Running SWTBot headless on Linux [message #558424 is a reply to message #548654] |
Sun, 12 September 2010 13:58   |
Eclipse User |
|
|
|
Hi Ketan,
After a long search in the last couple of days, I finally found the problem why the swtbotapplication was not found.
In the eclipse/configuration/org.eclipse.equinox.simpleconfigurator /bundles.info there was this line:
org.eclipse.equinox.p2.reconciler.dropins,1.1.0.v20100525,pl ugins/org.eclipse.equinox.p2.reconciler.dropins_1.1.0.v20100 525.jar,4,false
instead of:
org.eclipse.equinox.p2.reconciler.dropins,1.1.0.v20100525,pl ugins/org.eclipse.equinox.p2.reconciler.dropins_1.1.0.v20100 525.jar,4,true
The last parameter, which is Auto-Start, was set to false. This meant that eclipse did not automatically load the plug-in responsible with the finding of copied plug-ins in the "dropins" and "plugins" folders. Therefore, the copied SWTBot plug-ins and their dependencies were never loaded or considered for loading. So, no "org.eclipse.swtbot.eclipse.junit4.headless" plug-in, no " org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion ".
Now that I found the problem, I am still looking for the solution: how to make Eclipse generate an Eclipse-based product that has mark the "org.eclipse.equinox.p2.reconciler.dropins" plug-in with Auto-Start: true.
In case you don't know the solution, probably you know somebody who might.
Cheers,
Gabriel
|
|
|
Re: Running SWTBot headless on Linux [message #558449 is a reply to message #558424] |
Sun, 12 September 2010 19:15  |
Eclipse User |
|
|
|
I don't know most of the black magic that p2 does. Things that work in
one version don't work in some other versions.
The workaround that I do for such issues is to automagically alter such
config files after they are generated.
Sorry but I don't know any other solution. But you could ask the p2
forums to see what happens.
--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot
On 9/12/10 10:58 AM, Gabriel Petrovay wrote:
> Hi Ketan,
>
> After a long search in the last couple of days, I finally found the
> problem why the swtbotapplication was not found.
>
> In the eclipse/configuration/org.eclipse.equinox.simpleconfigurator
> /bundles.info there was this line:
>
> org.eclipse.equinox.p2.reconciler.dropins,1.1.0.v20100525,pl
> ugins/org.eclipse.equinox.p2.reconciler.dropins_1.1.0.v20100
> 525.jar,4,false
>
> instead of:
>
> org.eclipse.equinox.p2.reconciler.dropins,1.1.0.v20100525,pl
> ugins/org.eclipse.equinox.p2.reconciler.dropins_1.1.0.v20100 525.jar,4,true
>
> The last parameter, which is Auto-Start, was set to false. This meant
> that eclipse did not automatically load the plug-in responsible with the
> finding of copied plug-ins in the "dropins" and "plugins" folders.
> Therefore, the copied SWTBot plug-ins and their dependencies were never
> loaded or considered for loading. So, no
> "org.eclipse.swtbot.eclipse.junit4.headless" plug-in, no "
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion ".
>
> Now that I found the problem, I am still looking for the solution: how
> to make Eclipse generate an Eclipse-based product that has mark the
> "org.eclipse.equinox.p2.reconciler.dropins" plug-in with Auto-Start: true.
>
> In case you don't know the solution, probably you know somebody who might.
>
> Cheers,
> Gabriel
>
|
|
|
Goto Forum:
Current Time: Mon May 05 07:51:21 EDT 2025
Powered by FUDForum. Page generated in 0.03390 seconds
|