Skip to content

Commit

Permalink
Fixed #133
Browse files Browse the repository at this point in the history
 o Added getBuiltOn to BuildWithDetails
 o Enhancement requested by Naureen Razi
  • Loading branch information
khmarbaise committed Apr 11, 2016
1 parent d46442e commit f38f534
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ void enableJob(String jobName, boolean crumbFlag);

[Fixed #144 Problems with spaces in paths and job names][issue-144]

[Fixed #133 How do we find out which system the built was build on?][issue-133]

Now `BuildWithDetails` API has been enhanced with the following method get
the information on which node this build has ran.

```java
String getBuiltOn();
```

## Release 0.3.3

Expand Down Expand Up @@ -229,6 +237,7 @@ TestReport testReport = mavenJob.getLastSuccessfulBuild().getTestReport();
[issue-116]: https://github.com/RisingOak/jenkins-client/issues/116
[issue-108]: https://github.com/RisingOak/jenkins-client/issues/108
[issue-130]: https://github.com/RisingOak/jenkins-client/issues/130
[issue-133]: https://github.com/RisingOak/jenkins-client/issues/133
[issue-144]: https://github.com/RisingOak/jenkins-client/issues/144
[pull-123]: https://github.com/RisingOak/jenkins-client/pull/123

11 changes: 11 additions & 0 deletions src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class BuildWithDetails extends Build {
String consoleOutputText;
String consoleOutputHtml;
BuildChangeSet changeSet;
String builtOn;
List<BuildChangeSetAuthor> culprits;

public List<Artifact> getArtifacts() {
Expand Down Expand Up @@ -103,6 +104,10 @@ public BuildResult getResult() {
return result;
}

public String getBuiltOn() {
return builtOn;
}

public List getActions() {
return actions;
}
Expand Down Expand Up @@ -191,6 +196,11 @@ public boolean equals(Object obj) {
return false;
if (building != other.building)
return false;
if (builtOn == null) {
if (other.builtOn != null)
return false;
} else if (!builtOn.equals(other.builtOn))
return false;
if (changeSet == null) {
if (other.changeSet != null)
return false;
Expand Down Expand Up @@ -244,6 +254,7 @@ public int hashCode() {
result = prime * result + ((actions == null) ? 0 : actions.hashCode());
result = prime * result + ((artifacts == null) ? 0 : artifacts.hashCode());
result = prime * result + (building ? 1231 : 1237);
result = prime * result + ((builtOn == null) ? 0 : builtOn.hashCode());
result = prime * result + ((changeSet == null) ? 0 : changeSet.hashCode());
result = prime * result + ((consoleOutputHtml == null) ? 0 : consoleOutputHtml.hashCode());
result = prime * result + ((consoleOutputText == null) ? 0 : consoleOutputText.hashCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void checkCauses() throws Exception {
List<BuildCause> causes = build.getCauses();
assertNotNull(causes);

assertEquals("", build.getBuiltOn());
}

}

0 comments on commit f38f534

Please sign in to comment.