You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Vincent Massol (JIRA)" <ji...@codehaus.org> on 2010/10/12 16:00:32 UTC

[jira] Closed: (MNG-4861) Maven 3 and Surefire plugin 2.6 fail to execute tests that use a custom runner (e.g ClasspathSuite)

     [ http://jira.codehaus.org/browse/MNG-4861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Massol closed MNG-4861.
-------------------------------

    Resolution: Not A Bug
      Assignee: Vincent Massol

The problem was that we had 2 conflicting jars in the classpath: junit-4.8.2.jar and junit-dep-4.4.jar (drawn by some dependency transitively). I assume that for some reason the classpath is created differently with maven2 and maven3 (the order is probably not the same one). This could be a problem in itself but another issue should be created for this and I'll leave it to committers more in the know to decide if this is a bug or not.

Thanks

> Maven 3 and Surefire plugin 2.6 fail to execute tests that use a custom runner (e.g ClasspathSuite)
> ---------------------------------------------------------------------------------------------------
>
>                 Key: MNG-4861
>                 URL: http://jira.codehaus.org/browse/MNG-4861
>             Project: Maven 2 & 3
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Vincent Massol
>            Assignee: Vincent Massol
>
> In XWiki we're using ClasspathSuite (http://johanneslink.net/projects/cpsuite.jsp) in a AllTests file. This works fine with Maven 2.2.1 and Surefire plugin 2.6.
> When using Maven 3.0 the test fails to run with the following error:
> {noformat}
> java.lang.Exception: Custom runner class ClasspathSuite should have a public constructor with signature ClasspathSuite(Class testClass)
>         at org.junit.internal.runners.InitializationError.<init>(InitializationError.java:19)
>         at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:36)
>         at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:51)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
>         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)
> {noformat}
> To reproduce you can check out and build (you'll need to have XWiki's remote repo in your settings.xml, see http://dev.xwiki.org/xwiki/bin/view/Community/Building):
> http://svn.xwiki.org/svnroot/xwiki/enterprise/trunk/distribution-test/ui-tests/
> Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira