-
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.
Merge pull request #2732 from bj-9527/github2729
beforeConfiguration() listener method should be invoked for skipped configurations as well
- Loading branch information
Showing
8 changed files
with
50 additions
and
1 deletion.
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
16 changes: 16 additions & 0 deletions
16
testng-core/src/test/java/test/configuration/issue2729/BeforeConfigSampleListener.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,16 @@ | ||
package test.configuration.issue2729; | ||
|
||
import org.testng.IConfigurationListener; | ||
import org.testng.IInvokedMethodListener; | ||
import org.testng.ITestListener; | ||
import org.testng.ITestResult; | ||
|
||
public class BeforeConfigSampleListener | ||
implements ITestListener, IInvokedMethodListener, IConfigurationListener { | ||
public static int count = 0; | ||
|
||
@Override | ||
public void beforeConfiguration(ITestResult testResult) { | ||
count++; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
testng-core/src/test/java/test/configuration/issue2729/BeforeConfigTestSample.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,20 @@ | ||
package test.configuration.issue2729; | ||
|
||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Listeners; | ||
import org.testng.annotations.Test; | ||
|
||
@Listeners({BeforeConfigSampleListener.class}) | ||
public class BeforeConfigTestSample { | ||
@BeforeClass | ||
public void beforeClass() { | ||
int i = 5 / 0; | ||
} | ||
|
||
@BeforeMethod | ||
public void beforeMethod() {} | ||
|
||
@Test | ||
public void sampleTest() {} | ||
} |
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