diff options
author | Tatu Saloranta <tsaloranta@gmail.com> | 2011-12-25 21:54:15 -0800 |
---|---|---|
committer | Tatu Saloranta <tsaloranta@gmail.com> | 2011-12-25 21:54:15 -0800 |
commit | ffbadea73497dbd251c17172ec7054518e291704 (patch) | |
tree | 686ca5873a2e8861e5f5f27f1ce625302bcf5a61 | |
parent | 1f016edf6d12abc5126d8f644c1abd669048f9c5 (diff) | |
download | jackson-databind-ffbadea73497dbd251c17172ec7054518e291704.tar.gz |
...
-rw-r--r-- | src/test/java/com/fasterxml/jackson/databind/deser/TestGenericsBounded.java | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericsBounded.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericsBounded.java index a31424250..cfe0a7f81 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericsBounded.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericsBounded.java @@ -1,8 +1,7 @@ -package com.fasterxml.jackson.databind.deser; +package org.codehaus.jackson.map.deser; import java.util.*; - import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.*; @@ -57,7 +56,21 @@ public class TestGenericsBounded static class IntBeanWrapper<T extends IntBean> { public T wrapped; } + + // Helper types for [JACKSON-743] + public static abstract class Base<T> { + public T inconsequential = null; + } + + public static abstract class BaseData<T> { + public T dataObj; + } + + public static class Child extends Base<Long> { + public static class ChildData extends BaseData<List<String>> { } + } + /* /******************************************************* /* Unit tests @@ -73,10 +86,7 @@ public class TestGenericsBounded assertEquals(3, result.wrapped.x); } - /** - * Test related to type bound handling problem within - * [JACKSON-190] - */ + // Test related to type bound handling problem within [JACKSON-190] public void testBounded() throws Exception { ObjectMapper mapper = new ObjectMapper(); @@ -99,4 +109,15 @@ public class TestGenericsBounded assertEquals(-0.5, out.start); assertEquals(0.5, out.end); } + + // Reproducing issue 743 + public void testResolution743() throws Exception + { + String s3 = "{\"dataObj\" : [ \"one\", \"two\", \"three\" ] }"; + ObjectMapper m = new ObjectMapper(); + + Child.ChildData d = m.readValue(s3, Child.ChildData.class); + assertNotNull(d.dataObj); + assertEquals(3, d.dataObj.size()); + } } |