Search in sources :

Example 11 with YamlReader

use of com.esotericsoftware.yamlbeans.YamlReader in project yamlbeans by EsotericSoftware.

the class Issue101Test method test.

@Test
public void test() throws YamlException {
    StringBuilder sb = new StringBuilder();
    sb.append("!com.esotericsoftware.yamlbeans.issues.issue101.Issue101Test$TestObject").append(LINE_SEPARATOR);
    sb.append("test: test");
    YamlReader yamlReader = new YamlReader(sb.toString());
    TestObject testObject = (TestObject) yamlReader.read();
    assertEquals("test", testObject.test);
    sb = new StringBuilder();
    sb.append("!<!com.esotericsoftware.yamlbeans.issues.issue101.Issue101Test$TestObject>").append(LINE_SEPARATOR);
    sb.append("test: test");
    yamlReader = new YamlReader(sb.toString());
    testObject = (TestObject) yamlReader.read();
    assertEquals("test", testObject.test);
}
Also used : YamlReader(com.esotericsoftware.yamlbeans.YamlReader) Test(org.junit.Test)

Aggregations

YamlReader (com.esotericsoftware.yamlbeans.YamlReader)11 YamlException (com.esotericsoftware.yamlbeans.YamlException)5 InputStreamReader (java.io.InputStreamReader)5 Map (java.util.Map)4 FileReader (java.io.FileReader)3 InputStream (java.io.InputStream)3 ArrayList (java.util.ArrayList)3 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 ConfigurationException (org.audit4j.core.exception.ConfigurationException)2 Test (org.junit.Test)2 YamlConfig (com.esotericsoftware.yamlbeans.YamlConfig)1 YamlWriter (com.esotericsoftware.yamlbeans.YamlWriter)1 File (java.io.File)1 Reader (java.io.Reader)1 StringWriter (java.io.StringWriter)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Point2d (javax.vecmath.Point2d)1