You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dan Fabulich (JIRA)" <ji...@codehaus.org> on 2006/05/17 03:53:40 UTC

[jira] Created: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

When you <include> a JUnit TestSuite (with no test methods), no tests are run
-----------------------------------------------------------------------------

         Key: MSUREFIRE-113
         URL: http://jira.codehaus.org/browse/MSUREFIRE-113
     Project: Maven 2.x Surefire Plugin
        Type: Bug

    Versions: 2.2    
    Reporter: Dan Fabulich
    Priority: Blocker
 Attachments: suitebug.zip

In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."

I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.

This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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


[jira] Commented: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Charlie Groves (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-113?page=comments#action_65501 ] 

Charlie Groves commented on MSUREFIRE-113:
------------------------------------------

If JUnitDirectoryTestSuite checked against Test instead of TestCase in its isAssignableFrom test, this wouldn't be an issue.  From what I can tell in JUnitTestSet, having the testClasses passed to the constructor consist of anything that implements Test wouldn't be a problem as JUnitTestSet only uses the run and countTestMethods methods.

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>          Key: MSUREFIRE-113
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-113
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Dan Fabulich
>     Priority: Blocker
>  Attachments: suitebug.zip
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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


[jira] Updated: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Mike Perham (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSUREFIRE-113?page=all ]

Mike Perham updated MSUREFIRE-113:
----------------------------------

    Attachment: surefire-junit-2.1-SNAPSHOT.jar

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>          Key: MSUREFIRE-113
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-113
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Dan Fabulich
>     Priority: Blocker
>  Attachments: MSUREFIRE-113.patch, suitebug.zip, surefire-junit-2.1-SNAPSHOT.jar
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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


[jira] Commented: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-113?page=comments#action_65526 ] 

Brett Porter commented on MSUREFIRE-113:
----------------------------------------

this also should be changed in the TestNG provider

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>          Key: MSUREFIRE-113
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-113
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Dan Fabulich
>     Priority: Blocker
>  Attachments: MSUREFIRE-113.patch, suitebug.zip, surefire-junit-2.1-SNAPSHOT.jar
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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


[jira] Updated: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Mike Perham (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSUREFIRE-113?page=all ]

Mike Perham updated MSUREFIRE-113:
----------------------------------

    Attachment: MSUREFIRE-113.patch

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>          Key: MSUREFIRE-113
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-113
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Dan Fabulich
>     Priority: Blocker
>  Attachments: MSUREFIRE-113.patch, suitebug.zip
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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


[jira] Closed: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Mike Perham (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSUREFIRE-113?page=all ]
     
Mike Perham closed MSUREFIRE-113:
---------------------------------

     Resolution: Fixed
    Fix Version: 2.3

Updated surefire-junit and surefire-testng.

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>          Key: MSUREFIRE-113
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-113
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Dan Fabulich
>     Assignee: Mike Perham
>     Priority: Blocker
>      Fix For: 2.3
>  Attachments: MSUREFIRE-113.patch, suitebug.zip, surefire-junit-2.1-SNAPSHOT.jar
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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


[jira] Moved: (SUREFIRE-120) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter moved MSUREFIRE-113 to SUREFIRE-120:
-------------------------------------------------

    Affects Version/s:     (was: 2.0 (2.2 plugin))
                       2.0 (2.2 plugin)
        Fix Version/s:     (was: 2.3)
                       2.3
                  Key: SUREFIRE-120  (was: MSUREFIRE-113)
              Project: Maven Surefire  (was: Maven 2.x Surefire Plugin)

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>                 Key: SUREFIRE-120
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-120
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>            Reporter: Dan Fabulich
>         Assigned To: Mike Perham
>            Priority: Blocker
>             Fix For: 2.3
>
>         Attachments: MSUREFIRE-113.patch, suitebug.zip, surefire-junit-2.1-SNAPSHOT.jar
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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

        

[jira] Commented: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-113?page=comments#action_65500 ] 

Dan Fabulich commented on MSUREFIRE-113:
----------------------------------------

At a suggestion from groves on IRC, I tried making my AppTestSuite class extend TestCase instead of TestSuite.  This forced surefire to count the test cases correctly, and was an effective workaround for my project.

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>          Key: MSUREFIRE-113
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-113
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Dan Fabulich
>     Priority: Blocker
>  Attachments: suitebug.zip
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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


[jira] Commented: (MSUREFIRE-113) When you a JUnit TestSuite (with no test methods), no tests are run

Posted by "Mike Perham (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-113?page=comments#action_65521 ] 

Mike Perham commented on MSUREFIRE-113:
---------------------------------------

Charlie, excellent detective work.  I made your suggested changes and found this fixes the problem (I replaced my surefire-junit-2.0.jar with the attached snapshot).  I do not have commit privileges to the surefire source so this patch will need to be reviewed and committed by someone else.

> When you <include> a JUnit TestSuite (with no test methods), no tests are run
> -----------------------------------------------------------------------------
>
>          Key: MSUREFIRE-113
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-113
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Dan Fabulich
>     Priority: Blocker
>  Attachments: MSUREFIRE-113.patch, suitebug.zip, surefire-junit-2.1-SNAPSHOT.jar
>
>
> In the attached Maven project, I started with the default Maven getting started archetype and then created an AppTestSuite class, which extends TestSuite and defines the static suite() method, but it has no test methods of its own.  Then I added an <includes> configuration that specified <includes><include>**/AppTestSuite.java</include></includes>.  But when I run "mvn test", it claims that "There are no tests to run."
> I've watched this happening in a debugger.  The problem is in surefire-api-2.0.jar in PojoTestSet , on line 249.  When attempting to acquire a list of the number of tests to run, instead of invoking the suite method and counting the number of tests that come out, it's attempting to discoverTestMethods on the object (methods whose names begin with "test*"), which naturally won't work for suites.
> This is a really serious issue that's going to block testing for us.  (We happen to attach a TestSetup decorator to our suite, so we do need to run these tests as a suite rather than as individual test cases.)

-- 
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