citrus icon indicating copy to clipboard operation
citrus copied to clipboard

Incorrect parameter value passed to test when using TestNG DataProvider with attribute parallel set to true

Open p-khandelwal opened this issue 6 years ago • 5 comments

Related to #83

Scenario:

Trying to use TestNG DataProvider together with TestRunner resource injection. DataProvider attribute parallel = true

Testcase:

public class DataProviderTest extends TestNGCitrusTest {

private static final Logger log = LoggerFactory.getLogger(DataProviderTest.class);

@DataProvider(name = "getTestData", parallel = true)
public Object[][] getTestData() {
    return new String[][]{
            {"foo", null},
            {"bar", null},
    };
}

@Test(testName = "dataProviderAndCitrusResourceInjectionTest",
        dataProvider = "getTestData")
@CitrusTest(name = "dataProviderAndCitrusResourceInjectionTest")
@Parameters({"dataRecord", "runner"})
public void dataProviderAndCitrusResource(String dataRecord, @CitrusResource TestRunner runner) {
    runner.echo("Hello Citrus Test World.");
    log.info("DataProvider dataRecord = " + dataRecord);
}

}

Expected result:

Log contains string "DataProvider dataRecord = foo" and "DataProvider dataRecord = bar"

Actual result:

[PoolService-0] INFO ple.DataProviderTest| DataProvider dataRecord = foo [PoolService-1] INFO ple.DataProviderTest| DataProvider dataRecord = foo

p-khandelwal avatar Mar 19 '18 13:03 p-khandelwal

Parallel data provider is not supported yet

christophd avatar Mar 23 '18 15:03 christophd

Reminder: #501 contains another solid refinement of this issue!

svettwer avatar Oct 06 '18 11:10 svettwer

Would be really awesome if this could be fixed in the next release :)

mischcon avatar Oct 08 '18 09:10 mischcon

It would be great if you introduce this fix in the next release :)

mmarciniuk avatar Nov 07 '19 11:11 mmarciniuk

Could you update status of this task?

mmarciniuk avatar Feb 06 '21 22:02 mmarciniuk