Skip to content

Commit f38f534

Browse files
committed
o Added getBuiltOn to BuildWithDetails o Enhancement requested by Naureen Razi
1 parent d46442e commit f38f534

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

ReleaseNotes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ void enableJob(String jobName, boolean crumbFlag);
2323

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

26+
[Fixed #133 How do we find out which system the built was build on?][issue-133]
27+
28+
Now `BuildWithDetails` API has been enhanced with the following method get
29+
the information on which node this build has ran.
30+
31+
```java
32+
String getBuiltOn();
33+
```
2634

2735
## Release 0.3.3
2836

@@ -229,6 +237,7 @@ TestReport testReport = mavenJob.getLastSuccessfulBuild().getTestReport();
229237
[issue-116]: https://github.com/RisingOak/jenkins-client/issues/116
230238
[issue-108]: https://github.com/RisingOak/jenkins-client/issues/108
231239
[issue-130]: https://github.com/RisingOak/jenkins-client/issues/130
240+
[issue-133]: https://github.com/RisingOak/jenkins-client/issues/133
232241
[issue-144]: https://github.com/RisingOak/jenkins-client/issues/144
233242
[pull-123]: https://github.com/RisingOak/jenkins-client/pull/123
234243

src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class BuildWithDetails extends Build {
3131
String consoleOutputText;
3232
String consoleOutputHtml;
3333
BuildChangeSet changeSet;
34+
String builtOn;
3435
List<BuildChangeSetAuthor> culprits;
3536

3637
public List<Artifact> getArtifacts() {
@@ -103,6 +104,10 @@ public BuildResult getResult() {
103104
return result;
104105
}
105106

107+
public String getBuiltOn() {
108+
return builtOn;
109+
}
110+
106111
public List getActions() {
107112
return actions;
108113
}
@@ -191,6 +196,11 @@ public boolean equals(Object obj) {
191196
return false;
192197
if (building != other.building)
193198
return false;
199+
if (builtOn == null) {
200+
if (other.builtOn != null)
201+
return false;
202+
} else if (!builtOn.equals(other.builtOn))
203+
return false;
194204
if (changeSet == null) {
195205
if (other.changeSet != null)
196206
return false;
@@ -244,6 +254,7 @@ public int hashCode() {
244254
result = prime * result + ((actions == null) ? 0 : actions.hashCode());
245255
result = prime * result + ((artifacts == null) ? 0 : artifacts.hashCode());
246256
result = prime * result + (building ? 1231 : 1237);
257+
result = prime * result + ((builtOn == null) ? 0 : builtOn.hashCode());
247258
result = prime * result + ((changeSet == null) ? 0 : changeSet.hashCode());
248259
result = prime * result + ((consoleOutputHtml == null) ? 0 : consoleOutputHtml.hashCode());
249260
result = prime * result + ((consoleOutputText == null) ? 0 : consoleOutputText.hashCode());

src/test/java/com/offbytwo/jenkins/integration/BuildWithDetailsIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void checkCauses() throws Exception {
5252
List<BuildCause> causes = build.getCauses();
5353
assertNotNull(causes);
5454

55+
assertEquals("", build.getBuiltOn());
5556
}
5657

5758
}

0 commit comments

Comments
 (0)