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
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0 Report Plugin
    • Fix Version/s: 2.7.2
    • Labels:
      None

      Description

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

        Activity

        Carlos Sanchez created issue -
        Carlos Sanchez made changes -
        Field Original Value New Value
        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
        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_();
        Brett Porter made changes -
        Key MSUREFIREREP-33 SUREFIRE-260
        Project Maven 2.x Surefire report Plugin [ 11222 ] Maven Surefire [ 10541 ]
        Affects Version/s 2.0 Report Plugin [ 12481 ]
        Brett Porter made changes -
        Component/s report plugin [ 12564 ]
        Brett Porter made changes -
        Affects Version/s 2.0 Report Plugin [ 13171 ]
        Brett Porter made changes -
        Fix Version/s 2.x [ 13647 ]
        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
        Kristian Rosenvold made changes -
        Fix Version/s 2.7.2 [ 17030 ]
        Resolution Fixed [ 1 ]
        Assignee Kristian Rosenvold [ krosenvold ]
        Status Open [ 1 ] Closed [ 6 ]
        Kristian Rosenvold made changes -
        Fix Version/s Backlog [ 13647 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:23:32 UTC 2015 [ 1428240212200 ]
        Mark Thomas made changes -
        Workflow jira [ 12727503 ] Default workflow, editable Closed status [ 12758627 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 01:36:33 UTC 2015 [ 1428284193036 ]
        Mark Thomas made changes -
        Workflow jira [ 12965532 ] Default workflow, editable Closed status [ 13003262 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        1570d 1h 29m 1 Kristian Rosenvold 20/Jan/11 08:14

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development