/** * Compare an XML string (e.g. a result) against a classpath resource. * @param xml The XML (as a String) to be compared against the XML in the specified * classpath resource. * @param resourcePath The path to the classpath resource against which the XML is to be * compared. The specified path can be relative to the test class' location on the classpath. */ public void compareXMLToResource(String xml, String resourcePath) { XMLUnit.setIgnoreWhitespace(true); try { XMLAssert.assertXMLEqual(readResourceString(resourcePath), xml); } catch (Exception e) { Assert.fail("Unexpected error performing XML comparison: " + e.getMessage()); } }
/** * Compare an XML string (e.g. a result) against a classpath resource. * @param xml The XML (as a String) to be compared against the XML in the specified * classpath resource. * @param resourcePath The path to the classpath resource against which the XML is to be * compared. The specified path can be relative to the test class' location on the classpath. */ public void compareXMLToResource(String xml, String resourcePath) { XMLUnit.setIgnoreWhitespace(true); try { XMLAssert.assertXMLEqual(readResourceString(resourcePath), xml); } catch (Exception e) { Assert.fail("Unexpected error performing XML comparison: " + e.getMessage()); } }
Transformer xml2JavaTransformer = newTransformer(bindingConfigResPath, SmooksTransformType.XML2JAVA); Transformer java2xmlTransformer = newTransformer(bindingConfigResPath, SmooksTransformType.JAVA2XML); String xml = getTestKit().readResourceString(xmlResPath);
Transformer xml2JavaTransformer = newTransformer(bindingConfigResPath, SmooksTransformType.XML2JAVA); Transformer java2xmlTransformer = newTransformer(bindingConfigResPath, SmooksTransformType.JAVA2XML); String xml = getTestKit().readResourceString(xmlResPath);