Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUREFIRE-2090] - Xref link to source code with specified line number doesn't work. Missing "L" in anchor #555

Merged
merged 1 commit into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ private void constructFailureDetails( Sink sink, LocalizedProperties bundle, Lis
if ( xrefLocation != null )
{
String path = fullClassName.replace( '.', '/' );
sink.link( xrefLocation + "/" + path + ".html#" + errorLineNumber );
sink.link( xrefLocation + "/" + path + ".html#L" + errorLineNumber );
}
sink.text( fullClassName + ":" + errorLineNumber );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void testBasicSurefireReportIfLinkXrefIsFalse()

String htmlContent = FileUtils.fileRead( report );

int idx = htmlContent.indexOf( "./xref-test/com/shape/CircleTest.html#44" );
int idx = htmlContent.indexOf( "./xref-test/com/shape/CircleTest.html#L44" );

assertTrue( idx == -1 );
}
Expand All @@ -195,7 +195,7 @@ public void testBasicSurefireReportIfReportingIsNull()

String htmlContent = FileUtils.fileRead( report );

int idx = htmlContent.indexOf( "./xref-test/com/shape/CircleTest.html#44" );
int idx = htmlContent.indexOf( "./xref-test/com/shape/CircleTest.html#L44" );

assertTrue( idx < 0 );
}
Expand Down Expand Up @@ -276,7 +276,7 @@ public void testSurefireReportSingleError()

assertThat( htmlContent, containsString( ">surefire.MyTest:13</a>" ) );

assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#13" ) );
assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#L13" ) );

assertThat( htmlContent, containsString( toSystemNewLine( "<pre>"
+ "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
Expand Down Expand Up @@ -361,7 +361,7 @@ public void testSurefireReportNestedClassTrimStackTrace()
assertThat( htmlContent,
containsString( ">surefire.MyTest:13</a>" ) );

assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#13" ) );
assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#L13" ) );

assertThat( htmlContent, containsString( toSystemNewLine( "<pre>"
+ "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
Expand Down Expand Up @@ -424,7 +424,7 @@ public void testSurefireReportNestedClass()
assertThat( htmlContent,
containsString( ">surefire.MyTest:13</a>" ) );

assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#13" ) );
assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#L13" ) );

assertThat( htmlContent, containsString( toSystemNewLine( "<pre>"
+ "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
Expand Down Expand Up @@ -511,7 +511,7 @@ public void testSurefireReportEnclosedTrimStackTrace()

assertThat( htmlContent, containsString( ">surefire.MyTest$A:45</a>" ) );

assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest$A.html#45" ) );
assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest$A.html#L45" ) );

assertThat( htmlContent, containsString( toSystemNewLine( "<pre>"
+ "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
Expand Down Expand Up @@ -573,7 +573,7 @@ public void testSurefireReportEnclosed()

assertThat( htmlContent, containsString( ">surefire.MyTest$A:45</a>" ) );

assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest$A.html#45" ) );
assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest$A.html#L45" ) );

assertThat( htmlContent, containsString( toSystemNewLine(
"<pre>" + "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
Expand Down