-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure ITestResult injected to @AfterMethod is apt
Closes #3006
- Loading branch information
1 parent
3457a35
commit c7028f8
Showing
4 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
testng-core/src/test/java/test/configuration/issue3006/TestClassSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package test.configuration.issue3006; | ||
|
||
import org.testng.ITestResult; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
public class TestClassSample { | ||
|
||
public static ITestResult iTestResult; | ||
|
||
@BeforeMethod | ||
public void beforeMethod() { | ||
throw new RuntimeException("Exception to simulate configuration error"); | ||
} | ||
|
||
@Test | ||
public void test() {} | ||
|
||
@AfterMethod(alwaysRun = true) | ||
public void afterMethod(ITestResult testResult) { | ||
iTestResult = testResult; | ||
} | ||
} |