[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
This commit is contained in:
Antonio Muniz authored and Oleg Nenashev committed 2017-10-28 12:53:39 +02:00
1 parent 6e75f7349c
commit f546ffc9ea
3 files changed
+13 -5

No files matched your search

@@ -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");
}