Skip to content
Testaroo
properties684 B

Java Properties Parser Edge Cases

The .properties edge cases collected in one file: both comment markers, empty values, a value whose trailing spaces are significant, unescaped = and : inside values, a # that is not a comment, escape sequences, an escaped space in a key, and a duplicate key.

Preview, first 21 linesproperties
! An exclamation mark starts a comment too, not only '#'. Both forms appear in this file.
# Java properties edge cases, gathered so a .properties parser can be held to the spec.

empty.value=
whitespace.only.value=
trailing.spaces.kept=value with trailing spaces
leading.whitespace.trimmed=       value had leading spaces
equals.in.value=a=b=c
colon.in.value=host:8080
hash.not.a.comment=colour #4821 is not a comment
backslash.literal=C:\\builds\\example
tab.escape=before\tafter
newline.escape=first\nsecond
unicode.escape=\u00e9\u00e8\u00ea
key.with.spaces\ inside=works
multi.line.list=alpha,\
                beta,\
                gamma
duplicate.key=first
duplicate.key=second

Specifications

Entries
16
Comment Forms
# and !
Duplicate Keys
1
Escape Sequences
\t \n \uXXXX \\ \ (space)
Edge Case
trailing whitespace is kept, leading whitespace is trimmed

Testing contract

Expected to pass
Scenario
Hold a .properties parser to the specified whitespace, comment, and escape rules
Expected result
Leading value whitespace is trimmed while trailing whitespace is kept, the mid-value # is not treated as a comment, and duplicate.key resolves to "second"

What is a .properties file?

A .properties file is the Java configuration format: one `key=value` or `key:value` pair per line, with `#` or `!` comments, backslash line continuations, and escapes for spaces, colons, and equals signs inside keys. Keys are conventionally dot-separated to imply hierarchy, though the format itself is flat. In its original definition the file is ISO-8859-1 with `\uXXXX` escapes for anything else; modern Java tooling also reads UTF-8.

How to use this file

Use an example .properties file to test configuration and resource-bundle loaders, checking continuation lines, escaped separators inside keys, duplicate-key precedence, and correct decoding of `\uXXXX` escapes and non-ASCII values.

How to use this file for testing

“Java Properties Parser Edge Cases” is a deterministic Testaroo fixture for Config parsing, Syntax highlighting, Editor testing. TOML and INI configuration files with nested sections and typed values, for testing config parsers and loaders.

Documented properties for this file: 16 entries. 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.

Pipeline and infrastructure fixtures are inert configuration: steps reference fictional images and scripts, and nothing here executes. Run your linter, schema validator, migrator, or policy engine against them, and expect the deprecated-syntax and intentionally invalid variants to be rejected.

Point your config loader at the file and assert it reads the documented sections and typed values, including any deliberately-tricky nesting or comments.

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