Made test run only under JDK 8.

This commit is contained in:
Simone Bordet 2015-03-02 16:39:31 +01:00
parent 3cf2a5409d
commit 4caf991e44
1 changed files with 14 additions and 1 deletions

View File

@ -27,9 +27,12 @@ import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.toolchain.test.JDK;
import org.eclipse.jetty.toolchain.test.TestTracker;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
public class AbstractALPNTest
@ -39,6 +42,14 @@ public class AbstractALPNTest
protected Server server;
protected ServerConnector connector;
@Before
public void before()
{
// The mandatory cipher needed to run HTTP/2
// over TLS is only available in JDK 8.
Assume.assumeTrue(JDK.IS_8);
}
protected InetSocketAddress prepare() throws Exception
{
server = new Server();
@ -66,6 +77,7 @@ public class AbstractALPNTest
sslContextFactory.setTrustStorePath("src/test/resources/truststore.jks");
sslContextFactory.setTrustStorePassword("storepwd");
sslContextFactory.setIncludeProtocols("TLSv1.2");
// The mandatory HTTP/2 cipher.
sslContextFactory.setIncludeCipherSuites("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
return sslContextFactory;
}
@ -73,6 +85,7 @@ public class AbstractALPNTest
@After
public void dispose() throws Exception
{
server.stop();
if (server != null)
server.stop();
}
}