You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tibor Digana (JIRA)" <ji...@apache.org> on 2015/06/10 02:51:00 UTC

[jira] [Commented] (SUREFIRE-983) 'Running a Single Test' feature does not work as expected (for testng provider)

    [ https://issues.apache.org/jira/browse/SUREFIRE-983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14579812#comment-14579812 ] 

Tibor Digana commented on SUREFIRE-983:
---------------------------------------

This should work with 2.19-SNAPSHOT.
Please retest it or close.

> 'Running a Single Test' feature does not work as expected (for testng provider)
> -------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-983
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-983
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>    Affects Versions: 2.14, 2.15
>         Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
> Maven home: D:\Maven\apache-maven-3.0.4
> Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files\Java\jdk1.6.0_26\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Alex Chen
>         Attachments: patch_fix_afterclass_never_be_called.patch, test-run-single-case.zip
>
>
> Method with @AfterTest annotation are never been called if use the 'Running a Single Test' feature for testng.
> There are two classes in test project.
> BaseTest   # only has one method cleanUp with @AfterTest. it just prints out a string 'clean up'
> MyTest      # inherit from BaseTest (cases: testPlus, testSubtract, testMultiplication)
> 1).Cmd:     mvn test
> Result:
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running TestSuite
> Configuring TestNG with: TestNG652Configurator
> clean up   <==================================== Right @AfterClass method outputs
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.322 sec
> Results :
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 1.662s
> [INFO] Finished at: Sun Apr 07 20:21:41 CST 2013
> [INFO] Final Memory: 7M/244M
> [INFO] ------------------------------------------------------------------------
> 2).Cmd:     mvn test -Dtest=MyTest#testPlus
> Result:   
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running MyTest
> Configuring TestNG with: TestNG652Configurator
> <==================================== where is 'clean up'
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.292 sec
> Results :
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 1.641s
> [INFO] Finished at: Sun Apr 07 20:25:22 CST 2013
> [INFO] Final Memory: 7M/244M
> [INFO] ------------------------------------------------------------------------
> I find a workaround to resolve this problem. Please see the attachment.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)