Merge branch 'security-stable-1.609' into security-stable-1.625

This commit is contained in:
Jesse Glick committed 2016-04-29 13:36:09 -04:00
commit b85c74fc0c
2 files changed
-256

No files matched your search

@@ -272,37 +272,6 @@ public class XStream2Test {
ConcurrentHashMap<String,String> m = new ConcurrentHashMap<String,String>();
}
/**
* Tests that ConcurrentHashMap is serialized into a more compact format,
* but still can deserialize to older, verbose format.
*/
@Test
public void concurrentHashMapSerialization() throws Exception {
Foo2 foo = new Foo2();
foo.m.put("abc","def");
foo.m.put("ghi","jkl");
File v = File.createTempFile("hashmap", "xml");
try {
new XmlFile(v).write(foo);
// should serialize like map
String xml = FileUtils.readFileToString(v);
assertFalse(xml.contains("java.util.concurrent"));
//System.out.println(xml);
Foo2 deserialized = (Foo2) new XStream2().fromXML(xml);
assertEquals(2,deserialized.m.size());
assertEquals("def", deserialized.m.get("abc"));
assertEquals("jkl", deserialized.m.get("ghi"));
} finally {
v.delete();
}
// should be able to read in old data just fine
Foo2 map = (Foo2) new XStream2().fromXML(getClass().getResourceAsStream("old-concurrentHashMap.xml"));
assertEquals(1,map.m.size());
assertEquals("def",map.m.get("abc"));
}
@Issue("SECURITY-105")
@Test
public void dynamicProxyBlocked() {