use of io.netty.channel.ChannelHandler in project reactor-netty by reactor.
the class NettyContextTest method addNonByteEncoderWhenFullReactorPipeline.
@Test
public void addNonByteEncoderWhenFullReactorPipeline() throws Exception {
channel.pipeline().addLast(NettyPipeline.HttpCodec, new HttpServerCodec()).addLast(NettyPipeline.HttpServerHandler, new ChannelDuplexHandler()).addLast(NettyPipeline.ReactiveBridge, new ChannelHandlerAdapter() {
});
ChannelHandler encoder = new ChannelHandlerAdapter() {
};
testContext.addHandlerFirst("encoder", encoder);
assertEquals(channel.pipeline().names(), Arrays.asList(NettyPipeline.HttpCodec, NettyPipeline.HttpServerHandler, "encoder", NettyPipeline.ReactiveBridge, "DefaultChannelPipeline$TailContext#0"));
}
use of io.netty.channel.ChannelHandler in project reactor-netty by reactor.
the class NettyContextTest method addNonByteEncoderWhenNoRight.
@Test
public void addNonByteEncoderWhenNoRight() throws Exception {
channel.pipeline().addLast(NettyPipeline.HttpCodec, new ChannelHandlerAdapter() {
});
ChannelHandler encoder = new ChannelHandlerAdapter() {
};
testContext.addHandlerFirst("encoder", encoder);
assertEquals(channel.pipeline().names(), Arrays.asList(NettyPipeline.HttpCodec, "encoder", "DefaultChannelPipeline$TailContext#0"));
}
use of io.netty.channel.ChannelHandler in project reactor-netty by reactor.
the class NettyContextTest method addByteDecoderWhenNoRight.
@Test
public void addByteDecoderWhenNoRight() throws Exception {
channel.pipeline().addLast(NettyPipeline.HttpCodec, new ChannelHandlerAdapter() {
});
ChannelHandler decoder = new LineBasedFrameDecoder(12);
testContext.addHandlerLast("decoder", decoder).addHandlerFirst("decoder$extract", NettyPipeline.inboundHandler(ADD_EXTRACTOR));
assertEquals(channel.pipeline().names(), Arrays.asList(NettyPipeline.HttpCodec, "decoder$extract", "decoder", "DefaultChannelPipeline$TailContext#0"));
}
use of io.netty.channel.ChannelHandler in project reactor-netty by reactor.
the class NettyContextTest method addByteDecoderWhenNoLeft.
@Test
public void addByteDecoderWhenNoLeft() throws Exception {
channel.pipeline().addLast(NettyPipeline.ReactiveBridge, new ChannelHandlerAdapter() {
});
ChannelHandler decoder = new LineBasedFrameDecoder(12);
testContext.addHandlerLast("decoder", decoder).addHandlerFirst("decoder$extract", NettyPipeline.inboundHandler(ADD_EXTRACTOR));
assertEquals(channel.pipeline().names(), Arrays.asList("decoder$extract", "decoder", NettyPipeline.ReactiveBridge, "DefaultChannelPipeline$TailContext#0"));
}
use of io.netty.channel.ChannelHandler in project reactor-netty by reactor.
the class NettyContextTest method addByteEncoderWhenNoRight.
@Test
public void addByteEncoderWhenNoRight() throws Exception {
channel.pipeline().addLast(NettyPipeline.HttpCodec, new ChannelHandlerAdapter() {
});
ChannelHandler encoder = new LineBasedFrameDecoder(12);
testContext.addHandlerFirst("encoder", encoder);
assertEquals(channel.pipeline().names(), Arrays.asList(NettyPipeline.HttpCodec, "encoder", "DefaultChannelPipeline$TailContext#0"));
}
Aggregations