码迷,mamicode.com
首页 > 其他好文 > 详细

异步UnitTest测试结果接收

时间:2018-12-11 00:39:23      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:wait   结果   interrupt   async   row   test   creat   this   void   

public class TestUtil { public static AsyncTest createAsyncTest() { return new AsyncTest(); } public static class AsyncTest<T> { private T result; private CountDownLatch countDownLatch=new CountDownLatch(1); public T getResult() throws InterruptedException { countDownLatch.await(); return result; } public void setResult(T result) { this.result = result; countDownLatch.countDown(); } } }

异步UnitTest测试结果接收

标签:wait   结果   interrupt   async   row   test   creat   this   void   

原文地址:http://blog.51cto.com/13923464/2328616

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!