{
RackProxy rack = createMock( RackProxy.class );
RackChannelUpstreamHandler handler = new RackChannelUpstreamHandler( rack );
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast( "handler", handler );
Channel channel = new DefaultLocalServerChannelFactory().newChannel( pipeline );
HttpRequest hr = new DefaultHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, "http://localhost/" );
MessageEvent e = new UpstreamMessageEvent(
channel, hr, new InetSocketAddress( 54321 ) );
ChannelHandlerContext ctx = RackUtil.buildDummyChannelHandlerContext( "localhost", "80" );
Request request = createMockBuilder( Request.class ).withConstructor( ctx, hr, Ruby.getGlobalRuntime() ).createMock();