[BAEL-3750] deleted the yaml module
This commit is contained in:
parent
2b51ce0ebc
commit
7feb9bfb1e
2
pom.xml
2
pom.xml
|
@ -782,7 +782,6 @@
|
|||
<module>wildfly</module>
|
||||
<module>xml</module>
|
||||
<module>xstream</module>
|
||||
<module>yaml</module>
|
||||
</modules>
|
||||
|
||||
</profile>
|
||||
|
@ -1307,7 +1306,6 @@
|
|||
<module>wildfly</module>
|
||||
<module>xml</module>
|
||||
<module>xstream</module>
|
||||
<module>yaml</module>
|
||||
</modules>
|
||||
|
||||
</profile>
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
## YAML
|
||||
|
||||
This module contains articles about YAML
|
||||
|
||||
### Relevant articles
|
||||
|
||||
|
29
yaml/pom.xml
29
yaml/pom.xml
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yaml</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<snakeyaml.version>1.21</snakeyaml.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -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<String, String> parsed = yaml.load(inputStream);
|
||||
return parsed.get(key);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
key: >
|
||||
Line1
|
||||
Line2
|
||||
Line3
|
|
@ -1,8 +0,0 @@
|
|||
key: >
|
||||
Line1
|
||||
Line2
|
||||
|
||||
|
||||
Line3
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
key: >+
|
||||
Line1
|
||||
Line2
|
||||
Line3
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
key: >-
|
||||
Line1
|
||||
Line2
|
||||
Line3
|
||||
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
key: |
|
||||
Line1
|
||||
Line2
|
||||
Line3
|
|
@ -1,10 +0,0 @@
|
|||
key: |
|
||||
|
||||
|
||||
Line1
|
||||
|
||||
Line2
|
||||
|
||||
Line3
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
key: |+
|
||||
Line1
|
||||
Line2
|
||||
Line3
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
key: |-
|
||||
Line1
|
||||
Line2
|
||||
Line3
|
||||
|
|
@ -1 +0,0 @@
|
|||
key: "Line1\nLine2\nLine3"
|
|
@ -1,3 +0,0 @@
|
|||
key: 'Line1\nLine2
|
||||
|
||||
Line3'
|
Loading…
Reference in New Issue