Details
-
Bug
-
Resolution: Duplicate
-
Low
-
None
-
None
-
None
-
None
Description
Both JUnit and TestNG have features where you can specify that a test method should once for each item in a dataset. For example, in TestNG, you might do this:
@DataProvider(name = "squareRoots") public Object[][] createSquareRoots() { return new Object[][] {{4, 2}, {9, 3}, {16, 4}}; } @Test(dataProvider = "squareRoots") public void testMathSqrt(int val, int answer) { assertEquals(answer, Math.sqrt(val)); }
The result is that testMathSqrt gets run three times, and appears in the test results 3 times. If two or more of the tests fail, and you click on the test to view the results, you get an exception saying that the query did not return a unique result. For an example see:
https://bamboo.extranet.atlassian.com/browse/JST-JST-GAPPSIMPLE-491/test/case/213749056
Attachments
Issue Links
- duplicates
-
BAM-2627 Incorrect JUnit test count when multiple tests have the same name
- Closed