轻松构建和运行多线程的单元测试
2010-06-08 00:00:00 来源:WEB开发网
package test;
import static org.junit.Assert.*;
import org.amino.util.msdk.unit.Parallelized;
import org.amino.util.msdk.unit.annotation.CheckFor;
import org.amino.util.msdk.unit.annotation.InitFor;
import org.amino.util.msdk.unit.annotation.ParallelSetting;
import org.amino.util.msdk.unit.annotation.Threaded;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
@RunWith(Parallelized.class)
@ParallelSetting(threadNumber = { 1, 2, 4, 8, 16, 32, 64 })
public class TestUnitExtensionSample1 {
@BeforeClass
public static void setUpBeforeClass() throws Exception {}
@AfterClass
public static void tearDownAfterClass() throws Exception {}
@Before
public void setUp() throws Exception {}
@After
public void tearDown() throws Exception {}
@InitFor("testAdd")
public void initfortestAdd(int threadNum){}
@CheckFor("testAdd")
public void checkfortestAdd(int threadNum){}
@Threaded
public void testAdd(int rank, int threadNum){
}
}
更多精彩
赞助商链接