提交 f546ffc9 编写于 作者: A Antonio Muniz 提交者: Oleg Nenashev

[JENKINS-44851] Agents JVM must be 1.8+ now (#2915)

* [JENKINS-44851] Agents JVM must be 1.8+ now

* [JENKINS-44851] Fix tests

* Fix old Java 6 and 7 tests (an exception is expected now)
* Add new tests to Java 8
* Fix messages
上级 6e75f734
......@@ -187,7 +187,7 @@ public abstract class ComputerLauncher extends AbstractDescribableImpl<ComputerL
final String versionStr = m.group(1);
logger.println(Messages.ComputerLauncher_JavaVersionResult(javaCommand, versionStr));
try {
if (new DeweyDecimal(versionStr).isLessThan(new DeweyDecimal("1.6"))) {
if (new DeweyDecimal(versionStr).isLessThan(new DeweyDecimal("1.8"))) {
throw new IOException(Messages
.ComputerLauncher_NoJavaFound(line));
}
......
......@@ -36,7 +36,7 @@ SimpleScheduledRetentionStrategy.displayName=Take this agent online according to
EnvironmentVariablesNodeProperty.displayName=Environment variables
SlaveComputer.DisconnectedBy=Disconnected by {0}{1}
NodeDescriptor.CheckName.Mandatory=Name is mandatory
ComputerLauncher.NoJavaFound=Java version {0} was found but 1.6 or later is needed.
ComputerLauncher.NoJavaFound=Java version {0} was found but 1.8 or later is needed.
ComputerLauncher.JavaVersionResult={0} -version returned {1}.
ComputerLauncher.UnknownJavaVersion=Couldn\u2019t figure out the Java version of {0}
Cloud.ProvisionPermission.Description=Provision new nodes
......@@ -36,15 +36,15 @@ import static org.junit.Assert.*;
public class ComputerLauncherTest {
@Test public void jdk7() throws IOException {
@Test(expected=IOException.class) public void jdk7() throws IOException {
assertChecked("java version \"1.7.0_05\"\nJava(TM) SE Runtime Environment (build 1.7.0_05-b05)\nJava HotSpot(TM) Server VM (build 23.1-b03, mixed mode)\n", "1.7.0");
}
@Test public void openJDK7() throws IOException {
@Test(expected=IOException.class) public void openJDK7() throws IOException {
assertChecked("openjdk version \"1.7.0-internal\"\nOpenJDK Runtime Environment (build 1.7.0-internal-pkgsrc_2010_01_03_06_54-b00)\nOpenJDK 64-Bit Server VM (build 17.0-b04, mixed mode)\n", "1.7.0");
}
@Test public void jdk6() throws IOException {
@Test(expected=IOException.class) public void jdk6() throws IOException {
assertChecked("java version \"1.6.0_33\"\nJava(TM) SE Runtime Environment (build 1.6.0_33-b03)\nJava HotSpot(TM) Server VM (build 20.8-b03, mixed mode)\n", "1.6.0");
}
......@@ -56,6 +56,14 @@ public class ComputerLauncherTest {
ComputerLauncher.checkJavaVersion(new PrintStream(new NullOutputStream()), "-", new BufferedReader(new StringReader("java version \"1.4.2_19\"\nJava(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)\nJava HotSpot(TM) Client VM (build 1.4.2_19-b04, mixed mode)\n")));
}
@Test public void jdk8() throws IOException {
assertChecked("java version \"1.8.0_05\"\nJava(TM) SE Runtime Environment (build 1.8.0_05-b05)\nJava HotSpot(TM) Server VM (build 23.1-b03, mixed mode)\n", "1.8.0");
}
@Test public void openJDK8() throws IOException {
assertChecked("openjdk version \"1.8.0-internal\"\nOpenJDK Runtime Environment (build 1.8.0-internal-pkgsrc_2015_01_03_06_54-b00)\nOpenJDK 64-Bit Server VM (build 17.0-b04, mixed mode)\n", "1.8.0");
}
@Test public void jdk10() throws IOException { // predicted
assertChecked("java version \"1.10.0_02\"\nJava(TM) SE Runtime Environment (build 1.10.0_02-b01)\nJava HotSpot(TM) Server VM (build 23.1-b03, mixed mode)\n", "1.10.0");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册