@Test(timeout = 60000) public void testPipelineConfigurator() throws Exception { final Action1<ChannelPipeline> pipelineConfigurator = new Action1<ChannelPipeline>() { @Override public void call(ChannelPipeline pipeline) { } }; ClientState<String, String> newState = clientStateRule.clientState.pipelineConfigurator(pipelineConfigurator); clientStateRule.verifyMockPipelineAccessPostCopy(); assertThat("Client state not copied.", clientStateRule.clientState, is(not(newState))); assertThat("Options copied.", clientStateRule.clientState.unsafeChannelOptions(), is(newState.unsafeChannelOptions())); assertThat("Detached pipeline not copied.", clientStateRule.clientState.unsafeDetachedPipeline(), is(not(newState.unsafeDetachedPipeline()))); Mockito.verify(newState.unsafeDetachedPipeline()).configure(pipelineConfigurator); Mockito.verifyNoMoreInteractions(newState.unsafeDetachedPipeline()); Mockito.verifyNoMoreInteractions(clientStateRule.mockPipeline); }
public <WW, RR> ClientState<WW, RR> pipelineConfigurator(Action1<ChannelPipeline> pipelineConfigurator) { ClientState<WW, RR> copy = copy(); copy.detachedPipeline.configure(pipelineConfigurator); return copy; }
ClientState { public <WW, RR> ClientState<WW, RR> pipelineConfigurator(Action1<ChannelPipeline> pipelineConfigurator) { ClientState<WW, RR> copy = copy(); copy.detachedPipeline.configure(pipelineConfigurator); return copy; } }
ClientState { public <WW, RR> ClientState<WW, RR> pipelineConfigurator(Action1<ChannelPipeline> pipelineConfigurator) { ClientState<WW, RR> copy = copy(); copy.detachedPipeline.configure(pipelineConfigurator); return copy; } protected  ClientState(Observable<Host> hostStream, ConnectionProviderFactory<W, R> factory,
                          DetachedChannelPipeline detachedPipeline, EventLoopGroup eventLoopGroup,
                          Class<? extends Channel> channelClass); protected  ClientState(ClientState<W, R> toCopy, ChannelOption<?> option, Object value); protected  ClientState(ClientState<?, ?> toCopy, DetachedChannelPipeline newPipeline, boolean secure); protected  ClientState(ClientState<?, ?> toCopy, ChannelProviderFactory newFactory); protected  ClientState(ClientState<?, ?> toCopy, SslCodec sslCodec); }
