Cannot find class in classpath

1,005 views
Skip to first unread message

testng...@opensymphony.com

unread,
May 5, 2005, 12:46:27 PM5/5/05
to testng...@googlegroups.com
I am trying to run my first simple testng test via the eclipse plugin. I added the annotations and created a run configuration for the single test class, but get the exception below. I am /not/ using any xml file. Do I need to?

thanks

----

===============================================
org.blackboxtrader.liquidityarbitrage.openingorder.ByPriceOpeningOrderManagerTest
Total tests run: 0, Failures: 0, Skips: 0
===============================================

Exception in thread "main" com.beust.testng.TestNGException: Cannot find class in classpath: org.blackboxtrader.liquidityarbitrage.openingorder.ByPriceOpeningOrderManagerTest
at com.beust.testng.xml.XmlClass.getSupportClass(XmlClass.java:44)
at com.beust.testng.internal.Utils.xmlClassesToClasses(Utils.java:126)
at com.beust.testng.TestRunner.initMethods(TestRunner.java:224)
at com.beust.testng.TestRunner.init(TestRunner.java:164)
at com.beust.testng.TestRunner.init(TestRunner.java:133)
at com.beust.testng.TestRunner.<init>(TestRunner.java:111)
at com.beust.testng.eclipse.runner.RemoteTestNG$2.newTestRunner(RemoteTestNG.java:79)
at com.beust.testng.SuiteRunner.privateRun(SuiteRunner.java:119)
at com.beust.testng.SuiteRunner.run(SuiteRunner.java:87)
at com.beust.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:98)
at com.beust.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:137)

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1972&messageID=6072#6072

Cedric Beust

unread,
May 5, 2005, 12:52:36 PM5/5/05
to testng...@googlegroups.com
No, testng.xml has probably nothing to do with your problem, it must be a
simple Eclipse configuration issue.

Is ByPriceOPeningOrderManagerTest in your build path at all? (try
Ctrl-Shift-t and see if you can look it up there).

Also, what does the build path for your run configuration look like? Does
it use the default entries?

--
Cédric

testng...@opensymphony.com

unread,
May 5, 2005, 12:56:34 PM5/5/05
to testng...@googlegroups.com
I had my test methods annotated as: ' @Test(groups={"utest"})'. I change this to simply: '@Test' and the test runs correctly.

I then changed it back, and selected the 'utest' group in the run configuration, and that worked as well.

So it seems that its just a confusing exception message. The class clearly could be found, but not any tests without any group.

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1972&messageID=6074#6074

Alexandru Popescu

unread,
May 5, 2005, 1:47:57 PM5/5/05
to testng...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think in the project directory you can find an xml file. Can you paste it?

:alex |.::the_mindstorm::.|
- --
<<<<<<<<<<<<<<<<<<<--->>>>>>>>>>>>>>>>>>>
#:there are no problems, only solutions:#
<<<<<<<<<<<<<<<<<<<--->>>>>>>>>>>>>>>>>>>

#: testng...@opensymphony.com said :: 5/5/2005 6:46 PM :#
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCelxNOCPjdDT2FEURAj2OAJ9VcIvMqLie/tL0n6nmVQvy8Z9a2ACgtvdk
//rIOjke8juzOaJvw8YhoC4=
=9AsG
-----END PGP SIGNATURE-----

testng...@opensymphony.com

unread,
May 5, 2005, 1:32:49 PM5/5/05
to testng...@googlegroups.com
Hmm. I can no longer reproduce the error. I reverted the annotations to have the groups and created a new config just like the first one. But now the tests are found and run. I have no clue why. If I can reproduce this again, I will send the xml file. (I deleted it to get a fresh one, but now no new xml file is created.)

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1972&messageID=6079#6079

Reply all
Reply to author
Forward
0 new messages