Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-9326

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

    XMLWordPrintable

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: