Skip to content

Commit 88a4cc5

Browse files
committed
Move failing test for #359 under failing (for 3.0)
1 parent 12d56ba commit 88a4cc5

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

src/main/java/com/fasterxml/jackson/dataformat/xml/XmlMapper.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ public Builder(XmlFactory f) {
7777
// 04-May-2018, tatu: Important! Let's also default `String` `null` handling to coerce
7878
// to empty string -- this lets us induce `null` from empty tags first
7979

80-
// 08-Sep-2019, tatu: Note: this could conflict with [dataformat-xml#354] (true `null`s
81-
// with `xsi:nil`) unless we are careful to distinguish empty/null
80+
// 08-Sep-2019, tatu: This causes [dataformat-xml#359] (follow-up for #354), but
81+
// can not simply be removed.
82+
8283
_configOverrides.findOrCreateOverride(String.class)
8384
.setNullHandling(JsonSetter.Value.forValueNulls(Nulls.AS_EMPTY));
8485
}

src/test/java/com/fasterxml/jackson/dataformat/xml/deser/SimpleStringValuesTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ public void testStringArrayWithAttribute() throws Exception
9191
assertEquals("Good stuff", beans[2].text);
9292
}
9393

94+
// [dataformat-xml#359]
95+
/*
9496
public void testEmptyElementToString() throws Exception
9597
{
9698
final String XML =
@@ -104,6 +106,7 @@ public void testEmptyElementToString() throws Exception
104106
// assertEquals("", result.d);
105107
assertNull(result.d);
106108
}
109+
*/
107110

108111
/*
109112
/**********************************************************
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.fasterxml.jackson.dataformat.xml.failing;
2+
3+
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
4+
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
5+
6+
public class SimpleStringValues359Test extends XmlTestBase
7+
{
8+
static class Issue167Bean {
9+
public String d;
10+
}
11+
12+
private final XmlMapper MAPPER = newMapper();
13+
14+
// [dataformat-xml#359]
15+
public void testEmptyElementToString() throws Exception
16+
{
17+
final String XML =
18+
"<a xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\n"+
19+
"<d xsi:nil='true'/>\n"+
20+
"</a>\n";
21+
Issue167Bean result = MAPPER.readValue(XML, Issue167Bean.class);
22+
assertNotNull(result);
23+
// 06-Sep-2019, tatu: As per [dataformat-xml#354] this should now (2.10)
24+
// produce real `null`:
25+
// assertEquals("", result.d);
26+
assertNull(result.d);
27+
}
28+
}

0 commit comments

Comments
 (0)