}
@Test
public void testJSON2XML() throws Exception {
ExtensionPointRegistry extensionPointRegistry = new DefaultExtensionPointRegistry();
StAXHelper helper = StAXHelper.getInstance(extensionPointRegistry);
JSON2XMLStreamReader t2 = new JSON2XMLStreamReader();
XMLStreamReader reader2 = t2.transform(new JSONObject(JSON_STR), null);
StringWriter sw = new StringWriter();
XMLStreamWriter streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(sw);
helper.save(reader2, streamWriter);
Assert.assertTrue(sw.toString()
.contains("<xsl:root xmlns:xsl=\"http://foo.com\"><data>my json string</data></xsl:root>"));
}