use of io.netty.microbench.channel.EmbeddedChannelWriteReleaseHandlerContext in project netty by netty.
the class StompEncoderBenchmark method setup.
@Setup(Level.Trial)
public void setup() {
byte[] bytes = new byte[contentLength];
ThreadLocalRandom.current().nextBytes(bytes);
content = Unpooled.wrappedBuffer(bytes);
ByteBuf testContent = Unpooled.unreleasableBuffer(content.asReadOnly());
StompHeadersSubframe headersSubframe = ExampleStompHeadersSubframe.EXAMPLES.get(headersType);
stompFrame = new DefaultStompFrame(headersSubframe.command(), testContent);
stompFrame.headers().setAll(headersSubframe.headers());
stompEncoder = new StompSubframeEncoder();
context = new EmbeddedChannelWriteReleaseHandlerContext(pooledAllocator ? PooledByteBufAllocator.DEFAULT : UnpooledByteBufAllocator.DEFAULT, stompEncoder) {
@Override
protected void handleException(Throwable t) {
handleUnexpectedException(t);
}
};
}
Aggregations