Skip to content

Commit 730bdad

Browse files
committed
Add a failing test case for #177
1 parent 1f4e2a9 commit 730bdad

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.fasterxml.jackson.dataformat.xml.failing;
2+
3+
import java.util.List;
4+
5+
import com.fasterxml.jackson.dataformat.xml.*;
6+
import com.fasterxml.jackson.dataformat.xml.annotation.*;
7+
8+
// for [dataformat-xml#177]
9+
public class EmptyList177Test extends XmlTestBase
10+
{
11+
static class Config
12+
{
13+
@JacksonXmlProperty(isAttribute=true)
14+
public String id;
15+
16+
@JacksonXmlElementWrapper(useWrapping=false)
17+
public List<Entry> entry;
18+
}
19+
20+
static class Entry
21+
{
22+
@JacksonXmlProperty(isAttribute=true)
23+
public String id;
24+
}
25+
26+
/*
27+
/**********************************************************
28+
/* Test methods
29+
/**********************************************************
30+
*/
31+
32+
private final XmlMapper MAPPER = new XmlMapper();
33+
34+
public void testEmptyList() throws Exception
35+
{
36+
Config r = MAPPER.readValue(
37+
"<Config id='123'>\n"+
38+
" <entry id='foo'> </entry>\n"+
39+
"</Config>\n",
40+
Config.class);
41+
assertNotNull(r);
42+
}
43+
}

0 commit comments

Comments
 (0)