File tree Expand file tree Collapse file tree
src/test/java/com/fasterxml/jackson/dataformat/xml/failing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .fasterxml .jackson .dataformat .xml .failing ;
2+
3+ import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
4+
5+ import com .fasterxml .jackson .dataformat .xml .*;
6+ import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlProperty ;
7+
8+ public class TestOrderingIssue91 extends XmlTestBase
9+ {
10+ @ JsonPropertyOrder ({"a" , "c" })
11+ static class Bean91 {
12+ public String a ;
13+ @ JacksonXmlProperty (isAttribute = true )
14+ public String b ;
15+ public String c ;
16+
17+ public Bean91 (String a , String b , String c ) {
18+ this .a = a ;
19+ this .b = b ;
20+ this .c = c ;
21+ }
22+ }
23+
24+ public void testOrdering () throws Exception
25+ {
26+ XmlMapper xmlMapper = new XmlMapper ();
27+ String xml = xmlMapper .writeValueAsString (new Bean91 ("1" , "2" , "3" ));
28+ assertEquals ("<Bean91 b=\" 2\" ><a>1</a><c>3</c></Bean91>" , xml );
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments