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] Created: (MSUREFIRE-98) JUnit Tests are not executed if TestNG configuration file is used to invoke TestNG tests

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


[jira] Moved: (SUREFIRE-227) JUnit Tests are not executed if TestNG configuration file is used to invoke TestNG tests

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

Brett Porter moved MSUREFIRE-98 to SUREFIRE-227:
------------------------------------------------

        Key: SUREFIRE-227  (was: MSUREFIRE-98)
    Project: Maven Surefire  (was: Maven 2.x Surefire Plugin)

> JUnit Tests are not executed if TestNG configuration file is used to invoke TestNG tests
> ----------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-227
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-227
>             Project: Maven Surefire
>          Issue Type: Bug
>         Environment: Windows XP, Maven 2.0.4, Java 1.4, Surefire from Snapshot server
>            Reporter: Andreas Guther
>         Assigned To: Brett Porter
>         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

        

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

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

Brett Porter updated MSUREFIRE-98:
----------------------------------

    Fix Version: 2.2

> 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
>      Fix For: 2.2
>  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


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

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

      Assign To: Brett Porter
     Resolution: Won't Fix
    Fix Version:     (was: 2.2)

it's by design. The documentation for suiteXmlFiles clearly says it will stop any other tests from being run. It is assumed that if you are running a suiteXml you want to be very specific about what tests are run, so none are added automatically.

> 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
>     Assignee: Brett Porter
>  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


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

Posted by "Andreas Guther (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-98?page=comments#action_64573 ] 

Andreas Guther commented on MSUREFIRE-98:
-----------------------------------------

Correction regarding environment:

Actually the environment was not listed correctly.  I am running with Java 1.5 but generate 1.4 code.  TestNG is configured with JavaDoc annotations.

> 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


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

Posted by "Andreas Guther (JIRA)" <ji...@codehaus.org>.
     [ 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