public void testRunCallsQueuedRunnables() throws Exception {
RunnableQueue q = EasyMock.createMock(RunnableQueue.class);
Runnable task1 = EasyMock.createMock(Runnable.class);
Runnable task2 = EasyMock.createMock(Runnable.class);
EasyMock.expect(q.remove()).andReturn(task1);
task1.run();
EasyMock.expectLastCall();
EasyMock.expect(q.remove()).andReturn(task2);
task2.run();
EasyMock.expectLastCall();
EasyMock.expect(q.remove()).andThrow(new InterruptedException());
EasyMock.replay(q, task1, task2);
QueueExtractor extractor = new QueueExtractor(q);
extractor.run();
EasyMock.verify(q, task1, task2);
}
QueueExtractorTest.java 文件源码
java
阅读 12
收藏 0
点赞 0
评论 0
项目:opengse
作者:
评论列表
文章目录