public virtual void TestTimeoutNext() { BlockingQueue queue = new BlockingQueue(); Assert.IsNull(AssertTakeAtLeast(200, new _IClosure4_35(queue))); object obj = new object(); queue.Add(obj); Assert.AreSame(obj, AssertTakeLessThan(50, new _IClosure4_46(queue))); Assert.IsNull(AssertTakeAtLeast(200, new _IClosure4_53(queue))); }
internal ClientMessageDispatcherImpl(ClientObjectContainer client, Socket4Adapter a_socket, BlockingQueue synchronousMessageQueue, BlockingQueue asynchronousMessageQueue ) { _container = client; _synchronousMessageQueue = synchronousMessageQueue; _asynchronousMessageQueue = asynchronousMessageQueue; _socket = a_socket; }
public virtual void TestDrainTo() { var queue = new BlockingQueue(); queue.Add(new object()); queue.Add(new object()); var list = new Collection4(); Assert.AreEqual(2, queue.DrainTo(list)); Assert.AreEqual(2, list.Size()); Assert.IsFalse(queue.HasNext()); }
public virtual void TestNext() { IQueue4 queue = new BlockingQueue(); string[] data = new string[] { "a", "b", "c", "d" }; queue.Add(data[0]); Assert.AreSame(data[0], queue.Next()); queue.Add(data[1]); queue.Add(data[2]); Assert.AreSame(data[1], queue.Next()); Assert.AreSame(data[2], queue.Next()); }
/// <exception cref="System.Exception"></exception> public virtual void TestIsAliveInMultiThread() { IBlockingQueue4 barrier = new BlockingQueue(); client = (ClientObjectContainer)OpenNewSession(); client.MessageListener(new _IMessageListener_23(this, barrier)); Thread workThread = new Thread(new _IRunnable_38(), "Quering"); workThread.SetDaemon(true); workThread.Start(); barrier.Next(); client.IsAlive(); }
public virtual void TestIterator() { IQueue4 queue = new BlockingQueue(); string[] data = new string[] { "a", "b", "c", "d" }; for (int idx = 0; idx < data.Length; idx++) { AssertIterator(queue, data, idx); queue.Add(data[idx]); AssertIterator(queue, data, idx + 1); } }
public CommittedCallbacksDispatcher(ObjectServerImpl server, BlockingQueue committedInfosQueue ) { _server = server; _committedInfosQueue = committedInfosQueue; }
public _IClosure4_46(BlockingQueue _enclosing, long timeout) { this._enclosing = _enclosing; this.timeout = timeout; }
public _IClosure4_38(BlockingQueue _enclosing) { this._enclosing = _enclosing; }
public _IClosure4_20(BlockingQueue _enclosing, object obj) { this._enclosing = _enclosing; this.obj = obj; }
public _IClosure4_95(BlockingQueue _enclosing, IPredicate4 condition) { this._enclosing = _enclosing; this.condition = condition; }
public _IClosure4_54(BlockingQueue _enclosing, Collection4 target) { this._enclosing = _enclosing; this.target = target; }
public ClientAsynchronousMessageProcessor(BlockingQueue messageQueue) { _messageQueue = messageQueue; }
public virtual void TestBlocking() { IQueue4 queue = new BlockingQueue(); string[] data = new string[] { "a", "b", "c", "d" }; queue.Add(data[0]); Assert.AreSame(data[0], queue.Next()); BlockingQueueTestCase.NotifyThread notifyThread = new BlockingQueueTestCase.NotifyThread (queue, data[1]); notifyThread.Start(); long start = Runtime.CurrentTimeMillis(); Assert.AreSame(data[1], queue.Next()); long end = Runtime.CurrentTimeMillis(); Assert.IsGreater(500, end - start); }
public _IClosure4_53(BlockingQueue queue) { this.queue = queue; }
public virtual void TestStop() { BlockingQueue queue = new BlockingQueue(); string[] data = new string[] { "a", "b", "c", "d" }; queue.Add(data[0]); Assert.AreSame(data[0], queue.Next()); BlockingQueueTestCase.StopThread notifyThread = new BlockingQueueTestCase.StopThread (queue); notifyThread.Start(); Assert.Expect(typeof(BlockingQueueStoppedException), new _ICodeBlock_110(queue)); }
internal StopThread(BlockingQueue queue) { _queue = queue; }
public _ICodeBlock_110(BlockingQueue queue) { this.queue = queue; }