You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brett Porter (JIRA)" <ji...@codehaus.org> on 2007/02/23 08:06:38 UTC

[jira] Updated: (SUREFIRE-47) JUnit suite() method ends up being called twice when tests are run with Surefire

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

Brett Porter updated SUREFIRE-47:
---------------------------------

    Fix Version/s:     (was: 2.3)
                   2.4

> JUnit suite() method ends up being called twice when tests are run with Surefire
> --------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-47
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-47
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: maven 2.0.4, ant 1.6.5, this is on MacOSX 10.4.6
>            Reporter: toli kuznets
>             Fix For: 2.4
>
>         Attachments: surefireBug.tar
>
>
> JUnit defines that the static suite() method is only instantiated once.
> However, the recent release of surefire (2.0) seems to call the suite() method twice. 
> the first time it's called from during the creation of all suites (see the first stacktrace in the attached test.out files) - the JUnitTestSet calls "suite()" to instantiate a test object so that it can call countTestCases() on it. 
> The second time the suite() method is called during the actual test execution, when Surefire.run() iterates over all the collected test suites and eventually calls into JUnitTestSet.execute() method.
> a sample project is attached. I added an exception stacktrace into every occurence of the suite() method.
> there's also a build.xml file to run the 'ant test' command for comparison. 
> There's also a test.out file with the sample output.
> Suggested fixes:
> Is it possible to pass the suite itself to the JUnitTestSet w/out having to create it again? 
> We rely on suite() being called only once, and create one-time operations there (such as creating a few singletons) so this bug is a pain.

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