Failure in JUnit mode for class com.google.inject.BinderTestSuite$SuccessTest: could not create/run JUnit test suite: cannot retrieve JUnit method
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 1.7k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
_From [gliptak](https://code.google.com/u/101548205732780420380/) on January 12, 2011 15:52:56_
There are several of these listed in /core/target/surefire-reports/TestSuite-output.txt
The issue seems to be that the Maven unit testcase processor recognizes these inner classes as JUnit and tries to instantiate them directly (while they are not designed to be invoked directly).
I'm attaching a patch which helps this issue in Eclipse (effectively "hiding" these inner classes), but it does not clear up these messages.
To clear up these messages, empty constructor or testName only constructor needs to be added (possibly refactoring the final variables currently used).
org.testng.TestNGException:
Failure in JUnit mode for class com.google.inject.BinderTestSuite$ConfigurationExceptionTest: could not create/run JUnit test suite:
cannot retrieve JUnit method
at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:231)
at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:224)
at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:205)
at org.testng.TestRunner$2.run(TestRunner.java:559)
at org.testng.TestRunner.runWorkers(TestRunner.java:909)
at org.testng.TestRunner.privateRunJUnit(TestRunner.java:575)
at org.testng.TestRunner.run(TestRunner.java:496)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:915)
at org.testng.TestNG.runSuitesLocally(TestNG.java:879)
at org.testng.TestNG.run(TestNG.java:787)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:62)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:155)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
org.testng.TestNGException:
Failure in JUnit mode for class com.google.inject.BinderTestSuite$UserExceptionsTest: could not create/run JUnit test suite:
cannot retrieve JUnit method
Failure in JUnit mode for class com.google.inject.internal.util.$MapMakerTestSuite$ReferenceCombinationTestSuite$MapTest: could not create/run JUnit test suite:
cannot retrieve JUnit method
Failure in JUnit mode for class com.google.inject.BinderTestSuite$SuccessTest: could not create/run JUnit test suite:
cannot retrieve JUnit method
Failure in JUnit mode for class com.google.inject.BinderTestSuite$CreationExceptionTest: could not create/run JUnit test suite:
cannot retrieve JUnit method
**Attachment:** [gist](https://gist.github.com/b90e58fa74abd6b9e4f3)
_[guice3-surefire.patch](https://gist.githubusercontent.com/gissuebot/b90e58fa74abd6b9e4f3/raw/2532ad589157ad4536ecdaefb9299436cf6acf30/guice3-surefire.patch)_
_Original issue: http://code.google.com/p/google-guice/issues/detail?id=587_
Contributor guide
Assessment
This issue has not been assessed yet.