diff --git a/format/yaml/build.gradle.kts b/format/yaml/build.gradle.kts index 45b26b034..dbf1a21e4 100644 --- a/format/yaml/build.gradle.kts +++ b/format/yaml/build.gradle.kts @@ -4,6 +4,12 @@ import org.spongepowered.configurate.build.useAutoValue plugins { id("org.spongepowered.configurate.build.component") + groovy // For writing tests +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } description = "YAML format loader for Configurate" @@ -13,6 +19,11 @@ dependencies { api(core()) // When updating snakeyaml, check ConfigurateScanner for changes against upstream implementation("org.yaml:snakeyaml:1.+") + + testImplementation("org.codehaus.groovy:groovy:3.+:indy") + testImplementation("org.codehaus.groovy:groovy-nio:3.+:indy") + testImplementation("org.codehaus.groovy:groovy-test-junit5:3.+:indy") + testImplementation("org.codehaus.groovy:groovy-templates:3.+:indy") } tasks.compileJava { diff --git a/format/yaml/src/main/java/org/spongepowered/configurate/yaml/YamlParser.java b/format/yaml/src/main/java/org/spongepowered/configurate/yaml/YamlParser.java index 74a7b9199..82facde85 100644 --- a/format/yaml/src/main/java/org/spongepowered/configurate/yaml/YamlParser.java +++ b/format/yaml/src/main/java/org/spongepowered/configurate/yaml/YamlParser.java @@ -189,7 +189,7 @@ void mapping(final ConfigurationNode node) throws ParsingException { if (!child.virtual()) { // duplicate keys are forbidden (3.2.1.3) throw makeError(node, "Duplicate key '" + child.key() + "' encountered!", null); } - value(node.node(child)); + value(child); } requireEvent(Event.ID.MappingEnd); diff --git a/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/CommentTest.groovy b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/CommentTest.groovy new file mode 100644 index 000000000..4daee7a7e --- /dev/null +++ b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/CommentTest.groovy @@ -0,0 +1,163 @@ +/* + * Configurate + * Copyright (C) zml and Configurate contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.spongepowered.configurate.yaml + +import static org.junit.jupiter.api.Assertions.assertEquals +import static org.junit.jupiter.api.Assertions.assertFalse +import static org.junit.jupiter.api.Assertions.assertNull + +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test +import org.spongepowered.configurate.CommentedConfigurationNode + +class CommentTest implements YamlTest { + + @Test + void testLoadScalarComment() { + final CommentedConfigurationNode node = parseString(""" + # Hello world + "i'm a string" + """.stripIndent()) + + assertEquals("Hello world", node.comment()) + assertEquals("i'm a string", node.raw()) + } + + @Test + void testLoadBlockMappingComment() { + final CommentedConfigurationNode node = parseString(""" + test: + # meow + cat: purrs + """.stripIndent()) + + assertEquals("purrs", node.node("test", "cat").raw()) + assertEquals("meow", node.node("test", "cat").comment()) + } + + @Test + void testLoadBlockScalarSequenceComment() { + final CommentedConfigurationNode test = parseString(""" + - first + # i matter less + - second + - third + # we skipped one + - fourth + """.stripIndent()) + + assertNull(test.node(0).comment()) + assertEquals("i matter less", test.node(1).comment()) + assertEquals("we skipped one", test.node(3).comment()) + } + + @Test + @Disabled("This doesn't seem to associate comments with the first map entry properly") + void testLoadScalarCommentsInBlockMapping() { + final CommentedConfigurationNode test = parseString(""" + blah: + # beginning sequence + - # first on map entry + test: hello + - # on second mapping + test2: goodbye + """.stripIndent(true)) + + final CommentedConfigurationNode child = test.node("blah", 0) + assertFalse(child.virtual()) + assertEquals("beginning sequence", child.comment()) + assertEquals("first on map entry", child.node("test").comment()) + assertEquals("on second mapping", child.node("test2").comment()) + } + + // flow collections are a bit trickier + // we can't really do comments on one line, so these all have to have a line per element + + @Test + void testLoadCommentInFlowMapping() { + final CommentedConfigurationNode test = parseString(""" + { + # hello + test: value, + uncommented: thing, + #hi there + last: bye + } + """.stripIndent()) + + assertEquals("hello", test.node("test").comment()) + assertNull(test.node("uncommented").comment()) + assertEquals("hi there", test.node("last").comment()) + } + + @Test + void testLoadCommentInFlowSequence() { + final CommentedConfigurationNode test = parseString(""" + # on list + [ + # first + 'first entry', + # second + 'second entry' + ] + """.stripIndent()) + + assertEquals("on list", test.comment()) + assertEquals("first", test.node(0).comment()) + assertEquals("second", test.node(1).comment()) + } + + @Test + void testLoadMixedStructure() { + final CommentedConfigurationNode test = parseResource(getClass().getResource("/comments-complex.yml")) + + } + + @Test + void testWriteScalarCommented() { + final CommentedConfigurationNode node = CommentedConfigurationNode.root() + .raw("test") + .comment("i have a comment") + + assertEquals(""" + # i have a comment + test + """.stripIndent(), + dump(node)) + } + + @Test + void testWriteBlockMappingCommented() { + + } + + @Test + void testWriteBlockSequenceCommented() { + + } + + @Test + void testWriteFlowMappingCommented() { + + } + + @Test + void testWriteFlowSequenceCommented() { + + } + +} diff --git a/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlConfigurationLoaderTest.groovy b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlConfigurationLoaderTest.groovy new file mode 100644 index 000000000..ea3cd20a7 --- /dev/null +++ b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlConfigurationLoaderTest.groovy @@ -0,0 +1,104 @@ +/* + * Configurate + * Copyright (C) zml and Configurate contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.spongepowered.configurate.yaml + +import static org.junit.jupiter.api.Assertions.assertEquals + +import io.leangen.geantyref.TypeToken +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.io.TempDir +import org.spongepowered.configurate.BasicConfigurationNode +import org.spongepowered.configurate.CommentedConfigurationNode +import org.spongepowered.configurate.ConfigurateException +import org.spongepowered.configurate.ConfigurationNode +import org.spongepowered.configurate.loader.ConfigurationLoader + +import java.nio.charset.StandardCharsets +import java.nio.file.Path + +/** + * Basic sanity checks for the loader. + */ +class YamlConfigurationLoaderTest { + + @Test + void testSimpleLoading() throws ConfigurateException { + final def url = getClass().getResource("/example.yml") + final def out = new StringWriter() + final def loader = YamlConfigurationLoader.builder() + .url(url) + .sink(() -> new BufferedWriter(out)).build() + final def node = loader.load() + + assertEquals("unicorn", node.node("test", "op-level").raw()) + assertEquals("dragon", node.node("other", "op-level").raw()) + assertEquals("dog park", node.node("other", "location").raw()) + + loader.save(node) + println(out.toString()) + + final def fooList = new ArrayList<>(node.node("foo") + .getList(new TypeToken>>() {})) + assertEquals(0, fooList.get(0).get("bar").size()) + + } + + @Test + void testReadWithTabs() throws ConfigurateException { + final def expected = CommentedConfigurationNode.root(n -> { + n.node("document").act(d -> { + d.node("we").raw("support tabs") + d.node("and").raw("literal tabs\tin strings") + d.node("with").act(w -> { + w.appendListNode().raw("more levels") + w.appendListNode().raw("of indentation") + }) + }) + }) + + final URL url = getClass().getResource("/tab-example.yml") + final ConfigurationLoader loader = YamlConfigurationLoader.builder() + .url(url).build() + final ConfigurationNode node = loader.load() + assertEquals(expected, node) + } + + @Test + void testWriteBasicFile(final @TempDir Path tempDir) throws ConfigurateException, IOException { + final Path target = tempDir.resolve("write-basic.yml") + final ConfigurationNode node = BasicConfigurationNode.root(n -> { + n.node("mapping", "first").set("hello") + n.node("mapping", "second").set("world") + + n.node("list").act(c -> { + c.appendListNode().set(1) + c.appendListNode().set(2) + c.appendListNode().set(3) + c.appendListNode().set(4) + }) + }) + + final YamlConfigurationLoader loader = YamlConfigurationLoader.builder() + .path(target) + .nodeStyle(NodeStyle.BLOCK) + .build() + + loader.save(node) + + assertEquals(getClass().getResource("write-expected.yml").getText(StandardCharsets.UTF_8.name()), target.getText(StandardCharsets.UTF_8.name())) + } +} diff --git a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlParserTest.java b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlParserTest.groovy similarity index 60% rename from format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlParserTest.java rename to format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlParserTest.groovy index 135dc147d..9a75e87e4 100644 --- a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlParserTest.java +++ b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlParserTest.groovy @@ -14,30 +14,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.spongepowered.configurate.yaml; +package org.spongepowered.configurate.yaml -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull +import static org.junit.jupiter.api.Assertions.assertThrows +import static org.junit.jupiter.api.Assertions.assertTrue -import org.junit.jupiter.api.Test; -import org.spongepowered.configurate.ConfigurationNode; +import org.junit.jupiter.api.Test +import org.spongepowered.configurate.ConfigurationNode -import java.io.IOException; +import java.io.IOException -public class YamlParserTest implements YamlTest { +class YamlParserTest implements YamlTest { @Test void testEmptyDocument() throws IOException { - final ConfigurationNode result = parseString(""); - assertTrue(result.empty()); - assertNull(result.raw()); + final ConfigurationNode result = parseString("") + assertTrue(result.empty()) + assertNull(result.raw()) } @Test void testDuplicateKeysForbidden() throws IOException { assertTrue(assertThrows(IOException.class, () -> parseString("{duplicated: 1, duplicated: 2}")) - .getMessage().contains("Duplicate key")); + .getMessage().contains("Duplicate key")) } } diff --git a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlTest.java b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlTest.groovy similarity index 55% rename from format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlTest.java rename to format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlTest.groovy index d7ed1db85..e494eb9b3 100644 --- a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlTest.java +++ b/format/yaml/src/test/groovy/org/spongepowered/configurate/yaml/YamlTest.groovy @@ -14,66 +14,66 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.spongepowered.configurate.yaml; +package org.spongepowered.configurate.yaml -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull +import static org.junit.jupiter.api.Assertions.fail -import org.checkerframework.checker.nullness.qual.Nullable; -import org.spongepowered.configurate.CommentedConfigurationNode; -import org.yaml.snakeyaml.reader.StreamReader; +import org.checkerframework.checker.nullness.qual.Nullable +import org.spongepowered.configurate.CommentedConfigurationNode +import org.yaml.snakeyaml.reader.StreamReader -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.StringWriter; -import java.net.URL; -import java.nio.charset.StandardCharsets; +import java.io.BufferedReader +import java.io.BufferedWriter +import java.io.IOException +import java.io.InputStreamReader +import java.io.StringWriter +import java.net.URL +import java.nio.charset.StandardCharsets -public interface YamlTest { +interface YamlTest { default CommentedConfigurationNode parseString(final String input) { - final YamlParser parser = new YamlParser(new ConfigurateScanner(new StreamReader(input))); - final CommentedConfigurationNode result = CommentedConfigurationNode.root(); + final YamlParser parser = new YamlParser(new ConfigurateScanner(new StreamReader(input))) + final CommentedConfigurationNode result = CommentedConfigurationNode.root() try { - parser.singleDocumentStream(result); + parser.singleDocumentStream(result) } catch (final IOException ex) { - fail(ex); + fail(ex) } - return result; + return result } default CommentedConfigurationNode parseResource(final URL url) { - assertNotNull(url, "Expected resource is missing"); + assertNotNull(url, "Expected resource is missing") try { try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8))) { - final YamlParser parser = new YamlParser(new ConfigurateScanner(new StreamReader(reader))); - final CommentedConfigurationNode result = CommentedConfigurationNode.root(); - parser.singleDocumentStream(result); - return result; + final YamlParser parser = new YamlParser(new ConfigurateScanner(new StreamReader(reader))) + final CommentedConfigurationNode result = CommentedConfigurationNode.root() + parser.singleDocumentStream(result) + return result } } catch (final IOException ex) { - fail(ex); - throw new AssertionError(); + fail(ex) + throw new AssertionError() } } default String dump(final CommentedConfigurationNode input) { - return dump(input, null); + return dump(input, null) } - default String dump(final CommentedConfigurationNode input, final @Nullable NodeStyle preferredStyle) { - final StringWriter writer = new StringWriter(); + default String dump(final CommentedConfigurationNode input, final NodeStyle preferredStyle) { + final StringWriter writer = new StringWriter() try { YamlConfigurationLoader.builder() - .sink(() -> new BufferedWriter(writer)) + .sink { new BufferedWriter(writer) } .nodeStyle(preferredStyle) - .build().save(input); + .build().save(input) } catch (IOException e) { - fail(e); + fail(e) } - return writer.toString(); + return writer.toString() } } diff --git a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/CommentTest.java b/format/yaml/src/test/java/org/spongepowered/configurate/yaml/CommentTest.java deleted file mode 100644 index 339abf6f1..000000000 --- a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/CommentTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Configurate - * Copyright (C) zml and Configurate contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.spongepowered.configurate.yaml; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; - -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.spongepowered.configurate.CommentedConfigurationNode; - -public class CommentTest implements YamlTest { - - @Test - void testLoadScalarComment() { - final CommentedConfigurationNode node = parseString( - "# Hello world\n" - + "\"i'm a string\"" - ); - - assertEquals("Hello world", node.comment()); - assertEquals("i'm a string", node.raw()); - } - - @Test - void testLoadBlockMappingComment() { - final CommentedConfigurationNode node = parseString( - "test:\n" - + " # meow\n" - + " cat: purrs\n" - ); - - assertEquals("purrs", node.node("test", "cat").raw()); - assertEquals("meow", node.node("test", "cat").comment()); - } - - @Test - void testLoadBlockScalarSequenceComment() { - final CommentedConfigurationNode test = parseString( - "- first\n" - + "# i matter less\n" - + "- second\n" - + "- third\n" - + "# we skipped one\n" - + "- fourth\n" - ); - - assertNull(test.node(0).comment()); - assertEquals("i matter less", test.node(1).comment()); - assertEquals("we skipped one", test.node(3).comment()); - } - - @Test - @Disabled("This doesn't seem to associate comments with the first map entry properly") - void testLoadScalarCommentsInBlockMapping() { - final CommentedConfigurationNode test = parseString( - "blah:\n" - + "# beginning sequence\n" - + "- # first on map entry\n" - + " test: hello\n" - + " # on second mapping\n" - + " test2: goodbye\n" - ); - - final CommentedConfigurationNode child = test.node("blah", 0); - assertFalse(child.virtual()); - assertEquals("beginning sequence", child.comment()); - assertEquals("first on map entry", child.node("test").comment()); - assertEquals("on second mapping", child.node("test2").comment()); - } - - // flow collections are a bit trickier - // we can't really do comments on one line, so these all have to have a line per element - - @Test - void testLoadCommentInFlowMapping() { - final CommentedConfigurationNode test = parseString( - "{\n" - + "# hello\n" - + "test: value,\n" - + "uncommented: thing,\n" - + "#hi there\n" - + "last: bye\n" - + "}\n" - ); - - assertEquals("hello", test.node("test").comment()); - assertNull(test.node("uncommented").comment()); - assertEquals("hi there", test.node("last").comment()); - } - - @Test - void testLoadCommentInFlowSequence() { - final CommentedConfigurationNode test = parseString( - "# on list\n" - + "[\n" - + " # first\n" - + " 'first entry',\n" - + " # second\n" - + " 'second entry'\n" - + "]" - ); - - assertEquals("on list", test.comment()); - assertEquals("first", test.node(0).comment()); - assertEquals("second", test.node(1).comment()); - } - - @Test - void testLoadMixedStructure() { - final CommentedConfigurationNode test = parseResource(getClass().getResource("/comments-complex.yml")); - - } - - @Test - void testWriteScalarCommented() { - final CommentedConfigurationNode node = CommentedConfigurationNode.root() - .raw("test") - .comment("i have a comment"); - - assertEquals( - "# i have a comment\n" - + "test\n", - dump(node)); - } - - @Test - void testWriteBlockMappingCommented() { - - } - - @Test - void testWriteBlockSequenceCommented() { - - } - - @Test - void testWriteFlowMappingCommented() { - - } - - @Test - void testWriteFlowSequenceCommented() { - - } - -} diff --git a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlConfigurationLoaderTest.java b/format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlConfigurationLoaderTest.java deleted file mode 100644 index 330cd74c7..000000000 --- a/format/yaml/src/test/java/org/spongepowered/configurate/yaml/YamlConfigurationLoaderTest.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Configurate - * Copyright (C) zml and Configurate contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.spongepowered.configurate.yaml; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import io.leangen.geantyref.TypeToken; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.spongepowered.configurate.BasicConfigurationNode; -import org.spongepowered.configurate.CommentedConfigurationNode; -import org.spongepowered.configurate.ConfigurateException; -import org.spongepowered.configurate.ConfigurationNode; -import org.spongepowered.configurate.loader.ConfigurationLoader; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.StringWriter; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * Basic sanity checks for the loader. - */ -public class YamlConfigurationLoaderTest { - - @Test - void testSimpleLoading() throws ConfigurateException { - final URL url = getClass().getResource("/example.yml"); - final StringWriter out = new StringWriter(); - final ConfigurationLoader loader = YamlConfigurationLoader.builder() - .url(url) - .sink(() -> new BufferedWriter(out)).build(); - final ConfigurationNode node = loader.load(); - assertEquals("unicorn", node.node("test", "op-level").raw()); - assertEquals("dragon", node.node("other", "op-level").raw()); - assertEquals("dog park", node.node("other", "location").raw()); - - - loader.save(node); - System.out.println(out.toString()); - - final List>> fooList = new ArrayList<>(node.node("foo") - .getList(new TypeToken>>() {})); - assertEquals(0, fooList.get(0).get("bar").size()); - - } - - @Test - void testReadWithTabs() throws ConfigurateException { - final ConfigurationNode expected = CommentedConfigurationNode.root(n -> { - n.node("document").act(d -> { - d.node("we").raw("support tabs"); - d.node("and").raw("literal tabs\tin strings"); - d.node("with").act(w -> { - w.appendListNode().raw("more levels"); - w.appendListNode().raw("of indentation"); - }); - }); - }); - - final URL url = getClass().getResource("/tab-example.yml"); - final ConfigurationLoader loader = YamlConfigurationLoader.builder() - .url(url).build(); - final ConfigurationNode node = loader.load(); - assertEquals(expected, node); - } - - @Test - void testWriteBasicFile(final @TempDir Path tempDir) throws ConfigurateException, IOException { - final Path target = tempDir.resolve("write-basic.yml"); - final ConfigurationNode node = BasicConfigurationNode.root(n -> { - n.node("mapping", "first").set("hello"); - n.node("mapping", "second").set("world"); - - n.node("list").act(c -> { - c.appendListNode().set(1); - c.appendListNode().set(2); - c.appendListNode().set(3); - c.appendListNode().set(4); - }); - }); - - final YamlConfigurationLoader loader = YamlConfigurationLoader.builder() - .path(target) - .nodeStyle(NodeStyle.BLOCK) - .build(); - - loader.save(node); - - assertEquals(readLines(getClass().getResource("write-expected.yml")), Files.readAllLines(target, StandardCharsets.UTF_8)); - } - - private static List readLines(final URL source) throws IOException { - try (BufferedReader reader = new BufferedReader(new InputStreamReader(source.openStream(), StandardCharsets.UTF_8))) { - return reader.lines().collect(Collectors.toList()); - } - } - -} diff --git a/gradle/dependencies/format-yaml.lock b/gradle/dependencies/format-yaml.lock index 08780c4e1..3aca1239c 100644 --- a/gradle/dependencies/format-yaml.lock +++ b/gradle/dependencies/format-yaml.lock @@ -58,6 +58,11 @@ org.checkerframework:checker-qual:2.10.0=annotationProcessor,errorprone,testAnno org.checkerframework:checker-qual:3.5.0=checkstyle org.checkerframework:checker-qual:3.8.0=compileClasspath,testCompileClasspath org.checkerframework:dataflow-shaded:3.1.2=annotationProcessor,errorprone,testAnnotationProcessor +org.codehaus.groovy:groovy-nio:3.0.6=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.6=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-test-junit5:3.0.6=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-xml:3.0.6=testRuntimeClasspath +org.codehaus.groovy:groovy:3.0.6=testCompileClasspath,testRuntimeClasspath org.codehaus.mojo:animal-sniffer-annotations:1.17=annotationProcessor,errorprone,testAnnotationProcessor org.ec4j.core:ec4j-core:0.2.2=ktlint org.hamcrest:hamcrest-core:1.3=ktlint @@ -74,6 +79,7 @@ org.junit.jupiter:junit-jupiter-api:5.7.0=testCompileClasspath,testRuntimeClassp org.junit.jupiter:junit-jupiter-engine:5.7.0=testRuntimeClasspath org.junit.platform:junit-platform-commons:1.7.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.7.0=testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.7.0=testRuntimeClasspath org.junit:junit-bom:5.7.0=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.0-beta=pmd