| headless swtbot does not find testproject [message #495908] |
Fri, 06 November 2009 10:31  |
Sandor Szuecs Messages: 2 Registered: November 2009 |
Junior Member |
|
|
I tested on Mac OS X and on windows. Both tests works when I start them from inside Eclipse, not from CLI (or Ant).
To test in Eclipse I start org.eclipsecon.swtbot.example.AllTests as swtbot Test.
I followed the headless screencast and http://wiki.eclipse.org/SWTBot/Ant#Executing, but I don't really understand why.
On OSX it crashes with a SIGTRAP caused bylibswt-cocoa-carbon-3452.jnilib, I think that's maybe a problem from Apple's implementation.
On windows I get an error that the Test class was not found [1].
The commands I used on windows:
set ECLIPSE_HOME=D:\eclipse_saros
set TEST_CLASS=org.eclipsecon.swtbot.example.AllTests
set CLASSPATH=%ECLIPSE_HOME%\plugins\org.eclipse.equinox.launche r_1.0.101.R34x_v20081125.jar;D:\tmp\foo_workspace\org.eclips econ.swtbot.example\bin;%ECLIPSE_HOME%\plugins\org.eclipseco n.swtbot.example_1.0.0.jar
java -Xms256M -Xmx256M -XX:MaxPermSize=128M -DPLUGIN_PATH=D:\eclipse_saros\plugins -classpath %ECLIPSE_HOME%\plugins\org.eclipse.equinox.launcher_1.0.101. R34x_v20081125.jar;bin org.eclipse.core.launcher.Main -application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -data workspace formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,%ECLIPSE_HOME%/%TEST_CLASS%.xml formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter -testPluginName de.fu_berlin.inf.dpp -className %TEST_CLASS% -arch x86 -consoleLog -debug
[1] Class not found "org.eclipsecon.swtbot.example.AllTests"
Exception in thread "WorkbenchTestable" java.lang.ClassCastException: org.apache
.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter cannot be cast to jun
it.framework.TestListener
at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner .run(Ecli
pseTestRunner.java:331)
at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner .run(Ecli
pseTestRunner.java:208)
at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .runTests
(UITestApplication.java:115)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTest
able.java:68)
at java.lang.Thread.run(Unknown Source)
I hope you can help me, thanks
Sandor.
|
|
|
|
| Re: headless swtbot does not find testproject [message #496085 is a reply to message #496016] |
Sun, 08 November 2009 06:47   |
Sandor Szuecs Messages: 2 Registered: November 2009 |
Junior Member |
|
|
| Ketan Padegaonkar wrote on Fri, 06 November 2009 23:39 |
Did you delete the junit4 (or junit3) fragments supplied by swtbot as
described in the setup section of the wiki ? Do you have the
'org.eclipse.ant.optional.junit' fragment in your workspace ?
-- Ketan
|
I delete org.junit_3.8.2.* from plaugins folder and now it runs.
I thought it was not necessary, because on http://wiki.eclipse.org/SWTBot/Ant it was not mentioned. There is said only to use *.swtbot.*.junit4 (or 3).
I don't have 'org.eclipse.ant.optional.junit' on my workspace, do I need it?
Thanks and greets Sandor.
[Updated on: Sun, 08 November 2009 06:47] Report message to a moderator
|
|
|
| Re: headless swtbot does not find testproject [message #500414 is a reply to message #496085] |
Wed, 25 November 2009 21:02   |
|
Originally posted by: qiyaoltc.gmail.com
Sandor Szuecs <sandor.szuecs@fu-berlin.de> writes:
> Ketan Padegaonkar wrote on Fri, 06 November 2009 23:39
>> Sandor Szuecs wrote:
>>
>> Did you delete the junit4 (or junit3) fragments supplied by swtbot as
>> described in the setup section of the wiki ? Do you have the
>> 'org.eclipse.ant.optional.junit' fragment in your workspace ?
>>
>> -- Ketan
>
>
> I delete org.junit_3.8.2.* from plaugins folder and now it runs.
> I thought it was not necessary, because on
> http://wiki.eclipse.org/SWTBot/Ant it was not mentioned. There is said
> only to use *.swtbot.*.junit4 (or 3).
Sandor, I agree that we should add this in wiki page
http://wiki.eclipse.org/SWTBot/Ant
Some people get the same trouble for several times.
Ketan, We may change Setup section like this,
Setup
Your folder structure should look like the following:
ECLIPSE_HOME
+ plugins
| - com.yourplugins
| - ...
| - ...
| - org.eclipse.swtbot.swt.finder
| - org.eclipse.swtbot.eclipse.finder
| - org.hamcrest (and other dependencies)
| - ...
| - ...
| - org.eclipse.swtbot.ant.optional.junit4 (or junit3, but not both) (from the Headless Testing Framework)
| - org.eclipse.swtbot.eclipse.junit4.headless (or junit3.headless, but not both) (from the Headless Testing Framework)
| - org.junit4 (or org.junit, but not both)
+ features
Do you agree on this change?
Best Regards
--
Yao Qi <qiyaoltc AT gmail DOT com> GNU/Linux Developer
http://duewayqi.googlepages.com/
They seem to have learned the habit of cowering before authority even when
not actually threatened. How very nice for authority. I decided not to
learn this particular lesson.
-- Richard Stallman
|
|
|
|
|
|
|
| Re: headless swtbot does not find testproject [message #506701 is a reply to message #503305] |
Fri, 08 January 2010 15:56  |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
You need not delete the junit 3.8.2 plugin from your plugins directory.
See the SWTBot Troubleshooting guide on how to fix this[1].
-- Ketan
[1] -
http://wiki.eclipse.org/SWTBot/Troubleshooting#Exception_in_ thread_.22WorkbenchTestable
On 12/11/09 10:02 AM, Tino wrote:
> I have exactly the same ClassCastException.
>
> But I can't remove junit 3.8.2 from my Eclipse plugins directory,
> because it's used by other plugins.
>
> And I don't get it why I have to remove it. I thougt this is the big
> deal with OSGI that you can have plugins in different versions in your
> plugin directory. And your Manifest defines the right version for your
> plugin.
> Do you make some Classloader hacks in SWTBot or why is it necessary?
>
> Kind regards
> Tino
|
|
|
Powered by
FUDForum. Page generated in 0.01784 seconds