use of org.jenkinsci.test.acceptance.po.JdkInstallation in project acceptance-test-harness by jenkinsci.
the class JdkTest method autoinstallJdk.
@Test
@TestActivation({ "ORACLE_LOGIN", "ORACLE_PASSWORD" })
public void autoinstallJdk() {
final String login = System.getProperty("JdkTest.ORACLE_LOGIN");
final String passwd = System.getProperty("JdkTest.ORACLE_PASSWORD");
ToolInstallation.waitForUpdates(jenkins, JdkInstallation.class);
JdkInstallation jdk = ToolInstallation.addTool(jenkins, JdkInstallation.class);
jdk.name.set("jdk_1.8.0");
jdk.installVersion("jdk-8u141-oth-JPR");
jdk.getPage().save();
jdk.setCredentials(login, passwd);
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.addShellStep("java -version");
job.save();
int tenMinutes = 600000;
job.startBuild().waitUntilFinished(tenMinutes).shouldSucceed().shouldContainsConsoleOutput("Installing JDK jdk-8u141-oth-JPR").shouldContainsConsoleOutput("Downloading JDK from http://download.oracle.com");
}
use of org.jenkinsci.test.acceptance.po.JdkInstallation in project acceptance-test-harness by jenkinsci.
the class JdkTest method usePreinstalledJdk.
// This actually tests any installed JDK, not necessarily oracle.
@Test
@Native("java")
public void usePreinstalledJdk() {
String expectedVersion = localJavaVersion();
JdkInstallation jdk = ToolInstallation.addTool(jenkins, JdkInstallation.class);
jdk.name.set("preinstalled");
jdk.useNative();
jdk.getPage().save();
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.addShellStep("java -version");
job.save();
job.startBuild().shouldSucceed().shouldContainsConsoleOutput(expectedVersion);
}
Aggregations