ASF Bugzilla – Attachment 25506 Details for
Bug 47002
junitreport: expose classpath of internal XSLTProcess task
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Expose classpath and factory
bug47002-junitreport-classpath-r948574.patch (text/plain), 4.64 KB, created by
Martin von Gagern
on 2010-06-01 14:44:56 UTC
(
hide
)
Description:
Expose classpath and factory
Filename:
MIME Type:
Creator:
Martin von Gagern
Created:
2010-06-01 14:44:56 UTC
Size:
4.64 KB
patch
obsolete
>Index: src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java >=================================================================== >--- src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java (revision 950154) >+++ src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java (working copy) >@@ -41,6 +41,7 @@ > import org.apache.tools.ant.util.JAXPUtils; > import org.apache.tools.ant.util.FileUtils; > import org.apache.tools.ant.types.EnumeratedAttribute; >+import org.apache.tools.ant.types.Path; > import org.apache.tools.ant.types.Resource; > import org.apache.tools.ant.types.resources.URLResource; > import org.apache.tools.ant.types.resources.FileResource; >@@ -93,11 +94,11 @@ > protected File toDir; > > /** >- * The params that will be sent to the XSL transformation >+ * The internal XSLT task used to perform the transformation. > * >- * @since Ant 1.7 >+ * @since Ant 1.9 > */ >- private List params; >+ private XSLTProcess xsltTask; > > /** > * Instance of a utility class to use for file operations. >@@ -132,7 +133,8 @@ > */ > public AggregateTransformer(Task task) { > this.task = task; >- params = new Vector(); >+ xsltTask = new XSLTProcess(); >+ xsltTask.bindToOwner(task); > } > > /** >@@ -212,12 +214,30 @@ > * @since Ant 1.7 > */ > public XSLTProcess.Param createParam() { >- XSLTProcess.Param p = new XSLTProcess.Param(); >- params.add(p); >- return p; >+ return xsltTask.createParam(); > } > > /** >+ * Creates a classpath to be used for the internal XSLT task. >+ * >+ * @return the classpath to be configured >+ * @since Ant 1.9 >+ */ >+ public Path createClasspath() { >+ return xsltTask.createClasspath(); >+ } >+ >+ /** >+ * Creates a factory configuration to be used for the internal XSLT task. >+ * >+ * @return the factory description to be configured >+ * @since Ant 1.9 >+ */ >+ public XSLTProcess.Factory createFactory() { >+ return xsltTask.createFactory(); >+ } >+ >+ /** > * transformation > * @throws BuildException exception if something goes wrong with the transformation. > */ >@@ -228,9 +248,6 @@ > TempFile tempFileTask = new TempFile(); > tempFileTask.bindToOwner(task); > >- XSLTProcess xsltTask = new XSLTProcess(); >- xsltTask.bindToOwner(task); >- > xsltTask.setXslResource(getStylesheet()); > > // acrobatic cast. >@@ -248,13 +265,6 @@ > outputFile = new File(toDir, "junit-noframes.html"); > } > xsltTask.setOut(outputFile); >- for (Iterator i = params.iterator(); i.hasNext();) { >- XSLTProcess.Param param = (XSLTProcess.Param) i.next(); >- XSLTProcess.Param newParam = xsltTask.createParam(); >- newParam.setProject(task.getProject()); >- newParam.setName(param.getName()); >- newParam.setExpression(param.getExpression()); >- } > XSLTProcess.Param paramx = xsltTask.createParam(); > paramx.setProject(task.getProject()); > paramx.setName("output.dir"); >Index: docs/manual/Tasks/style.html >=================================================================== >--- docs/manual/Tasks/style.html (revision 950154) >+++ docs/manual/Tasks/style.html (working copy) >@@ -269,7 +269,7 @@ > should be applied to. Use a nested mapper and the task's destdir > attribute to specify the output files.</p> > >-<h4>classpath</h4> >+<h4><a name="classpath">classpath</a></h4> > <p>The classpath to load the processor from can be specified via a > nested <code><classpath></code>, as well - that is, a > <a href="../using.html#path">path</a>-like structure.</p> >@@ -338,7 +338,7 @@ > </table> > </blockquote> > >-<h4>factory ('trax' processors only)</h4> >+<h4><a name="factory">factory ('trax' processors only)</a></h4> > Used to specify factory settings. > <blockquote> > <h4>Parameters</h4> >Index: docs/manual/Tasks/junitreport.html >=================================================================== >--- docs/manual/Tasks/junitreport.html (revision 950154) >+++ docs/manual/Tasks/junitreport.html (working copy) >@@ -167,8 +167,17 @@ > </tr> > </table> > >+<h4>classpath</h4> >+<p><em>Since Ant 1.9.</em> >+Like for the <a href="../CoreTasks/style.html#classpath">XSLT task</a>, >+a nested <classpath> will be used to load the processor.</p> > >+<h4>factory</h4> >+<p><em>Since Ant 1.9.</em> >+Like for the <a href="../CoreTasks/style.html#factory">XSLT task</a>, >+a nested <factory> can be used to specify factory settings.</p> > >+ > <h3>Example of report</h3> > <blockquote> > <pre><junitreport todir="./reports">
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 47002
:
23470
| 25506