File tree 2 files changed +19
-27
lines changed
src/test/java/com/fasterxml/jackson/dataformat/xml
2 files changed +19
-27
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import com .fasterxml .jackson .dataformat .xml .XmlMapper ;
7
7
import com .fasterxml .jackson .dataformat .xml .XmlTestBase ;
8
+ import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlProperty ;
8
9
9
10
public class EmptyStringValueTest extends XmlTestBase
10
11
{
@@ -23,6 +24,14 @@ static class Names {
23
24
public List <Name > names = new ArrayList <Name >();
24
25
}
25
26
27
+ // [dataformat-xml#25]
28
+ static class EmptyStrings25
29
+ {
30
+ @ JacksonXmlProperty (isAttribute =true )
31
+ public String a = "NOT SET" ;
32
+ public String b = "NOT SET" ;
33
+ }
34
+
26
35
/*
27
36
/**********************************************************
28
37
/* Test methods
@@ -70,4 +79,14 @@ public void testEmptyStringElement() throws Exception
70
79
assertEquals ("" , bean .text );
71
80
// assertNull(bean.text);
72
81
}
82
+
83
+ // [dataformat-xml#25]
84
+ public void testEmptyStringFromElemAndAttr () throws Exception
85
+ {
86
+ EmptyStrings25 ob = MAPPER .readValue ("<EmptyString a=''><b /></EmptyString>" ,
87
+ EmptyStrings25 .class );
88
+ assertNotNull (ob );
89
+ assertEquals ("" , ob .a );
90
+ assertEquals ("" , ob .b );
91
+ }
73
92
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments