Skip to content

Junit XML can't be parsed when test case or test suite names contain invalid XML chars #285

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

Closed
sfc-gh-abalik opened this issue Jun 24, 2024 · 0 comments

Comments

@sfc-gh-abalik
Copy link
Contributor

With a ParameterizedTest it is possible to generate test case names with invalid XML characters. E.g.

@ParameterizedTest
@ValueSource(strings = {"Weird\bname"})
void testFoo(String input) {
    ...
}

The test case name is derived from the input string, which in this case contains an invalid XML char \b. When tools (like IDEs) try to parse the junit XML, they'll fail due to the invalid char.

It looks like this could also happen for test suite names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant