Skip to content
Novus Examples
xml465 B

JUnit XML — Locale-Formatted and Exponent Durations

Durations written four different ways in one file: scientific notation, a comma decimal separator from a German-locale JVM, a bare integer, and a comma that could be either a decimal point or a thousands separator. A parser using a locale-sensitive number reader gets a different answer depending on where it runs.

Preview — first 8 linesxml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="perf.TimingTest" tests="4" failures="0" errors="0" skipped="0" time="1,238">
  <testcase classname="perf.TimingTest" name="microBenchmark" time="1.0E-4"/>
  <testcase classname="perf.TimingTest" name="localeFormattedDuration" time="0,123"/>
  <testcase classname="perf.TimingTest" name="integerDuration" time="3"/>
  <testcase classname="perf.TimingTest" name="thousandsSeparated" time="1,115"/>
</testsuite>

Specifications

Seed
61200
Encoding
UTF-8
Line Endings
LF
Tests
4
Failures
0
Duration Formats
decimal point, comma decimal, exponent, integer
Producer Locale
de-DE

Testing contract

Expected to recover
Scenario
Parse duration attributes emitted by a runner on a comma-decimal locale.
Expected result
1.0E-4 and 3 parse unambiguously; 0,123 and 1,115 are ambiguous and must be flagged or parsed with an explicitly declared locale, never with the host default.

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 — Locale-Formatted and Exponent Durations” is a deterministic Novus Examples fixture for Error handling, Conversion testing, Encoding detection. Deliberately corrupt and invalid files, clearly labelled, for testing how your tool fails.

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-locale-number-formats.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])

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