* Test to verify that default wrapping setting is used
*/
public void testDefaultWrapping() throws Exception
{
// by default, should be using wrapping, so:
XmlMapper mapper = new XmlMapper();
DefaultList input = new DefaultList();
input.value = new Value[] { new Value("a"), new Value("b") };
String json = mapper.writeValueAsString(input);
assertEquals("<DefaultList><value><value><v>a</v></value><value><v>b</v></value></value></DefaultList>", json);
DefaultList output = mapper.readValue(json, DefaultList.class);
assertNotNull(output.value);
assertEquals(2, output.value.length);
// but can be changed not to use wrapping by default
JacksonXmlModule module = new JacksonXmlModule();
module.setDefaultUseWrapper(false);
mapper = new XmlMapper(module);
json = mapper.writeValueAsString(input);
assertEquals("<DefaultList><value><v>a</v></value><value><v>b</v></value></DefaultList>", json);
output = mapper.readValue(json, DefaultList.class);
assertNotNull(output.value);
assertEquals(2, output.value.length);
}