Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade snakeyaml to 2.0 #2903

Merged
merged 1 commit into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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