Apache.NMS.ActiveMQ.Test.InactivityMonitorTest.TestReadTimeout C# (CSharp) Method

TestReadTimeout() private method

private TestReadTimeout ( ) : void
return void
        public void TestReadTimeout()
        {
            InactivityMonitor monitor = new InactivityMonitor( this.transport );

            monitor.Exception += new ExceptionHandler(OnException);
            monitor.Command += new CommandHandler(OnCommand);

            // Send the local one for the monitor to record.
            monitor.Oneway( this.localWireFormatInfo );

            Thread.Sleep( 2000 );

            // Should not have timed out on Read yet.
            Assert.IsTrue( this.exceptions.Count == 0 );

            Thread.Sleep( 5000 );

            // Channel should have been inactive for to long.
            Assert.IsTrue( this.exceptions.Count > 0 );
        }