-
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 26, 2021
1 parent
49dbdc9
commit 0bd597d
Showing
22 changed files
with
429 additions
and
3 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
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
68 changes: 68 additions & 0 deletions
68
testng-core/src/test/java/test/ConfigurationMethodPriorityTest.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,68 @@ | ||
package test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.testng.Assert; | ||
import org.testng.TestNG; | ||
import org.testng.annotations.Test; | ||
|
||
import test.configuration.issue2663.ConfigurationMethodPrioritySampleTest; | ||
import test.configuration.issue2663.ConfigurationMethodPriorityWithGroupDependencySampleTest; | ||
|
||
public class ConfigurationMethodPriorityTest extends SimpleBaseTest { | ||
|
||
@Test(description = "GITHUB-2663") | ||
public void ensureThatPriorityWorksOnConfigurationMethods() { | ||
TestNG testng = create(ConfigurationMethodPrioritySampleTest.class); | ||
testng.run(); | ||
assertThat(testng.getStatus()).isEqualTo(0); | ||
List<String> expectedLogs = | ||
Arrays.asList( | ||
"beforeSuiteB", | ||
"beforeSuiteA", | ||
"beforeClassB", | ||
"beforeClassA", | ||
"beforeMethodB", | ||
"beforeMethodA", | ||
"TestB", | ||
"afterMethodB", | ||
"afterMethodA", | ||
"beforeMethodB", | ||
"beforeMethodA", | ||
"TestA", | ||
"afterMethodB", | ||
"afterMethodA", | ||
"afterClassB", | ||
"afterClassA", | ||
"afterSuiteB", | ||
"afterSuiteA"); | ||
assertThat(ConfigurationMethodPrioritySampleTest.logs).containsExactlyElementsOf(expectedLogs); | ||
} | ||
@Test | ||
public void ensureThatPriorityWorksOnConfigurationMethodsWithGroupDependency() { | ||
List<String> expectedOrder1 = Arrays.asList("s1", "s2", "s3","t1", "t2", "t3","c1", "c2", "c3","m1", "m2", "m3","test1","m1", "m2", "m3","test2","m1", "m2", "m3","test3"); | ||
TestNG tng = create(ConfigurationMethodPriorityWithGroupDependencySampleTest.class); | ||
InvokedMethodNameListener listener = new InvokedMethodNameListener(); | ||
tng.addListener(listener); | ||
tng.run(); | ||
System.out.println(expectedOrder1); | ||
System.out.println(listener.getSucceedMethodNames()); | ||
Assert.assertEquals(listener.getSucceedMethodNames(), expectedOrder1); | ||
} | ||
|
||
@Test | ||
public void ensureThatPriorityWorksOnConfigurationMethodsWithMethodDependency() { | ||
List<String> expectedOrder1 = Arrays.asList("s1", "s2", "s3","t1", "t2", "t3","c1", "c2", "c3","m1", "m2", "m3","test1","m1", "m2", "m3","test2","m1", "m2", "m3","test3"); | ||
TestNG tng = create(ConfigurationMethodPriorityWithGroupDependencySampleTest.class); | ||
InvokedMethodNameListener listener = new InvokedMethodNameListener(); | ||
tng.addListener(listener); | ||
tng.run(); | ||
System.out.println(expectedOrder1); | ||
System.out.println(listener.getSucceedMethodNames()); | ||
Assert.assertEquals(listener.getSucceedMethodNames(), expectedOrder1); | ||
} | ||
|
||
} |
Oops, something went wrong.