Skip to content

Commit

Permalink
Upgrade snakeyaml to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
labianchin authored and krmahadevan committed May 3, 2023
1 parent 46d8180 commit a766113
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions testng-core/src/main/java/org/testng/internal/Yaml.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.testng.xml.XmlScript;
import org.testng.xml.XmlSuite;
import org.testng.xml.XmlTest;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.nodes.MappingNode;
Expand All @@ -30,7 +31,7 @@ private Yaml() {}

public static XmlSuite parse(String filePath, InputStream is, boolean loadClasses)
throws FileNotFoundException {
Constructor constructor = new TestNGConstructor(XmlSuite.class);
Constructor constructor = new TestNGConstructor(XmlSuite.class, new LoaderOptions());
{
TypeDescription suiteDescription = new TypeDescription(XmlSuite.class);
suiteDescription.addPropertyParameters("packages", XmlPackage.class);
Expand Down Expand Up @@ -301,8 +302,8 @@ private static void toYaml(StringBuilder sb, String sp, Map<String, String> para

private static class TestNGConstructor extends Constructor {

public TestNGConstructor(Class<?> theRoot) {
super(theRoot);
public TestNGConstructor(Class<?> theRoot, LoaderOptions loadingConfig) {
super(theRoot, loadingConfig);
yamlClassConstructors.put(NodeId.scalar, new ConstructParallelMode());
yamlClassConstructors.put(NodeId.mapping, new ConstructXmlScript());
}
Expand Down
2 changes: 1 addition & 1 deletion versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ version.org.webjars..jquery=3.6.1

version.org.xmlunit..xmlunit-assertj=2.9.0

version.org.yaml..snakeyaml=1.33
version.org.yaml..snakeyaml=2.0

version.org.slf4j..slf4j-simple=1.7.36
## # available=1.8.0-alpha0
Expand Down

0 comments on commit a766113

Please sign in to comment.