Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Prakash2015-05-13 20:06:53 -0400
committerWinston Prakash2015-05-13 20:06:53 -0400
commit16f65cfd4c0f47c142f3afc40c2d0d1b5711f4e9 (patch)
tree93d0d9bbe3d9b505b0710db803d73254b87d69f1
parent04fcc19506e799f4d4d20504f248a3d7e56ca599 (diff)
downloadorg.eclipse.hudson.core-16f65cfd4c0f47c142f3afc40c2d0d1b5711f4e9.tar.gz
org.eclipse.hudson.core-16f65cfd4c0f47c142f3afc40c2d0d1b5711f4e9.tar.xz
org.eclipse.hudson.core-16f65cfd4c0f47c142f3afc40c2d0d1b5711f4e9.zip
Bug Fix: 414876 - Add the ability to add a description to each build step
-rw-r--r--hudson-core/pom.xml2
-rw-r--r--hudson-core/src/main/java/hudson/tasks/Ant.java8
-rw-r--r--hudson-core/src/main/java/hudson/tasks/BatchFile.java9
-rw-r--r--hudson-core/src/main/java/hudson/tasks/Builder.java16
-rw-r--r--hudson-core/src/main/java/hudson/tasks/Maven.java13
-rw-r--r--hudson-core/src/main/java/hudson/tasks/Shell.java8
-rw-r--r--hudson-core/src/main/resources/hudson/tasks/Ant/config.jelly53
-rw-r--r--hudson-core/src/main/resources/hudson/tasks/BatchFile/config.jelly3
-rw-r--r--hudson-core/src/main/resources/hudson/tasks/Maven/config.jelly3
-rw-r--r--hudson-core/src/main/resources/hudson/tasks/Shell/config.jelly3
-rw-r--r--hudson-core/src/test/java/hudson/tasks/AntEqualsHashCodeTest.java30
-rw-r--r--hudson-core/src/test/java/hudson/tasks/BatchFileEqualsHashCodeTest.java24
-rw-r--r--hudson-core/src/test/java/hudson/tasks/MavenEqualsHashCodeTest.java30
-rw-r--r--hudson-core/src/test/java/hudson/tasks/ShellEqualsHashCodeTest.java24
-rw-r--r--hudson-core/src/test/java/hudson/util/CopyOnWriteListEqualsHashCodeTest.java14
-rw-r--r--hudson-core/src/test/java/hudson/util/PersistedListEqualsHashCodeTest.java22
-rw-r--r--hudson-core/src/test/java/org/eclipse/hudson/model/project/property/DescribableListProjectPropertyTest.java8
17 files changed, 160 insertions, 110 deletions
diff --git a/hudson-core/pom.xml b/hudson-core/pom.xml
index 1c4507bf..255c4668 100644
--- a/hudson-core/pom.xml
+++ b/hudson-core/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.eclipse.hudson</groupId>
<artifactId>hudson-parent</artifactId>
- <version> 3.3.0-SNAPSHOT</version>
+ <version>3.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/hudson-core/src/main/java/hudson/tasks/Ant.java b/hudson-core/src/main/java/hudson/tasks/Ant.java
index daf6d9d9..d9eb28eb 100644
--- a/hudson-core/src/main/java/hudson/tasks/Ant.java
+++ b/hudson-core/src/main/java/hudson/tasks/Ant.java
@@ -88,15 +88,21 @@ public class Ant extends Builder {
* syntax.
*/
private final String properties;
+
+ public Ant(String targets, String antName, String antOpts, String buildFile, String properties) {
+ this(targets, antName, antOpts, buildFile, properties, false, "");
+ }
+
@DataBoundConstructor
- public Ant(String targets, String antName, String antOpts, String buildFile, String properties, boolean disabled) {
+ public Ant(String targets, String antName, String antOpts, String buildFile, String properties, boolean disabled, String description) {
this.targets = targets;
this.antName = antName;
this.antOpts = StringUtils.trimToNull(antOpts);
this.buildFile = StringUtils.trimToNull(buildFile);
this.properties = StringUtils.trimToNull(properties);
setDisabled(disabled);
+ setDescription(description);
}
public String getBuildFile() {
diff --git a/hudson-core/src/main/java/hudson/tasks/BatchFile.java b/hudson-core/src/main/java/hudson/tasks/BatchFile.java
index 44060285..34a71231 100644
--- a/hudson-core/src/main/java/hudson/tasks/BatchFile.java
+++ b/hudson-core/src/main/java/hudson/tasks/BatchFile.java
@@ -29,11 +29,16 @@ import org.kohsuke.stapler.StaplerRequest;
* @author Kohsuke Kawaguchi
*/
public class BatchFile extends CommandInterpreter {
+
+ public BatchFile(String command) {
+ this(command, false, "");
+ }
@DataBoundConstructor
- public BatchFile(String command, boolean disabled) {
+ public BatchFile(String command, boolean disabled, String description) {
super(command);
setDisabled(disabled);
+ setDescription(description);
}
public String[] buildCommandLine(FilePath script) {
@@ -62,7 +67,7 @@ public class BatchFile extends CommandInterpreter {
@Override
public Builder newInstance(StaplerRequest req, JSONObject data) {
- return new BatchFile(data.getString("command"), data.getBoolean("disabled"));
+ return new BatchFile(data.getString("command"), data.getBoolean("disabled"), data.getString("description"));
}
public boolean isApplicable(Class<? extends AbstractProject> jobType) {
diff --git a/hudson-core/src/main/java/hudson/tasks/Builder.java b/hudson-core/src/main/java/hudson/tasks/Builder.java
index dff72eee..ba25d121 100644
--- a/hudson-core/src/main/java/hudson/tasks/Builder.java
+++ b/hudson-core/src/main/java/hudson/tasks/Builder.java
@@ -54,6 +54,22 @@ public abstract class Builder extends BuildStepCompatibilityLayer implements Bui
}
/**
+ * @since 3.3.0
+ * Description of what this builder does as documentation
+ * (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=414876)
+ */
+
+ private String description;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
* Default implementation that does nothing.
*/
public boolean prebuild(Build build, BuildListener listener) {
diff --git a/hudson-core/src/main/java/hudson/tasks/Maven.java b/hudson-core/src/main/java/hudson/tasks/Maven.java
index e9c28649..d8577f77 100644
--- a/hudson-core/src/main/java/hudson/tasks/Maven.java
+++ b/hudson-core/src/main/java/hudson/tasks/Maven.java
@@ -108,15 +108,21 @@ public class Maven extends Builder {
private final static String MAVEN_2_INSTALLATION_COMMON_FILE = "bin/mvn";
public Maven(String targets, String name) {
- this(targets, name, null, null, null, false, false);
+ this(targets, name, null, null, null, false, false, "");
}
public Maven(String targets, String name, String pom, String properties, String jvmOptions) {
- this(targets, name, pom, properties, jvmOptions, false, false);
+ this(targets, name, pom, properties, jvmOptions, false, false, "");
+ }
+
+ public Maven(String targets, String name, String pom, String properties,
+ String jvmOptions, boolean usePrivateRepository) {
+ this(targets, name, pom, properties, jvmOptions, usePrivateRepository, false, "");
}
@DataBoundConstructor
- public Maven(String targets, String name, String pom, String properties, String jvmOptions, boolean usePrivateRepository, boolean disabled) {
+ public Maven(String targets, String name, String pom, String properties,
+ String jvmOptions, boolean usePrivateRepository, boolean disabled, String description) {
this.targets = targets;
this.mavenName = name;
this.pom = StringUtils.trimToNull(pom);
@@ -124,6 +130,7 @@ public class Maven extends Builder {
this.jvmOptions = StringUtils.trimToNull(jvmOptions);
this.usePrivateRepository = usePrivateRepository;
setDisabled(disabled);
+ setDescription(description);
}
public String getTargets() {
diff --git a/hudson-core/src/main/java/hudson/tasks/Shell.java b/hudson-core/src/main/java/hudson/tasks/Shell.java
index 872c5fab..ad39dbfd 100644
--- a/hudson-core/src/main/java/hudson/tasks/Shell.java
+++ b/hudson-core/src/main/java/hudson/tasks/Shell.java
@@ -43,10 +43,14 @@ public class Shell extends CommandInterpreter {
private static final Logger LOGGER = Logger.getLogger(Shell.class.getName());
+ public Shell(String command){
+ this(command, false, "");
+ }
@DataBoundConstructor
- public Shell(String command, boolean disabled) {
+ public Shell(String command, boolean disabled, String description) {
super(fixCrLf(command));
this.setDisabled(disabled);
+ setDescription(description);
}
/**
@@ -165,7 +169,7 @@ public class Shell extends CommandInterpreter {
@Override
public Builder newInstance(StaplerRequest req, JSONObject data) {
- return new Shell(data.getString("command"), data.getBoolean("disabled"));
+ return new Shell(data.getString("command"), data.getBoolean("disabled"), data.getString("description"));
}
@Override
diff --git a/hudson-core/src/main/resources/hudson/tasks/Ant/config.jelly b/hudson-core/src/main/resources/hudson/tasks/Ant/config.jelly
index 01be9cd7..4657223d 100644
--- a/hudson-core/src/main/resources/hudson/tasks/Ant/config.jelly
+++ b/hudson-core/src/main/resources/hudson/tasks/Ant/config.jelly
@@ -17,32 +17,35 @@
<?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">
- <j:if test="${!empty(descriptor.installations)}">
- <f:entry title="${%Ant Version}">
- <select class="setting-input" name="ant.antName">
- <option value="(Default)">(${%Default})</option>
- <j:forEach var="inst" items="${descriptor.installations}">
- <f:option selected="${inst.name==instance.ant.name}" value="${inst.name}">${inst.name}</f:option>
- </j:forEach>
- </select>
+ <f:entry title="" help="/help/disable-builder.html">
+ <f:checkbox name="disabled" checked="${instance.disabled}"
+ title="${%Temporarily disable this builder}"/>
</f:entry>
- </j:if>
- <f:entry title="" help="/help/disable-builder.html">
- <f:checkbox name="disabled" checked="${instance.disabled}"
- title="${%Temporarily disable this builder}"/>
- </f:entry>
- <f:entry title="${%Targets}" help="/help/ant/ant-targets.html">
- <f:expandableTextbox name="ant.targets" value="${instance.targets}" />
- </f:entry>
- <f:advanced>
- <f:entry title="${%Build File}" help="/help/ant/ant-buildfile.html">
- <f:textbox name="ant.buildFile" value="${instance.buildFile}"/>
+ <f:entry title="${%Description}" >
+ <f:textarea name="description" value="${instance.description}" class="fixed-width" />
</f:entry>
- <f:entry title="${%Properties}" help="/help/ant/ant-properties.html">
- <f:textarea name="ant.properties" value="${instance.properties}"/>
+ <j:if test="${!empty(descriptor.installations)}">
+ <f:entry title="${%Ant Version}">
+ <select class="setting-input" name="ant.antName">
+ <option value="(Default)">(${%Default})</option>
+ <j:forEach var="inst" items="${descriptor.installations}">
+ <f:option selected="${inst.name==instance.ant.name}" value="${inst.name}">${inst.name}</f:option>
+ </j:forEach>
+ </select>
+ </f:entry>
+ </j:if>
+ <f:entry title="${%Targets}" help="/help/ant/ant-targets.html">
+ <f:expandableTextbox name="ant.targets" value="${instance.targets}" />
</f:entry>
- <f:entry title="${%Java Options}" help="/help/ant/ant-opts.html">
- <f:expandableTextbox name="ant.antOpts" value="${instance.antOpts}"/>
- </f:entry>
- </f:advanced>
+ <f:advanced>
+ <f:entry title="${%Build File}" help="/help/ant/ant-buildfile.html">
+ <f:textbox name="ant.buildFile" value="${instance.buildFile}"/>
+ </f:entry>
+ <f:entry title="${%Properties}" help="/help/ant/ant-properties.html">
+ <f:textarea name="ant.properties" value="${instance.properties}"/>
+ </f:entry>
+ <f:entry title="${%Java Options}" help="/help/ant/ant-opts.html">
+ <f:expandableTextbox name="ant.antOpts" value="${instance.antOpts}"/>
+ </f:entry>
+ </f:advanced>
</j:jelly>
diff --git a/hudson-core/src/main/resources/hudson/tasks/BatchFile/config.jelly b/hudson-core/src/main/resources/hudson/tasks/BatchFile/config.jelly
index ebb684c7..baaa310b 100644
--- a/hudson-core/src/main/resources/hudson/tasks/BatchFile/config.jelly
+++ b/hudson-core/src/main/resources/hudson/tasks/BatchFile/config.jelly
@@ -21,6 +21,9 @@
<f:checkbox name="disabled" checked="${instance.disabled}"
title="${%Temporarily disable this builder}"/>
</f:entry>
+ <f:entry title="${%Description}">
+ <f:textarea name="description" value="${instance.description}" class="fixed-width" />
+ </f:entry>
<f:entry title="${%Command}"
description="${%description(rootURL)}">
<f:textarea name="command" value="${instance.command}" class="fixed-width" />
diff --git a/hudson-core/src/main/resources/hudson/tasks/Maven/config.jelly b/hudson-core/src/main/resources/hudson/tasks/Maven/config.jelly
index 79148760..de3a4c92 100644
--- a/hudson-core/src/main/resources/hudson/tasks/Maven/config.jelly
+++ b/hudson-core/src/main/resources/hudson/tasks/Maven/config.jelly
@@ -21,6 +21,9 @@
<f:checkbox name="disabled" checked="${instance.disabled}"
title="${%Temporarily disable this builder}"/>
</f:entry>
+ <f:entry title="${%Description}">
+ <f:textarea name="description" value="${instance.description}" class="fixed-width" />
+ </f:entry>
<j:if test="${!empty(descriptor.installations)}">
<f:entry title="${%Maven Version}">
<select class="setting-input" name="maven.name">
diff --git a/hudson-core/src/main/resources/hudson/tasks/Shell/config.jelly b/hudson-core/src/main/resources/hudson/tasks/Shell/config.jelly
index 7e22f70b..f0f21fb8 100644
--- a/hudson-core/src/main/resources/hudson/tasks/Shell/config.jelly
+++ b/hudson-core/src/main/resources/hudson/tasks/Shell/config.jelly
@@ -21,6 +21,9 @@
<f:checkbox name="disabled" checked="${instance.disabled}"
title="${%Temporarily disable this builder}"/>
</f:entry>
+ <f:entry title="${%Description}">
+ <f:textarea name="description" value="${instance.description}" class="fixed-width" />
+ </f:entry>
<f:entry title="${%Command}" description="${%description(rootURL)}">
<f:textarea name="command" value="${instance.command}" class="fixed-width" />
</f:entry>
diff --git a/hudson-core/src/test/java/hudson/tasks/AntEqualsHashCodeTest.java b/hudson-core/src/test/java/hudson/tasks/AntEqualsHashCodeTest.java
index b40d603f..3ab7647d 100644
--- a/hudson-core/src/test/java/hudson/tasks/AntEqualsHashCodeTest.java
+++ b/hudson-core/src/test/java/hudson/tasks/AntEqualsHashCodeTest.java
@@ -27,18 +27,18 @@ import org.junit.Test;
* @author Nikita Levyankov
*/
public class AntEqualsHashCodeTest {
- private Ant ant = new Ant("targets", "antName", "antOpts", "buildFile", "properties", false);
+ private Ant ant = new Ant("targets", "antName", "antOpts", "buildFile", "properties");
@Test
public void testHashCode() {
- assertEquals(ant.hashCode(), new Ant("targets", "antName", "antOpts", "buildFile", "properties", false).hashCode());
- assertFalse(ant.hashCode() == new Ant("targets", "antName", "antOpts", "buildFile", "properties1", false).hashCode());
- assertFalse(ant.hashCode() == new Ant("targets", "antName", "antOpts", "buildFile1", "properties", false).hashCode());
- assertFalse(ant.hashCode() == new Ant("targets", "antName", "antOpts1", "buildFile", "properties", false).hashCode());
- assertFalse(ant.hashCode() == new Ant("targets", "antName1", "antOpts", "buildFile", "properties", false).hashCode());
- assertFalse(ant.hashCode() == new Ant("targets1", "antName", "antOpts", "buildFile", "properties", false).hashCode());
+ assertEquals(ant.hashCode(), new Ant("targets", "antName", "antOpts", "buildFile", "properties").hashCode());
+ assertFalse(ant.hashCode() == new Ant("targets", "antName", "antOpts", "buildFile", "properties1").hashCode());
+ assertFalse(ant.hashCode() == new Ant("targets", "antName", "antOpts", "buildFile1", "properties").hashCode());
+ assertFalse(ant.hashCode() == new Ant("targets", "antName", "antOpts1", "buildFile", "properties").hashCode());
+ assertFalse(ant.hashCode() == new Ant("targets", "antName1", "antOpts", "buildFile", "properties").hashCode());
+ assertFalse(ant.hashCode() == new Ant("targets1", "antName", "antOpts", "buildFile", "properties").hashCode());
assertFalse(
- ant.hashCode() == new Ant("targets1", "antName1", "antOpts1", "buildFile1", "properties1", false).hashCode());
+ ant.hashCode() == new Ant("targets1", "antName1", "antOpts1", "buildFile1", "properties1").hashCode());
}
@Test
@@ -46,12 +46,12 @@ public class AntEqualsHashCodeTest {
assertEquals(ant, ant);
assertFalse(ant.equals(null));
assertFalse(ant.equals(new Object()));
- assertEquals(ant, new Ant("targets", "antName", "antOpts", "buildFile", "properties", false));
- assertFalse(ant.equals(new Ant("targets", "antName", "antOpts", "buildFile", "properties1", false)));
- assertFalse(ant.equals(new Ant("targets", "antName", "antOpts", "buildFile1", "properties", false)));
- assertFalse(ant.equals(new Ant("targets", "antName", "antOpts1", "buildFile", "properties", false)));
- assertFalse(ant.equals(new Ant("targets", "antName1", "antOpts", "buildFile", "properties", false)));
- assertFalse(ant.equals(new Ant("targets1", "antName", "antOpts", "buildFile", "properties", false)));
- assertFalse(ant.equals(new Ant("targets1", "antName1", "antOpts1", "buildFile1", "properties1", false)));
+ assertEquals(ant, new Ant("targets", "antName", "antOpts", "buildFile", "properties"));
+ assertFalse(ant.equals(new Ant("targets", "antName", "antOpts", "buildFile", "properties1")));
+ assertFalse(ant.equals(new Ant("targets", "antName", "antOpts", "buildFile1", "properties")));
+ assertFalse(ant.equals(new Ant("targets", "antName", "antOpts1", "buildFile", "properties")));
+ assertFalse(ant.equals(new Ant("targets", "antName1", "antOpts", "buildFile", "properties")));
+ assertFalse(ant.equals(new Ant("targets1", "antName", "antOpts", "buildFile", "properties")));
+ assertFalse(ant.equals(new Ant("targets1", "antName1", "antOpts1", "buildFile1", "properties1")));
}
}
diff --git a/hudson-core/src/test/java/hudson/tasks/BatchFileEqualsHashCodeTest.java b/hudson-core/src/test/java/hudson/tasks/BatchFileEqualsHashCodeTest.java
index 455ed115..0a52123f 100644
--- a/hudson-core/src/test/java/hudson/tasks/BatchFileEqualsHashCodeTest.java
+++ b/hudson-core/src/test/java/hudson/tasks/BatchFileEqualsHashCodeTest.java
@@ -30,23 +30,23 @@ import org.junit.Test;
public class BatchFileEqualsHashCodeTest {
@Test
public void testHashCode() {
- assertEquals(new BatchFile(null, false).hashCode(), new BatchFile(null, false).hashCode());
- assertEquals(new BatchFile("", false).hashCode(), new BatchFile("", false).hashCode());
- assertEquals(new BatchFile("echo", false).hashCode(), new BatchFile("echo", false).hashCode());
- assertFalse(new BatchFile("echo 'test'", false).hashCode() == new BatchFile("echo '123'", false).hashCode());
- assertFalse(new BatchFile(null, false).hashCode() == new BatchFile("echo '123'", false).hashCode());
+ assertEquals(new BatchFile(null).hashCode(), new BatchFile(null).hashCode());
+ assertEquals(new BatchFile("").hashCode(), new BatchFile("").hashCode());
+ assertEquals(new BatchFile("echo").hashCode(), new BatchFile("echo").hashCode());
+ assertFalse(new BatchFile("echo 'test'").hashCode() == new BatchFile("echo '123'").hashCode());
+ assertFalse(new BatchFile(null).hashCode() == new BatchFile("echo '123'").hashCode());
}
@Test
public void testEqual() {
- BatchFile echo = new BatchFile("echo", false);
+ BatchFile echo = new BatchFile("echo");
assertEquals(echo, echo);
- assertFalse(new BatchFile("echo", false).equals(null));
+ assertFalse(new BatchFile("echo").equals(null));
assertFalse(echo.equals(new Object()));
- assertEquals(echo, new BatchFile("echo", false));
- assertEquals(new BatchFile(null, false), new BatchFile(null, false));
- assertEquals(new BatchFile("", false), new BatchFile("", false));
- assertFalse(new BatchFile("echo 'test'", false).equals(new BatchFile("echo '123'", false)));
- assertFalse(new BatchFile(null, false).equals(new BatchFile("echo '123'", false)));
+ assertEquals(echo, new BatchFile("echo"));
+ assertEquals(new BatchFile(null), new BatchFile(null));
+ assertEquals(new BatchFile(""), new BatchFile(""));
+ assertFalse(new BatchFile("echo 'test'").equals(new BatchFile("echo '123'")));
+ assertFalse(new BatchFile(null).equals(new BatchFile("echo '123'")));
}
} \ No newline at end of file
diff --git a/hudson-core/src/test/java/hudson/tasks/MavenEqualsHashCodeTest.java b/hudson-core/src/test/java/hudson/tasks/MavenEqualsHashCodeTest.java
index ef0fdd5a..5063fb07 100644
--- a/hudson-core/src/test/java/hudson/tasks/MavenEqualsHashCodeTest.java
+++ b/hudson-core/src/test/java/hudson/tasks/MavenEqualsHashCodeTest.java
@@ -28,24 +28,24 @@ import org.junit.Test;
*/
public class MavenEqualsHashCodeTest {
- private Maven maven = new Maven("targets", "name", "pom", "properties", "jvmOptions", false, false);
+ private Maven maven = new Maven("targets", "name", "pom", "properties", "jvmOptions", false );
@Test
public void testHashCode() {
assertEquals(maven.hashCode(),
- new Maven("targets", "name", "pom", "properties", "jvmOptions", false, false).hashCode());
+ new Maven("targets", "name", "pom", "properties", "jvmOptions", false ).hashCode());
assertFalse(
- maven.hashCode() == new Maven("targets", "name", "pom", "properties", "jvmOptions", true, false).hashCode());
+ maven.hashCode() == new Maven("targets", "name", "pom", "properties", "jvmOptions", true ).hashCode());
assertFalse(
- maven.hashCode() == new Maven("targets", "name", "pom", "properties", "jvmOptions1", false, false).hashCode());
+ maven.hashCode() == new Maven("targets", "name", "pom", "properties", "jvmOptions1", false ).hashCode());
assertFalse(
- maven.hashCode() == new Maven("targets", "name", "pom", "properties1", "jvmOptions", false, false).hashCode());
+ maven.hashCode() == new Maven("targets", "name", "pom", "properties1", "jvmOptions", false ).hashCode());
assertFalse(
- maven.hashCode() == new Maven("targets", "name", "pom1", "properties", "jvmOptions", false, false).hashCode());
+ maven.hashCode() == new Maven("targets", "name", "pom1", "properties", "jvmOptions", false ).hashCode());
assertFalse(
- maven.hashCode() == new Maven("targets", "name1", "pom", "properties", "jvmOptions", false, false).hashCode());
+ maven.hashCode() == new Maven("targets", "name1", "pom", "properties", "jvmOptions", false ).hashCode());
assertFalse(
- maven.hashCode() == new Maven("targets1", "name", "pom", "properties", "jvmOptions", false, false).hashCode());
+ maven.hashCode() == new Maven("targets1", "name", "pom", "properties", "jvmOptions", false ).hashCode());
}
@Test
@@ -53,12 +53,12 @@ public class MavenEqualsHashCodeTest {
assertEquals(maven, maven);
assertFalse(maven.equals(null));
assertFalse(maven.equals(new Object()));
- assertEquals(maven, new Maven("targets", "name", "pom", "properties", "jvmOptions", false, false));
- assertFalse(maven.equals(new Maven("targets", "name", "pom", "properties", "jvmOptions", true, false)));
- assertFalse(maven.equals(new Maven("targets", "name", "pom", "properties", "jvmOptions1", false, false)));
- assertFalse(maven.equals(new Maven("targets", "name", "pom1", "properties", "jvmOptions", false, false)));
- assertFalse(maven.equals(new Maven("targets", "name1", "pom", "properties", "jvmOptions", false, false)));
- assertFalse(maven.equals(new Maven("targets1", "name", "pom", "properties", "jvmOptions", false, false)));
- assertFalse(maven.equals(new Maven("targets1", "name1", "pom1", "properties1", "jvmOptions1", true, false)));
+ assertEquals(maven, new Maven("targets", "name", "pom", "properties", "jvmOptions", false ));
+ assertFalse(maven.equals(new Maven("targets", "name", "pom", "properties", "jvmOptions", true )));
+ assertFalse(maven.equals(new Maven("targets", "name", "pom", "properties", "jvmOptions1", false )));
+ assertFalse(maven.equals(new Maven("targets", "name", "pom1", "properties", "jvmOptions", false )));
+ assertFalse(maven.equals(new Maven("targets", "name1", "pom", "properties", "jvmOptions", false )));
+ assertFalse(maven.equals(new Maven("targets1", "name", "pom", "properties", "jvmOptions", false )));
+ assertFalse(maven.equals(new Maven("targets1", "name1", "pom1", "properties1", "jvmOptions1", true )));
}
}
diff --git a/hudson-core/src/test/java/hudson/tasks/ShellEqualsHashCodeTest.java b/hudson-core/src/test/java/hudson/tasks/ShellEqualsHashCodeTest.java
index bb47f7ed..6b15b1cb 100644
--- a/hudson-core/src/test/java/hudson/tasks/ShellEqualsHashCodeTest.java
+++ b/hudson-core/src/test/java/hudson/tasks/ShellEqualsHashCodeTest.java
@@ -30,23 +30,23 @@ public class ShellEqualsHashCodeTest {
@Test
public void testHashCode() {
- assertEquals(new Shell(null, false).hashCode(), new Shell(null, false).hashCode());
- assertEquals(new Shell("", false).hashCode(), new Shell("", false).hashCode());
- assertEquals(new Shell("echo", false).hashCode(), new Shell("echo", false).hashCode());
- assertFalse(new Shell("echo 'test'", false).hashCode() == new Shell("echo '123'", false).hashCode());
- assertFalse(new Shell(null, false).hashCode() == new Shell("echo '123'", false).hashCode());
+ assertEquals(new Shell(null).hashCode(), new Shell(null).hashCode());
+ assertEquals(new Shell("").hashCode(), new Shell("").hashCode());
+ assertEquals(new Shell("echo").hashCode(), new Shell("echo").hashCode());
+ assertFalse(new Shell("echo 'test'").hashCode() == new Shell("echo '123'").hashCode());
+ assertFalse(new Shell(null).hashCode() == new Shell("echo '123'").hashCode());
}
@Test
public void testEqual() {
- Shell echo = new Shell("echo", false);
+ Shell echo = new Shell("echo");
assertEquals(echo, echo);
- assertFalse(new Shell("echo", false).equals(null));
+ assertFalse(new Shell("echo").equals(null));
assertFalse(echo.equals(new Object()));
- assertEquals(echo, new Shell("echo", false));
- assertEquals(new Shell(null, false), new Shell(null, false));
- assertEquals(new Shell("", false), new Shell("", false));
- assertFalse(new Shell("echo 'test'", false).equals(new Shell("echo '123'", false)));
- assertFalse(new Shell(null, false).equals(new Shell("echo '123'", false)));
+ assertEquals(echo, new Shell("echo"));
+ assertEquals(new Shell(null), new Shell(null));
+ assertEquals(new Shell(""), new Shell(""));
+ assertFalse(new Shell("echo 'test'").equals(new Shell("echo '123'")));
+ assertFalse(new Shell(null).equals(new Shell("echo '123'")));
}
}
diff --git a/hudson-core/src/test/java/hudson/util/CopyOnWriteListEqualsHashCodeTest.java b/hudson-core/src/test/java/hudson/util/CopyOnWriteListEqualsHashCodeTest.java
index 4a8b7908..4e32d1fa 100644
--- a/hudson-core/src/test/java/hudson/util/CopyOnWriteListEqualsHashCodeTest.java
+++ b/hudson-core/src/test/java/hudson/util/CopyOnWriteListEqualsHashCodeTest.java
@@ -38,13 +38,13 @@ public class CopyOnWriteListEqualsHashCodeTest {
@Before
public void setUp() {
data1 = new ArrayList<Builder>();
- data1.add(new Shell("echo 'test'", false));
- data1.add(new Shell("echo 'test1'", false));
- data1.add(new Shell("echo 'test2'", false));
+ data1.add(new Shell("echo 'test'"));
+ data1.add(new Shell("echo 'test1'"));
+ data1.add(new Shell("echo 'test2'"));
data2 = new ArrayList<Builder>();
- data2.add(new Shell("echo 'test1'", false));
- data2.add(new Shell("echo 'test'", false));
+ data2.add(new Shell("echo 'test1'"));
+ data2.add(new Shell("echo 'test'"));
}
@Test
@@ -52,7 +52,7 @@ public class CopyOnWriteListEqualsHashCodeTest {
assertEquals(new CopyOnWriteList(data1).hashCode(), new CopyOnWriteList(data1).hashCode());
assertFalse(new CopyOnWriteList(data1).hashCode() == new CopyOnWriteList(data2).hashCode());
- data2.add(new Shell("echo 'test2'", false));
+ data2.add(new Shell("echo 'test2'"));
assertFalse(new CopyOnWriteList(data1).hashCode() == new CopyOnWriteList(data2).hashCode());
}
@@ -66,7 +66,7 @@ public class CopyOnWriteListEqualsHashCodeTest {
assertFalse(new CopyOnWriteList(data1).equals(new CopyOnWriteList(data2)));
assertEquals(new CopyOnWriteList(data1), new CopyOnWriteList(data1));
- data2.add(new Shell("echo 'test2'", false));
+ data2.add(new Shell("echo 'test2'"));
assertEquals(new CopyOnWriteList(data1), new CopyOnWriteList(data2));
}
}
diff --git a/hudson-core/src/test/java/hudson/util/PersistedListEqualsHashCodeTest.java b/hudson-core/src/test/java/hudson/util/PersistedListEqualsHashCodeTest.java
index 1f3471d3..0929243b 100644
--- a/hudson-core/src/test/java/hudson/util/PersistedListEqualsHashCodeTest.java
+++ b/hudson-core/src/test/java/hudson/util/PersistedListEqualsHashCodeTest.java
@@ -54,13 +54,13 @@ public class PersistedListEqualsHashCodeTest {
assertEquals(new PersistedList().hashCode(), new PersistedList().hashCode());
assertEquals(persistedList1.hashCode(), new PersistedList(owner1).hashCode());
assertFalse(persistedList1.hashCode() == persistedList2.hashCode());
- persistedList1.add(new Shell("echo 'test1'", false));
+ persistedList1.add(new Shell("echo 'test1'"));
assertFalse(persistedList1.hashCode() == persistedList2.hashCode());
- persistedList2.add(new Shell("echo 'test1'", false));
+ persistedList2.add(new Shell("echo 'test1'"));
assertFalse(persistedList1.hashCode() == persistedList2.hashCode());
- persistedList3.add(new Shell("echo 'test1'", false));
+ persistedList3.add(new Shell("echo 'test1'"));
assertEquals(persistedList1.hashCode(), persistedList3.hashCode());
- persistedList3.replaceBy(Arrays.asList(new Shell("echo 'test2'", false)));
+ persistedList3.replaceBy(Arrays.asList(new Shell("echo 'test2'")));
assertFalse(persistedList1.hashCode() == persistedList3.hashCode());
}
@@ -71,16 +71,16 @@ public class PersistedListEqualsHashCodeTest {
assertFalse(persistedList1.equals(new Object()));
assertFalse(persistedList1.equals(persistedList2));
assertEquals(persistedList1, persistedList3);
- persistedList1.add(new Shell("echo 'test1'", false));
- persistedList3.add(new Shell("echo 'test1'", false));
+ persistedList1.add(new Shell("echo 'test1'"));
+ persistedList3.add(new Shell("echo 'test1'"));
assertEquals(persistedList1, persistedList3);
- persistedList1.add(new Shell("echo 'test3'", false));
- persistedList1.add(new Shell("echo 'test2'", false));
- persistedList3.add(new Shell("echo 'test2'", false));
- persistedList3.add(new Shell("echo 'test3'", false));
+ persistedList1.add(new Shell("echo 'test3'"));
+ persistedList1.add(new Shell("echo 'test2'"));
+ persistedList3.add(new Shell("echo 'test2'"));
+ persistedList3.add(new Shell("echo 'test3'"));
assertEquals(persistedList1, persistedList3);
- persistedList3.replaceBy(Arrays.asList(new Shell("echo 'test2'", false)));
+ persistedList3.replaceBy(Arrays.asList(new Shell("echo 'test2'")));
assertFalse(persistedList1.equals(persistedList3));
}
}
diff --git a/hudson-core/src/test/java/org/eclipse/hudson/model/project/property/DescribableListProjectPropertyTest.java b/hudson-core/src/test/java/org/eclipse/hudson/model/project/property/DescribableListProjectPropertyTest.java
index 6a639491..c51eb428 100644
--- a/hudson-core/src/test/java/org/eclipse/hudson/model/project/property/DescribableListProjectPropertyTest.java
+++ b/hudson-core/src/test/java/org/eclipse/hudson/model/project/property/DescribableListProjectPropertyTest.java
@@ -119,9 +119,9 @@ public class DescribableListProjectPropertyTest {
assertFalse(property.allowOverrideValue(new DescribableList(project), new DescribableList(project)));
assertFalse(property.allowOverrideValue(new DescribableList(project), new DescribableList(parent)));
DescribableList describableList1 = new DescribableList(project,
- Arrays.asList(new Shell("echo 'test3'", false), new Shell("echo 'test2'", false)));
+ Arrays.asList(new Shell("echo 'test3'"), new Shell("echo 'test2'")));
DescribableList describableList2 = new DescribableList(project,
- Arrays.asList(new Shell("echo 'test2'", false), new Shell("echo 'test3'", false)));
+ Arrays.asList(new Shell("echo 'test2'"), new Shell("echo 'test3'")));
assertFalse(property.allowOverrideValue(describableList1, describableList2));
DescribableList describableList3 = new DescribableList(parent, describableList2.toList());
@@ -136,8 +136,8 @@ public class DescribableListProjectPropertyTest {
assertTrue(property.allowOverrideValue(new DescribableList(project), null));
assertTrue(property.allowOverrideValue(new DescribableList(project),
- new DescribableList(project, Arrays.asList(new Shell("echo 'test1'", false)))));
- assertTrue(property.allowOverrideValue(new DescribableList(project, Arrays.asList(new Shell("echo 'test1'", false))),
+ new DescribableList(project, Arrays.asList(new Shell("echo 'test1'")))));
+ assertTrue(property.allowOverrideValue(new DescribableList(project, Arrays.asList(new Shell("echo 'test1'"))),
new DescribableList(project)));
}

Back to the top