View Javadoc
1   /*
2    * MIT License
3    * Copyright (c) 2006-2025 JMockit developers
4    * See LICENSE file for full license text.
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  // Just to make sure no NPEs or other exceptions occur from JMockit-TestNG integration.
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  }