-
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.
Add support for Priority in Configuration Methods
- Loading branch information
Martin Aldrin
committed
Oct 25, 2021
1 parent
49dbdc9
commit cd9cbf2
Showing
18 changed files
with
219 additions
and
2 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
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
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
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
85 changes: 85 additions & 0 deletions
85
testng-core/src/test/java/test/ConfigurationMethodPrioritySampleTest.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,85 @@ | ||
package test; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.testng.annotations.AfterClass; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.AfterSuite; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.BeforeSuite; | ||
import org.testng.annotations.Test; | ||
|
||
public class ConfigurationMethodPrioritySampleTest { | ||
public static List<String> logs = new ArrayList<>(); | ||
|
||
@BeforeSuite(priority = 100) | ||
public void beforeSuiteA() { | ||
logs.add("beforeSuiteA"); | ||
} | ||
|
||
@BeforeSuite(priority = 1) | ||
public void beforeSuiteB() { | ||
logs.add("beforeSuiteB"); | ||
} | ||
|
||
@BeforeClass(priority = 100) | ||
public void beforeClassA() { | ||
logs.add("beforeClassA"); | ||
} | ||
|
||
@BeforeClass(priority = 1) | ||
public void beforeClassB() { | ||
logs.add("beforeClassB"); | ||
} | ||
|
||
@BeforeMethod(priority = 100) | ||
public void beforeMethodA() { | ||
logs.add("beforeMethodA"); | ||
} | ||
|
||
@BeforeMethod(priority = 1) | ||
public void beforeMethodB() { | ||
logs.add("beforeMethodB"); | ||
} | ||
|
||
@Test(priority = 100) | ||
public void testA() { | ||
logs.add("TestA"); | ||
} | ||
|
||
@Test(priority = 0) | ||
public void testB() { | ||
logs.add("TestB"); | ||
} | ||
|
||
@AfterSuite(priority = 100) | ||
public void afterSuiteA() { | ||
logs.add("afterSuiteA"); | ||
} | ||
|
||
@AfterSuite(priority = 1) | ||
public void afterSuiteB() { | ||
logs.add("afterSuiteB"); | ||
} | ||
|
||
@AfterClass(priority = 100) | ||
public void afterClassA() { | ||
logs.add("afterClassA"); | ||
} | ||
|
||
@AfterClass(priority = 1) | ||
public void afterClassB() { | ||
logs.add("afterClassB"); | ||
} | ||
|
||
@AfterMethod(priority = 100) | ||
public void afterMethodA() { | ||
logs.add("afterMethodA"); | ||
} | ||
|
||
@AfterMethod(priority = 1) | ||
public void afterMethodB() { | ||
logs.add("afterMethodB"); | ||
} | ||
} |
Oops, something went wrong.