Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » formatter option does not allow test cases to run
formatter option does not allow test cases to run [message #633302] Sat, 16 October 2010 06:54 Go to next message
Ravi  is currently offline Ravi
Messages: 7
Registered: October 2010
Junior Member
Hi All

If I user the "formatter"parameter in the CLI for launching the application in headless option then SWTBot does not execute the tests. It gives the following exception:

java -Xms256M -Xmx512M -XX:MaxPermSize=512M -classpath "C:\Program Files\Gale Technologies\GaleForce\plugins\org.eclipse.equinox.launcher_ 1.0.200.v20090520.jar " org.eclipse.core.launcher.Main -application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -testApplication com.lm.uc.app.application -data test-workspace formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,results.xml formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain JUnitResultFormatter -testPluginName com.galetechnologies.qa.uc.test -className MySecondTestCase -os win32 -ws win32 -arch x86 -consoleLog -debug > abc.log 2>&1

Exception in thread "WorkbenchTestable" java.lang.NoClassDefFoundError: junit/framework/TestListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:183)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:576)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:546)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:477)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass_LockClassLoader(ClasspathManager.java:465)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:445)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:211)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass (BundleLoader.java:376)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:452)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:405)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:393)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:183)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:576)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:546)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:477)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass_LockClassLoader(ClasspathManager.java:465)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:445)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:211)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass (BundleLoader.java:376)
at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadCla ss(SingleSourcePackage.java:33)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:440)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:405)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:393)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner .createFormatter(EclipseTestRunner.java:455)
at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner .createAndStoreFormatter(EclipseTestRunner.java:437)
at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner .run(EclipseTestRunner.java:179)
at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .runTests(UITestApplication.java:153)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:71)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: junit.framework.TestListener
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:489)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:405)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:393)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 39 more


I think "org.apache.tools.ant.taskdefs.optional.junit.*" depends upon Junit which can not use as I am using Junit4 for my test cases.
Re: formatter option does not allow test cases to run [message #633414 is a reply to message #633302] Sun, 17 October 2010 15:44 Go to previous message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
It's likely that you have some stray dependencies that are wiring up
your ant to use junit3's TestListener instead of junit 4's TestListener
which causes this error.

The solution is described here: http://goo.gl/e4Br

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr


On 10/15/10 11:55 PM, Ravi wrote:
> Hi All
> If I user the "formatter"parameter in the CLI for launching the
> application in headless option then SWTBot does not execute the tests.
> It gives the following exception:
>
> java -Xms256M -Xmx512M -XX:MaxPermSize=512M -classpath "C:\Program
> Files\Gale Technologies\GaleForce\plugins\org.eclipse.equinox.launcher_
> 1.0.200.v20090520.jar " org.eclipse.core.launcher.Main -application
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion
> -testApplication com.lm.uc.app.application -data test-workspace
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU
> nitResultFormatter,results.xml
> formatter=org.apache.tools.ant.taskdefs.optional.junit.Plain
> JUnitResultFormatter -testPluginName com.galetechnologies.qa.uc.test
> -className MySecondTestCase -os win32 -ws win32 -arch x86 -consoleLog
> -debug > abc.log 2>&1
>
> Exception in thread "WorkbenchTestable" java.lang.NoClassDefFoundError:
> junit/framework/TestListener
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(Unknown Source)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def
> ineClass(DefaultClassLoader.java:183)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC
> lass(ClasspathManager.java:576)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla
> ssImpl(ClasspathManager.java:546)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc
> alClassImpl(ClasspathManager.java:477)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc
> alClass_LockClassLoader(ClasspathManager.java:465)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc
> alClass(ClasspathManager.java:445)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin
> dLocalClass(DefaultClassLoader.java:211)
> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass
> (BundleLoader.java:376)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter
> nal(BundleLoader.java:452)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:405)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:393)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa
> dClass(DefaultClassLoader.java:105)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(Unknown Source)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def
> ineClass(DefaultClassLoader.java:183)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC
> lass(ClasspathManager.java:576)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla
> ssImpl(ClasspathManager.java:546)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc
> alClassImpl(ClasspathManager.java:477)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc
> alClass_LockClassLoader(ClasspathManager.java:465)
> at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc
> alClass(ClasspathManager.java:445)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin
> dLocalClass(DefaultClassLoader.java:211)
> at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass
> (BundleLoader.java:376)
> at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadCla
> ss(SingleSourcePackage.java:33)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter
> nal(BundleLoader.java:440)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:405)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:393)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa
> dClass(DefaultClassLoader.java:105)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner
> .createFormatter(EclipseTestRunner.java:455)
> at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner
> .createAndStoreFormatter(EclipseTestRunner.java:437)
> at org.eclipse.swtbot.eclipse.junit4.headless.EclipseTestRunner
> .run(EclipseTestRunner.java:179)
> at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication
> .runTests(UITestApplication.java:153)
> at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work
> benchTestable.java:71)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException: junit.framework.TestListener
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter
> nal(BundleLoader.java:489)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:405)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund
> leLoader.java:393)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa
> dClass(DefaultClassLoader.java:105)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 39 more
>
>
> I think "org.apache.tools.ant.taskdefs.optional.junit.*" depends upon
> Junit which can not use as I am using Junit4 for my test cases.
Previous Topic:java.lang.NoClassDefFoundError: junit/framework/TestListener
Next Topic:"Run as SWTBot Test" missing
Goto Forum:
  


Current Time: Wed Oct 01 14:22:15 GMT 2014

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

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