You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jan Sievers (JIRA)" <ji...@codehaus.org> on 2011/08/19 11:52:32 UTC
[jira] Created: (SUREFIRE-761) java.lang.NoSuchMethodException when
trying to run Junit 3 suite class
java.lang.NoSuchMethodException when trying to run Junit 3 suite class
----------------------------------------------------------------------
Key: SUREFIRE-761
URL: https://jira.codehaus.org/browse/SUREFIRE-761
Project: Maven Surefire
Issue Type: Bug
Components: JUnit 3.x support
Affects Versions: 2.9, 2.8
Environment: maven 3.0.3
Reporter: Jan Sievers
Priority: Critical
Attachments: demo.zip
attached small demo project demonstrates that JUnit 3 suite classes can't be executed due to NoSuchMethodException.
surefire 1.8 and 2.9 are affected. BTW I also tested with older surefire versions, here the suite class is completely ignored which is also a bug.
We found this bug while porting the tycho surefire plugin to surefire 2.9, see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=353222
I will create a patch for this issue.
--- build log snippet ---
[INFO] --- maven-surefire-plugin:2.9:test (default-test) @ demo ---
[INFO] Surefire report directory: C:\ws\tycho\demo\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
Caused by: org.apache.maven.surefire.util.NestedRuntimeException: When finding method run; nested exception is java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:113)
at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getRunMethod(JUnit3Reflector.java:208)
at org.apache.maven.surefire.junit.JUnitTestSet.<init>(JUnitTestSet.java:71)
at org.apache.maven.surefire.junit.JUnit3Provider.createTestSet(JUnit3Provider.java:103)
at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:93)
... 9 more
Caused by: java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
at java.lang.Class.getMethod(Class.java:1605)
at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:109)
... 13 more
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SUREFIRE-761) java.lang.NoSuchMethodException
when trying to run Junit 3 suite class
Posted by "Jan Sievers (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SUREFIRE-761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=276465#comment-276465 ]
Jan Sievers commented on SUREFIRE-761:
--------------------------------------
forgot to mention, all other unit tests and ITs pass with patch applied.
> java.lang.NoSuchMethodException when trying to run Junit 3 suite class
> ----------------------------------------------------------------------
>
> Key: SUREFIRE-761
> URL: https://jira.codehaus.org/browse/SUREFIRE-761
> Project: Maven Surefire
> Issue Type: Bug
> Components: JUnit 3.x support
> Affects Versions: 2.8, 2.9
> Environment: maven 3.0.3
> Reporter: Jan Sievers
> Priority: Critical
> Attachments: demo.zip, SUREFIRE-761.patch
>
>
> attached small demo project demonstrates that JUnit 3 suite classes can't be executed due to NoSuchMethodException.
> surefire 1.8 and 2.9 are affected. BTW I also tested with older surefire versions, here the suite class is completely ignored which is also a bug.
> We found this bug while porting the tycho surefire plugin to surefire 2.9, see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=353222
> I will create a patch for this issue.
> --- build log snippet ---
> [INFO] --- maven-surefire-plugin:2.9:test (default-test) @ demo ---
> [INFO] Surefire report directory: C:\ws\tycho\demo\target\surefire-reports
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
> java.lang.reflect.InvocationTargetException
> 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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
> at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
> Caused by: org.apache.maven.surefire.util.NestedRuntimeException: When finding method run; nested exception is java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:113)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getRunMethod(JUnit3Reflector.java:208)
> at org.apache.maven.surefire.junit.JUnitTestSet.<init>(JUnitTestSet.java:71)
> at org.apache.maven.surefire.junit.JUnit3Provider.createTestSet(JUnit3Provider.java:103)
> at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:93)
> ... 9 more
> Caused by: java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
> at java.lang.Class.getMethod(Class.java:1605)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:109)
> ... 13 more
> Results :
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (SUREFIRE-761) java.lang.NoSuchMethodException when
trying to run Junit 3 suite class
Posted by "Jan Sievers (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SUREFIRE-761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jan Sievers updated SUREFIRE-761:
---------------------------------
Attachment: SUREFIRE-761.patch
patch including unit test which should fix the issue.
> java.lang.NoSuchMethodException when trying to run Junit 3 suite class
> ----------------------------------------------------------------------
>
> Key: SUREFIRE-761
> URL: https://jira.codehaus.org/browse/SUREFIRE-761
> Project: Maven Surefire
> Issue Type: Bug
> Components: JUnit 3.x support
> Affects Versions: 2.8, 2.9
> Environment: maven 3.0.3
> Reporter: Jan Sievers
> Priority: Critical
> Attachments: demo.zip, SUREFIRE-761.patch
>
>
> attached small demo project demonstrates that JUnit 3 suite classes can't be executed due to NoSuchMethodException.
> surefire 1.8 and 2.9 are affected. BTW I also tested with older surefire versions, here the suite class is completely ignored which is also a bug.
> We found this bug while porting the tycho surefire plugin to surefire 2.9, see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=353222
> I will create a patch for this issue.
> --- build log snippet ---
> [INFO] --- maven-surefire-plugin:2.9:test (default-test) @ demo ---
> [INFO] Surefire report directory: C:\ws\tycho\demo\target\surefire-reports
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
> java.lang.reflect.InvocationTargetException
> 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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
> at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
> Caused by: org.apache.maven.surefire.util.NestedRuntimeException: When finding method run; nested exception is java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:113)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getRunMethod(JUnit3Reflector.java:208)
> at org.apache.maven.surefire.junit.JUnitTestSet.<init>(JUnitTestSet.java:71)
> at org.apache.maven.surefire.junit.JUnit3Provider.createTestSet(JUnit3Provider.java:103)
> at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:93)
> ... 9 more
> Caused by: java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
> at java.lang.Class.getMethod(Class.java:1605)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:109)
> ... 13 more
> Results :
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (SUREFIRE-761) java.lang.NoSuchMethodException when
trying to run Junit 3 suite class
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/SUREFIRE-761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Rosenvold closed SUREFIRE-761.
---------------------------------------
Resolution: Fixed
Fix Version/s: 2.10
Assignee: Kristian Rosenvold
Thanks for the patch with a good testcase ! Applied in r1160400
> java.lang.NoSuchMethodException when trying to run Junit 3 suite class
> ----------------------------------------------------------------------
>
> Key: SUREFIRE-761
> URL: https://jira.codehaus.org/browse/SUREFIRE-761
> Project: Maven Surefire
> Issue Type: Bug
> Components: JUnit 3.x support
> Affects Versions: 2.8, 2.9
> Environment: maven 3.0.3
> Reporter: Jan Sievers
> Assignee: Kristian Rosenvold
> Priority: Critical
> Fix For: 2.10
>
> Attachments: demo.zip, SUREFIRE-761.patch
>
>
> attached small demo project demonstrates that JUnit 3 suite classes can't be executed due to NoSuchMethodException.
> surefire 1.8 and 2.9 are affected. BTW I also tested with older surefire versions, here the suite class is completely ignored which is also a bug.
> We found this bug while porting the tycho surefire plugin to surefire 2.9, see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=353222
> I will create a patch for this issue.
> --- build log snippet ---
> [INFO] --- maven-surefire-plugin:2.9:test (default-test) @ demo ---
> [INFO] Surefire report directory: C:\ws\tycho\demo\target\surefire-reports
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
> java.lang.reflect.InvocationTargetException
> 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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
> at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)
> Caused by: org.apache.maven.surefire.util.NestedRuntimeException: When finding method run; nested exception is java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:113)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getRunMethod(JUnit3Reflector.java:208)
> at org.apache.maven.surefire.junit.JUnitTestSet.<init>(JUnitTestSet.java:71)
> at org.apache.maven.surefire.junit.JUnit3Provider.createTestSet(JUnit3Provider.java:103)
> at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:93)
> ... 9 more
> Caused by: java.lang.NoSuchMethodException: test.demo.Suite.run(junit.framework.TestResult)
> at java.lang.Class.getMethod(Class.java:1605)
> at org.apache.maven.surefire.common.junit3.JUnit3Reflector.getMethod(JUnit3Reflector.java:109)
> ... 13 more
> Results :
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira