Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
[JENKINS-27392] Using SimpleBuildWrapper.createLoggerDecorator from C…
Browse files Browse the repository at this point in the history
…oreWrapperStep.
  • Loading branch information
jglick committed Mar 31, 2015
1 parent 63179a3 commit 874c461
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Expand Up @@ -51,7 +51,6 @@
import static org.junit.Assert.*;
import org.junit.Assume;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runners.model.Statement;
Expand Down Expand Up @@ -165,7 +164,6 @@ public static class OneVarWrapper extends SimpleBuildWrapper {
}
}

@Ignore("TODO test prepared")
@Issue("JENKINS-27392")
@Test public void loggerDecorator() throws Exception {
story.addStep(new Statement() {
Expand Down
Expand Up @@ -29,6 +29,7 @@
import hudson.Extension;
import hudson.FilePath;
import hudson.Launcher;
import hudson.console.ConsoleLogFilter;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.tasks.BuildWrapperDescriptor;
Expand Down Expand Up @@ -76,6 +77,10 @@ public static final class Execution extends AbstractStepExecutionImpl {
if (!overrides.isEmpty()) {
bodyInvoker.withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), new ExpanderImpl(overrides)));
}
ConsoleLogFilter filter = step.delegate.createLoggerDecorator(run);
if (filter != null) {
bodyInvoker.withContext(BodyInvoker.mergeConsoleLogFilters(getContext().get(ConsoleLogFilter.class), filter));
}
SimpleBuildWrapper.Disposer disposer = c.getDisposer();
bodyInvoker.withCallback(disposer != null ? new Callback(disposer) : BodyExecutionCallback.wrap(getContext())).start();
return false;
Expand Down
22 changes: 21 additions & 1 deletion pom.xml
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.608-SNAPSHOT</version> <!-- TODO SimpleBuildWrapper-JENKINS-27392 -->
<version>1.607</version> <!-- TODO SimpleBuildWrapper-JENKINS-27392 branch -->
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-pom</artifactId>
Expand Down Expand Up @@ -99,6 +99,26 @@
</dependencies>
</dependencyManagement>
<dependencies>
<dependency> <!-- TODO SimpleBuildWrapper-JENKINS-27392 branch @ a52d665180a7b11dcd64673c3f08b719f6c9f908 -->
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-core</artifactId>
<version>1.608-20150331.141653-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-war</artifactId>
<version>1.608-20150331.141722-1</version>
<type>war</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-war</artifactId>
<version>1.608-20150331.141722-1</version>
<classifier>war-for-test</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
Expand Down

0 comments on commit 874c461

Please sign in to comment.