+
+ /**
+ * Transforms a file using a class path resolver.
+ *
+ */
+ public void testTransformUsingClassPathResolver() throws Exception {
+ XslTransformer transformer = new XslTransformer(new ClasspathUriResolver());
+
+ InputResource xmlResource = new TestResource(XslTransformerTest.class,
+ REPORT_XML);
+ Source xslt = new StreamSource(new File(FileSystemUtils
+ .getTestInputDir(XslTransformerTest.class),
+ REPORT_TO_HTML2_XSLT));
+
+ byte[] documentData = FileSystemUtils
+ .read(xmlResource.getInputStream()).getBytes();
+
+ Document output1 = transformer.transform(documentData, xslt);
+ Document expected = DomUtils.read(new TestResource(
+ XslTransformerTest.class, "output-reportToHtml-report.xml")
+ .getInputStream());
+ XmlUtils.assertEquals("doc", expected, output1);
+ }
+
+ /**
+ * Transforms a file to text output. Verifies the file is transformed
+ * correctly.
+ *
+ */
+ public void testTransformToTextOutput() throws Exception {
+ XslTransformer transformer = new XslTransformer(new ClasspathUriResolver());
+
+ InputResource xmlResource = new TestResource(XslTransformerTest.class,
+ REPORT_XML);
+ Source xslt = new StreamSource(
+ new File(FileSystemUtils
+ .getTestInputDir(XslTransformerTest.class),
+ REPORT_TO_TEXT_XSLT));
+
+ byte[] documentData = FileSystemUtils
+ .read(xmlResource.getInputStream()).getBytes();