Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for JENKINS-17438
Updated getXUnitToolInfoObject() to include:
 * BuildListener parameter
 * Use Util.replaceMacro() to expand CustomXSL string

Updated performTests() call to getXUnitToolInfoObject() to include BuildListener parameter
 * Searched rest of the code, this seems to be the only call of getXUnitToolInfoObject()

Addresses Bug: https://issues.jenkins-ci.org/browse/JENKINS-17438
  • Loading branch information
bobtheshrew committed Apr 5, 2013
1 parent 9bfb261 commit a7352df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/jenkinsci/plugins/xunit/XUnitPublisher.java
Expand Up @@ -166,7 +166,7 @@ private boolean performTests(XUnitLog xUnitLog, AbstractBuild<?, ?> build, Build
xUnitLog.infoConsoleLogger("Processing " + tool.getDescriptor().getDisplayName());
if (!isEmptyGivenPattern(xUnitReportService, tool)) {
String expandedPattern = getExpandedResolvedPattern(tool, build, listener);
XUnitToolInfo xUnitToolInfo = getXUnitToolInfoObject(tool, expandedPattern, build);
XUnitToolInfo xUnitToolInfo = getXUnitToolInfoObject(tool, expandedPattern, build, listener));
XUnitTransformer xUnitTransformer = getXUnitTransformerObject(xUnitToolInfo, listener);
boolean resultTransformation = getWorkspace(build).act(xUnitTransformer);
if (!resultTransformation) {
Expand All @@ -187,15 +187,15 @@ private String getExpandedResolvedPattern(TestType tool, AbstractBuild build, Bu
return Util.replaceMacro(newExpandedPattern, build.getEnvironment(listener));
}

private XUnitToolInfo getXUnitToolInfoObject(TestType tool, String expandedPattern, AbstractBuild build) {
private XUnitToolInfo getXUnitToolInfoObject(TestType tool, String expandedPattern, AbstractBuild build, BuildListener listener) {
return new XUnitToolInfo(
new FilePath(new File(Hudson.getInstance().getRootDir(), "userContent")),
tool.getInputMetric(),
expandedPattern,
tool.isFailIfNotNew(),
tool.isDeleteOutputFiles(), tool.isStopProcessingIfError(),
build.getTimeInMillis(),
(tool instanceof CustomType) ? getWorkspace(build).child(((CustomType) tool).getCustomXSL()) : null);
(tool instanceof CustomType) ? getWorkspace(build).child( Util.replaceMacro( ((CustomType) tool).getCustomXSL() , build.getEnvironment(listener)) ) : null);
}

private FilePath getWorkspace(AbstractBuild build) {
Expand Down

0 comments on commit a7352df

Please sign in to comment.