cbeust/testng — Issue #148: 'Run Failed Test' doesn't run the proper tests after 2nd rerun when DataProvider is used
Author: akracheva
Created: 2011-12-16 14:14:28+00:00
State: open

Execute the simple test code bellow:

@DataProvider(name = "test")
public Object[][] testDataProvider() {
List data = new ArrayList();

data.add(new Object[] { 1 });
data.add(new Object[] { 2 });
data.add(new Object[] { 3 });

return (Object[][]) data.toArray(new Object[data.size()][]);
}

@Test(description = "simple test", dataProvider = "test")
public void testMethod(int test) {
if( test == 3){
throw new RuntimeException("Test Case: " + test + " failed!");
}
}

Only 3rd test case fails and testing-failed.xml indicates it with invocation-numbers="2".
Now rerun failed tests only. The proper test is run and it fails again but testing-failed.xml now indicates it with invocation-numbers="0". So on the next run the 1st test case will be run not the failed one.

Environment:
-Eclipse Version: 3.6.2
-TestNG plug-in for Eclipse version 6.3.2.20111203_1323