Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Problems running tutorial from command line on Linux
Problems running tutorial from command line on Linux [message #632801] Thu, 14 October 2010 10:28 Go to next message
Geoff Bache is currently offline Geoff BacheFriend
Messages: 33
Registered: October 2010
Member
Hi all,

I'm trying to make the tutorial tests (rcpmail example) work from the command line on Linux by following the instructions here:

http://wiki.eclipse.org/SWTBot/Ant

It works fine from within Eclipse.

Like many others before me I ran into this exception:

java.lang.RuntimeException: Application " org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion " could not be found in the registry. The applications available are: ...

I have downloaded and unzipped the headless testing framework, and placed it with my other plugins.

I did notice though that Eclipse had installed the SWTbot jars under
/users/geoff/.eclipse/org.eclipse.platform_3.5.0_28590886/pl ugins

while when I ran from the command line it created a new directory under
/users/geoff/.eclipse/org.eclipse.platform_3.5.0_1498612367

and said it was using the configuration from there. So I removed the newly created directory and made it into a symbolic link to the one containing my plugins.

Will stuff in this plugins directory be picked up magically or does it need to be added to the classpath jar by jar?

Thanks for any advice.
/Geoff

Here is my full script:

#!/bin/sh

export ECLIPSE_HOME=/usr/local/eclipse-SDK-3.5.2/eclipse
export ECLIPSE_PERSONAL=/users/geoff/.eclipse/org.eclipse.platform_ 3.5.0_28590886/plugins
#/users/geoff/.eclipse/org.eclipse.platform_3.5.0_28590886
export TEST_CLASS=org.rcpmail.test.MessageCreateTest
# see http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/ AllTests.java for an example
export TEST_APPLICATION_ID=org.rcpmail # the id of the application that needs to be tested
export WORKSPACE=/users/geoff/tmp/swtbot_workspace
# TEST_PRODUCT_ID=com.yourcompany.product # optional, if you're not using a product, please do not add the -product argument in the command below
export TEST_PLUGIN_ID=org.rcpmail.test
export OS=linux
export WS=gtk
export ARCH=x86_64

java \
-Xms256M -Xmx768M -XX:MaxPermSize=512M \
-classpath $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.0.201.R 35x_v20090715.jar:${ECLIPSE_PERSONAL}/org.eclipse.swtbot.ecl ipse.junit4.headless_2.0.0.595-dev-e35:${ECLIPSE_PERSONAL}/o rg.eclipse.swtbot.ant.optional.junit4_2.0.0.595-dev-e35.jar: ${ECLIPSE_PERSONAL}/org.eclipse.swtbot.eclipse.core_2.0.0.59 5-dev-e35.jar:${ECLIPSE_PERSONAL}/org.eclipse.swtbot.eclipse .finder_2.0.0.595-dev-e35.jar:${ECLIPSE_PERSONAL}/org.eclips e.swtbot.junit4_x_2.0.0.595-dev-e35.jar \
org.eclipse.core.launcher.Main \
-application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion \
-testApplication $TEST_APPLICATION_ID \
-data $WORKSPACE \
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,$ECLIPSE_HOME/$TEST_CLASS.xml \
formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter \
-testPluginName $TEST_PLUGIN_ID \
-className $TEST_CLASS \
-os $OS -ws $WS -arch $ARCH \
-consoleLog -debug

and this is what it says:

Install location:
file:/usr/local/eclipse-SDK-3.5.2/eclipse/
Configuration file:
file:/usr/local/eclipse-SDK-3.5.2/eclipse/configuration/conf ig.ini loaded
Configuration location:
file:/users/geoff/.eclipse/org.eclipse.platform_3.5.0_149861 2367/configuration/
Configuration file:
file:/users/geoff/.eclipse/org.eclipse.platform_3.5.0_149861 2367/configuration/config.ini loaded
Shared configuration location:
file:/usr/local/eclipse-SDK-3.5.2/eclipse/configuration/
Framework located:
file:/usr/local/eclipse-SDK-3.5.2/eclipse/plugins/org.eclips e.osgi_3.5.2.R35x_v20100126.jar
Framework classpath:
file:/usr/local/eclipse-SDK-3.5.2/eclipse/plugins/org.eclips e.osgi_3.5.2.R35x_v20100126.jar
Debug options:
file:/nfs/vm/texttest/geoff/Testing/Automatic/lh_cms/.option s not found
Time to load bundles: 7
Starting application: 1267
!SESSION 2010-10-14 12:14:41.026 -----------------------------------------------
eclipse.buildId=M20100211-1343
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -testApplication org.rcpmail formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,/usr/local/eclipse-SDK-3.5.2/eclipse/org. rcpmail.test.MessageCreateTest.xml formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter -testPluginName org.rcpmail.test -className org.rcpmail.test.MessageCreateTest
Command-line arguments: -application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -testApplication org.rcpmail -data /users/geoff/tmp/swtbot_workspace formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,/usr/local/eclipse-SDK-3.5.2/eclipse/org. rcpmail.test.MessageCreateTest.xml formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter -testPluginName org.rcpmail.test -className org.rcpmail.test.MessageCreateTest -os linux -ws gtk -arch x86_64 -consoleLog -debug

!ENTRY org.eclipse.osgi 4 0 2010-10-14 12:14:42.327
!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.ant.ui.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.jdt.apt.core.aptBuild, org.eclipse.jdt.core.JavaCodeFormatter, org.eclipse.pde.build.Build, org.eclipse.pde.junit.runtime.uitestapplication, org.eclipse.pde.junit.runtime.legacytestapplication, org.eclipse.pde.junit.runtime.coretestapplication, org.eclipse.pde.junit.runtime.coretestapplicationnonmain, org.eclipse.pde.junit.runtime.nonuithreadtestapplication, 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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)

