forked from testng-team/testng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Segregate native & user listeners before ordering
Closes testng-team#2771
- Loading branch information
1 parent
c087eaa
commit 37cd664
Showing
6 changed files
with
49 additions
and
7 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
12 changes: 12 additions & 0 deletions
12
testng-core/src/test/java/test/listeners/issue2771/CustomSoftAssert.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,12 @@ | ||
package test.listeners.issue2771; | ||
|
||
import org.testng.ITestResult; | ||
import org.testng.reporters.ExitCodeListener; | ||
|
||
public class CustomSoftAssert extends ExitCodeListener { | ||
@Override | ||
public void onTestSuccess(ITestResult result) { | ||
result.setStatus(ITestResult.FAILURE); | ||
result.setThrowable(new AssertionError("There have been some failed soft asserts")); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
testng-core/src/test/java/test/listeners/issue2771/TestCaseSample.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,10 @@ | ||
package test.listeners.issue2771; | ||
|
||
import org.testng.annotations.Listeners; | ||
import org.testng.annotations.Test; | ||
|
||
@Listeners(CustomSoftAssert.class) | ||
public class TestCaseSample { | ||
@Test | ||
public void someCustomSoftAsserts() {} | ||
} |
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