File tree 2 files changed +52
-1
lines changed
src/test/java/com/fasterxml/jackson/dataformat/xml/failing
2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ static class CountryName314 {
40
40
.propertyNamingStrategy (PropertyNamingStrategy .UPPER_CAMEL_CASE )
41
41
.build ();
42
42
43
- // [dataform #314]
43
+ // [dataformat-xml #314]
44
44
public void testDeser314Order1 () throws Exception
45
45
{
46
46
String content = ""
Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .dataformat .xml .failing ;
2
+
3
+ import java .util .List ;
4
+
5
+ import com .fasterxml .jackson .databind .ObjectMapper ;
6
+ import com .fasterxml .jackson .dataformat .xml .XmlTestBase ;
7
+ import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlElementWrapper ;
8
+ import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlProperty ;
9
+ import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlRootElement ;
10
+
11
+ public class ListDeser390Test extends XmlTestBase
12
+ {
13
+
14
+ @ JacksonXmlRootElement (localName = "many" )
15
+ static class Many390 {
16
+ @ JacksonXmlProperty (localName = "one" )
17
+ @ JacksonXmlElementWrapper (useWrapping = false )
18
+ List <One390 > ones ;
19
+ }
20
+
21
+ static class One390 {
22
+ @ JacksonXmlProperty
23
+ String value ;
24
+ @ JacksonXmlProperty
25
+ String another ;
26
+ }
27
+
28
+ /*
29
+ /********************************************************
30
+ /* Test methods
31
+ /********************************************************
32
+ */
33
+
34
+ private final ObjectMapper MAPPER = newMapper ();
35
+
36
+ // [dataformat-xml#390]
37
+ public void testDeser390 () throws Exception
38
+ {
39
+ String XML = "<many>\n "
40
+ + " <one>\n "
41
+ + " <value bar=\" baz\" >foo</value>\n "
42
+ + " <another></another>\n "
43
+ + " </one>\n "
44
+ + "</many>" ;
45
+ Many390 many = MAPPER .readValue (XML , Many390 .class );
46
+ assertNotNull (many .ones );
47
+
48
+ //System.err.println("XML:\n"+MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(many));
49
+ assertEquals (1 , many .ones .size ());
50
+ }
51
+ }
You can’t perform that action at this time.
0 commit comments