Re: Problems running tutorial from command line on Linux [message #632879 is a reply to message #632801] Thu, 14 October 2010 14:36 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
I believe you're using some form of a shared install with eclipse
installed in /usr/local and the rest of the plugins installed in your
home dir.

I'm not sure if the headless testing framework works with this kind of
an install. I've certainly never tried it, or seen someone report that
they have.

Would it be possible to not use a shared install for testing rcp based
apps ?

Also a few glitches (mostly because of my bad documentation skills):

* ECLIPSE_HOME should point to the root of the app under test
* ECLIPSE_HOME should contain all the plugins listed in the ant tutorial

Also point 8 onwards at a blog entry on
http://www.bonitasoft.org/blog/eclipse/swtbot-my-new-friend/ documents
something that you may use to integrate fully into your pde build
scripts to run tests headless.

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

On 10/14/10 3:29 AM, Geoff Bache wrote:
> Hi all,
>
> I'm trying to make the tutorial tests (rcpmail example) work from the
> command line on Linux by following the instructions here:
>
> http://wiki.eclipse.org/SWTBot/Ant
>
> It works fine from within Eclipse.
>
> Like many others before me I ran into this exception:
>
> java.lang.RuntimeException: Application "
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion "
> could not be found in the registry. The applications available are: ...
>
> I have downloaded and unzipped the headless testing framework, and
> placed it with my other plugins.
>
> I did notice though that Eclipse had installed the SWTbot jars under
> /users/geoff/.eclipse/org.eclipse.platform_3.5.0_28590886/pl ugins
>
> while when I ran from the command line it created a new directory under
> /users/geoff/.eclipse/org.eclipse.platform_3.5.0_1498612367
>
> and said it was using the configuration from there. So I removed the
> newly created directory and made it into a symbolic link to the one
> containing my plugins.
>
> Will stuff in this plugins directory be picked up magically or does it
> need to be added to the classpath jar by jar?
>
> Thanks for any advice.
> /Geoff
>
> Here is my full script:
>
> #!/bin/sh
>
> export ECLIPSE_HOME=/usr/local/eclipse-SDK-3.5.2/eclipse
> export ECLIPSE_PERSONAL=/users/geoff/.eclipse/org.eclipse.platform_
> 3.5.0_28590886/plugins
> #/users/geoff/.eclipse/org.eclipse.platform_3.5.0_28590886
> export TEST_CLASS=org.rcpmail.test.MessageCreateTest # see
> http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/ AllTests.java
> for an example
> export TEST_APPLICATION_ID=org.rcpmail # the id of the application that
> needs to be tested
> export WORKSPACE=/users/geoff/tmp/swtbot_workspace
> # TEST_PRODUCT_ID=com.yourcompany.product # optional, if you're not
> using a product, please do not add the -product argument in the command
> below
> export TEST_PLUGIN_ID=org.rcpmail.test
> export OS=linux
> export WS=gtk
> export ARCH=x86_64
>
> java \
> -Xms256M -Xmx768M -XX:MaxPermSize=512M \
> -classpath $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.0.201.R
> 35x_v20090715.jar:${ECLIPSE_PERSONAL}/org.eclipse.swtbot.ecl
> ipse.junit4.headless_2.0.0.595-dev-e35:${ECLIPSE_PERSONAL}/o
> rg.eclipse.swtbot.ant.optional.junit4_2.0.0.595-dev-e35.jar:
> ${ECLIPSE_PERSONAL}/org.eclipse.swtbot.eclipse.core_2.0.0.59
> 5-dev-e35.jar:${ECLIPSE_PERSONAL}/org.eclipse.swtbot.eclipse
> .finder_2.0.0.595-dev-e35.jar:${ECLIPSE_PERSONAL}/org.eclips
> e.swtbot.junit4_x_2.0.0.595-dev-e35.jar \
> org.eclipse.core.launcher.Main \
> -application
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion \
> -testApplication $TEST_APPLICATION_ID \
> -data $WORKSPACE \
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU
> nitResultFormatter,$ECLIPSE_HOME/$TEST_CLASS.xml \
> formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain
> JUnitResultFormatter \
> -testPluginName $TEST_PLUGIN_ID \
> -className $TEST_CLASS \
> -os $OS -ws $WS -arch $ARCH \
> -consoleLog -debug
>
> and this is what it says:
>
> Install location:
> file:/usr/local/eclipse-SDK-3.5.2/eclipse/
> Configuration file:
> file:/usr/local/eclipse-SDK-3.5.2/eclipse/configuration/conf ig.ini loaded
> Configuration location:
> file:/users/geoff/.eclipse/org.eclipse.platform_3.5.0_149861
> 2367/configuration/
> Configuration file:
> file:/users/geoff/.eclipse/org.eclipse.platform_3.5.0_149861
> 2367/configuration/config.ini loaded
> Shared configuration location:
> file:/usr/local/eclipse-SDK-3.5.2/eclipse/configuration/
> Framework located:
> file:/usr/local/eclipse-SDK-3.5.2/eclipse/plugins/org.eclips
> e.osgi_3.5.2.R35x_v20100126.jar
> Framework classpath:
> file:/usr/local/eclipse-SDK-3.5.2/eclipse/plugins/org.eclips
> e.osgi_3.5.2.R35x_v20100126.jar
> Debug options:
> file:/nfs/vm/texttest/geoff/Testing/Automatic/lh_cms/.option s not found
> Time to load bundles: 7
> Starting application: 1267
> !SESSION 2010-10-14 12:14:41.026
> -----------------------------------------------
> eclipse.buildId=M20100211-1343
> java.version=1.6.0_21
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
> Framework arguments: -application
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion
> -testApplication org.rcpmail
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU
> nitResultFormatter,/usr/local/eclipse-SDK-3.5.2/eclipse/org.
> rcpmail.test.MessageCreateTest.xml
> formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain
> JUnitResultFormatter -testPluginName org.rcpmail.test -className
> org.rcpmail.test.MessageCreateTest
> Command-line arguments: -application
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion
> -testApplication org.rcpmail -data /users/geoff/tmp/swtbot_workspace
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU
> nitResultFormatter,/usr/local/eclipse-SDK-3.5.2/eclipse/org.
> rcpmail.test.MessageCreateTest.xml
> formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain
> JUnitResultFormatter -testPluginName org.rcpmail.test -className
> org.rcpmail.test.MessageCreateTest -os linux -ws gtk -arch x86_64
> -consoleLog -debug
>
> !ENTRY org.eclipse.osgi 4 0 2010-10-14 12:14:42.327
> !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.ant.ui.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.jdt.apt.core.aptBuild,
> org.eclipse.jdt.core.JavaCodeFormatter, org.eclipse.pde.build.Build,
> org.eclipse.pde.junit.runtime.uitestapplication,
> org.eclipse.pde.junit.runtime.legacytestapplication,
> org.eclipse.pde.junit.runtime.coretestapplication,
> org.eclipse.pde.junit.runtime.coretestapplicationnonmain,
> org.eclipse.pde.junit.runtime.nonuithreadtestapplication,
> 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:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> 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)
>
>
Re: Problems running tutorial from command line on Linux [message #633027 is a reply to message #632879] Fri, 15 October 2010 07:16 Go to previous messageGo to next message
Geoff Bache is currently offline Geoff BacheFriend
Messages: 33
Registered: October 2010
Member
Hi Ketan,

Thanks for the assistance. You are right that I'm using a shared install, and I can of course try again with a fresh personal install. If it assumes that ECLIPSE_HOME contains all of Eclipse, SWTBot and the application under test then it's clearly not going to work in this environment. I don't think our sysadmins will be too happy about everyone maintaining their own Eclipse installation if we ever use this for real but I'm only experimenting at the moment.

Should I report this as a bug do you think?

/Geoff

Ketan Padegaonkar wrote on Thu, 14 October 2010 10:36
I believe you're using some form of a shared install with eclipse
installed in /usr/local and the rest of the plugins installed in your
home dir.

I'm not sure if the headless testing framework works with this kind of
an install. I've certainly never tried it, or seen someone report that
they have.

Would it be possible to not use a shared install for testing rcp based
apps ?

Also a few glitches (mostly because of my bad documentation skills):

* ECLIPSE_HOME should point to the root of the app under test
* ECLIPSE_HOME should contain all the plugins listed in the ant tutorial

Also point 8 onwards at a blog entry on
http://www.bonitasoft.org/blog/eclipse/swtbot-my-new-friend/ documents
something that you may use to integrate fully into your pde build
scripts to run tests headless.

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

Re: Problems running tutorial from command line on Linux [message #633169 is a reply to message #633027] Fri, 15 October 2010 14:31 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
On 10/15/10 12:16 AM, Geoff Bache wrote:
> Hi Ketan,
>
> Thanks for the assistance. You are right that I'm using a shared
> install, and I can of course try again with a fresh personal install. If
> it assumes that ECLIPSE_HOME contains all of Eclipse, SWTBot and the
> application under test then it's clearly not going to work in this
> environment. I don't think our sysadmins will be too happy about
> everyone maintaining their own Eclipse installation if we ever use this
> for real but I'm only experimenting at the moment.
> Should I report this as a bug do you think?
>
> /Geoff

I'd suggest opening a bug against equinox that the launcher is unable to
find plugins when launched using the headless test runner.

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr
Previous Topic:how to click a Coolbar item in SWTbot
Next Topic:Failed to start test application with "Application Error" message
Goto Forum:
  


Current Time: Thu Dec 18 21:51:48 GMT 2014

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

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