[Git][java-team/jackson-dataformat-xml][master] 4 commits: New upstream version 2.10.1

Markus Koschany gitlab at salsa.debian.org
Sun Dec 15 21:16:52 GMT 2019



Markus Koschany pushed to branch master at Debian Java Maintainers / jackson-dataformat-xml


Commits:
609d7362 by Markus Koschany at 2019-12-15T20:57:55Z
New upstream version 2.10.1
- - - - -
74d62e50 by Markus Koschany at 2019-12-15T20:58:01Z
Update upstream source from tag 'upstream/2.10.1'

Update to upstream version '2.10.1'
with Debian dir 5edfe6acbd11abfcac80ba256dd758eedf2d4053
- - - - -
91e8592c by Markus Koschany at 2019-12-15T20:58:29Z
Update jackson-base-version.patch

- - - - -
595594da by Markus Koschany at 2019-12-15T20:59:11Z
Update changelog

- - - - -


10 changed files:

- debian/changelog
- debian/patches/jackson-base-version.patch
- pom.xml
- release-notes/VERSION-2.x
- src/test/java/com/fasterxml/jackson/dataformat/xml/failing/DefaultTyping325Test.java → src/test/java/com/fasterxml/jackson/dataformat/xml/deser/DefaultTyping325Test.java
- src/test/java/com/fasterxml/jackson/dataformat/xml/deser/XsiNil354Test.java
- + src/test/java/com/fasterxml/jackson/dataformat/xml/failing/EmptyBeanDeser318Test.java
- + src/test/java/com/fasterxml/jackson/dataformat/xml/failing/ListDeser319Test.java
- + src/test/java/com/fasterxml/jackson/dataformat/xml/failing/XsiNil366Test.java
- src/test/java/com/fasterxml/jackson/dataformat/xml/misc/RootNameTest.java


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+jackson-dataformat-xml (2.10.1-1) unstable; urgency=medium
+
+  * New upstream version 2.10.1.
+
+ -- Markus Koschany <apo at debian.org>  Sun, 15 Dec 2019 21:58:57 +0100
+
 jackson-dataformat-xml (2.10.0-1) unstable; urgency=medium
 
   * New upstream version 2.10.0.


=====================================
debian/patches/jackson-base-version.patch
=====================================
@@ -14,7 +14,7 @@ index b72dfa1..3264169 100644
    <parent>
      <groupId>com.fasterxml.jackson</groupId>
      <artifactId>jackson-base</artifactId>
--    <version>2.10.0</version>
+-    <version>2.10.1</version>
 +    <version>debian</version>
    </parent>
    <groupId>com.fasterxml.jackson.dataformat</groupId>


=====================================
pom.xml
=====================================
@@ -4,11 +4,11 @@
   <parent>
     <groupId>com.fasterxml.jackson</groupId>
     <artifactId>jackson-base</artifactId>
-    <version>2.10.0</version>
+    <version>2.10.1</version>
   </parent>
   <groupId>com.fasterxml.jackson.dataformat</groupId>
   <artifactId>jackson-dataformat-xml</artifactId>
