Skip to content

Commit

Permalink
Cast in test to be able to run on ealier versions of java (java-nativ…
Browse files Browse the repository at this point in the history
…e-access#282)

Motivation:

SSLEngine.getApplicationProtocol may not exists on earlier versions of java.

Modifications:

Cast to QuicheQuicSslEngine to allow running on older version of java

Result:

Works on older Java8 releases as well
  • Loading branch information
normanmaurer authored May 14, 2021
1 parent 211c8cc commit a33bcc6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ public int maxTokenLength() {
stream.writeAndFlush(Unpooled.directBuffer().writeZero(numBytes)).sync();
clientLatch.await();

assertEquals(QuicTestUtils.PROTOS[0], quicChannel.sslEngine().getApplicationProtocol());
assertEquals(QuicTestUtils.PROTOS[0],
// Just do the cast as getApplicationProtocol() only exists in SSLEngine itself since Java9+ and
// we may run on an earlier version
((QuicheQuicSslEngine) quicChannel.sslEngine()).getApplicationProtocol());
stream.close().sync();
quicChannel.close().sync();
ChannelFuture closeFuture = quicChannel.closeFuture().await();
Expand Down

0 comments on commit a33bcc6

Please sign in to comment.