View Javadoc
1   package otherTests.testng;
2   
3   import static org.testng.Assert.assertEquals;
4   
5   import java.util.concurrent.atomic.AtomicInteger;
6   
7   import org.testng.annotations.AfterClass;
8   import org.testng.annotations.Test;
9   
10  // Just to make sure no NPEs or other exceptions occur from JMockit-TestNG integration.
11  public final class ParallelExecutionTest {
12      final AtomicInteger counter = new AtomicInteger();
13  
14      @Test(threadPoolSize = 4, invocationCount = 10)
15      public void parallelExecution() {
16          counter.incrementAndGet();
17      }
18  
19      @AfterClass
20      public void checkCounter() {
21          assertEquals(counter.get(), 10);
22      }
23  }