Skip to content

Commit

Permalink
skip tests if JVM is prior to 1.8.0u162
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke committed Aug 16, 2018
1 parent 8c2a520 commit 33ecf05
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
*/
public class Http2ClientTest {

static boolean alpnBootJarFoundInBootClassPath;
private static final boolean alpnBootJarFoundInBootClassPath;
private static boolean ellipticCurvesExtensionFoundInClassPath;

static {

Expand All @@ -46,12 +47,20 @@ public class Http2ClientTest {
} else {
System.out.println("alpn jar not found in boot classpath.");
}

try {
Class.forName("sun.security.ssl.EllipticCurvesExtension");
ellipticCurvesExtensionFoundInClassPath = true;
} catch (ClassNotFoundException e) {
// this test case require 1.8.0u162 or later
ellipticCurvesExtensionFoundInClassPath = false;
}
}

@Test
void testNoPreferOption() throws Exception {
// no prefer option
if (alpnBootJarFoundInBootClassPath) {
if (alpnBootJarFoundInBootClassPath && ellipticCurvesExtensionFoundInClassPath) {
AlternativeHttpClientImpl http = callOembed();

// check HTTP/2.0
Expand Down

0 comments on commit 33ecf05

Please sign in to comment.