-
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.
Dont honour params specified in suite-file tag
Closes #581 TestNG does not have any logic that would honour parameter tags specified within suite-files tag. But due to a parsing bug, we end up reading parameters that were specified within `<suite-file>` tag. This tag by definition is NOT meant to have any child tags inside of it. Fixed this discrepancy by adding a warning when this anomaly is detected and skipping of reading the `<parameter>` tag inside it as if it were specified within `<suite>` tag.
- Loading branch information
1 parent
d6767b5
commit 60e9946
Showing
7 changed files
with
70 additions
and
0 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
12 changes: 12 additions & 0 deletions
12
testng-core/src/test/java/test/parameters/issue581/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,12 @@ | ||
package test.parameters.issue581; | ||
|
||
import org.testng.annotations.Optional; | ||
import org.testng.annotations.Parameters; | ||
import org.testng.annotations.Test; | ||
|
||
public class TestClassSample { | ||
|
||
@Parameters(value = "url") | ||
@Test | ||
public void test(@Optional String ignored) {} | ||
} |
11 changes: 11 additions & 0 deletions
11
testng-core/src/test/resources/parametertest/issue_581/parent_suite.xml
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,11 @@ | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | ||
<suite name="parent_suite"> | ||
<suite-files> | ||
<suite-file path="suite_one.xml"> | ||
<parameter name="url" value="http://www.google.com"/> | ||
</suite-file> | ||
<suite-file path="suite_two.xml"> | ||
<parameter name="url" value="http://www.bing.com"/> | ||
</suite-file> | ||
</suite-files> | ||
</suite> |
8 changes: 8 additions & 0 deletions
8
testng-core/src/test/resources/parametertest/issue_581/suite_one.xml
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,8 @@ | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | ||
<suite name="suite_one"> | ||
<test name="test_one"> | ||
<classes> | ||
<class name="test.parameters.issue581.TestClassSample"/> | ||
</classes> | ||
</test> | ||
</suite> |
8 changes: 8 additions & 0 deletions
8
testng-core/src/test/resources/parametertest/issue_581/suite_two.xml
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,8 @@ | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | ||
<suite name="suite_two"> | ||
<test name="test_two"> | ||
<classes> | ||
<class name="test.parameters.issue581.TestClassSample"/> | ||
</classes> | ||
</test> | ||
</suite> |