Issue #4443 - Track backport of ALPN APIs to Java 8

For Jetty 9.2.x, supporting the backport of the JDK ALPN APIs
of JDK 8u252 would have required a number of backports from
Jetty 9.4.x.
Rather than doing all that work for an EOL Jetty branch, we
instead excluded the modules/tests that required ALPN, so
that the Jetty 9.2.x branch can still be built with 8u252
or later, but it will lack some of the artifacts.
Users needing those artifacts are encouraged to move to
Jetty 9.4.x or later.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2020-03-07 18:53:49 +01:00
parent 305e4609b2
commit c1dc03a440
10 changed files with 59 additions and 13 deletions

View File

@ -41,6 +41,9 @@ public class ALPNClientConnection extends NegotiatingClientConnection implements
{
super(endPoint, executor, sslEngine, connectionFactory, context);
this.protocol = protocol;
// Client-side ALPN support is only available via Jetty ALPN API, so JDK 8u252 is not supported.
// Support for JDK 8u252 requires a TLS handshake listener so that when the TLS handshake is
// finished completed() can be called, but SslHandshakeListener is not backported to 9.2.x.
ALPN.put(sslEngine, this);
}

View File

@ -36,6 +36,9 @@ public class ALPNServerConnection extends NegotiatingServerConnection implements
public ALPNServerConnection(Connector connector, EndPoint endPoint, SSLEngine engine, List<String> protocols, String defaultProtocol)
{
super(connector, endPoint, engine, protocols, defaultProtocol);
// Server-side ALPN support is only available via Jetty ALPN API, so JDK 8u252 is not supported.
// Support for JDK 8u252 requires a TLS handshake listener so that when the TLS handshake is
// finished setProtocol() can be called, but SslHandshakeListener is not backported to 9.2.x.
ALPN.put(engine, this);
}

View File

@ -1027,6 +1027,9 @@ public class HttpClientStreamTest extends AbstractHttpClientServerTest
public void testUploadWithConnectFailureClosesStream() throws Exception
{
start(new EmptyServerHandler());
client.stop();
client.setConnectTimeout(1000);
client.start();
final CountDownLatch closeLatch = new CountDownLatch(1);
InputStream stream = new ByteArrayInputStream("test".getBytes(StandardCharsets.UTF_8))

View File

@ -302,12 +302,6 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty.alpn</groupId>
<artifactId>alpn-boot</artifactId>
<version>${alpn.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.osgi</groupId>
<artifactId>jetty-osgi-alpn</artifactId>
@ -389,11 +383,14 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- No point defining -Xbootclasspath as the actual OSGi VM is run as a forked process by pax-exam -->
<!-- But we do pass the sys property of the alpn-boot jar so that it can be configued inside tests -->
<!-- But we do pass the sys property of the alpn-boot jar so that it can be configured inside tests -->
<argLine>-Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar</argLine>
<systemPropertyVariables>
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
</systemPropertyVariables>
<excludes>
<exclude>**/TestJettyOSGiBootSpdy.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>

View File

@ -21,19 +21,19 @@
<module>spdy-http-server</module>
<module>spdy-http-client-transport</module>
<module>spdy-example-webapp</module>
<module>spdy-alpn-tests</module>
</modules>
<profiles>
<profile>
<id>npn</id>
<activation>
<jdk>1.7</jdk>
</activation>
<modules>
<!--
<module>spdy-npn-tests</module>
-->
</modules>
</profile>
<profile>
<id>alpn</id>
<modules>
<module>spdy-alpn-tests</module>
</modules>
</profile>
</profiles>

View File

@ -11,6 +11,12 @@
<url>http://www.eclipse.org/jetty</url>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>org.eclipse.jetty.start.SpdyTestGroup</excludedGroups>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>

View File

@ -31,6 +31,7 @@ import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
@ -101,6 +102,7 @@ public class LicenseTest
}
@Test
@Category(SpdyTestGroup.class)
public void testAdd_SPDY_Licensed() throws Exception
{
File basePath = testdir.getEmptyDir();
@ -117,6 +119,7 @@ public class LicenseTest
}
@Test
@Category(SpdyTestGroup.class)
public void testAdd_HttpSpdy_Then_Deploy() throws Exception
{
File basePath = testdir.getEmptyDir();
@ -143,6 +146,7 @@ public class LicenseTest
}
@Test
@Category(SpdyTestGroup.class)
public void testCreate_SPDY_Licensed() throws Exception
{
File basePath = testdir.getEmptyDir();

View File

@ -30,6 +30,7 @@ import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
@ -156,6 +157,7 @@ public class MainTest
}
@Test
@Category(SpdyTestGroup.class)
public void testWithSpdy() throws Exception
{
List<String> cmdLineArgs = new ArrayList<>();

View File

@ -0,0 +1,26 @@
//
// ========================================================================
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.start;
/**
* Marker interface to group SPDY tests.
*/
public interface SpdyTestGroup
{
}

View File

@ -24,6 +24,7 @@ import java.util.List;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.junit.Test;
import org.junit.experimental.categories.Category;
/**
* Various Home + Base use cases
@ -104,6 +105,7 @@ public class TestUseCases
}
@Test
@Category(SpdyTestGroup.class)
public void testWithSpdy() throws Exception
{
assertUseCase("home","base.enable.spdy","assert-enable-spdy.txt","java.version=1.7.0_60");