Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BeforeGroups should run before any matched test
- Loading branch information
Showing
6 changed files
with
125 additions
and
28 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
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
21 changes: 21 additions & 0 deletions
21
testng-core/src/test/java/test/beforegroups/issue2359/ListenerAdapter.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,21 @@ | ||
package test.beforegroups.issue2359; | ||
|
||
import org.testng.ITestResult; | ||
import org.testng.TestListenerAdapter; | ||
import java.util.Collection; | ||
import java.util.concurrent.ConcurrentLinkedQueue; | ||
|
||
public class ListenerAdapter extends TestListenerAdapter { | ||
|
||
private final Collection<ITestResult> passedConfiguration = new ConcurrentLinkedQueue<>(); | ||
|
||
@Override | ||
public void onConfigurationSuccess(ITestResult itr) { | ||
super.onConfigurationSuccess(itr); | ||
this.passedConfiguration.add(itr); | ||
} | ||
|
||
public Collection<ITestResult> getPassedConfiguration() { | ||
return passedConfiguration; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
testng-core/src/test/java/test/beforegroups/issue2359/SampleFor2359.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,32 @@ | ||
package test.beforegroups.issue2359; | ||
|
||
import org.testng.annotations.BeforeGroups; | ||
import org.testng.annotations.Test; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
public class SampleFor2359 { | ||
|
||
@BeforeGroups(groups = "testng2359") | ||
public void beforeGroup() { | ||
try { | ||
TimeUnit.SECONDS.sleep(2); | ||
} catch (InterruptedException e) { | ||
Thread.currentThread().interrupt(); | ||
} | ||
} | ||
|
||
@Test(groups = "testng2359") | ||
public void sampleTest1() { | ||
|
||
} | ||
|
||
@Test(groups = "testng2359") | ||
public void sampleTest2() { | ||
|
||
} | ||
|
||
@Test(groups = "testng2359") | ||
public void sampleTest3() { | ||
|
||
} | ||
} |