Get rid of deprecated SslContext methods in handler-proxy testsMotivation:ProxyHandlerTest package uses deprecated methods SslContext.newServerContext andSslContext.newClientContext.Modifications:SslContextBuilder is used to build server and client SslContext.Result:Less deprecated method in the code.
Fix random number generators in WebSocketUtilMotivation:Implementation of WebSocketUtil/randomNumber is incorrect and might violatethe API returning values > maximum specified.Modifications:* WebSocketUtil/randomNumber is reimplemented, the idea of the solution described in the comment in the code* Implementation of WebSocketUtil/randomBytes changed to nextBytes method* PlatformDependet.threadLocalRandom is used instead of Math.random to improve efficiency* Added test cases to check random numbers generator* To ensure corretness, we now assert that min < max when generating random numberResult:WebSocketUtil/randomNumber always produces correct result.Covers https://github.com/netty/netty/issues/8023
Make results of handler proxy tests reproducibleMotivation:`ProxyHandlerTest` relies on random values to run tests: first toshuffle collection of test items and lately to set configurationflag for `AUTO_READ`. While the purpose of randomization is clear,it's still impossible to reproduce the same sequence of test caseswhen something went wrong. For `AUTO_READ` it's even impossibleto tell what flag was set when the particular test failed.Modifications:* Test runner now log seed values that was used for shuffling, so you can take one and put in your tests to "freeze" them while debugging (pretty common approach with randomized tests)* `SuccessItemTest` is split into 2 different use cases: for AUTO_READ flag set to "on" and "off"Result:You can reproduce specific tests results now.
DnsAddressResolverGroup to use pluggable DnsNameResolverBuilder (#7793)Motivation:Right now to customize DNS name resolver when using DnsAddressResolverGroupone should subclass implementation and override newNameResolver method whenin fact it's possible to collect all settings in a DnsNameResolverBuilderinstance. Described in #7749.Modifications:- Added new constructor for DnsNameResolverBuilder in order to delay EventLoop specification- Added copy() method to DnsNameResolverBuilder to provide an immutable copy of the builder- Added new single-argument constructor for DnsAddressResolverGroup and RoundRobinDnsAddressResolverGroup accepting DnsNameResolverBuilder instance- DnsAddressResolverGroup to build a new resolver using DnsNameResolverBuilder given instead of creating a new one- Test cases to check that changing channelFactory after the builder was passed to create a DnsNameResolverGroup would not propagate to the name resolverResult:Much easier to customize DNS settings w/o subclassing DnsAddressResolverGroup
PendingWriteQueue to handle write operations with void futureMotivation:Right now PendingWriteQueue.removeAndWriteAll collects all promises toPromiseCombiner instance which sets listener to each given promise throwingIllegalStateException on VoidChannelPromise which breaks while loopand "reports" operation as failed (when in fact part of writes might beactually written).Modifications:Check if the promise is not void before adding it to the PromiseCombinerinstance.Result:PendingWriteQueue.removeAndWriteAll succesfully writes all pendingseven in case void promise was used.