-
-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #309 - Added better support for Maven Modules
- slight modifications based on removement of Guava
- Loading branch information
1 parent
c4f5953
commit 5807954
Showing
8 changed files
with
198 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 50 additions & 1 deletion
51
jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
jenkins-client/src/main/java/com/offbytwo/jenkins/model/MavenModuleWithDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright (c) 2018 Cosmin Stejerean, Karl Heinz Marbaise, and contributors. | ||
* | ||
* Distributed under the MIT license: http://opensource.org/licenses/MIT | ||
*/ | ||
package com.offbytwo.jenkins.model; | ||
|
||
import static com.offbytwo.jenkins.helper.FunctionalHelper.SET_CLIENT; | ||
import static java.util.stream.Collectors.toList; | ||
|
||
import java.io.IOException; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* Model Class for Maven Modules | ||
* | ||
* @author Jakub Zacek | ||
*/ | ||
public class MavenModuleWithDetails extends BaseModel { | ||
|
||
private List<Build> builds = Collections.emptyList(); | ||
private List actions = Collections.emptyList(); | ||
private String displayName; | ||
private BuildResult result; | ||
private String url; | ||
private long duration; | ||
private long timestamp; | ||
|
||
public List getActions() { | ||
return actions; | ||
} | ||
|
||
public void setActions(List actions) { | ||
this.actions = actions; | ||
} | ||
|
||
public void setBuilds(List<Build> builds) { | ||
this.builds = builds; | ||
} | ||
|
||
public List<Build> getBuilds() { | ||
return builds.stream() | ||
.map(SET_CLIENT(this.getClient())) | ||
.collect(toList()); | ||
} | ||
|
||
public Build getBuildByNumber(final int buildNumber) { | ||
return builds.stream() | ||
.filter(isBuildNumberEqualTo(buildNumber)) | ||
.map(SET_CLIENT(this.getClient())) | ||
.findFirst() | ||
.orElse(Build.BUILD_HAS_NEVER_RUN); | ||
} | ||
|
||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
public void setDisplayName(String displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
public BuildResult getResult() { | ||
return result; | ||
} | ||
|
||
public void setResult(BuildResult result) { | ||
this.result = result; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(long timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public long getDuration() { | ||
return duration; | ||
} | ||
|
||
public void setDuration(long duration) { | ||
this.duration = duration; | ||
} | ||
|
||
public String getConsoleOutputText() throws IOException { | ||
return client.get(getUrl() + "/logText/progressiveText"); | ||
} | ||
|
||
public TestReport getTestReport() throws IOException { | ||
return client.get(this.getUrl() + "/testReport/?depth=1", TestReport.class); | ||
} | ||
|
||
} |