diff --git a/WHATSNEW b/WHATSNEW
index 75e48ff15..da5b9d421 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -10,6 +10,9 @@ Fixed bugs:
* Fixed NullPointerException when a mappedresource is used in pathconvert
Bugzilla Report 62076
+ * Allow Saxon to be used for junitreport XSL transformation
+ Github Pull Request #57
+
Changes from Ant 1.10.1 TO Ant 1.10.2
=====================================
diff --git a/build.xml b/build.xml
index f9096f38b..f1aca800c 100644
--- a/build.xml
+++ b/build.xml
@@ -611,6 +611,8 @@
+
+
diff --git a/contributors.xml b/contributors.xml
index fb92b6ba5..3ab3be8fe 100644
--- a/contributors.xml
+++ b/contributors.xml
@@ -38,6 +38,10 @@
Adam
Bryzak
+
+ Adam
+ Retter
+
Adam
Sotona
diff --git a/manual/Tasks/junitreport.html b/manual/Tasks/junitreport.html
index 6c8e86192..79fd6590f 100644
--- a/manual/Tasks/junitreport.html
+++ b/manual/Tasks/junitreport.html
@@ -100,8 +100,8 @@ element.
The directory where the stylesheets are defined. They must
be conforming to the following conventions:
- - frames format: the stylesheet must be named junit-frames.xsl.
- - noframes format: the stylesheet must be named junit-noframes.xsl.
+ - frames format: the stylesheet must be named junit-frames.xsl, or junit-frames-saxon.xsl if you are using Saxon 9+.
+ - noframes format: the stylesheet must be named junit-noframes.xsl, or junit-noframes-saxon.xsl if you are using Saxon 9+.
|
No. Default to embedded stylesheets. |
diff --git a/src/etc/ant-bin.wxs b/src/etc/ant-bin.wxs
index 74ed74feb..f1f750850 100644
--- a/src/etc/ant-bin.wxs
+++ b/src/etc/ant-bin.wxs
@@ -436,16 +436,18 @@
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/src/etc/junit-frames-saxon.xsl b/src/etc/junit-frames-saxon.xsl
new file mode 100644
index 000000000..f8de992fc
--- /dev/null
+++ b/src/etc/junit-frames-saxon.xsl
@@ -0,0 +1,971 @@
+
+
+
+
+
+
+
+
+ Unit Test Results.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Standard Output from
+
+
+
+
+
+
+
+
+
+
+
+ Standard Error from
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, table tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ .Properties {
+ text-align:right;
+ }
+
+
+
+
+
+
+
+
+
+ All Failures
+
+
+ All Errors
+
+
+ All Skipped
+
+
+ All Tests
+
+
+
+
+ Unit Test Results:
+
+
+
+
+
+ open('allclasses-frame.html','classListFrame')
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .
+
+
+ Unit Test Results:
+
+
+
+
+
+
+
+
+ Class
+
+
+
+
+
+
+ Failures
+
+
+ Errors
+
+
+ Skipped
+
+
+ Tests
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cur = TestCases['.'] = new Array();
+
+
+ cur[''] = '';
+
+
+
+
+
+
+
+
+
+
+ Unit Test Classes:
+
+
+
+
+
+
+
+ Classes
+
+
+
+
+
+
+
+
+
+
+ All Unit Test Classes
+
+
+
+
+
+ Classes
+
+
+
+
+
+
+
+
+
+
+
+
+ /
+ _.html
+
+
+
+ |
+
+
+
+
+
+
+
+
+ All Unit Test Packages
+
+
+
+
+
+
+ Packages
+
+
+
+
+
+
+
+
+
+
+ <none>
+
+ |
+
+
+
+
+
+
+
+ Unit Test Results: Summary
+
+
+
+
+
+ open('allclasses-frame.html','classListFrame')
+
+ Summary
+
+
+
+
+
+
+
+
+ Tests |
+ Failures |
+ Errors |
+ Skipped |
+ Success rate |
+ Time |
+
+
+
+
+ Error
+ Failure
+ Pass
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+ Note: failures are anticipated and checked for with assertions while errors are unanticipated.
+ |
+
+
+
+ Packages
+
+
+
+
+
+
+
+
+
+
+ Error
+ Failure
+ Pass
+
+
+
+
+ <none>
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ open('package-frame.html','classListFrame')
+
+ Package
+
+
+
+
+
+ Classes
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ../
+
+
+
+
+
+ ../
+
+
+
+
+
+
+
+ stylesheet.css
+
+
+
+
+
+
+
+
+ |
+ Designed for use with JUnit and Ant. |
+
+
+
+
+
+
+
+
+ Name |
+ Tests |
+ Errors |
+ Failures |
+ Skipped |
+ Time(s) |
+ Time Stamp |
+ Host |
+
+
+
+
+
+
+
+
+ Class |
+
+ Name |
+ Status |
+ Type |
+ Time(s) |
+
+
+
+
+
+
+
+
+
+ Error
+ Failure
+ Pass
+
+
+ |
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+ Error
+ Failure
+ TableRowColor
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+ Failure |
+ |
+
+
+ Error |
+ |
+
+
+ Skipped |
+ |
+
+
+ Success |
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ N/A
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 32
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/etc/junit-noframes-saxon.xsl b/src/etc/junit-noframes-saxon.xsl
new file mode 100644
index 000000000..fd1d3c98e
--- /dev/null
+++ b/src/etc/junit-noframes-saxon.xsl
@@ -0,0 +1,514 @@
+
+
+
+
+
+
+Unit Test Results.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Packages
+ Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Failure
+ Error
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Package
+
+
+ Back to top
+
+
+
+
+
+
+
+
+
+
+ TestCase
+
+
+
+
+
+ Back to top
+
+
+
+
+ Summary
+
+
+
+
+
+
+
+
+ Tests |
+ Failures |
+ Errors |
+ Skipped |
+ Success rate |
+ Time |
+
+
+
+
+ Failure
+ Error
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+ Note: failures are anticipated and checked for with assertions while errors are unanticipated.
+ |
+
+
+
+
+
+
+ cur = TestCases['.'] = new Array();
+
+
+ cur[''] = '';
+
+
+
+
+
+
+
+
+ |
+ Designed for use with JUnit and Ant. |
+
+
+
+
+
+
+
+ Name |
+ Tests |
+ Errors |
+ Failures |
+ Skipped |
+ Time(s) |
+
+
+
+
+
+
+ Name |
+ Tests |
+ Errors |
+ Failures |
+ Skipped |
+ Time(s) |
+ Time Stamp |
+ Host |
+
+
+
+
+
+
+ Name |
+ Status |
+ Type |
+ Time(s) |
+
+
+
+
+
+
+
+
+
+
+ Failure
+ Error
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+
+
+ Error
+
+
+ |
+
+
+ Failure |
+ |
+
+
+ Error |
+ |
+
+
+ Skipped |
+ |
+
+
+ Success |
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ N/A
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 32
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/etc/poms/ant-junit/pom.xml b/src/etc/poms/ant-junit/pom.xml
index b7238d657..c1ca76c70 100644
--- a/src/etc/poms/ant-junit/pom.xml
+++ b/src/etc/poms/ant-junit/pom.xml
@@ -67,6 +67,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
+
+
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
index 84afe3c8c..637792a5a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
@@ -297,10 +297,7 @@ public class AggregateTransformer {
* @return stylesheet as a resource
*/
protected Resource getStylesheet() {
- String xslname = "junit-frames.xsl";
- if (NOFRAMES.equals(format)) {
- xslname = "junit-noframes.xsl";
- }
+ final String xslname = getXslName();
if (styleDir == null) {
// If style dir is not specified we have to retrieve
// the stylesheet from the classloader
@@ -313,6 +310,32 @@ public class AggregateTransformer {
return new FileResource(new File(styleDir, xslname));
}
+ /**
+ * Gets the filename of the XSL stylesheet
+ *
+ * Will provide Xalan or Saxon specific
+ * stylesheets.
+ *
+ * @return The filename of the stylesheet
+ */
+ private String getXslName() {
+ final String suffix;
+
+ final String xsltFactoryName = xsltFactory == null ? null : xsltFactory.getName();
+ if(xsltFactoryName != null && "net.sf.saxon.TransformerFactoryImpl".equals(xsltFactoryName)) {
+ suffix = "-saxon.xsl";
+ } else {
+ suffix = ".xsl";
+ }
+ final String xslname;
+ if (NOFRAMES.equals(format)) {
+ xslname = "junit-noframes" + suffix;
+ } else {
+ xslname = "junit-frames" + suffix;
+ }
+ return xslname;
+ }
+
/** check for invalid options
* @throws BuildException if something goes wrong.
*/
@@ -335,10 +358,7 @@ public class AggregateTransformer {
* not exist.
*/
protected String getStylesheetSystemId() throws IOException {
- String xslname = "junit-frames.xsl";
- if (NOFRAMES.equals(format)) {
- xslname = "junit-noframes.xsl";
- }
+ final String xslname = getXslName();
if (styleDir == null) {
URL url = getClass().getResource("xsl/" + xslname);
if (url == null) {