Log Message
Merge test changes from HEAD.
Modified Paths
- branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/SerializationNestedWriteObjectsTest.java
- branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/annotations/AnnotationsTest.java
Property Changed
Diff
Property changes: branches/v-1.4.x
Modified: svn:mergeinfo
Modified: branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/SerializationNestedWriteObjectsTest.java (2292 => 2293)
--- branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/SerializationNestedWriteObjectsTest.java 2014-07-02 12:01:16 UTC (rev 2292)
+++ branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/SerializationNestedWriteObjectsTest.java 2014-07-03 18:01:52 UTC (rev 2293)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2010, 2012 XStream Committers.
+ * Copyright (C) 2006, 2007, 2010, 2012, 2014 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -207,17 +207,17 @@
xstream.alias("raw", RawString.class);
String expectedXml = ""
- + "<object-stream>\n"
+ + "<root>\n"
+ " <raw serialization=\"custom\">\n"
+ " <raw>\n"
+ " <byte>7</byte>\n"
+ " <byte-array>WFN0cmVhbQ==</byte-array>\n"
+ " </raw>\n"
+ " </raw>\n"
- + "</object-stream>";
+ + "</root>";
StringWriter stringWriter = new StringWriter();
- ObjectOutputStream os = xstream.createObjectOutputStream(stringWriter);
+ ObjectOutputStream os = xstream.createObjectOutputStream(stringWriter, "root");
os.writeObject(new RawString("XStream"));
os.close();
String actualXml = stringWriter.getBuffer().toString();
Modified: branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/annotations/AnnotationsTest.java (2292 => 2293)
--- branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/annotations/AnnotationsTest.java 2014-07-02 12:01:16 UTC (rev 2292)
+++ branches/v-1.4.x/xstream/src/test/com/thoughtworks/acceptance/annotations/AnnotationsTest.java 2014-07-03 18:01:52 UTC (rev 2293)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005, 2006 Joe Walnes.
- * Copyright (C) 2006, 2007, 2008 XStream Committers.
+ * Copyright (C) 2006, 2007, 2008, 2014 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -16,6 +16,9 @@
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamInclude;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
@@ -170,6 +173,23 @@
assertEquals(internalType, xstream.fromXML(xml));
}
+ public void testForClassInObjectStreamIsDetectedAtDeserialization() throws IOException, ClassNotFoundException {
+ // must preprocess annotations here
+ xstream.processAnnotations(InternalType.class);
+ xstream.ignoreUnknownElements();
+ InternalType internalType = new InternalType();
+ String xml = ""
+ + "<root>\n"
+ + " <second>\n"
+ + " <aliased>value</aliased>\n"
+ + " <none>1</none>\n"
+ + " </second>\n"
+ + "</root>";
+ ObjectInputStream in = xstream.createObjectInputStream(new StringReader(xml));
+ assertEquals(internalType, in.readObject());
+ in.close();
+ }
+
@XStreamInclude({InternalType.class})
interface Include {
}
To unsubscribe from this list please visit:
