Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/master' into JENKINS-36472
  • Loading branch information
cpoenisch committed Aug 30, 2016
2 parents 09041cf + c9756ee commit 4348bf4
Show file tree
Hide file tree
Showing 16 changed files with 320 additions and 293 deletions.
2 changes: 1 addition & 1 deletion lib/net/sf/jacob-project/jacob/maven-metadata-local.xml
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>1.18</version>
</versions>
<lastUpdated>20150908141157</lastUpdated>
<lastUpdated>20160830092734</lastUpdated>
</versioning>
</metadata>
@@ -1 +1 @@
419fa8f7070ab89d863427f0231cb3ea
f018b5ab7ad92ae28f6f6b76a6a963ee
@@ -1 +1 @@
a3cd19a82b7aee3ffad42d225c4550081c29e0d7
98cf082e9bc8436ba62dedb593053b794df6a899
13 changes: 11 additions & 2 deletions pom.xml
Expand Up @@ -34,7 +34,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.11</version>
<version>2.14</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -93,7 +93,7 @@
<maven-pmd-plugin.version>3.6</maven-pmd-plugin.version>

<!-- Test scope -->
<equalsverifier.version>1.7.8</equalsverifier.version>
<equalsverifier.version>2.1.5</equalsverifier.version>
<mockito-core.version>1.10.19</mockito-core.version>
<workflow.version>1.4.2</workflow.version>
<jacoco.version>0.7.7.201606060606</jacoco.version>
Expand Down Expand Up @@ -429,5 +429,14 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>doclint-java8-disable</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
</profiles>
</project>
16 changes: 6 additions & 10 deletions src/main/java/de/tracetronic/jenkins/plugins/ecutest/ETPlugin.java
Expand Up @@ -151,17 +151,13 @@ public String toShortString() {
}

