-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37eb331
commit 0068fed
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/test/java/com/fasterxml/jackson/dataformat/xml/failing/EmptyListDeser124Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.fasterxml.jackson.dataformat.xml.failing; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.dataformat.xml.*; | ||
|
||
// for [dataformat-xml#124] | ||
public class EmptyListDeser124Test extends XmlTestBase | ||
{ | ||
public static class TestList { | ||
@JsonProperty("list") | ||
public List<Object> list; | ||
} | ||
|
||
// [dataformat-xml#124] | ||
public void test124() throws Exception { | ||
final XmlMapper xmlMapper = new XmlMapper(); | ||
TestList originalObject = new TestList(); | ||
originalObject.list = new ArrayList<Object>(); | ||
String xml = xmlMapper.writeValueAsString(originalObject); | ||
//System.err.println(xml); // print <TestList><list/>></TestList> | ||
|
||
TestList result = xmlMapper.readValue(xml, TestList.class); | ||
|
||
assertNotNull(result.list); | ||
assertEquals(0, result.list.size()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters