-
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.
Restrict Group inheritance to Before|AfterGroups
- Loading branch information
1 parent
4e09c18
commit 3457a35
Showing
5 changed files
with
60 additions
and
6 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
21 changes: 21 additions & 0 deletions
21
testng-core/src/test/java/test/configuration/issue3003/BaseClassSample.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.configuration.issue3003; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.testng.annotations.BeforeClass; | ||
|
||
public class BaseClassSample { | ||
public static final List<String> logs = new ArrayList<>(); | ||
|
||
@BeforeClass(alwaysRun = true) | ||
public void setupMethod1() { | ||
logs.add("setupMethod1"); | ||
} | ||
|
||
@BeforeClass( | ||
alwaysRun = true, | ||
dependsOnMethods = {"setupMethod1"}) | ||
public void setupMethod2() { | ||
logs.add("setupMethod2"); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
testng-core/src/test/java/test/configuration/issue3003/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,19 @@ | ||
package test.configuration.issue3003; | ||
|
||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
@Test(groups = {"GROUP 1"}) | ||
public class TestClassSample extends BaseClassSample { | ||
|
||
@BeforeClass( | ||
alwaysRun = true, | ||
dependsOnMethods = {"setupMethod2"}) | ||
public void setupMethod3() { | ||
logs.add("setupMethod3"); | ||
} | ||
|
||
public void testMethod1() { | ||
logs.add("testMethod1"); | ||
} | ||
} |