@Override
public boolean equals(final Object that) {
if (this == that) {
return true;
public boolean equals(final Object other) {
boolean result = false;
if (other instanceof ToolVersion) {
final ToolVersion that = (ToolVersion) other;
result = compareTo((ToolVersion) that) == 0;
}
if (that == null) {
return false;
}
if (this.getClass() != that.getClass()) {
return false;
}
return compareTo((ToolVersion) that) == 0;
return result;
}

@Override
Expand Down
Expand Up @@ -45,6 +45,7 @@
import java.util.Map;

import net.sf.json.JSONArray;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
import net.sf.json.groovy.JsonSlurper;
import de.tracetronic.jenkins.plugins.ecutest.env.TestEnvInvisibleAction;
Expand Down Expand Up @@ -336,7 +337,7 @@ public Boolean call() throws IOException {
boolean isUploaded = true;
final TTConsoleLogger logger = new TTConsoleLogger(getListener());
final Map<String, String> configMap = getConfigMap(true);
try (ETComClient comClient = new ETComClient()) {
try (final ETComClient comClient = new ETComClient()) {
final TestEnvironment testEnv = (TestEnvironment) comClient.getTestEnvironment();
final List<FilePath> uploadFiles = getReportFiles();
if (uploadFiles.isEmpty()) {
Expand All @@ -355,15 +356,19 @@ public Boolean call() throws IOException {
if (errorFile.exists()) {
isUploaded = false;
logger.logError("Error during uploading ATX report:");
final JSONObject jsonObject = (JSONObject) new JsonSlurper().parse(errorFile);
final JSONArray jsonArray = jsonObject.optJSONArray("ENTRIES");
if (jsonArray != null) {
for (int i = 0; i < jsonArray.size(); i++) {
final String file = jsonArray.getJSONObject(i).getString("FILE");
final String status = jsonArray.getJSONObject(i).getString("STATUS");
final String text = jsonArray.getJSONObject(i).getString("TEXT");
logger.logError(String.format("%s: %s - %s", status, file, text));
try {
final JSONObject jsonObject = (JSONObject) new JsonSlurper().parse(errorFile);
final JSONArray jsonArray = jsonObject.optJSONArray("ENTRIES");
if (jsonArray != null) {
for (int i = 0; i < jsonArray.size(); i++) {
final String file = jsonArray.getJSONObject(i).getString("FILE");
final String status = jsonArray.getJSONObject(i).getString("STATUS");
final String text = jsonArray.getJSONObject(i).getString("TEXT");
logger.logError(String.format("%s: %s - %s", status, file, text));
}
}
} catch (final JSONException e) {
logger.logError("-> Could not parse JSON response: " + e.getMessage());
}
break;
}
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 TraceTronic GmbH
* Copyright (c) 2015-2016 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,6 +31,7 @@

import hudson.Extension;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.kohsuke.stapler.DataBoundConstructor;

/**
Expand Down Expand Up @@ -65,6 +66,26 @@ public boolean isChecked() {
return checked;
}

@Override
public final boolean equals(final Object other) {
boolean result = false;
if (other instanceof ATXCustomBooleanSetting) {
final ATXCustomBooleanSetting that = (ATXCustomBooleanSetting) other;
result = that.canEqual(this) && super.equals(that) && checked == that.checked;
}
return result;
}

@Override
public final boolean canEqual(final Object other) {
return other instanceof ATXCustomBooleanSetting;
}

@Override
public final int hashCode() {
return new HashCodeBuilder(17, 31).append(super.hashCode()).append(checked).toHashCode();
}

/**
* DescriptorImpl for {@link ATXBooleanSetting}.
*/
Expand Down
Expand Up @@ -89,22 +89,29 @@ public ATXCustomSetting clone() {
}

@Override
public final boolean equals(final Object that) {
if (this == that) {
return true;
public boolean equals(final Object other) {
boolean result = false;
if (other instanceof ATXCustomSetting) {
final ATXCustomSetting that = (ATXCustomSetting) other;
result = that.canEqual(this) && (name == null ? that.name == null : name.equals(that.name));
}
if (!(that instanceof ATXCustomSetting)) {
return false;
}
final ATXCustomSetting other = (ATXCustomSetting) that;
if (name == null ? other.name != null : !name.equals(other.name)) {
return false;
}
return true;
return result;
}

/**
* Implementation according to <a href="www.artima.com/lejava/articles/equality.html">Equality Pitfall #4</a>.
*
* @param other
* the other object
* @return {@code true} if the other object is an instance of the class in which canEqual is (re)defined,
* {@code false} otherwise.
*/
public boolean canEqual(final Object other) {
return other instanceof ATXCustomSetting;
}

@Override
public final int hashCode() {
public int hashCode() {
return new HashCodeBuilder(17, 31).append(name).toHashCode();
}

Expand Down
Expand Up @@ -32,6 +32,7 @@
import hudson.Extension;
import hudson.util.FormValidation;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;

Expand Down Expand Up @@ -67,6 +68,27 @@ public String getValue() {
return value;
}

@Override
public final boolean equals(final Object other) {
boolean result = false;
if (other instanceof ATXCustomTextSetting) {
final ATXCustomTextSetting that = (ATXCustomTextSetting) other;
result = that.canEqual(this) && super.equals(that)
&& (value == null ? that.value == null : value.equals(that.value));
}
return result;
}

@Override
public final boolean canEqual(final Object other) {
return other instanceof ATXCustomTextSetting;
}

@Override
public final int hashCode() {
return new HashCodeBuilder(17, 31).append(super.hashCode()).append(value).toHashCode();
}

/**
* DescriptorImpl for {@link ATXTextSetting}.
*/
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 TraceTronic GmbH
* Copyright (c) 2015-2016 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -51,7 +51,7 @@
* @author Christian Pönisch <christian.poenisch@tracetronic.de>
*/
public class ExecutionConfig extends AbstractDescribableImpl<ExecutionConfig> implements Serializable,
ExpandableConfig {
ExpandableConfig {

private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -191,19 +191,14 @@ public ExecutionConfig expand(final EnvVars envVars) {
}

@Override
public final boolean equals(final Object that) {
if (this == that) {
return true;
public final boolean equals(final Object other) {
boolean result = false;
if (other instanceof ExecutionConfig) {
final ExecutionConfig that = (ExecutionConfig) other;
result = (timeout == null ? that.timeout == null : timeout.equals(that.timeout))
&& stopOnError == that.stopOnError && checkTestFile == that.checkTestFile;
}
if (!(that instanceof ExecutionConfig)) {
return false;
}
final ExecutionConfig other = (ExecutionConfig) that;
if ((timeout == null ? other.timeout != null : !timeout.equals(other.timeout))
|| stopOnError != other.stopOnError || checkTestFile != other.checkTestFile) {
return false;
}
return true;
return result;
}

@Override
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 TraceTronic GmbH
* Copyright (c) 2015-2016 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -94,20 +94,14 @@ public GlobalConstant expand(final EnvVars envVars) {
}

@Override
public final boolean equals(final Object that) {
if (this == that) {
return true;
public final boolean equals(final Object other) {
boolean result = false;
if (other instanceof GlobalConstant) {
final GlobalConstant that = (GlobalConstant) other;
result = (name == null ? that.name == null : name.equals(that.name))
&& (value == null ? that.value == null : value.equals(that.value));
}
if (!(that instanceof GlobalConstant)) {
return false;
}
final GlobalConstant other = (GlobalConstant) that;
if (name == null ? other.name != null
: !name.equals(other.name) || value == null ? other.value != null : !value
.equals(other.value)) {
return false;
}
return true;
return result;
}

@Override
Expand Down

0 comments on commit 4348bf4

Please sign in to comment.