diff --git a/pom.xml b/pom.xml index b0d3f2297d..0c9896cf35 100644 --- a/pom.xml +++ b/pom.xml @@ -782,7 +782,6 @@ wildfly xml xstream - yaml @@ -1307,7 +1306,6 @@ wildfly xml xstream - yaml diff --git a/yaml/README.md b/yaml/README.md deleted file mode 100644 index ebf403eb57..0000000000 --- a/yaml/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## YAML - -This module contains articles about YAML - -### Relevant articles - - diff --git a/yaml/pom.xml b/yaml/pom.xml deleted file mode 100644 index c801505c6a..0000000000 --- a/yaml/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - 4.0.0 - yaml - 1.0-SNAPSHOT - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.yaml - snakeyaml - 1.21 - - - - - 1.8 - 1.21 - - - \ No newline at end of file diff --git a/yaml/src/test/java/com/baeldung/multiline/MultiLineStringsUnitTest.java b/yaml/src/test/java/com/baeldung/multiline/MultiLineStringsUnitTest.java deleted file mode 100644 index a99de63a47..0000000000 --- a/yaml/src/test/java/com/baeldung/multiline/MultiLineStringsUnitTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.baeldung.multiline; - -import org.junit.Before; -import org.junit.Test; -import org.yaml.snakeyaml.Yaml; - -import java.io.File; -import java.io.InputStream; -import java.util.Map; - -import static org.junit.Assert.assertEquals; - -public class MultiLineStringsUnitTest { - - private Yaml yaml; - - @Before - public void setup() { - yaml = new Yaml(); - } - - @Test - public void whenLiteral_ThenLineBreaksArePresent() { - String key = parseYamlKey("literal.yaml", "key"); - assertEquals("Line1\nLine2\nLine3", key); - } - - @Test - public void whenLiteral_ThenEndingBreaksAreReducedToOne() { - String key = parseYamlKey("literal2.yaml", "key"); - assertEquals("\n\nLine1\n\nLine2\n\nLine3\n", key); - } - - @Test - public void whenFolded_ThenLineBreaksAreReplaced() { - String key = parseYamlKey("folded.yaml", "key"); - assertEquals("Line1 Line2 Line3", key); - } - - @Test - public void whenFolded_ThenEmptyLinesAreReducedToOne() { - String key = parseYamlKey("folded2.yaml", "key"); - assertEquals("Line1 Line2\n\nLine3\n", key); - } - - @Test - public void whenLiteralKeep_ThenLastEmptyLinesArePresent() { - String key = parseYamlKey("literal_keep.yaml", "key"); - assertEquals("Line1\nLine2\nLine3\n\n", key); - } - - @Test - public void whenLiteralStrip_ThenLastEmptyLinesAreRemoved() { - String key = parseYamlKey("literal_strip.yaml", "key"); - assertEquals("Line1\nLine2\nLine3", key); - } - - @Test - public void whenFoldedKeep_ThenLastEmptyLinesArePresent() { - String key = parseYamlKey("folded_keep.yaml", "key"); - assertEquals("Line1 Line2 Line3\n\n\n", key); - } - - @Test - public void whenFoldedStrip_ThenLastEmptyLinesAreRemoved() { - String key = parseYamlKey("folded_strip.yaml", "key"); - assertEquals("Line1 Line2 Line3", key); - } - - @Test - public void whenDoubleQuotes_ThenExplicitBreaksArePreserved() { - String key = parseYamlKey("plain_double_quotes.yaml", "key"); - assertEquals("Line1\nLine2\nLine3", key); - } - - @Test - public void whenSingleQuotes_ThenExplicitBreaksAreIgnored() { - String key = parseYamlKey("plain_single_quotes.yaml", "key"); - assertEquals("Line1\\nLine2\nLine3", key); - } - - String parseYamlKey(String fileName, String key) { - InputStream inputStream = this.getClass() - .getClassLoader() - .getResourceAsStream("multi-line" + File.separator + fileName); - Map parsed = yaml.load(inputStream); - return parsed.get(key); - } - -} diff --git a/yaml/src/test/resources/multi-line/folded.yaml b/yaml/src/test/resources/multi-line/folded.yaml deleted file mode 100644 index c5fa743a08..0000000000 --- a/yaml/src/test/resources/multi-line/folded.yaml +++ /dev/null @@ -1,4 +0,0 @@ -key: > - Line1 - Line2 - Line3 \ No newline at end of file diff --git a/yaml/src/test/resources/multi-line/folded2.yaml b/yaml/src/test/resources/multi-line/folded2.yaml deleted file mode 100644 index 735abf9b2f..0000000000 --- a/yaml/src/test/resources/multi-line/folded2.yaml +++ /dev/null @@ -1,8 +0,0 @@ -key: > - Line1 - Line2 - - - Line3 - - diff --git a/yaml/src/test/resources/multi-line/folded_keep.yaml b/yaml/src/test/resources/multi-line/folded_keep.yaml deleted file mode 100644 index 555291fd26..0000000000 --- a/yaml/src/test/resources/multi-line/folded_keep.yaml +++ /dev/null @@ -1,6 +0,0 @@ -key: >+ - Line1 - Line2 - Line3 - - diff --git a/yaml/src/test/resources/multi-line/folded_strip.yaml b/yaml/src/test/resources/multi-line/folded_strip.yaml deleted file mode 100644 index 0a3a246dc2..0000000000 --- a/yaml/src/test/resources/multi-line/folded_strip.yaml +++ /dev/null @@ -1,7 +0,0 @@ -key: >- - Line1 - Line2 - Line3 - - - diff --git a/yaml/src/test/resources/multi-line/literal.yaml b/yaml/src/test/resources/multi-line/literal.yaml deleted file mode 100644 index 7e02501a33..0000000000 --- a/yaml/src/test/resources/multi-line/literal.yaml +++ /dev/null @@ -1,4 +0,0 @@ -key: | - Line1 - Line2 - Line3 \ No newline at end of file diff --git a/yaml/src/test/resources/multi-line/literal2.yaml b/yaml/src/test/resources/multi-line/literal2.yaml deleted file mode 100644 index 7c7fed0163..0000000000 --- a/yaml/src/test/resources/multi-line/literal2.yaml +++ /dev/null @@ -1,10 +0,0 @@ -key: | - - - Line1 - - Line2 - - Line3 - - diff --git a/yaml/src/test/resources/multi-line/literal_keep.yaml b/yaml/src/test/resources/multi-line/literal_keep.yaml deleted file mode 100644 index 37f22684dd..0000000000 --- a/yaml/src/test/resources/multi-line/literal_keep.yaml +++ /dev/null @@ -1,5 +0,0 @@ -key: |+ - Line1 - Line2 - Line3 - diff --git a/yaml/src/test/resources/multi-line/literal_strip.yaml b/yaml/src/test/resources/multi-line/literal_strip.yaml deleted file mode 100644 index 0791e13d5d..0000000000 --- a/yaml/src/test/resources/multi-line/literal_strip.yaml +++ /dev/null @@ -1,5 +0,0 @@ -key: |- - Line1 - Line2 - Line3 - diff --git a/yaml/src/test/resources/multi-line/plain_double_quotes.yaml b/yaml/src/test/resources/multi-line/plain_double_quotes.yaml deleted file mode 100644 index ccab040a27..0000000000 --- a/yaml/src/test/resources/multi-line/plain_double_quotes.yaml +++ /dev/null @@ -1 +0,0 @@ -key: "Line1\nLine2\nLine3" \ No newline at end of file diff --git a/yaml/src/test/resources/multi-line/plain_single_quotes.yaml b/yaml/src/test/resources/multi-line/plain_single_quotes.yaml deleted file mode 100644 index acbf35a462..0000000000 --- a/yaml/src/test/resources/multi-line/plain_single_quotes.yaml +++ /dev/null @@ -1,3 +0,0 @@ -key: 'Line1\nLine2 - - Line3' \ No newline at end of file