Launch SWTBot test on generated RCP product [message #509152] |
Thu, 21 January 2010 09:24  |
Eclipse User |
|
|
|
Hello,
I try to test my RCP application with SWTBot.
When I launch my tests with my product (Run As "SWTBot test"), my tests are running. Nevertheless I would like to test a generated product that users will use.
So, I export my SWTBot test plugin and Igenerate a RCP product. I add :
SWTBot plugins
org.eclipse.swtbot.eclipse.junit4.headless
org.eclipse.swtbot.ant.optional.junit4.jar
my exported test plugin
to the plugins directory.
I add this to my .product file
<feature id="myswtbotPlugin"/>
<feature id="org.eclipse.swtbot"/>
<feature id="org.eclipse.swtbot.eclipse"/>
<feature id="org.eclipse.swtbot.eclipse.test"/>
And I create Ant to launch my test on my genereted RCP.
The build.xml is:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="testsuite" default="run" basedir=".">
<property name="eclipse-home" value="E:/RCP/SWTBot"/>
<property name="plugin-name" value="myswtbotPlugin"/>
<property name="test-classname" value="MyTest"/>
<property name="library-file" value="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.187-dev/library.xml"/>
<target name="suite">
<property name="jvmOption" value=""></property>
<property name="temp-workspace" value="workspace" />
<ant target="swtbot-test" antfile="${library-file}" dir="${eclipse-home}">
<property name="data-dir" value="${temp-workspace}" />
<property name="plugin-name" value="${plugin-name}" />
<property name="os" value="win32" />
<property name="ws" value="workspace" />
<property name="arch" value="x86" />
<property name="classname" value="${test-classname}" />
<property name="vmargs" value=" -Xms128M -XX:MaxPermSize=512M -Xmx512M"/>
</ant>
</target>
<target name="cleanup" />
<target name="run" depends="suite,cleanup">
</target>
</project>
But I have the following error :
Quote: | java.lang.RuntimeException: Application " org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion " could not be found in the registry.
|
I look at http://wiki.eclipse.org/SWTBot/Troubleshooting but I don't know what I have forgotten.
Can someone help me please?
Thanks,
David.
|
|
|
|
Re: Launch SWTBot test on generated RCP product [message #510013 is a reply to message #509575] |
Tue, 26 January 2010 03:34  |
Eclipse User |
|
|
|
Hi linlei ,
thanks for your answer.
But have I to add your code Quote: | <antcall>...<antcall/>
| to mine or to replace my code with yourth?
Besides, I would like to know if ${launchTarget} is the install path to my generated product, and if "my application" is my product or my genetated exe.
ex :
<property name="launchTarget" value="E:/RCP/SWTBot"/>
<property name="application" value="myrcp.exe"/>
Thanks a lot,
David.
|
|
|
Powered by
FUDForum. Page generated in 0.04930 seconds