Skip to content

Commit

Permalink
Merge pull request #2071 from svanoort/remove-broken-xstream-test
Browse files Browse the repository at this point in the history
Remove broken XStream2 test of legacy custom ConcurrentHashMapSerialization
  • Loading branch information
jglick committed Mar 7, 2016
2 parents 738800e + 7dd7296 commit 785811a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 326 deletions.
69 changes: 0 additions & 69 deletions core/src/main/java/hudson/util/ConcurrentHashMapConverter.java

This file was deleted.

1 change: 0 additions & 1 deletion core/src/main/java/hudson/util/XStream2.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ private void init() {
registerConverter(new ImmutableSortedSetConverter(getMapper(),getReflectionProvider()),10);
registerConverter(new ImmutableSetConverter(getMapper(),getReflectionProvider()),10);
registerConverter(new ImmutableListConverter(getMapper(),getReflectionProvider()),10);
registerConverter(new ConcurrentHashMapConverter(getMapper(),getReflectionProvider()),10);
registerConverter(new CopyOnWriteMap.Tree.ConverterImpl(getMapper()),10); // needs to override MapConverter
registerConverter(new DescribableList.ConverterImpl(getMapper()),10); // explicitly added to handle subtypes
registerConverter(new Label.ConverterImpl(),10);
Expand Down
31 changes: 0 additions & 31 deletions core/src/test/java/hudson/util/XStream2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,37 +272,6 @@ public static class Foo2 {
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() {
Expand Down
225 changes: 0 additions & 225 deletions core/src/test/resources/hudson/util/old-concurrentHashMap.xml

This file was deleted.

0 comments on commit 785811a

Please sign in to comment.