" }\n" +
"}";
String xml = "<?xml version='1.0'?><customer><id>112</id><first-name>Jane</first-name><last-name>Doe</last-name><address><street>123 A Street</street></address><phone-number type=\"work\">555-1111</phone-number><phone-number type=\"cell\">555-2222</phone-number></customer>";
JsonToXml jToX = new JsonToXml();
String xmlResponse = (String) jToX.transform(json);
assertEquals(xml, xmlResponse);
xmlResponse = (String) jToX.transform(new StringReader(json));
assertEquals(xml, xmlResponse);
xmlResponse = (String) jToX.transform(json.getBytes());
assertEquals(xml, xmlResponse);
xmlResponse = (String) jToX.transform(new ByteArrayInputStream(json.getBytes()));
assertEquals(xml, xmlResponse);
try
{
jToX.transform(new Object());
fail();
}
catch (Exception ex)
{
assertTrue(ex instanceof TransformerException);