1 package test.dataprovider;
2 
3 import org.testng.annotations.DataProvider;
4 import org.testng.annotations.Test;
5 import org.testng.collections.Lists;
6 
7 import java.util.Iterator;
8 import java.util.List;
9 
10 /**
11  * @author Jacek Pulut <jacek.pulut@gmail.com>
12  *
13  * Make sure this class can run without causing a ConcurrentModificationException.
14  */
15 public class ParallelDataProvider2Test {
16   @DataProvider(parallel = true)
provide()17   Iterator<Integer[]> provide()
18   {
19     final List<Integer[]> ret = Lists.newArrayList();
20     for (int i = 0; i < 1000; i++)
21     {
22       ret.add(new Integer[] { i });
23     }
24     return ret.iterator();
25   }
26 
27   @Test(groups = "cme", dataProvider = "provide", invocationCount = 2, threadPoolSize = 2)
checkCME(final Integer i)28   public void checkCME(final Integer i)
29   {
30 //    Reporter.log("" + i, true);
31   }
32 }