"cannot retrieve JUnit method"

181 views
Skip to first unread message

TTop

unread,
Nov 13, 2009, 7:37:30 PM11/13/09
to testng-users
I'm trying to execute some JUnit 3.8 tests using the TestNG ant task,
but it fails with an error:

[testng] Failure in JUnit mode for class
com.theplatform.test.media.facade.functional.FormatRegistryTest: could
not create/run JUnit test suite:
[testng] cannot retrieve JUnit method
[testng] at org.testng.junit.JUnitTestRunner.runFailed
(JUnitTestRunner.java:231)
[testng] at org.testng.junit.JUnitTestRunner.start
(JUnitTestRunner.java:224)
[testng] at org.testng.junit.JUnitTestRunner.run
(JUnitTestRunner.java:205)
[testng] at org.testng.TestRunner$2.run(TestRunner.java:546)
[testng] at org.testng.TestRunner.runWorkers(TestRunner.java:
759)
[testng] at org.testng.TestRunner.privateRunJUnit
(TestRunner.java:558)
[testng] at org.testng.TestRunner.run(TestRunner.java:483)
[testng] at org.testng.SuiteRunner.runTest(SuiteRunner.java:
332)
[testng] at org.testng.SuiteRunner.runSequentially
(SuiteRunner.java:327)
[testng] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:
299)
[testng] at org.testng.SuiteRunner.run(SuiteRunner.java:204)
[testng] at org.testng.TestNG.createAndRunSuiteRunners
(TestNG.java:912)
[testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
[testng] at org.testng.TestNG.run(TestNG.java:784)
[testng] at org.testng.TestNG.privateMain(TestNG.java:949)
[testng] at org.testng.TestNG.main(TestNG.java:922)

I'm hoping somebody can give me an idea of what's wrong... I'm new to
TestNG.

My testng.xml file looks like this:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1" parallel="classes" thread-count="5">
<test name="mediafunc" junit="true">
<classes>
<class
name="com.theplatform.test.media.facade.functional.AdminTagsTest"/>
<class
name="com.theplatform.test.media.facade.functional.CategoryTest"/>
<class
name="com.theplatform.test.media.facade.functional.MediaDateTest"/>
<class
name="com.theplatform.test.media.facade.functional.FormatRegistryTest"/
>
</classes>
</test>
</suite>

Todd Wells

unread,
Nov 16, 2009, 5:44:34 PM11/16/09
to testng-users
Any ideas on this?

Cédric Beust ♔

unread,
Nov 16, 2009, 5:47:15 PM11/16/09
to testng...@googlegroups.com
The exception is happening inside the JUnit runner, can you debug into this?

Also, what class is it trying to run?

--
Cédric

Todd Wells

unread,
Nov 16, 2009, 5:58:09 PM11/16/09
to testng...@googlegroups.com
It occurs once for each test class specified. I'm not really sure how to set up to debug the test runner, I'm just calling this via the ant task.

What would the most straightforward way to do this? I use IDEA for my IDE.



2009/11/16 Cédric Beust ♔ <cbe...@google.com>

Karthik Krishnan

unread,
Nov 16, 2009, 9:01:56 PM11/16/09
to testng...@googlegroups.com
http://www.vitorrodrigues.com/blog/2009/07/10/debugging-ant-tasks-in-eclipse/

This link  will help you to debug ant task. Just make sure that to configure the source of jar file in Eclipse so that when the debugger starts to execute the code inside junit jars, eclipse will load the source in IDE

Kartik
Reply all
Reply to author
Forward
0 new messages