-  <version>2.10.0</version>
+  <version>2.10.1</version>
   <name>Jackson-dataformat-XML</name>
   <packaging>bundle</packaging>
   <description>Data format extension for Jackson (http://jackson.codehaus.org) to offer
@@ -21,7 +21,7 @@ Some data-binding types overridden as well (ObjectMapper sub-classed as XmlMappe
     <connection>scm:git:git at github.com:FasterXML/jackson-dataformat-xml.git</connection>
     <developerConnection>scm:git:git at github.com:FasterXML/jackson-dataformat-xml.git</developerConnection>
     <url>http://github.com/FasterXML/jackson-dataformat-xml</url>    
-    <tag>jackson-dataformat-xml-2.10.0</tag>
+    <tag>jackson-dataformat-xml-2.10.1</tag>
   </scm>
   <properties>
     <packageVersion.dir>com/fasterxml/jackson/dataformat/xml</packageVersion.dir>
@@ -87,7 +87,7 @@ Some data-binding types overridden as well (ObjectMapper sub-classed as XmlMappe
     <dependency>
       <groupId>com.fasterxml.woodstox</groupId>
       <artifactId>woodstox-core</artifactId>
-      <version>6.0.1</version>
+      <version>6.0.2</version>
       <exclusions>
         <exclusion>
 	  <groupId>javax.xml.stream</groupId>


=====================================
release-notes/VERSION-2.x
=====================================
@@ -4,6 +4,10 @@ Project: jackson-dataformat-xml
 = Releases
 ------------------------------------------------------------------------
 
+2.10.1 (09-Nov-2019)
+
+- Upgrade Woodstox dependency to 6.0.2
+
 2.10.0 (26-Sep-2019)
 
 #242: Deserialization of class inheritance depends on attributes order


=====================================
src/test/java/com/fasterxml/jackson/dataformat/xml/failing/DefaultTyping325Test.java → src/test/java/com/fasterxml/jackson/dataformat/xml/deser/DefaultTyping325Test.java
=====================================
@@ -1,4 +1,4 @@
-package com.fasterxml.jackson.dataformat.xml.failing;
+package com.fasterxml.jackson.dataformat.xml.deser;
 
 import java.io.IOException;
 


=====================================
src/test/java/com/fasterxml/jackson/dataformat/xml/deser/XsiNil354Test.java
=====================================
@@ -29,7 +29,7 @@ public class XsiNil354Test extends XmlTestBase
                 DoubleWrapper.class);
         assertNotNull(bean);
         assertNull(bean.d);
-        
+
         // actually we should perhaps also verify there is no content but... for now, let's leave it.
     }
 


=====================================
src/test/java/com/fasterxml/jackson/dataformat/xml/failing/EmptyBeanDeser318Test.java
=====================================
@@ -0,0 +1,102 @@
+package com.fasterxml.jackson.dataformat.xml.failing;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
+
+public class EmptyBeanDeser318Test extends XmlTestBase
+{
+    static class Wrapper {
+        @JacksonXmlProperty(localName = "id")
+        String id;
+        @JacksonXmlProperty(localName = "nested")
+        Nested nested;
+    }
+
+    static class Nested {
+        @JacksonXmlProperty(localName = "nested2")
+        Nested2 nested2;
+    }
+
+    static class Nested2 {
+        @JacksonXmlProperty(localName = "attr", isAttribute = true)
+        String attr;
+        @JacksonXmlText
+        String value;
+    }
+
+    /*
+    /**********************************************************************
+    /* Test methods
+    /**********************************************************************
+     */
+
+    private final XmlMapper MAPPER = newMapper();
+
+    public void testEmptyString() throws Exception {
+        String s = "<wrapper>"
+                + "  <id>id</id>"
+                + "  <nested></nested>"
+                + "</wrapper>";
+
+        Wrapper value = MAPPER.readValue(s, Wrapper.class);
+        assertEquals("id", value.id);
+        assertNull(value.nested);
+    }
+
+    public void testBlankString() throws Exception {
+        String s = "<wrapper>"
+                + "  <id>id</id>"
+                + "  <nested>    </nested>"
+                + "</wrapper>";
+
+        // This fails with the following exception:
+        // com.fasterxml.jackson.databind.exc.MismatchedInputException:
+        // Cannot construct instance of `JacksonXMLTest$Nested` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('    ')
+        Wrapper value = MAPPER.readValue(s, Wrapper.class);
+        assertEquals("id", value.id);
+        assertNull(value.nested);
+    }
+
+    public void testBlankString2() throws Exception {
+        String s = "<wrapper>"
+                + "  <id>id</id>"
+                + "  <nested>    </nested>"
+                + "</wrapper>";
+
+        // This fails with the following exception:
+        // com.fasterxml.jackson.databind.exc.MismatchedInputException:
+        // Cannot construct instance of `JacksonXMLTest$Nested` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('    ')
+        Wrapper value = MAPPER.readerFor(Wrapper.class)
+                .with(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)
+                .readValue(s);
+        assertEquals("id", value.id);
+        assertNull(value.nested);
+    }
+
+    public void testMissing() throws Exception {
+        String s = "<wrapper>"
+                + "  <id>id</id>"
+                + "</wrapper>";
+
+        Wrapper value = MAPPER.readValue(s, Wrapper.class);
+        assertEquals("id", value.id);
+        assertNull(value.nested);
+    }
+
+    public void testValidStructure() throws Exception {
+        String s = "<wrapper>"
+                + "  <id>id</id>"
+                + "  <nested>"
+                + "    <nested2 attr=\"test\"><![CDATA[Some text]]></nested2>"
+                + "  </nested>"
+                + "</wrapper>";
+
+        Wrapper value = MAPPER.readValue(s, Wrapper.class);
+        assertEquals("id", value.id);
+        assertEquals("test", value.nested.nested2.attr);
+        assertEquals("Some text", value.nested.nested2.value);
+    }
+}


=====================================
src/test/java/com/fasterxml/jackson/dataformat/xml/failing/ListDeser319Test.java
=====================================
@@ -0,0 +1,31 @@
+package com.fasterxml.jackson.dataformat.xml.failing;
+
+import java.util.*;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
+
+public class ListDeser319Test extends XmlTestBase
+{
+    static class Value319 {
+        public Long orderId, orderTypeId;
+    }    
+
+    /*
+    /**********************************************************************
+    /* Test methods
+    /**********************************************************************
+     */
+
+    private final XmlMapper MAPPER = newMapper();
+
+    public void testEmptyList319() throws Exception
+    {
+        final String DOC = "<orders></orders>";
+        List<Value319> value = MAPPER.readValue(DOC,
+                new TypeReference<List<Value319>>() { });
+        assertNotNull(value);
+        assertEquals(0, value.size());
+    }
+}


=====================================
src/test/java/com/fasterxml/jackson/dataformat/xml/failing/XsiNil366Test.java
=====================================
@@ -0,0 +1,46 @@
+package com.fasterxml.jackson.dataformat.xml.failing;
+
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
+
+public class XsiNil366Test extends XmlTestBase
+{
+    // for [dataformat-xml#366]
+    protected static class Parent366 {
+        public Level1 level1;
+    }
+
+    protected static class Level1 {
+        public Level2 level2;
+        public String field; // this should not be needed, but an unknown element is thrown without it
+    }
+
+    protected static class Level2 {
+        public String ignored;
+        public String field;
+    }
+
+    private final XmlMapper MAPPER = newMapper();
+
+    // for [dataformat-xml#366]
+    public void testDoesNotAffectHierarchy() throws Exception
+    {
+        String xml = "<Parent xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
+                + "<level1>"
+                + "<level2>"
+                + "<ignored xsi:nil=\"true\"/>"
+                + "<field>test-value</field>"
+                + "</level2>"
+                + "</level1>"
+                + "</Parent>";
+        Parent366 bean = MAPPER.readValue(xml, Parent366.class);
+
+        assertNotNull(bean);
+
+        // this should not be set, but having an xsi:nil field before it causes it to set the next field on the wrong class
+        assertEquals("test-value", bean.level1.field);
+
+        // fails because field is set on level1 instead of on level2
+        assertEquals("test-value", bean.level1.level2.field);
+    }
+}


=====================================
src/test/java/com/fasterxml/jackson/dataformat/xml/misc/RootNameTest.java
=====================================
@@ -3,7 +3,6 @@ package com.fasterxml.jackson.dataformat.xml.misc;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.List;
 
 import com.fasterxml.jackson.databind.ObjectWriter;
 import com.fasterxml.jackson.databind.PropertyName;



View it on GitLab: https://salsa.debian.org/java-team/jackson-dataformat-xml/compare/d436a8106ea13afc487744d0b1654cf85bb22a90...595594da7b53b87afe83498748d9e2391c493e00

-- 
View it on GitLab: https://salsa.debian.org/java-team/jackson-dataformat-xml/compare/d436a8106ea13afc487744d0b1654cf85bb22a90...595594da7b53b87afe83498748d9e2391c493e00
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20191215/6739a2d6/attachment.html>


More information about the pkg-java-commits mailing list