Skip to content

Commit

Permalink
[JENKINS-34392] Upgrade to 2.7 parent pom. Fix findbugs errors. Fix f…
Browse files Browse the repository at this point in the history
…ailing tests.
  • Loading branch information
armfergom committed Apr 22, 2016
1 parent 098b854 commit 2638dc9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -32,3 +32,7 @@ target/
work/
pom.xml.releaseBackup
release.properties

.settings
.project
.classpath
8 changes: 6 additions & 2 deletions pom.xml
Expand Up @@ -4,10 +4,9 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.447</version><!-- which version of Jenkins is this plugin built against? -->
<version>2.7</version><!-- which version of Jenkins is this plugin built against? -->
</parent>

<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>mstestrunner</artifactId>
<version>1.2.1-SNAPSHOT</version>
<packaging>hpi</packaging>
Expand All @@ -22,6 +21,11 @@
</developer>
</developers>

<properties>
<jenkins.version>1.580.1</jenkins.version>
<java.level>6</java.level>
</properties>

<scm>
<connection>scm:git:git://github.com/jenkinsci/mstestrunner-plugin.git</connection>

Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/jenkinsci/plugins/MsTestBuilder.java
Expand Up @@ -10,7 +10,7 @@
import hudson.model.AbstractBuild;
import hudson.model.Computer;
import hudson.model.Descriptor;
import hudson.model.AbstractBuild;
import hudson.model.Node;
import hudson.model.AbstractProject;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
Expand Down Expand Up @@ -114,7 +114,12 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
args.add(execName);
} else {
EnvVars env = build.getEnvironment(listener);
installation = installation.forNode(Computer.currentComputer().getNode(), listener);
Node node = Computer.currentComputer().getNode();
if (node == null) {
listener.fatalError("Configuration has changed and node has been removed.");
return false;
}
installation = installation.forNode(node, listener);
installation = installation.forEnvironment(env);
String pathToMsTest = installation.getHome();
FilePath exec = new FilePath(launcher.getChannel(), pathToMsTest);
Expand Down Expand Up @@ -269,7 +274,7 @@ public boolean isApplicable(@SuppressWarnings("rawtypes") final Class<? extends
}

public MsTestInstallation[] getInstallations() {
return installations;
return Arrays.copyOf(installations, installations.length);
}

public void setInstallations(MsTestInstallation... antInstallations) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jenkinsci/plugins/MsTestInstallation.java
Expand Up @@ -19,6 +19,8 @@
*/
public final class MsTestInstallation extends ToolInstallation implements NodeSpecific<MsTestInstallation>, EnvironmentSpecific<MsTestInstallation> {

private static final long serialVersionUID = -2469009525603494417L;

@SuppressWarnings("unused")
/**
* Backward compatibility
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/index.jelly
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
This plugin run MSTest command line tool to execute unit tests for .NET projects.
</div>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">

Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:entry title="${%Name}" field="name">
<f:textbox />
Expand Down

0 comments on commit 2638dc9

Please sign in to comment.