Two tests with exactly the same name throw exception when you try to view them

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Low
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      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

            Assignee:
            Unassigned
            Reporter:
            James Roper [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: