You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andreas Guther (JIRA)" <ji...@codehaus.org> on 2006/05/02 18:44:41 UTC

[jira] Updated: (MSUREFIRE-98) JUnit Tests are not executed if TestNG configuration file is used to invoke TestNG tests

     [ http://jira.codehaus.org/browse/MSUREFIRE-98?page=all ]

Andreas Guther updated MSUREFIRE-98:
------------------------------------

    Attachment: my-app.zip

> JUnit Tests are not executed if TestNG configuration file is used to invoke TestNG tests
> ----------------------------------------------------------------------------------------
>
>          Key: MSUREFIRE-98
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-98
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>  Environment: Windows XP, Maven 2.0.4, Java 1.4, Surefire from Snapshot server
>     Reporter: Andreas Guther
>  Attachments: my-app.zip
>
>
> I have JUnit tests and TestNG unit tests in the same project.  If I use a TestNG XML configurartion file only the files (TestNG) listed in the configuration file are executed.  JUnit test files are ignored.  TestNG allows to include JUnit tests in the configuration, but I would expect that JUnit tests should be found based on the standard naming pattern and in addition TestNG classes as listed in the TestNG XML config file are executed as well.
> Expected that JUnit files are executed and in addition TestNG files.  It should be possible to use different test frameworks in the same project.
> I will attach the example project.
> Output:
> C:\workspace\my-app>mvn test
> [INFO] Scanning for projects...
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Are JUnit Tests Ignored if TestNG Config XML is used?
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [surefire:test]
> [INFO] Surefire report directory: C:\workspace\my-app\target\surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running Test with JavaDoc Annotations under Java 1.4
> com.mycompany.app.JavaOneFourTngSample: beforeClass
> com.mycompany.app.JavaOneFourTngSample: beforeMethod
> com.mycompany.app.JavaOneFourTngSample: someTestMethod
> com.mycompany.app.JavaOneFourTngSample: beforeMethod
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec <<< FAILURE!
> Results :
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
> [ERROR] There are test failures.
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Tue May 02 09:38:59 PDT 2006
> [INFO] Final Memory: 4M/508M
> [INFO] ------------------------------------------------------------------------

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