Skip to content

Commit adced22

Browse files
committed
Merge branch '2.11' into 2.12
2 parents 722e22b + 88d53ec commit adced22

File tree

3 files changed

+72
-1
lines changed

3 files changed

+72
-1
lines changed

release-notes/VERSION-2.x

+7
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ Project: jackson-dataformat-xml
2525

2626
No changes since 2.10.x
2727

28+
2.10.5 (not yet released)
29+
30+
-
31+
2832
2.10.4 (03-May-2020)
2933

34+
#219: Deserialization issue from XML to POJO with Jackson: no String-argument
35+
constructor/factory method to deserialize from String value
36+
(NOTE: likely fixed earlier, but fix verified after 2.10.4 release)
3037
- Upgrade Woodstox dependency to 6.2.0 (minor improvement to MSV shading)
3138

3239
2.10.3 (03-Mar-2020)

src/test/java/com/fasterxml/jackson/dataformat/xml/deser/TestDeserialization.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void testMapWithAttr() throws Exception
6868
assertNotNull(map);
6969
}
7070

71-
// // Tests for [Issue#64]
71+
// // Tests for [dataformat-xml#64]
7272

7373
public void testOptionalAttr() throws Exception
7474
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package com.fasterxml.jackson.dataformat.xml.deser;
2+
3+
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
4+
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
5+
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
6+
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
7+
8+
public class TestDeserialization219 extends XmlTestBase
9+
{
10+
// [dataformat-xml#219]
11+
static class Worker219
12+
{
13+
@JacksonXmlProperty(localName = "developer")
14+
String developer;
15+
@JacksonXmlProperty(localName = "tester")
16+
String tester;
17+
@JacksonXmlProperty(localName = "manager")
18+
String manager;
19+
}
20+
21+
// [dataformat-xml#219]
22+
@JacksonXmlRootElement(localName="line")
23+
static class Line219 {
24+
public String code; //This should ideally be complex type
25+
public String amount;
26+
}
27+
28+
/*
29+
/**********************************************************
30+
/* Test methods
31+
/**********************************************************
32+
*/
33+
34+
private final XmlMapper MAPPER = newMapper();
35+
36+
// [dataformat-xml#219]
37+
public void testWithAttribute219Worker() throws Exception
38+
{
39+
final String DOC =
40+
"<worker>\n" +
41+
" <developer>test1</developer>\n" +
42+
" <tester grade='senior'>test2</tester>\n" +
43+
" <manager>test3</manager>\n" +
44+
"</worker>"
45+
;
46+
Worker219 result = MAPPER.readValue(DOC, Worker219.class);
47+
assertNotNull(result);
48+
assertEquals("test3", result.manager);
49+
}
50+
51+
// [dataformat-xml#219]
52+
public void testWithAttribute219Line() throws Exception
53+
{
54+
final String DOC =
55+
"<line>\n" +
56+
" <code type='ABC'>qsd</code>\n" +
57+
" <amount>138</amount>\n" +
58+
"</line>"
59+
;
60+
Line219 result = MAPPER.readValue(DOC, Line219.class);
61+
assertNotNull(result);
62+
assertEquals("138", result.amount);
63+
}
64+
}

0 commit comments

Comments
 (0)