ClientState { public <WW, RR> ClientState<WW, RR> pipelineConfigurator(Action1<ChannelPipeline> pipelineConfigurator) { ClientState<WW, RR> copy = copy(); copy.detachedPipeline.configure(pipelineConfigurator); return copy; } protected  ClientState(Observable<Host> hostStream, ConnectionProviderFactory<W, R> factory,
                          DetachedChannelPipeline detachedPipeline, EventLoopGroup eventLoopGroup,
                          Class<? extends Channel> channelClass); protected  ClientState(ClientState<W, R> toCopy, ChannelOption<?> option, Object value); protected  ClientState(ClientState<?, ?> toCopy, DetachedChannelPipeline newPipeline, boolean secure); protected  ClientState(ClientState<?, ?> toCopy, ChannelProviderFactory newFactory); protected  ClientState(ClientState<?, ?> toCopy, SslCodec sslCodec); ClientState<W, R> channelOption(ChannelOption<T> option, T value); ClientState<WW, RR> addChannelHandlerFirst(String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerFirst(EventExecutorGroup group, String name,
                                                               Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerLast(String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerLast(EventExecutorGroup group, String name,
                                                              Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerBefore(String baseName, String name,
                                                                Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerBefore(EventExecutorGroup group, String baseName,
                                                                String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerAfter(String baseName, String name,
                                                               Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerAfter(EventExecutorGroup group, String baseName,
                                                               String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> pipelineConfigurator(Action1<ChannelPipeline> pipelineConfigurator); ClientState<W, R> enableWireLogging(final LogLevel wireLoggingLevel); ClientState<W, R> enableWireLogging(String name, final LogLevel wireLoggingLevel); static ClientState<WW, RR> create(ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream); static ClientState<WW, RR> create(ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream,
                                                      EventLoopGroup eventLoopGroup,
                                                      Class<? extends Channel> channelClass); static ClientState<WW, RR> create(DetachedChannelPipeline detachedPipeline,
                                                      ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream); static ClientState<WW, RR> create(DetachedChannelPipeline detachedPipeline,
                                                      ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream,
                                                      EventLoopGroup eventLoopGroup,
                                                      Class<? extends Channel> channelClass); Bootstrap newBootstrap(final EventPublisher eventPublisher, final ClientEventListener eventListener); DetachedChannelPipeline unsafeDetachedPipeline(); Map<ChannelOption<?>, Object> unsafeChannelOptions(); ClientState<W, R> channelProviderFactory(ChannelProviderFactory factory); ClientState<W, R> secure(Func1<ByteBufAllocator, SSLEngine> sslEngineFactory); ClientState<W, R> secure(SSLEngine sslEngine); ClientState<W, R> secure(SslCodec sslCodec); ClientState<W, R> unsafeSecure(); ConnectionProviderFactory<W, R> getFactory(); Observable<Host> getHostStream(); ChannelProviderFactory getChannelProviderFactory(); static EventLoopGroup defaultEventloopGroup(); static Class<? extends Channel> defaultSocketChannelClass(); }
ClientState { public <WW, RR> ClientState<WW, RR> pipelineConfigurator(Action1<ChannelPipeline> pipelineConfigurator) { ClientState<WW, RR> copy = copy(); copy.detachedPipeline.configure(pipelineConfigurator); return copy; } protected  ClientState(Observable<Host> hostStream, ConnectionProviderFactory<W, R> factory,
                          DetachedChannelPipeline detachedPipeline, EventLoopGroup eventLoopGroup,
                          Class<? extends Channel> channelClass); protected  ClientState(ClientState<W, R> toCopy, ChannelOption<?> option, Object value); protected  ClientState(ClientState<?, ?> toCopy, DetachedChannelPipeline newPipeline, boolean secure); protected  ClientState(ClientState<?, ?> toCopy, ChannelProviderFactory newFactory); protected  ClientState(ClientState<?, ?> toCopy, SslCodec sslCodec); ClientState<W, R> channelOption(ChannelOption<T> option, T value); ClientState<WW, RR> addChannelHandlerFirst(String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerFirst(EventExecutorGroup group, String name,
                                                               Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerLast(String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerLast(EventExecutorGroup group, String name,
                                                              Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerBefore(String baseName, String name,
                                                                Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerBefore(EventExecutorGroup group, String baseName,
                                                                String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerAfter(String baseName, String name,
                                                               Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> addChannelHandlerAfter(EventExecutorGroup group, String baseName,
                                                               String name, Func0<ChannelHandler> handlerFactory); ClientState<WW, RR> pipelineConfigurator(Action1<ChannelPipeline> pipelineConfigurator); ClientState<W, R> enableWireLogging(final LogLevel wireLoggingLevel); ClientState<W, R> enableWireLogging(String name, final LogLevel wireLoggingLevel); static ClientState<WW, RR> create(ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream); static ClientState<WW, RR> create(ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream,
                                                      EventLoopGroup eventLoopGroup,
                                                      Class<? extends Channel> channelClass); static ClientState<WW, RR> create(DetachedChannelPipeline detachedPipeline,
                                                      ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream); static ClientState<WW, RR> create(DetachedChannelPipeline detachedPipeline,
                                                      ConnectionProviderFactory<WW, RR> factory,
                                                      Observable<Host> hostStream,
                                                      EventLoopGroup eventLoopGroup,
                                                      Class<? extends Channel> channelClass); Bootstrap newBootstrap(final EventPublisher eventPublisher, final ClientEventListener eventListener); DetachedChannelPipeline unsafeDetachedPipeline(); Map<ChannelOption<?>, Object> unsafeChannelOptions(); ClientState<W, R> channelProviderFactory(ChannelProviderFactory factory); ClientState<W, R> secure(Func1<ByteBufAllocator, SSLEngine> sslEngineFactory); ClientState<W, R> secure(SSLEngine sslEngine); ClientState<W, R> secure(SslCodec sslCodec); ClientState<W, R> unsafeSecure(); ConnectionProviderFactory<W, R> getFactory(); Observable<Host> getHostStream(); ChannelProviderFactory getChannelProviderFactory(); static EventLoopGroup defaultEventloopGroup(); static Class<? extends Channel> defaultSocketChannelClass();  }