ClassCastException during running swtbot test with ant [message #482413] |
Wed, 26 August 2009 13:21 |
Michelle Davidson Messages: 41 Registered: August 2009 |
Member |
|
|
Hello,
I have done the two video tutorials from the swtbot website and I read the tipps from the website http://wiki.eclipse.org/SWTBot/Ant
But, when I start my test with ant. The Test application (eclipse IDE) starts but my tests dont run and I get this exception
Quote: | Total time: 57 seconds
C:\eclipse4test\headlessEclipse>ant
Buildfile: build.xml
init:
suite:
[delete] Deleting directory C:\eclipse4test\headlessEclipse\workspace
init:
swtbot-test:
java-test:
[echo] Running testpackage.FirstTestCase. Result file: C:/eclipse4test/headlesseclipse/results/testpackage.FirstTes tCase.xml.
[java] Exception in thread "WorkbenchTestable" java.lang.ClassCastException: org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultF ormatter cannot be cast to junit.framework.TestListener
[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:619)
collect-results:
[junitreport] the file C:\eclipse4test\headlesseclipse\testpackage.FirstTestCase.xm l 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\headlesseclipse\results
cleanup:
run:
|
This ist my build.xml
<?xml version="1.0" encoding="UTF-8" ?>
<project name="testsuite" default="run" basedir=".">
<property name="eclipse-home" value="C:/eclipse4test/headlesseclipse" />
<property name="plugin-name" value="aaa.swtbot.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="class-name" value="testpackage.FirstTestCase" />
<target name="init">
<tstamp />
<delete>
<fileset dir="${eclipse-home}" includes="org*.xml" />
</delete>
</target>
<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="plugin-name" value="${plugin-name}" />
<property name="testProduct" value="org.eclipse.sdk.ide" />
<property name="classname" value="${class-name}" />
<property name="os" value="win32" />
<property name="ws" value="win32" />
<property name="arch" value="x86" />
<property name="formatter" value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter" />
<property name="vmargs" value="-Xms40m -Xmx256m" />
</ant>
</target>
<target name="cleanup" />
<target name="run" depends="init,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>
Is there a wrong parameter in thebuild.xml or must I have another version of a plugin? Or is there another error?
The tests run when I launch the class in eclipse as swtbottest.
[Updated on: Wed, 26 August 2009 13:25] Report message to a moderator
|
|
|
|
|
|
|
|
Re: ClassCastException during running swtbot test with ant [message #482806 is a reply to message #482780] |
Fri, 28 August 2009 06:27 |
Michelle Davidson Messages: 41 Registered: August 2009 |
Member |
|
|
Hello,
Unfortunaly that hasn't any effect.
I still get the same exception, after the eclipse IDE has start, and the tests should launch.
I don't know If there was a problem, with the generation of the testreports.
I have the versions of ant, junit, log4j which where standard in the eclipse 3.4.2 destribution. Are these versions too old.
Could this be the reason?
Is there a chance to deactivate the testreports so that I can check, if the tests will launch?
Yes In eclipse, all will be fine. The tests run, and in the junit view I see,, if they was ok or not.
|
|
|
Re: ClassCastException during running swtbot test with ant [message #483781 is a reply to message #482806] |
Wed, 02 September 2009 23:01 |
Derek Messages: 30 Registered: July 2009 |
Member |
|
|
Michelle Davidson wrote:
> Hello,
> Unfortunaly that hasn't any effect.
> I still get the same exception, after the eclipse IDE has start, and the
tests should launch.
> I don't know If there was a problem, with the generation of the testreports.
> I have the versions of ant, junit, log4j which where standard in the eclipse
3.4.2 destribution. Are these versions too old.
> Could this be the reason?
> Is there a chance to deactivate the testreports so that I can check, if the
tests will launch?
> Yes In eclipse, all will be fine. The tests run, and in the junit view I
see,, if they was ok or not.
The part in your build.xml:
<property name="formatter"
value=" org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultF ormatter "
/>
I don't know what that's doing, I don't have that in mine.
Will your tests run if you take that out?
|
|
|
|
|
|
|
Re: ClassCastException during running swtbot test with ant [message #536318 is a reply to message #535909] |
Thu, 27 May 2010 15:54 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
Can you identify these as failures of a particular type ?
Something like menu clicks (this is an issue), certain buttons cannot be
clicked on certain dialogs, anything else you see as a pattern ?
It could also be an environment issue, see
http://wiki.eclipse.org/SWTBot/CI_Server for more.
Cheers!
--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot
On 5/26/10 2:28 AM, Laurent Redor wrote:
> Hello,
>
> I had the same problem : sometimes the Hudson job works and sometimes it
> fails and nothing changed between this two jobs.
> Although I have only installed
> org.eclipse.swtbot.eclipse.junit4.headless_* and
> org.eclipse.swtbot.ant.optional.junit4_*.
>
> I removed the fragment org.eclipse.ant.optional.junit_*.jar from the
> eclipse-test-framework.
>
> I also removed the fragment org.pluginbuilder.ant.optional.junit_*.jar
> from the org.pluginbuilder.autotestsuite framework.
>
> Now my hudson job works each times.
>
> Regards,
>
> Laurent
>
> Denis Golovin a écrit :
>> If you Eclipse Test Framework installed, than
>> org.eclipse.ant.optional.junit_*.jar should be deleted to fix this
>> problem. I had the same problem which was even worst, because this
>> happened for me sometimes, even if previous build was successful an
>> nothing changed for next one.
>> I works for me after org.eclipse.ant.optional.junit_*.jar was deleted.
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05873 seconds