GitHub user kermit-the-frog opened a pull request:
https://github.com/apache/maven-surefire/pull/36
Avoid invalid link ids in surefire-report
If you are using the Maven Surefire Report Plugin to view your jasmine test
results (generated with Jasmine Maven Plugin) as HTML. The generated HTML-Pages
look quite good in different browsers but the links on failed tests don't work
at all.
The XML containing the jasmine results has whitespace and special chars in
the names of the testcases. Theses names are not allowed for HTML-Ids, so the
names have to be modified before using them as ids/targets for anchors/links in
the generated HTML.
This is only done halfway in the current version of Maven Surefire Report
Plugin. The anchors have a modified id. Because the
SurefireReportGenerator.java uses sink.anchor() to generate the anchor tags.
That function uses DoxiaUtils.encodeId() to encode any illegal character. But
the link targets are wrong. SurefireReportGenerator.java uses it's own function
toHtmlId() which does not implement the same logic as DoxiaUtils.encodeId().
Fixes included in this commit:
+ Call toHtmlId() everytime before using testCase.getFullName() as anchor
id or link target.
+ Use DoxiaUtils.encodeId() in toHtmlId(), to avoid problems with any
illegal char.
Regards,
kermit-the-frog
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kermit-the-frog/maven-surefire master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/maven-surefire/pull/36.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #36
----
commit 3f5b1fb2bcebb7ae96b7ce8e747d1732b4759353
Author: kermit-the-frog <[email protected]>
Date: 2014-03-13T08:42:17Z
avoid invalid link ids
Call toHtmlId() everytime before using testCase.getFullName() as anchor
id or link target.
Use DoxiaUtils.encodeId() in toHtmlId(), to avoid problems with any
illegal char.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]