</aop:aspect>
</aop:config>
@Test
public void test_01_thread_run(){
ThreadFactory thFac=new ThreadFactory();
//配置切面信息
mockAspect.setMockResult(11);
ThreadTest th=new ThreadTest();
th.setOwnerBean(hello);
th.setMethodName("hello");
th.setMockAspect(mockAspect);
th.setThreadMockFlag(true);
//一个线程可以有n个校验服务
AssertService as=new AssertService();
//增加线程中的验证方法,直接可以定义
as.setCheckMethod(this, "checkResult");
th.addAssertService(as);
//通过传单个mock thread来传参
thFac.addThread(th);
//同时启动5个线程来测试
thFac.startThreads(5);
}
public void checkResult(Integer result){
System.out.println("传入设置actual值得方法");
result=result+1;
assertThat("
原文转自:http://www.taobaotesting.com/blogs/2443