| Issue 2: | Number of methods is reported incorrectly in the TestNG View when a test method is run multiple times. | |
| 3 people starred this issue and may be notified of changes. | Back to list |
To reproduce the problem, write a test with a data provider that causes the
test to be run multiple times. Run the test, and look at the "Methods:
n/n" result shown in the TestNG View. When done with the example code that
I will provide, the result is "Methods: 3/1". This should either be
"Method: 1/1" or "Methods: 3/3", depending on whether it is reporting the
number of test methods, or the number of test method calls that are made.
Example.java:
public class Example {
String value;
public Example(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
ExampleTest.java:
import static org.testng.Assert.assertEquals;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class ExampleTest {
@DataProvider(name = "provider")
public Object[][] provideValues() {
return new Object[][]{{"foo"}, {"42"}, {"bar"}};
}
@Test(groups = {"unit"}, dataProvider = "provider")
public void testValue(String value) {
Example testObject = new Example(value);
assertEquals(value, testObject.getValue());
}
}
Oct 26, 2006
Project Member
#1
the.mind...@gmail.com
Owner:
---
|