Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Fixed up the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Jun 8, 2023
1 parent 5392216 commit 3f4943e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ public class JenkinsBuilderTest {
public GenericContainer jenkins = new GenericContainer(new ImageFromDockerfile("jenkinspipelinestest", false)
.withDockerfileFromBuilder(builder ->
builder
.from("jenkins/jenkins:2.319.3")
.from("jenkins/jenkins:lts")
.user("root")
// install plugins
.run("jenkins-plugin-cli --plugins "
+ "pipeline-utility-steps:2.15.4 "
+ "ws-cleanup:0.45 "
+ "gradle:2.8 "
+ "maven-plugin:3.22 "
+ "jdk-tool:66.vd8fa_64ee91b_d "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

public class JenkinsClient {
Expand Down Expand Up @@ -77,11 +78,16 @@ public Try<String> getJobLogs(final String hostname, final Integer port, final S
}

private boolean isBuilding(final Document doc) {
return doc.getDocumentElement()
.getElementsByTagName("building")
.item(0)
.getTextContent()
.equals("true");
final NodeList building = doc.getDocumentElement()
.getElementsByTagName("building");

if (building.getLength() != 0) {
return building.item(0)
.getTextContent()
.equals("true");
}

return true;
}

public boolean isSuccess(final Document doc) {
Expand Down

0 comments on commit 3f4943e

Please sign in to comment.