You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Pigg (JIRA)" <ji...@codehaus.org> on 2009/05/05 13:12:44 UTC

[jira] Created: (SUREFIRE-549) TestNg provider does not run junit tests correctly when forkMode=always

TestNg provider does not run junit tests correctly when forkMode=always
-----------------------------------------------------------------------

                 Key: SUREFIRE-549
                 URL: http://jira.codehaus.org/browse/SUREFIRE-549
             Project: Maven Surefire
          Issue Type: Bug
          Components: process forking
    Affects Versions: 2.4.3
            Reporter: Michael Pigg
            Priority: Minor
         Attachments: SurefireJunitViaTestngProblem.zip

We have both TestNG-based tests for unit testing and Junit-based tests (that use Spring OSGi test framework) for integration testing. When running the JUnit tests we would like to use forkMode=always to force the OSGi container to be created for each test. However, when forkMode=always is set, the TestNG provider does not properly run the JUnit test. In the default forkMode of once, the JUnit tests are executed.

The problem is that the TestNGDirectoryTestSuite.execute method is coded to run both TestNG and JUnit tests when run for multiple test sets (which is executed for forkMode=once), but when run for one test it seems to assume that the test is a TestNG test. I think it should check for JUnit tests in either mode of execution.

The work-around for the problem is to add the TestNG junit property to the surefire configuration when running the JUnit tests:
<properties>
     <property>
           <name>junit</name>
           <value>true</value>
     </property>
</properties>

-- 
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: (SUREFIRE-549) TestNg provider does not run junit tests correctly when forkMode=always

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/SUREFIRE-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Rosenvold closed SUREFIRE-549.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.11
         Assignee: Kristian Rosenvold

As of r1200541, all the configuration properties are now properly sent to testng in forkmode always, this solves this issue too. In fact, I seem to be running into trouble if I *supply* the TestNG parameter, which I suppose might be related to junit version. Removing junit parameter works fine

> TestNg provider does not run junit tests correctly when forkMode=always
> -----------------------------------------------------------------------
>
>                 Key: SUREFIRE-549
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-549
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>    Affects Versions: 2.4.3
>            Reporter: Michael Pigg
>            Assignee: Kristian Rosenvold
>            Priority: Minor
>             Fix For: 2.11
>
>         Attachments: SurefireJunitViaTestngProblem.zip
>
>
> We have both TestNG-based tests for unit testing and Junit-based tests (that use Spring OSGi test framework) for integration testing. When running the JUnit tests we would like to use forkMode=always to force the OSGi container to be created for each test. However, when forkMode=always is set, the TestNG provider does not properly run the JUnit test. In the default forkMode of once, the JUnit tests are executed.
> The problem is that the TestNGDirectoryTestSuite.execute method is coded to run both TestNG and JUnit tests when run for multiple test sets (which is executed for forkMode=once), but when run for one test it seems to assume that the test is a TestNG test. I think it should check for JUnit tests in either mode of execution.
> The work-around for the problem is to add the TestNG junit property to the surefire configuration when running the JUnit tests:
> <properties>
>      <property>
>            <name>junit</name>
>            <value>true</value>
>      </property>
> </properties>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (SUREFIRE-549) TestNg provider does not run junit tests correctly when forkMode=always

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

Kristian Rosenvold updated SUREFIRE-549:
----------------------------------------

    Component/s:     (was: process forking)
                 TestNG support

> TestNg provider does not run junit tests correctly when forkMode=always
> -----------------------------------------------------------------------
>
>                 Key: SUREFIRE-549
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-549
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>    Affects Versions: 2.4.3
>            Reporter: Michael Pigg
>            Priority: Minor
>         Attachments: SurefireJunitViaTestngProblem.zip
>
>
> We have both TestNG-based tests for unit testing and Junit-based tests (that use Spring OSGi test framework) for integration testing. When running the JUnit tests we would like to use forkMode=always to force the OSGi container to be created for each test. However, when forkMode=always is set, the TestNG provider does not properly run the JUnit test. In the default forkMode of once, the JUnit tests are executed.
> The problem is that the TestNGDirectoryTestSuite.execute method is coded to run both TestNG and JUnit tests when run for multiple test sets (which is executed for forkMode=once), but when run for one test it seems to assume that the test is a TestNG test. I think it should check for JUnit tests in either mode of execution.
> The work-around for the problem is to add the TestNG junit property to the surefire configuration when running the JUnit tests:
> <properties>
>      <property>
>            <name>junit</name>
>            <value>true</value>
>      </property>
> </properties>

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