Skip to content

Commit

Permalink
[JENKINS-31999] bumped Jenkins baseline version to 1.580.1
Browse files Browse the repository at this point in the history
- adapted Callable/FileCallable to according MasterToSlave(File)Callable
- fixed NPE when configuring tool installations
- bumped TEST-GUIDE compatible version
  • Loading branch information
cpoenisch committed May 18, 2016
1 parent a30e310 commit 5009823
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 114 deletions.
78 changes: 42 additions & 36 deletions pom.xml
Expand Up @@ -79,12 +79,11 @@

<properties>
<!-- Jenkins base -->
<jenkins.version>1.580.1</jenkins.version>
<jenkins-test-harness.version>1.580.1</jenkins-test-harness.version>
<jenkins.version>1.565.3</jenkins.version>
<jenkins-test-harness.version>1.565.3</jenkins-test-harness.version>

<!-- Jenkins plugins -->
<matrix-project.version>1.4</matrix-project.version>
<junit.version>1.3</junit.version>
<job-dsl.version>1.37</job-dsl.version>

<!-- Static code analysis -->
Expand Down Expand Up @@ -153,12 +152,6 @@
<artifactId>matrix-project</artifactId>
<version>${matrix-project.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>job-dsl</artifactId>
Expand Down Expand Up @@ -269,6 +262,37 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.3,)
</versionRange>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -290,44 +314,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.3,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<versionRange>[2.10.1,)</versionRange>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<versionRange>
[2.10.1,)
</versionRange>
<goals>
<goal>javadoc</goal>
</goals>
Expand Down
Expand Up @@ -58,7 +58,7 @@ public class ETPlugin extends Plugin {
/**
* Defines the TEST-GUIDE version that the provided ATX configuration is based on.
*/
public static final ToolVersion ATX_VERSION = new ToolVersion(1, 30, 0, 0);
public static final ToolVersion ATX_VERSION = new ToolVersion(1, 29, 0, 0);

/**
* Helper class to easily compare tool versions defined by major, minor, micro and qualifier version. Mainly used to
Expand Down
Expand Up @@ -41,7 +41,6 @@
import hudson.model.AbstractItem;
import hudson.model.AbstractProject;
import hudson.model.Computer;
import hudson.model.Node;
import hudson.model.Run;
import hudson.tasks.BuildStepMonitor;
import hudson.tasks.Recorder;
Expand Down Expand Up @@ -231,12 +230,8 @@ protected boolean canContinue(final Result result) {
protected AbstractToolInstallation configureToolInstallation(final String toolName,
final BuildListener listener, final EnvVars envVars) throws IOException, InterruptedException {
AbstractToolInstallation installation = getToolInstallation(toolName, envVars);

if (installation != null) {
final Node node = Computer.currentComputer().getNode();
if (node != null) {
installation = installation.forNode(node, listener);
}
installation = installation.forNode(Computer.currentComputer().getNode(), listener);
installation = installation.forEnvironment(envVars);
}
return installation;
Expand Down
Expand Up @@ -58,7 +58,6 @@

import javax.annotation.CheckForNull;

import jenkins.security.MasterToSlaveCallable;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

Expand Down Expand Up @@ -242,7 +241,7 @@ public boolean perform(final AbstractBuild<?, ?> build, final Launcher launcher,
*/
private boolean publishReports(final ATXInstallation installation, final AbstractBuild<?, ?> build,
final Launcher launcher, final BuildListener listener)
throws IOException, InterruptedException {
throws IOException, InterruptedException {
final TTConsoleLogger logger = new TTConsoleLogger(listener);
final boolean isUploadEnabled = isUploadEnabled(installation);
final boolean isServerReachable = isServerReachable(installation, launcher, build.getEnvironment(listener));
Expand Down Expand Up @@ -302,7 +301,7 @@ private boolean isServerReachable(final ATXInstallation installation, final Laun
/**
* {@link Callable} providing remote access to test the TEST-GUIDE server availability.
*/
private static final class TestConnectionCallable extends MasterToSlaveCallable<Boolean, IOException> {
private static final class TestConnectionCallable implements Callable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

Expand Down
Expand Up @@ -39,7 +39,6 @@
import java.util.List;
import java.util.Map;

import jenkins.security.MasterToSlaveCallable;
import de.tracetronic.jenkins.plugins.ecutest.report.atx.installation.ATXBooleanSetting;
import de.tracetronic.jenkins.plugins.ecutest.report.atx.installation.ATXConfig;
import de.tracetronic.jenkins.plugins.ecutest.report.atx.installation.ATXCustomBooleanSetting;
Expand All @@ -63,7 +62,7 @@ public abstract class AbstractATXReportHandler {
/**
* Common {@link Callable} enabling generating and uploading ATX reports remotely.
*/
protected abstract static class AbstractReportCallable extends MasterToSlaveCallable<Boolean, IOException> {
protected abstract static class AbstractReportCallable implements Callable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

Expand Down
Expand Up @@ -40,7 +40,6 @@
import java.util.List;
import java.util.Map;

import jenkins.security.MasterToSlaveCallable;
import de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger;
import de.tracetronic.jenkins.plugins.ecutest.wrapper.com.ETComClient;
import de.tracetronic.jenkins.plugins.ecutest.wrapper.com.ETComException;
Expand Down Expand Up @@ -96,7 +95,7 @@ public boolean generate(final List<FilePath> reportFiles, final Launcher launche
/**
* {@link Callable} enabling generation of reports with specific generator remotely.
*/
private static final class GenerateReportCallable extends MasterToSlaveCallable<Boolean, IOException> {
private static final class GenerateReportCallable implements Callable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

Expand Down
Expand Up @@ -42,7 +42,6 @@
import hudson.model.Result;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Job;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Publisher;
import hudson.tasks.junit.TestResult;
Expand Down Expand Up @@ -185,7 +184,7 @@ public AbstractToolInstallation getToolInstallation(final EnvVars envVars) {
public Action getProjectAction(final AbstractProject<?, ?> project) {
final TestResultProjectAction action = project.getAction(TestResultProjectAction.class);
if (action == null) {
return new TestResultProjectAction((Job<?, ?>) project);
return new TestResultProjectAction(project);
} else {
return action;
}
Expand Down
Expand Up @@ -39,7 +39,6 @@
import java.io.IOException;
import java.util.List;

import jenkins.security.MasterToSlaveCallable;
import de.tracetronic.jenkins.plugins.ecutest.env.ToolEnvInvisibleAction;
import de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger;
import de.tracetronic.jenkins.plugins.ecutest.tool.StartETBuilder;
Expand Down Expand Up @@ -181,7 +180,7 @@ private String getSettingsDir(final AbstractBuild<?, ?> build) {
/**
* {@link Callable} enabling generation of UNIT reports remotely.
*/
private static final class GenerateUnitReportCallable extends MasterToSlaveCallable<Boolean, IOException> {
private static final class GenerateUnitReportCallable implements Callable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015-2016 TraceTronic GmbH
* Copyright (c) 2015 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -47,7 +47,6 @@
import java.util.Collections;
import java.util.List;

import jenkins.MasterToSlaveFileCallable;
import de.tracetronic.jenkins.plugins.ecutest.env.TestEnvInvisibleAction;
import de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger;

Expand Down Expand Up @@ -127,7 +126,7 @@ private List<FilePath> getReportFiles(final String junitDir, final AbstractBuild
/**
* {@link FileCallable} enabling remote file access to parse the JUnit report.
*/
private static final class ParseTestResultCallable extends MasterToSlaveFileCallable<TestResult> {
private static final class ParseTestResultCallable implements FileCallable<TestResult> {

private static final long serialVersionUID = 1L;

Expand All @@ -145,7 +144,7 @@ private static final class ParseTestResultCallable extends MasterToSlaveFileCall

@Override
public TestResult invoke(final File file, final VirtualChannel channel) throws IOException,
InterruptedException {
InterruptedException {
testResult.parse(file);
return testResult;
}
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015-2016 TraceTronic GmbH
* Copyright (c) 2015 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -102,7 +102,7 @@ public List<ETLogAnnotation> parse() {
}
}
}
} catch (final IOException | InterruptedException e) {
} catch (final IOException e) {
LOGGER.log(Level.SEVERE,
String.format("Failed parsing log file %s: %s", logFile.getRemote(), e.getMessage()));
}
Expand All @@ -129,7 +129,7 @@ public int parseLogCount(final Severity severity) {
}
}
}
} catch (final IOException | InterruptedException e) {
} catch (final IOException e) {
LOGGER.log(Level.SEVERE,
String.format("Failed parsing log file %s: %s", logFile.getRemote(), e.getMessage()));
}
Expand Down
Expand Up @@ -50,8 +50,6 @@
import java.util.Collections;
import java.util.List;

import jenkins.MasterToSlaveFileCallable;

import org.kohsuke.stapler.DataBoundConstructor;

import de.tracetronic.jenkins.plugins.ecutest.env.TestEnvInvisibleAction;
Expand Down Expand Up @@ -400,7 +398,7 @@ private int traverseReports(final List<ETLogReport> logReports, final FilePath a
*/
private int traverseSubReports(final ETLogReport logReport, final FilePath testReportDir,
final FilePath subTestReportDir, int id)
throws IOException, InterruptedException {
throws IOException, InterruptedException {
for (final FilePath subDir : subTestReportDir.listDirectories()) {
FilePath logFile = subDir.child(ERROR_LOG_NAME);
if (logFile.exists()) {
Expand Down Expand Up @@ -567,7 +565,7 @@ private List<FilePath> getTestSpecificLogFiles(final AbstractBuild<?, ?> build,
/**
* {@link FileCallable} providing remote file access to list included files.
*/
private static final class ListFilesCallable extends MasterToSlaveFileCallable<List<String>> {
private static final class ListFilesCallable implements FilePath.FileCallable<List<String>> {

private static final long serialVersionUID = 1;

Expand All @@ -589,7 +587,7 @@ private static final class ListFilesCallable extends MasterToSlaveFileCallable<L

@Override
public List<String> invoke(final File baseDir, final VirtualChannel channel) throws IOException,
InterruptedException {
InterruptedException {
final List<String> files = new ArrayList<String>();
for (final String includedFile : Util.createFileSet(baseDir, includes, excludes)
.getDirectoryScanner().getIncludedFiles()) {
Expand Down
Expand Up @@ -41,8 +41,6 @@
import java.io.IOException;
import java.util.List;

import jenkins.security.MasterToSlaveCallable;

import org.apache.commons.lang.StringUtils;

import de.tracetronic.jenkins.plugins.ecutest.env.TestEnvInvisibleAction;
Expand Down Expand Up @@ -283,7 +281,7 @@ protected abstract boolean runTest(String testFile, TestConfig testConfig, Execu
* if the current thread is interrupted while waiting for the completion
*/
private boolean checkETInstance(final Launcher launcher, final boolean kill) throws IOException,
InterruptedException {
InterruptedException {
final List<String> foundProcesses = ETClient.checkProcesses(launcher, kill);
return !foundProcesses.isEmpty();
}
Expand All @@ -303,7 +301,7 @@ private boolean checkETInstance(final Launcher launcher, final boolean kill) thr
* if the current thread is interrupted while waiting for the completion
*/
private boolean closeETInstance(final Launcher launcher, final BuildListener listener) throws IOException,
InterruptedException {
InterruptedException {
final List<String> foundProcesses = ETClient.checkProcesses(launcher, false);
if (foundProcesses.isEmpty()) {
return false;
Expand All @@ -325,7 +323,7 @@ private boolean closeETInstance(final Launcher launcher, final BuildListener lis
* if the current thread is interrupted while waiting for the completion
*/
private boolean checkTSInstance(final Launcher launcher, final boolean kill) throws IOException,
InterruptedException {
InterruptedException {
final List<String> foundProcesses = TSClient.checkProcesses(launcher, kill);
return !foundProcesses.isEmpty();
}
Expand Down Expand Up @@ -461,7 +459,7 @@ protected String getPackagesDir(final Launcher launcher, final BuildListener lis
/**
* {@link Callable} providing remote access to get a ECU-TEST workspace setting value via COM.
*/
private static final class GetSettingCallable extends MasterToSlaveCallable<String, IOException> {
private static final class GetSettingCallable implements Callable<String, IOException> {

private static final long serialVersionUID = 1L;

Expand Down

0 comments on commit 5009823

Please sign in to comment.