Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Testing RCP Applications
Testing RCP Applications [message #44083] Mon, 20 July 2009 10:45 Go to next message
Denis Ungemach is currently offline Denis UngemachFriend
Messages: 3
Registered: July 2009
Junior Member
I try to test a RCP-Application (com.dmissoh.rcp.mail, it`s the mail
samplecode from the Plugin-Wizard). The test works in eclipse, but it
doesn`t work in console with an ant script and the exported product.

Both videotutorials worked fine, but after i`ve changed the details of the
ant script to the mail product it didn`t work anymore.
build.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<project name="testsuite" default="run" basedir="." >
<property name="eclipse-home" value="C:\SWTBotTest\Mail" />
<property name="plugin-name" value="swtbot.example" />
<property name="test-classname" value="MyFirstTest" />
<property name="library-file"
value=" ${eclipse-home}\plugins\org.eclipse.swtbot.eclipse.junit4.he adless_2.0.0.371-dev-e35\library.xml "
/>
<target name="suite" >
<property name="jvmOption" value="" ></property>
<property name="temp-workspace" value="workspace" />
<delete dir="${temp-workspace}" quiet="true" />
<ant target="swtbot-test" antfile="${library-file}" dir="${eclipse-home}"
>
<property name="data-dir" value="${temp-workspace}" />
<property name="testProduct" value="com.dmissoh.rcp.mail.product" />
<property name="plugin-name" value="${plugin-name}" />
<property name="os" value="win32" />
<property name="ws" value="win32" />
<property name="arch" value="x86" />
<property name="classname" value="swtbot.example.MyFirstTest" />
<property name="vmargs" value="-Xms128M -XX:MaxPermSize=512m -Xmx512M" />
</ant>
</target>
<target name="cleanup" />

<target name="run" depends="suite,cleanup">
</target>
</project>

report:
Install location:
file:/c:/SWTBotTest/Mail/
Configuration file:
file:/c:/SWTBotTest/Mail/configuration/config.ini loaded
Configuration location:
file:/c:/SWTBotTest/Mail/configuration/
Framework located:

file:/c:/SWTBotTest/Mail/plugins/org.eclipse.osgi_3.4.3.R34x _v20081215-1030.jar
Framework classpath:

file:/c:/SWTBotTest/Mail/plugins/org.eclipse.osgi_3.4.3.R34x _v20081215-1030.jar
Debug options:
file:/C:/SWTBotTest/Mail/.options not found
Time to load bundles: 15
Starting application: 1094
!SESSION 2009-07-20 12:31:32.093
-----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments: -application
org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -product
com.dmissoh.rcp.mail.product
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,C:\SWTBotTest\Mail/swtbot.example.MyFirst Test.xml
formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter
-testPluginName swtbot.example -className swtbot.example.MyFirstTest
Command-line arguments: -application
org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -product
com.dmissoh.rcp.mail.product -data workspace
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,C:\SWTBotTest\Mail/swtbot.example.MyFirst Test.xml
formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter
-testPluginName swtbot.example -className swtbot.example.MyFirstTest -os
win32 -ws win32 -arch x86 -consoleLog -debug

!ENTRY org.eclipse.osgi 4 0 2009-07-20 12:31:33.250
!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:
com.dmissoh.rcp.mail.application, org.eclipse.equinox.app.error.
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:386)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
at org.eclipse.core.launcher.Main.main(Main.java:30)
Re: Testing RCP Applications [message #44119 is a reply to message #44083] Mon, 20 July 2009 11:36 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
On 20/7/09 16:15, Denis Ungemach wrote:
> I try to test a RCP-Application (com.dmissoh.rcp.mail, it`s the mail
> samplecode from the Plugin-Wizard). The test works in eclipse, but it
> doesn`t work in console with an ant script and the exported product.
>
> Both videotutorials worked fine, but after i`ve changed the details of
> the ant script to the mail product it didn`t work anymore.

<snipped/>

> java.lang.RuntimeException: Application
> " org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion " could
> not be found in the registry. The applications available are:
> com.dmissoh.rcp.mail.application, org.eclipse.equinox.app.error.

To execute the headless tests, you'll need to additionally download the
'headless testing framework' from the download site. Before you execute
the tests, knock off the junit3 (or junit4) plugins from the headless
plugin.

--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
Re: Testing RCP Applications [message #44426 is a reply to message #44119] Tue, 21 July 2009 07:02 Go to previous message
Denis Ungemach is currently offline Denis UngemachFriend
Messages: 3
Registered: July 2009
Junior Member
> To execute the headless tests, you'll need to additionally download the
> 'headless testing framework' from the download site. Before you execute
> the tests, knock off the junit3 (or junit4) plugins from the headless
> plugin.

I downloaded them and i did everything in the same way i did in the
tutorial, but i found my mistake. This time i added the plugins

(org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
org.eclipse.swtbot.eclipse.ui;bundle-version="2.0.0",
org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
swtbot.example;bundle-version="1.0.0" (my testplugin),
org.hamcrest;bundle-version="1.1.0",
org.junit4;bundle-version="4.3.1",
org.eclipse.swtbot.eclipse.junit4.headless;bundle-version="2.0.0 ")

to the dependencies of the plugin and then i exported the product, now its
working. The last time i just copied them in the plugins-directory of my
product.

I think , if i just copy these plugins to the exported product, i have to
change the configuration.

Thanks anyway.
Previous Topic:SWTBot test progress is intermittent?
Next Topic:SWTBot and context menus
Goto Forum:
  


Current Time: Thu Jan 02 18:30:13 GMT 2025

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

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

Back to the top