diff --git a/pom.xml b/pom.xml index d12a38efe..3a4669ca3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson jackson-base - 2.9.3 + 2.9.4-SNAPSHOT com.fasterxml.jackson.dataformat jackson-dataformat-xml diff --git a/src/test/java/com/fasterxml/jackson/dataformat/xml/deser/CaseInsensitiveDeserTest.java b/src/test/java/com/fasterxml/jackson/dataformat/xml/deser/CaseInsensitiveDeserTest.java index f4aaa7df9..1c49e319a 100644 --- a/src/test/java/com/fasterxml/jackson/dataformat/xml/deser/CaseInsensitiveDeserTest.java +++ b/src/test/java/com/fasterxml/jackson/dataformat/xml/deser/CaseInsensitiveDeserTest.java @@ -5,18 +5,15 @@ import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.XmlTestBase; public class CaseInsensitiveDeserTest extends XmlTestBase { - // [databind#1036] static class BaseResponse { public int errorCode; public String debugMessage; } - // [databind#1438] static class InsensitiveCreator { int v; @@ -35,13 +32,9 @@ public InsensitiveCreator(@JsonProperty("value") int v0) { private final ObjectMapper MAPPER = newObjectMapper(); - private final ObjectMapper INSENSITIVE_MAPPER = newObjectMapper(); - { - INSENSITIVE_MAPPER.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES); - - } + private final ObjectMapper INSENSITIVE_MAPPER = newObjectMapper() + .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES); - // [databind#1036] public void testCaseInsensitive1036() throws Exception { final String DOC = @@ -60,12 +53,4 @@ public void testCaseInsensitive1036() throws Exception verifyException(e, "ErrorCode"); } } - - // [databind#1438] - public void testCreatorWithInsensitive() throws Exception - { - final String DOC = aposToQuotes("3"); - InsensitiveCreator bean = INSENSITIVE_MAPPER.readValue(DOC, InsensitiveCreator.class); - assertEquals(3, bean.v); - } } diff --git a/src/test/java/com/fasterxml/jackson/dataformat/xml/failing/CaseInsensitiveDeser273Test.java b/src/test/java/com/fasterxml/jackson/dataformat/xml/failing/CaseInsensitiveDeser273Test.java new file mode 100644 index 000000000..c9131991b --- /dev/null +++ b/src/test/java/com/fasterxml/jackson/dataformat/xml/failing/CaseInsensitiveDeser273Test.java @@ -0,0 +1,59 @@ +package com.fasterxml.jackson.dataformat.xml.failing; + +import java.util.ArrayList; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.dataformat.xml.XmlTestBase; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +public class CaseInsensitiveDeser273Test extends XmlTestBase +{ + // [dataformat-xml#273] + static class Depots273 + { + public String command; + public String taskId; + + @JacksonXmlElementWrapper(useWrapping = false) + public ArrayList element; + } + + @JsonIgnoreProperties(ignoreUnknown = true) + static class Depot273 + { + @JacksonXmlProperty(isAttribute = true) + public String number; + @JacksonXmlProperty(isAttribute = true) + public String name; + } + + /* + /******************************************************** + /* Test methods + /******************************************************** + */ + + private final ObjectMapper INSENSITIVE_MAPPER = newObjectMapper() + .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES); + + // [dataformat-xml#273] + public void testCaseInsensitiveComplex() throws Exception + { + final String DOC = +"\n"+ +" \n"+ +" \n"+ +"" + ; + + Depots273 result = INSENSITIVE_MAPPER.readValue(DOC, Depots273.class); + assertNotNull(result); + } +}