Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Running SWTBot testcase with ant(Error during running swtbot Testcase withhin eclipse)
Running SWTBot testcase with ant [message #479464] Tue, 11 August 2009 08:32 Go to next message
speedracer  is currently offline speedracer
Messages: 19
Registered: August 2009
Junior Member
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 #479493 is a reply to message #479464] Tue, 11 August 2009 10:21 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
On 11/8/09 14:02, speedracer wrote:
>> [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)

See http://wiki.eclipse.org/SWTBot/Ant#Setup

--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
Re: Running SWTBot testcase with ant [message #479508 is a reply to message #479493] Tue, 11 August 2009 11:07 Go to previous message
speedracer  is currently offline speedracer
Messages: 19
Registered: August 2009
Junior Member
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.
Previous Topic:expandNode delays
Next Topic:Re: [swtbot-dev] Welcome Mariot Chauvin as a new technology.swtbot Committer
Goto Forum:
  


Current Time: Sat Oct 25 18:10:31 GMT 2014

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

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