Skip to content

Commit

Permalink
Merge branch '2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 11, 2015
2 parents 605dbd6 + bff35ba commit d22b735
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void testCollectionDefaulting() throws Exception
assertEquals(LinkedList.class, result.getClass());
}

public void testMapDefaulting() throws Exception
public void testMapDefaultingBasic() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
SimpleModule mod = new SimpleModule("test", Version.unknownVersion());
Expand All @@ -64,7 +64,24 @@ public void testMapDefaulting() throws Exception
Map<?,?> result = mapper.readValue("{}", Map.class);
assertEquals(TreeMap.class, result.getClass());
}


/* 11-Feb-2015, tatu: too tricky to fix in 2.5.x; move to 2.6
// [databind#700]
public void testMapDefaultingRecursive() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
SimpleModule mod = new SimpleModule("test", Version.unknownVersion());
// default is HashMap, so:
mod.addAbstractTypeMapping(Map.class, TreeMap.class);
mapper.registerModule(mod);
Object result = mapper.readValue("[ {} ]", Object.class);
assertEquals(ArrayList.class, result.getClass());
Object v = ((List<?>) result).get(0);
assertNotNull(v);
assertEquals(TreeMap.class, v.getClass());
}
*/

public void testInterfaceDefaulting() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
Expand Down

0 comments on commit d22b735

Please sign in to comment.