</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);
//一個(gè)線(xiàn)程可以有n個(gè)校驗服務(wù)
AssertService as=new AssertService();
//增加線(xiàn)程中的驗證方法,直接可以定義
as.setCheckMethod(this, "checkResult");
th.addAssertService(as);
//通過(guò)傳單個(gè)mock thread來(lái)傳參
thFac.addThread(th);
//同時(shí)啟動(dòng)5個(gè)線(xiàn)程來(lái)測試
thFac.startThreads(5);
}
public void checkResult(Integer result){
System.out.println("傳入設置actual值得方法");
result=result+1;
assertThat("
原文轉自:http://www.taobaotesting.com/blogs/2443