MCPcopy Create free account
hub / github.com/grpc/grpc-java / checkForAlpnApi

Method checkForAlpnApi

okhttp/src/test/java/io/grpc/okhttp/TlsTest.java:79–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 public final GrpcCleanupRule grpcCleanupRule = new GrpcCleanupRule();
78
79 @Before
80 public void checkForAlpnApi() throws Exception {
81 // This checks for the "Java 9 ALPN API" which was backported to Java 8u252. The Kokoro Windows
82 // CI is on too old of a JDK for us to assume this is available.
83 SSLContext context = SSLContext.getInstance("TLS");
84 context.init(null, null, null);
85 SSLEngine engine = context.createSSLEngine();
86 try {
87 SSLEngine.class.getMethod("getApplicationProtocol").invoke(engine);
88 } catch (NoSuchMethodException | UnsupportedOperationException ex) {
89 Assume.assumeNoException(ex);
90 }
91 }
92
93 @Test
94 public void basicTls_succeeds() throws Exception {

Callers

nothing calls this directly

Calls 4

invokeMethod · 0.65
getInstanceMethod · 0.45
initMethod · 0.45
getMethodMethod · 0.45

Tested by

no test coverage detected