Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2.0.3 (2026-10-31)

- G-11.6: the Finding reported every `Closeable` outside `try`-with-resources, so the per-class fixture its title asks
for (opened in `@BeforeAll`, closed in `@AfterAll`) was a finding. The Finding now exempts a per-class fixture
closed in `@AfterAll` or by an extension, and the text says how `@AfterAll` closes a fixture whose start failed.
The title wins over the Finding it contradicted; no other rule changed.

## 2.0.2 (2026-10-31)

Corrections found by applying the standard to a whole repository; no rule ID, scope, class or Finding line changed.
Expand Down
2 changes: 1 addition & 1 deletion RULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ rule. Read the rule's block in the standard before applying it or reporting a fi
| G-11.3 | Fault injection is an anonymous subclass of the facade, failing on the Nth call or on a specific name, installed via the configuration for one test block | skip unless facades | rule | review | A mocking library, or fault injection that does not go through the facade. |
| G-11.4 | Randomness is a two-seed generator, seeds printed on every run and accepted back through system properties | everywhere | rule | test, review | A randomised test whose seed is not printed or cannot be replayed. |
| G-11.5 | Concurrency tests: a barrier to start, a latch with a timeout to join, atomics for outcomes asserted once on the main thread, `assertEventually` with backoff instead of `Thread.sleep`, races hunted with seeded repeat loops | everywhere | rule | review | `Thread.sleep` used to wait for a condition, an unbounded join, or outcomes asserted on a worker thread. |
| G-11.6 | Heavy fixtures are static per class; every mutable piece is reset before each test (`@BeforeEach`); overrides go through a typed `Overrides` object the test configuration consults live | everywhere | rule | review | A `Closeable` in a test outside `try`-with-resources, mutable shared state not reset per test, or a copied test where a parameter would do. |
| G-11.6 | Heavy fixtures are static per class; every mutable piece is reset before each test (`@BeforeEach`); overrides go through a typed `Overrides` object the test configuration consults live | everywhere | rule | review | A `Closeable` in a test that is neither in `try`-with-resources nor a per-class fixture closed in `@AfterAll` (or by an extension), mutable shared state not reset per test, or a copied test where a parameter would do. |
| G-11.7 | Tests are documented with Markdown comments | everywhere | rule | test | A test class or test method without a `///` comment, or a `/** */` comment on one. |
| G-11.8 | Tests never touch the user's data | everywhere | defect | review, test | A test that reads or writes the user's home data, keychain, preferences or configuration without a named flag. |
| G-12.1 | A repository that follows this standard has an Apply section | everywhere | rule | review | A repository whose agent instructions or documentation claim this standard and that has no Apply section, or an Apply section without the version it follows. |
Expand Down
9 changes: 6 additions & 3 deletions STANDARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -1864,10 +1864,13 @@ assertEquals(0, anomalies.get());

**Scope:** everywhere · **From:** P1, P5 · **Checked by:** review · **Class:** rule

**Finding:** A `Closeable` in a test outside `try`-with-resources, mutable shared state not reset per test, or a copied test where a parameter would do.
**Finding:** A `Closeable` in a test that is neither in `try`-with-resources nor a per-class fixture closed in `@AfterAll` (or by an extension), mutable shared state not reset per test, or a copied test where a parameter would do.

`try (final X x = ...)` for every `Closeable` in
tests. Parameterise over modes rather than copy tests. Assert meaning, not
A heavy fixture (an embedded database, a server) lives for the class: opened in
`@BeforeAll` and closed in `@AfterAll`, which closes what was opened even when
the start failed half-way (a fixture still `null` is skipped, so the start's
failure is the one reported). Every other `Closeable` in a test is held in
`try (final X x = ...)`. Parameterise over modes rather than copy tests. Assert meaning, not
representation. Narrow unit tests need no base class.


Expand Down
Loading