Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.jboss.netty.buffer.ChannelBuffer triggerOperationCompleteCallback(BufferReusingChunkingChannelBuffer buffer) throws Exception
        private static ChannelBuffer TriggerOperationCompleteCallback(BufferReusingChunkingChannelBuffer buffer)
        {
            ChannelBuffer reusedBuffer = spy(ChannelBuffers.dynamicBuffer());

            ChannelFuture channelFuture = mock(typeof(ChannelFuture));

            when(channelFuture.Done).thenReturn(true);
            when(channelFuture.Success).thenReturn(true);

            buffer.NewChannelFutureListener(reusedBuffer).operationComplete(channelFuture);
            return(reusedBuffer);
        }
Example #2
0
        private static BufferReusingChunkingChannelBuffer NewBufferReusingChunkingChannelBuffer(int capacity, CountingChannelBufferFactory bufferFactory)
        {
            ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();

            Channel       channel       = mock(typeof(Channel));
            ChannelFuture channelFuture = mock(typeof(ChannelFuture));

            when(channel.Open).thenReturn(true);
            when(channel.Connected).thenReturn(true);
            when(channel.Bound).thenReturn(true);
            when(channel.write(any())).thenReturn(channelFuture);

            return(new BufferReusingChunkingChannelBuffer(buffer, bufferFactory, channel, capacity, ( sbyte )1, ( sbyte )1));
        }
Example #3
0
 public override ChannelBuffer NewInstance()
 {
     InstancesCreated++;
     return(ChannelBuffers.dynamicBuffer());
 }