From f076b53967609a5a8e500b776c83c76aa6679f53 Mon Sep 17 00:00:00 2001 From: James Nord Date: Wed, 27 May 2015 11:58:13 +0100 Subject: [PATCH] [FIXED JENKINS-28588] make the callable a static class. Don't send over the CucumberTestResultArchiver just to find out what the remote temporary directory is. --- .../CucumberTestResultArchiver.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/cucumber/jsontestsupport/CucumberTestResultArchiver.java b/src/main/java/org/jenkinsci/plugins/cucumber/jsontestsupport/CucumberTestResultArchiver.java index bdb7c9b..0da37c4 100644 --- a/src/main/java/org/jenkinsci/plugins/cucumber/jsontestsupport/CucumberTestResultArchiver.java +++ b/src/main/java/org/jenkinsci/plugins/cucumber/jsontestsupport/CucumberTestResultArchiver.java @@ -112,12 +112,7 @@ public boolean getIgnoreBadSteps(){ CucumberTestResult result = parser.parse(_testResults, build, launcher, listener); // TODO - look at all of the Scenarios and see if there are any embedded items contained with in them - String remoteTempDir = launcher.getChannel().call(new Callable() { - @Override - public String call() throws InterruptedException { - return System.getProperty("java.io.tmpdir"); - } - }); + String remoteTempDir = launcher.getChannel().call(new TmpDirCallable()); // if so we need to copy them to the master. for (FeatureResult f : result.getFeatures()) { @@ -217,6 +212,17 @@ public DescriptorImpl getDescriptor() { } + /** + * {@link Callable} that gets the temporary directory from the node. + */ + private final static class TmpDirCallable implements Callable { + @Override + public String call() throws InterruptedException { + return System.getProperty("java.io.tmpdir"); + } + } + + @Extension public static class DescriptorImpl extends BuildStepDescriptor {