Maven Surefire
  1. Maven Surefire
  2. SUREFIRE-260

Detail display doesn't work if there are tests with the same name

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0 Report Plugin
    • Fix Version/s: 2.7.2
    • Labels:
      None
    • Number of attachments :
      0

      Description

      toggleDisplay uses only the name of the test method for identifying the tests, it should use the full class name+method name

        Activity

        Hide
        Carlos Sanchez added a comment -

        This patch should make it work but it does not.

        Index: src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
        ===================================================================
         src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java (revision 452343)
        +++ src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java (working copy)
        @@ -407,10 +407,10 @@
         
                                     sink.rawText( "  <div class=\"detailToggle\" style=\"display:inline\">" );
         
        -                            sink.link( "javascript:toggleDisplay('" + testCase.getName() + "');" );
        +                            sink.link( "javascript:toggleDisplay('" + testCase.getFullName() + "');" );
         
        -                            sink.rawText( "<span style=\"display: inline;\" " + "id=\"" + testCase.getName() +
        -                                "off\">+</span><span id=\"" + testCase.getName() + "on\" " +
        +                            sink.rawText( "<span style=\"display: inline;\" " + "id=\"" + testCase.getFullName() +
        +                                "off\">+</span><span id=\"" + testCase.getFullName() + "on\" " +
                                         "style=\"display: none;\">-</span> " );
                                     sink.text( "[ Detail ]" );
                                     sink.link_();
        
        Show
        Carlos Sanchez added a comment - This patch should make it work but it does not. Index: src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java =================================================================== src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java (revision 452343) +++ src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java (working copy) @@ -407,10 +407,10 @@ sink.rawText( " <div class=\" detailToggle\ " style=\" display:inline\ ">" ); - sink.link( "javascript:toggleDisplay('" + testCase.getName() + "');" ); + sink.link( "javascript:toggleDisplay('" + testCase.getFullName() + "');" ); - sink.rawText( "<span style=\" display: inline;\ " " + "id=\" " + testCase.getName() + - "off\" >+</span><span id=\ "" + testCase.getName() + " on\ " " + + sink.rawText( "<span style=\" display: inline;\ " " + "id=\" " + testCase.getFullName() + + "off\" >+</span><span id=\ "" + testCase.getFullName() + " on\ " " + "style=\" display: none;\ ">-</span> " ); sink.text( "[ Detail ]" ); sink.link_();
        Hide
        Anil Philip added a comment -

        This was opened almost 3 years ago - does anyone have a workaround? If so, can you please share it?

        Show
        Anil Philip added a comment - This was opened almost 3 years ago - does anyone have a workaround? If so, can you please share it?
        Hide
        Kristian Rosenvold added a comment -

        Fixed in r1061306

        Show
        Kristian Rosenvold added a comment - Fixed in r1061306

          People

          • Assignee:
            Kristian Rosenvold
            Reporter:
            Carlos Sanchez
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: