1
2
3
4
5
6 package otherTests.testng;
7
8 import static org.testng.Assert.assertEquals;
9
10 import java.util.concurrent.atomic.AtomicInteger;
11
12 import org.testng.annotations.AfterClass;
13 import org.testng.annotations.Test;
14
15
16 public final class ParallelExecutionTest {
17 final AtomicInteger counter = new AtomicInteger();
18
19 @Test(threadPoolSize = 4, invocationCount = 10)
20 public void parallelExecution() {
21 counter.incrementAndGet();
22 }
23
24 @AfterClass
25 public void checkCounter() {
26 assertEquals(counter.get(), 10);
27 }
28 }