alexey kachayev <> in Netty

Get rid of deprecated SslContext methods in handler-proxy tests


ProxyHandlerTest package uses deprecated methods SslContext.newServerContext and



SslContextBuilder is used to build server and client SslContext.


Less deprecated method in the code.

Fix random number generators in WebSocketUtil


Implementation of WebSocketUtil/randomNumber is incorrect and might violate

the API returning values > maximum specified.


* 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 number


WebSocketUtil/randomNumber always produces correct result.


Make results of handler proxy tests reproducible


`ProxyHandlerTest` relies on random values to run tests: first to

shuffle collection of test items and lately to set configuration

flag for `AUTO_READ`. While the purpose of randomization is clear,

it's still impossible to reproduce the same sequence of test cases

when something went wrong. For `AUTO_READ` it's even impossible

to tell what flag was set when the particular test failed.


* 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"


You can reproduce specific tests results now.

DnsAddressResolverGroup to use pluggable DnsNameResolverBuilder (#7793)


Right now to customize DNS name resolver when using DnsAddressResolverGroup

one should subclass implementation and override newNameResolver method when

in fact it's possible to collect all settings in a DnsNameResolverBuilder

instance. Described in #7749.


- 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


- 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 resolver


Much easier to customize DNS settings w/o subclassing DnsAddressResolverGroup

PendingWriteQueue to handle write operations with void future


Right now PendingWriteQueue.removeAndWriteAll collects all promises to

PromiseCombiner instance which sets listener to each given promise throwing

IllegalStateException on VoidChannelPromise which breaks while loop

and "reports" operation as failed (when in fact part of writes might be

actually written).


Check if the promise is not void before adding it to the PromiseCombiner



PendingWriteQueue.removeAndWriteAll succesfully writes all pendings

even in case void promise was used.