Dump/Load fails
---------------
Key: JRUBY-2091
URL: http://jira.codehaus.org/browse/JRUBY-2091
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Environment: Using jyYAML version 2.1 jar
Reporter: Jason Kary
package com;
import junit.framework.TestCase;
import org.jvyaml.YAML;
public class YAMLTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();
}
public void testSerialDeserial() {
SimpleObj obj = new SimpleObj();
obj.a = "FOO";
obj.b = "BAR";
String foo = YAML.dump(obj, YAML.config().useVersion(true));
assertNotNull( foo );
System.out.println( foo );
Object test = YAML.load(foo);
}
}
class SimpleObj {
String a;
String b;
public String getA() {
return a;
}
public void setA(String a) {
this.a = a;
}
public String getB() {
return b;
}
public void setB(String b) {
this.b = b;
}
}
This code produces the following:
%YAML 1.1
--- !java/object:com.SimpleObj
b: &id1
a: *id1
With the exception trace
while scanning a node
expected the node content, but found org.jvyaml.tokens.KeyToken
org.jvyaml.ParserException: ParserException while scanning a node we had this
expected the node content, but found org.jvyaml.tokens.KeyToken
at org.jvyaml.ParserImpl$10.produce(ParserImpl.java:261)
at org.jvyaml.ParserImpl.parseStreamNext(ParserImpl.java:796)
at org.jvyaml.ParserImpl.peekEvent(ParserImpl.java:747)
at org.jvyaml.ComposerImpl.composeNode(ComposerImpl.java:106)
at org.jvyaml.ComposerImpl.composeNode(ComposerImpl.java:168)
at org.jvyaml.ComposerImpl.composeDocument(ComposerImpl.java:95)
at org.jvyaml.ComposerImpl.getNode(ComposerImpl.java:71)
at org.jvyaml.BaseConstructorImpl.getData(BaseConstructorImpl.java:88)
at org.jvyaml.YAML.load(YAML.java:179)
at org.jvyaml.YAML.load(YAML.java:161)
at
com.cisco.hrit.acq.excel.YAMLTest.testSerialDeserial(YAMLTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email