Running SWTBot testcase with ant [message #479464] |
Tue, 11 August 2009 04:32  |
Eclipse User |
|
|
|
Hello
I try to test a RCP-Application (org.rcpmail) For this plugin, I create a own testPluign. I get this both plugins from the swtbot development repository
The test works in eclipse, but it doesn`t work in console with an ant script and the exported product.
I have copied the exportet mail and test plugin in my eclipse home plugin directory.
Here is my plugin.xml
<?xml version="1.0" encoding="UTF-8" ?>
<project name="testsuite" default="run" basedir=".">
<property name="eclipse-home" value="C:/eclipse4test/eclipse" />
<property name="plugin-name" value="org.rcpmail.test" />
<property name="library-file" value="${eclipse-home}/plugins/org.eclipse.swtbot.eclipse.junit4.headless_2.0.0.371-dev-e34/library.xml"/>
<property name="test-classname" value="org.rcpmail.MessageCreateTest"/>
<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="org.rcpmail.product" />
<property name="testApplication" value="org.rcpmail.application" />
<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="${test-classname}" />
<property name="vmargs" value=" -Xms128M -Xmx512M -XX:MaxPermSize=512M ${jvmOption}" />
</ant>
</target>
<target name="cleanup" />
<target name="run" depends="suite,cleanup">
<ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
<property name="includes" value="*.xml" />
<property name="output-file" value="${plugin-name}.xml" />
</ant>
</target>
</project>
When I run the build.xml the application (org.rcpmail) start, but the testcase will not run.
In the console there was this Class cast exception.
Quote: | Buildfile: build.xml
suite:
init:
swtbot-test:
java-test:
[echo] Running org.rcpmail.MessageCreateTest. Result file: C:/eclipse4test/eclipse/results/org.rcpmail.MessageCreateTes t.xml.
[java] Exception in thread "WorkbenchTestable" java.lang.ClassCastException: org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultF ormatter
[java] at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner .run(EclipseTestRunner.java:331)
[java] at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner .run(EclipseTestRunner.java:208)
[java] at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .runTests(UITestApplication.java:115)
[java] at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
[java] at java.lang.Thread.run(Thread.java:595)
collect-results:
[junitreport] the file C:\eclipse4test\eclipse\org.rcpmail.MessageCreateTest.xml is empty.
[junitreport] This can be caused by the test JVM exiting unexpectedly
[style] Warning: the task name <style> is deprecated. Use <xslt> instead.
[style] Transforming into C:\eclipse4test\eclipse\results
cleanup:
run:
collect:
[junitreport] the file C:\eclipse4test\eclipse\AllTests.xml is empty.
[junitreport] This can be caused by the test JVM exiting unexpectedly
[junitreport] the file C:\eclipse4test\eclipse\artifacts.xml is not a valid testsuite XML document
[junitreport] the file C:\eclipse4test\eclipse\org.rcpmail.AllTests.xml is empty.
[junitreport] This can be caused by the test JVM exiting unexpectedly
[junitreport] the file C:\eclipse4test\eclipse\org.rcpmail.MessageCreateTest.xml is empty.
[junitreport] This can be caused by the test JVM exiting unexpectedly
[junitreport] the file C:\eclipse4test\eclipse\org.rcpmail.test.AllTests.xml is empty.
[junitreport] This can be caused by the test JVM exiting unexpectedly
[junitreport] the file C:\eclipse4test\eclipse\org.rcpmail.test.xml is not a valid testsuite XML document
BUILD SUCCESSFUL
Total time: 45 seconds
|
What can I do, that I can run this test within eclipse.
|
|
|
|
Re: Running SWTBot testcase with ant [message #479508 is a reply to message #479493] |
Tue, 11 August 2009 07:07  |
Eclipse User |
|
|
|
Hello,
thanks for the answer.
I have read this tutorial and have changed these build xml to generate my own.
But I can not see, what I have forgotten.
I have the two Plugins for headless juint4 test, I have the build xml. Where is my mistake.
Please help me.
|
|
|
Powered by
FUDForum. Page generated in 0.03464 seconds