WEB开发网
开发学院软件开发Java 轻松构建和运行多线程的单元测试 阅读

轻松构建和运行多线程的单元测试

 2010-06-08 00:00:00 来源:WEB开发网   
核心提示: packagetest;importstaticorg.junit.Assert.*;importorg.amino.util.msdk.unit.Parallelized;importorg.amino.util.msdk.unit.annotation.CheckFor;importorg.

  
 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){ 
  } 
 
} 

上一页  1 2 3 4 5 6 7  下一页

Tags:轻松 构建 运行

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接