maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tibor Digana (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SUREFIRE-983) 'Running a Single Test' feature does not work as expected (for testng provider)
Date Mon, 12 Oct 2015 17:10:05 GMT

     [ https://issues.apache.org/jira/browse/SUREFIRE-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tibor Digana updated SUREFIRE-983:
----------------------------------
    Fix Version/s: 2.19

> '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
>            Assignee: Tibor Digana
>             Fix For: 2.19
>
>         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)

Mime
View raw message