From 2df07f29e92f8eae0c866da1333cc4defe5b832c Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 13 Dec 2017 10:38:13 +0100 Subject: [PATCH] Jetty 9.4.x 2016 openjdk8 osgi headers (#2026) * Issue #2016 Add osgi headers for openjdk8 alpn and add tests for http2 in osgi Signed-off-by: Jan Bartel --- jetty-alpn/jetty-alpn-client/pom.xml | 3 +- jetty-alpn/jetty-alpn-openjdk8-client/pom.xml | 37 +++++- jetty-alpn/jetty-alpn-openjdk8-server/pom.xml | 37 +++++- jetty-alpn/jetty-alpn-server/pom.xml | 2 + jetty-osgi/pom.xml | 13 +-- jetty-osgi/test-jetty-osgi/pom.xml | 96 ++++++++++++++-- .../src/test/config/etc/jetty-alpn.xml | 23 ++++ .../src/test/config/etc/jetty-http2.xml | 14 ++- .../src/test/config/etc/jetty-https.xml | 9 +- .../osgi/test/TestJettyOSGiBootHTTP2.java | 106 +++++++++++++++--- .../osgi/test/TestJettyOSGiBootWithJsp.java | 4 +- .../eclipse/jetty/osgi/test/TestOSGiUtil.java | 59 +++++----- 12 files changed, 328 insertions(+), 75 deletions(-) create mode 100644 jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-alpn.xml diff --git a/jetty-alpn/jetty-alpn-client/pom.xml b/jetty-alpn/jetty-alpn-client/pom.xml index f88b457328f..a91883265a2 100644 --- a/jetty-alpn/jetty-alpn-client/pom.xml +++ b/jetty-alpn/jetty-alpn-client/pom.xml @@ -23,7 +23,8 @@ - org.eclipse.jetty.alpn;resolution:=optional + org.eclipse.jetty.alpn;resolution:=optional,* + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)", osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.io.ssl.ALPNProcessor$Client)";cardinality:=multiple diff --git a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml index 005ade7ab2a..73c2d9b1150 100644 --- a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml +++ b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml @@ -14,7 +14,7 @@ Jetty :: ALPN :: OpenJDK8 Client Implementation - ${project.groupId}.alpn.java.client + ${project.groupId}.alpn.openjdk8.client @@ -35,4 +35,39 @@ test + + + + org.codehaus.mojo + build-helper-maven-plugin + + + parse-version + + parse-version + + + alpn + ${alpn.api.version} + + + + + + org.apache.felix + maven-bundle-plugin + true + + + OpenJDK8 Client ALPN + org.eclipse.jetty.alpn;version="${alpn.majorVersion}.${alpn.minorVersion}.${alpn.incrementalVersion}",* + * + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.io.ssl.ALPNProcessor$Client + <_nouses>true + + + + + diff --git a/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml b/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml index c8542ed94b8..f2c0ec6cb23 100644 --- a/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml +++ b/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml @@ -12,7 +12,7 @@ Jetty :: ALPN :: OpenJDK8 Server Implementation - ${project.groupId}.alpn.conscrypt.server + ${project.groupId}.alpn.openjdk8.server @@ -40,4 +40,39 @@ test + + + + org.codehaus.mojo + build-helper-maven-plugin + + + parse-version + + parse-version + + + alpn + ${alpn.api.version} + + + + + + org.apache.felix + maven-bundle-plugin + true + + + OpenJDK8 Server ALPN + * + org.eclipse.jetty.alpn;version="${alpn.majorVersion}.${alpn.minorVersion}.${alpn.incrementalVersion}",* + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.io.ssl.ALPNProcessor$Server + <_nouses>true + + + + + diff --git a/jetty-alpn/jetty-alpn-server/pom.xml b/jetty-alpn/jetty-alpn-server/pom.xml index 4b8462f21fa..3354fa42539 100644 --- a/jetty-alpn/jetty-alpn-server/pom.xml +++ b/jetty-alpn/jetty-alpn-server/pom.xml @@ -47,7 +47,9 @@ ${bundle-symbolic-name};singleton:=true + org.eclipse.jetty.alpn.server,* org.eclipse.jetty.alpn;version="${alpn.majorVersion}.${alpn.minorVersion}.${alpn.incrementalVersion}",* + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)", osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.io.ssl.ALPNProcessor$Server)";resolution:=optional;cardinality:=multiple diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml index 44cbdfca12a..2f46d71bd83 100644 --- a/jetty-osgi/pom.xml +++ b/jetty-osgi/pom.xml @@ -33,20 +33,9 @@ test-jetty-osgi-fragment test-jetty-osgi-server jetty-osgi-alpn + test-jetty-osgi - - - jdk8 - - [1.8,1.9) - - - test-jetty-osgi - - - - diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index aeb32594255..6abbdaea1e5 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -14,7 +14,7 @@ ${project.groupId}.boot.test.osgi http://download.eclipse.org/jetty/orbit/ target/distribution - 4.10.0 + 4.11.0 2.5.2 1.0 @@ -67,13 +67,13 @@ org.eclipse.platform org.eclipse.osgi - 3.11.2 + 3.12.50 test org.eclipse.platform org.eclipse.osgi.services - 3.5.100 + 3.6.0 test @@ -394,18 +394,25 @@ 5.0.1 test - + + org.eclipse.jetty.http2 + http2-client + ${project.version} + test + + + org.eclipse.jetty.http2 + http2-http-client-transport + ${project.version} + test + maven-surefire-plugin - - 2.18.1 - - - -Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar + true @@ -451,4 +458,75 @@ + + + jdk8 + + [1.8,1.9) + + + + org.eclipse.jetty + jetty-alpn-openjdk8-server + ${project.version} + test + + + org.eclipse.jetty + jetty-alpn-openjdk8-client + ${project.version} + test + + + + + + maven-surefire-plugin + + false + + **/*JDK9* + + + + -Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar + + + + + + + jdk9 + + [1.9,) + + + + org.eclipse.jetty + jetty-alpn-java-server + ${project.version} + test + + + org.eclipse.jetty + jetty-alpn-java-client + ${project.version} + test + + + + + + maven-surefire-plugin + + false + + **/*JDK9 + + + + + + + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-alpn.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-alpn.xml new file mode 100644 index 00000000000..14f9a5b6d2d --- /dev/null +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-alpn.xml @@ -0,0 +1,23 @@ + + + + + + + + + alpn + + + + + + + + + + + + + + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml index 3362c1bfd0e..1d6423589e3 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-http2.xml @@ -9,9 +9,19 @@ - + + + + - + + + + + true + + + diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml index c9d497e2c15..75b77f7ec3c 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-https.xml @@ -16,11 +16,18 @@ - + + + + boot.https.port + + + + diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java index c4d5d8dd4fe..48ee00b3315 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java @@ -18,12 +18,28 @@ package org.eclipse.jetty.osgi.test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.ops4j.pax.exam.CoreOptions.mavenBundle; +import static org.ops4j.pax.exam.CoreOptions.systemProperty; + import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; +import java.util.concurrent.Executor; + import javax.inject.Inject; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.http.HttpStatus; +import org.eclipse.jetty.http2.client.HTTP2Client; +import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @@ -34,11 +50,9 @@ import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; import org.ops4j.pax.exam.spi.reactors.PerClass; +import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; - -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.systemProperty; +import org.osgi.framework.ServiceReference; /** * HTTP2 setup. @@ -57,19 +71,33 @@ public class TestJettyOSGiBootHTTP2 public Option[] config() { ArrayList