-
-
Notifications
You must be signed in to change notification settings - Fork 220
/
ListDeser314Test.java
83 lines (73 loc) · 2.74 KB
/
ListDeser314Test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.fasterxml.jackson.dataformat.xml.failing;
import java.util.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
// [dataformat-xml#314]
public class ListDeser314Test extends XmlTestBase
{
static class Customer314 {
@JacksonXmlElementWrapper(localName = "Customer", useWrapping = false)
@JacksonXmlProperty(localName = "Address")
public List<Address314> address;
}
static class Address314 {
public String stateProv;
public CountryName314 countryName;
}
static class CountryName314 {
public String code;
@JacksonXmlText
public String name;
}
/*
/********************************************************
/* Test methods
/********************************************************
*/
private final ObjectMapper MAPPER = mapperBuilder()
.propertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE)
.build();
// [dataformat-xml#314]
public void testDeser314Order1() throws Exception
{
String content = ""
+ "<Customer>\n"
+ " <Address>\n"
+ " <StateProv StateCode='DE-NI'>Niedersachsen</StateProv>\n"
+ " <CountryName Code='DE'>Deutschland</CountryName>\n"
+ " </Address>\n"
+ "</Customer>"
;
Customer314 result = MAPPER.readValue(content, Customer314.class);
assertNotNull(result);
}
/*
public void testDeser314Order2() throws Exception
{
String content = ""
+ "<Customer>\n"
+ " <Address>\n"
+ " <CountryName Code='DE'>Deutschland</CountryName>\n"
+ " <StateProv StateCode='DE-NI'>Niedersachsen</StateProv>\n"
+ " </Address>\n"
+ "</Customer>"
;
Customer314 result = MAPPER.readValue(content, Customer314.class);
assertNotNull(result);
}
public void testDeser314Address() throws Exception
{
String content = ""
+ " <Address>\n"
+ " <CountryName Code=\"DE\">Deutschland</CountryName>\n"
+ " <StateProv StateCode=\"DE-NI\">Niedersachsen</StateProv>\n"
+ " </Address>\n"
;
Address314 result = MAPPER.readValue(content, Address314.class);
assertNotNull(result);
}*/
}