Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Running SWTBot headless on Linux
Running SWTBot headless on Linux [message #545797] Fri, 09 July 2010 08:19 Go to next message
Gabriel Petrovay is currently offline Gabriel PetrovayFriend
Messages: 42
Registered: July 2009
Member
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 17:22]

Report message to a moderator

Re: Running SWTBot headless on Linux [message #548472 is a reply to message #545797] Thu, 22 July 2010 02:42 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
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 #548499 is a reply to message #548472] Thu, 22 July 2010 07:56 Go to previous messageGo to next message
Gabriel Petrovay is currently offline Gabriel PetrovayFriend
Messages: 42
Registered: July 2009
Member
Thanks Ketan for your answer I will come back today with more details after I test what you suggested.

One more question to understand the context where you run in headless mode. Are you doing it from the command line NOT in X Server? I do it either from a cron job or from a shell to which I connect through ssh without x forwarding.

Does this work for you?

Thanks!

Gabriel

[Updated on: Thu, 22 July 2010 07:58]

Report message to a moderator

Re: Running SWTBot headless on Linux [message #548654 is a reply to message #548499] Thu, 22 July 2010 14:57 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Hi Gabriel,

I'd suggest getting the command line to work before throwing in xvfb in
the mix -- too many moving parts might be confusing :)

In my case I have a build agent running on linux, which spins off a
window manager on say display port :3. The agent merely sets the DISPLAY
environment variable to match up the display port so that the tests run
on the correct X server.

I'm not familiar with Xvfb, but you'd need to ensure that there's a
window manager like gnome/kde/xfce running. Just a dummy X server with
no window manager will not work.

You may try running the following to see if there's a window manager
running (from http://goo.gl/Sm7j):

$ Xvfb :1 &
$ gnome-terminal -display :1 &
$ xwd -display :1 -root -out image.xwd

See http://wiki.eclipse.org/SWTBot/CI_Server for more information about
this kind of a setup.

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

On 7/22/10 12:56 AM, Gabriel Petrovay wrote:
> Thanks Ketan for your answer I will come back today with more details
> after I test what you said.
>
> One more question to understand the context where you run in headless
> mode. Are you doing it from the command line NOT in X Server? I do it
> either from a cron job or from a shell to which I connect through ssh
> without x forwarding.
>
> This is what work for you?
>
> Thanks!
>
> Gabriel
Re: Running SWTBot headless on Linux [message #558424 is a reply to message #548654] Sun, 12 September 2010 17:58 Go to previous messageGo to next message
Gabriel Petrovay is currently offline Gabriel PetrovayFriend
Messages: 42
Registered: July 2009
Member
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 23:15 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
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
>
Previous Topic:Issues with tree widget
Next Topic:When will SWTBot come out of the incubation phase?
Goto Forum:
  


Current Time: Fri Mar 29 10:45:51 GMT 2024

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

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

Back to the top