-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
25485b8
commit 7ac573b
Showing
3 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
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
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
59 changes: 59 additions & 0 deletions
59
src/test/java/com/fasterxml/jackson/dataformat/xml/failing/CaseInsensitiveDeser273Test.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,59 @@ | ||
package com.fasterxml.jackson.dataformat.xml.failing; | ||
|
||
import java.util.ArrayList; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
import com.fasterxml.jackson.databind.*; | ||
import com.fasterxml.jackson.dataformat.xml.XmlTestBase; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
|
||
public class CaseInsensitiveDeser273Test extends XmlTestBase | ||
{ | ||
// [dataformat-xml#273] | ||
static class Depots273 | ||
{ | ||
public String command; | ||
public String taskId; | ||
|
||
@JacksonXmlElementWrapper(useWrapping = false) | ||
public ArrayList<Depot273> element; | ||
} | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
static class Depot273 | ||
{ | ||
@JacksonXmlProperty(isAttribute = true) | ||
public String number; | ||
@JacksonXmlProperty(isAttribute = true) | ||
public String name; | ||
} | ||
|
||
/* | ||
/******************************************************** | ||
/* Test methods | ||
/******************************************************** | ||
*/ | ||
|
||
private final ObjectMapper INSENSITIVE_MAPPER = newObjectMapper() | ||
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES); | ||
|
||
// [dataformat-xml#273] | ||
public void testCaseInsensitiveComplex() throws Exception | ||
{ | ||
final String DOC = | ||
"<AcResponse Command='show depots' TaskId='1260'>\n"+ | ||
" <Element Number='1' Name='accurev' Slice='1'\n"+ | ||
"exclusiveLocking='false' case='insensitive' locWidth='128'"+ | ||
"></Element>\n"+ | ||
" <Element Number='2' Name='second accurev' Slice='2'\n"+ | ||
"exclusiveLocking='false' case='insensitive' locWidth='128'\n"+ | ||
"></Element>\n"+ | ||
"</AcResponse>" | ||
; | ||
|
||
Depots273 result = INSENSITIVE_MAPPER.readValue(DOC, Depots273.class); | ||
assertNotNull(result); | ||
} | ||
} |