File tree 2 files changed +36
-1
lines changed
src/test/java/com/fasterxml/jackson/dataformat/xml
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ static class Test {
19
19
@ JacksonXmlProperty (localName = "test" )
20
20
@ JacksonXmlElementWrapper (useWrapping = false )
21
21
List <Test > list = new ArrayList <Test >();
22
- }
22
+ }
23
23
24
24
private final XmlMapper MAPPER = newMapper ();
25
25
Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .dataformat .xml .ser ;
2
+
3
+ import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
4
+ import com .fasterxml .jackson .annotation .JsonRawValue ;
5
+ import com .fasterxml .jackson .dataformat .xml .XmlMapper ;
6
+ import com .fasterxml .jackson .dataformat .xml .XmlTestBase ;
7
+
8
+ // [dataformat-xml#269]
9
+ public class RawValueSerializationTest extends XmlTestBase
10
+ {
11
+ @ JsonPropertyOrder ({ "id" , "raw" })
12
+ static class RawWrapper {
13
+ public int id = 42 ;
14
+
15
+ @ JsonRawValue
16
+ public String raw = "Mixed <b>content</b>" ;
17
+ }
18
+
19
+ /*
20
+ /********************************************************
21
+ /* Test methods
22
+ /********************************************************
23
+ */
24
+
25
+ private final XmlMapper MAPPER = newMapper ();
26
+
27
+ public void testRawValueSerialization () throws Exception
28
+ {
29
+ assertEquals ("<RawWrapper>"
30
+ +"<id>42</id>"
31
+ +"<raw>Mixed <b>content</b></raw>"
32
+ +"</RawWrapper>" ,
33
+ MAPPER .writeValueAsString (new RawWrapper ()).trim ());
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments