Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » headless swtbot does not find testproject
headless swtbot does not find testproject [message #495908] Fri, 06 November 2009 15:31 Go to next message
Sandor Szuecs is currently offline Sandor SzuecsFriend
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 #496016 is a reply to message #495908] Sat, 07 November 2009 04:39 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Sandor Szuecs wrote:

> [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 junit.framework.TestListener

The class is not found because of a class cast exception. Loading of the
class byte code itself failed in this case. Perhaps you have a mismatch
of junit versions.

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
Re: headless swtbot does not find testproject [message #496085 is a reply to message #496016] Sun, 08 November 2009 11:47 Go to previous messageGo to next message
Sandor Szuecs is currently offline Sandor SzuecsFriend
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 11:47]

Report message to a moderator

Re: headless swtbot does not find testproject [message #500414 is a reply to message #496085] Thu, 26 November 2009 02:02 Go to previous messageGo to next message
Eclipse UserFriend
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 #500433 is a reply to message #500414] Thu, 26 November 2009 07:35 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
Yao Qi wrote:

> Ketan, We may change Setup section like this,

It's a wiki, feel free to edit, esp when it's an error :)

-- Ketan
Re: headless swtbot does not find testproject [message #500919 is a reply to message #500433] Mon, 30 November 2009 10:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: qiyaoltc.gmail.com

Ketan Padegaonkar <ketanpadegaonkar@gmail.com> writes:

> Yao Qi wrote:
>
>> Ketan, We may change Setup section like this,
>
> It's a wiki, feel free to edit, esp when it's an error :)

Done!! :)



Best Regards

--
Yao Qi <qiyaoltc AT gmail DOT com> GNU/Linux Developer
http://duewayqi.googlepages.com/

Yes, we will be going to OSI, Mars, and Pluto, but not necessarily in
that order.
-- Jeffrey Honig
Re: headless swtbot does not find testproject [message #503305 is a reply to message #500919] Fri, 11 December 2009 18:02 Go to previous messageGo to next message
Tino is currently offline TinoFriend
Messages: 8
Registered: July 2009
Junior Member
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
Re: headless swtbot does not find testproject [message #506668 is a reply to message #495908] Fri, 08 January 2010 15:51 Go to previous messageGo to next message
Tino is currently offline TinoFriend
Messages: 8
Registered: July 2009
Junior Member
This is still a show stopper for me. Any ideas how to solve this problem without removing junit3 or junit4 from the plugins directory?

Thanks for your help.

Tino
Re: headless swtbot does not find testproject [message #506701 is a reply to message #503305] Fri, 08 January 2010 20:56 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
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
Previous Topic:swtbot 2.0 and eclipse 3.3
Next Topic:log4j warnings
Goto Forum:
  


Current Time: Thu Oct 29 08:56:22 GMT 2020

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

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

Back to the top