JUnit XML — Escaped Characters in Test Names
Test names containing &, <, >, quotes and an apostrophe, escaped as XML requires. Round-tripping this report through a converter is the fastest way to find double-escaping bugs that turn & into &amp; one hop at a time.
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="cart.PricingTest" tests="5" failures="1" errors="0" skipped="0" time="0.350" timestamp="2026-08-07T09:14:22" hostname="ci-runner-04">
<testcase classname="cart.PricingTest" name="applies discount & tax together" time="0.050"/>
<testcase classname="cart.PricingTest" name="rejects quantity < 0" time="0.060">
<failure message="expected:<12.60> but was:<12.59>" type="java.lang.AssertionError"><![CDATA[java.lang.AssertionError: expected:<12.60> but was:<12.59>
at cart.PricingTest.appliesTaxToSubtotal(PricingTest.java:88)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
]]></failure>
</testcase>
<testcase classname="cart.PricingTest" name='accepts currency code "GBP"' time="0.070"/>
<testcase classname="cart.PricingTest" name="handles apostrophe in customer's name" time="0.080"/>
<testcase classname="cart.PricingTest" name="renders <em>emphasis</em> in receipts" time="0.090"/>
</testsuite>
</testsuites>
Specifications
- Seed
- 61200
- Encoding
- UTF-8
- Line Endings
- LF
- Tests
- 5
- Failures
- 1
- Escaped Entities
- amp lt gt quot apos
Testing contract
Expected to pass- Scenario
- Round-trip a JUnit report whose test names contain XML metacharacters.
- Expected result
- The name reads back as "applies discount & tax together" with a single ampersand after one decode, and re-serialising escapes it exactly once.
What is a .xml file?
XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.
How to use this file
Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.
How to use this file for testing
“JUnit XML — Escaped Characters in Test Names” is a deterministic Novus Examples fixture for Encoding detection, Conversion testing, Error handling. UTF-8, UTF-8-BOM, UTF-16, and Latin-1 files with documented encodings and line endings for testing charset detection.
Documented properties for this file: seed 61200 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.
Code examples
import xml.etree.ElementTree as ET
tree = ET.parse("structure-xml-escaped-names.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])Related files
- xmlJUnit XML — @Playwright/Test Dialect (playwright)The same 12-case Novus Checkout run written the way @playwright/test 1.47 junit reporter writes it. Playwright puts the run totals on the <testsuites> root, names each suite after its spec file, and uses the bare describe title as classname. All eight dialect files in this group report 12 tests, 1 failure, 1 error and 1 skip, so a JUnit parser can be held to identical totals across every producer.

- xmlJUnit XML — All Tests PassingA clean green run: six passing cases, zero failures, errors and skips. The baseline a CI gate should treat as success, and the control case for any dashboard that colours a build from the failure count.

- xmlJUnit XML — Empty Suite (Zero Tests)A structurally valid report containing a suite with no <testcase> children at all — what a runner writes when a filter matched nothing. Aggregators that divide by the test count to compute a pass rate hit a zero denominator here.

- xmlJUnit XML — Error and Failure DistinguishedOne <failure> (an assertion that did not hold) and one <error> (an exception the test never expected), side by side. Parsers that collapse the two lose the distinction between a broken assertion and a broken environment.

- xmlJUnit XML — Every Test SkippedA suite in which every case was skipped, so tests equals skipped and nothing actually ran. A gate that reads only the failure count calls this green; one that checks executed>0 catches it.

- xmlJUnit XML — Go-Junit-Report Dialect (go-junit-report)The same 12-case Novus Checkout run written the way go-junit-report 2.1 writes it. go-junit-report names each suite after a Go package and carries the toolchain version in a go.version property. All eight dialect files in this group report 12 tests, 1 failure, 1 error and 1 skip, so a JUnit parser can be held to identical totals across every producer.

Generated by generation/testing.py. Free for any use, no attribution required — license.