I wanted to run tests defined by TestNG in parallel.
I have @DataProvider method which contains the list of IDs
@BeforeClass method gets every ID, does some processing and stores the result in the Map. There is one @Test method which uses the values present in Map and performs the validation.
I used the following statement within the xml:
<suite name="My suite" parallel="methods" thread-count="5">
I wanted to run the tests in parallel and the Map computed should not be shared across the thread. The values should be thread specific.
How should I define such a variable and use it only for that thread?