Example #1
0
 public void TestHandlerAddedExecutedInEventLoop(int timeout)
 {
     var latch = new CountdownEvent(1);
     var ex = new AtomicReference<Exception>();
     IChannelHandler handler = new ChannelHandler3(latch, ex);
     var channel = new EmbeddedChannel(handler);
     Assert.False(channel.Finish());
     Assert.True(latch.Wait(timeout));
     var cause = ex.Value;
     if (cause != null)
     {
         throw cause;
     }
 }
Example #2
0
        public void TestHandlerAddedExecutedInEventLoop(int timeout)
        {
            var             latch   = new CountdownEvent(1);
            var             ex      = new AtomicReference <Exception>();
            IChannelHandler handler = new ChannelHandler3(latch, ex);
            var             channel = new EmbeddedChannel(handler);

            Assert.False(channel.Finish());
            Assert.True(latch.Wait(timeout));
            Exception cause = ex.Value;

            if (cause != null)
            {
                throw cause;
            }
        }