From f6ea2e4fa54f119dfbbc3e020c85e685b83c4e52 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 17 Jan 2017 15:38:50 +0100 Subject: [PATCH] Issue #1073 - JDK9 support in Jetty 9.3.x. Made module tests work with JDK 9 too. --- .../org/eclipse/jetty/start/ModulesTest.java | 7 ++-- .../dist-home/modules/alpn-impl/alpn-8.mod | 30 ++++++++++++++++ .../dist-home/modules/alpn-impl/alpn-9.mod | 5 +++ .../test/resources/dist-home/modules/alpn.mod | 35 ++----------------- 4 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-8.mod create mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-9.mod diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java index 7d206a3db80..6aa4d27215c 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java @@ -38,7 +38,9 @@ import org.hamcrest.Matchers; import org.junit.Rule; import org.junit.Test; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; public class ModulesTest @@ -74,8 +76,7 @@ public class ModulesTest modules.registerAll(); // Check versions - assertThat("java.version.major", args.getProperties().getString("java.version.major"),equalTo("1")); - assertThat("java.version.minor", args.getProperties().getString("java.version.minor"),anyOf(equalTo("7"),Matchers.equalTo("8"),Matchers.equalTo("9"))); + assertThat("java.version.platform", args.getProperties().getString("java.version.platform"),anyOf(Matchers.equalTo("8"),Matchers.equalTo("9"))); List moduleNames = new ArrayList<>(); for (Module mod : modules) diff --git a/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-8.mod b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-8.mod new file mode 100644 index 00000000000..cc0befd31df --- /dev/null +++ b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-8.mod @@ -0,0 +1,30 @@ +# ALPN is provided via a -Xbootclasspath that modifies the secure connections +# in java to support the ALPN layer needed for HTTP/2. +# +# This modification has a tight dependency on specific recent updates of +# Java 1.7 and Java 1.8 (Java versions prior to 1.7u40 are not supported). +# +# The alpn module will use an appropriate alpn-boot jar for your +# specific version of Java. +# +# IMPORTANT: Versions of Java that exist after this module was created are +# not guaranteed to work with existing alpn-boot jars, and might +# need a new alpn-boot to be created / tested / deployed by the +# Jetty project in order to provide support for these future +# Java versions. +# +# All versions of the alpn-boot jar can be found at +# http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ + +[depend] +alpn-impl/alpn-${java.version} + +[files] +lib/ +lib/alpn/ + +[license] +ALPN is a hosted at github under the GPL v2 with ClassPath Exception. +ALPN replaces/modifies OpenJDK classes in the sun.security.ssl package. +http://github.com/jetty-project/jetty-alpn +http://openjdk.java.net/legal/gplv2+ce.html diff --git a/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-9.mod b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-9.mod new file mode 100644 index 00000000000..731b744e8fe --- /dev/null +++ b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-9.mod @@ -0,0 +1,5 @@ +# Provides support for ALPN based on JDK 9. + +[lib] +lib/jetty-alpn-java-server-${jetty.version}.jar +lib/alpn-api-*.jar diff --git a/jetty-start/src/test/resources/dist-home/modules/alpn.mod b/jetty-start/src/test/resources/dist-home/modules/alpn.mod index 7928e649280..a16dbf5082c 100644 --- a/jetty-start/src/test/resources/dist-home/modules/alpn.mod +++ b/jetty-start/src/test/resources/dist-home/modules/alpn.mod @@ -1,27 +1,6 @@ -# ALPN is provided via a -Xbootclasspath that modifies the secure connections -# in java to support the ALPN layer needed for HTTP/2. -# -# This modification has a tight dependency on specific recent updates of -# Java 1.7 and Java 1.8 (Java versions prior to 1.7u40 are not supported). -# -# The alpn module will use an appropriate alpn-boot jar for your -# specific version of Java. -# -# IMPORTANT: Versions of Java that exist after this module was created are -# not guaranteed to work with existing alpn-boot jars, and might -# need a new alpn-boot to be created / tested / deployed by the -# Jetty project in order to provide support for these future -# Java versions. -# -# All versions of alpn-boot can be found at -# http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ - -[name] -alpn - [depend] ssl -alpn-impl/alpn-${java.version} +alpn-impl/alpn-${java.version.platform} [lib] lib/jetty-alpn-client-${jetty.version}.jar @@ -30,24 +9,14 @@ lib/jetty-alpn-server-${jetty.version}.jar [xml] etc/jetty-alpn.xml -[files] -lib/ -lib/alpn/ - [ini-template] ## Overrides the order protocols are chosen by the server. ## The default order is that specified by the order of the ## modules declared in start.ini. -# jetty.alpn.protocols=h2-16,http/1.1 +# jetty.alpn.protocols=h2,http/1.1 ## Specifies what protocol to use when negotiation fails. # jetty.alpn.defaultProtocol=http/1.1 ## ALPN debug logging on System.err # jetty.alpn.debug=false - -[license] -ALPN is a hosted at github under the GPL v2 with ClassPath Exception. -ALPN replaces/modifies OpenJDK classes in the java.sun.security.ssl package. -http://github.com/jetty-project/jetty-alpn -http://openjdk.java.net/legal/gplv2+ce.html