Skip to content

Fix/test file pairing conventions - #4

Merged
HeliosHawk merged 2 commits into
masterfrom
fix/test-file-pairing-conventions
Nov 18, 2026
Merged

HeliosHawk merged 2 commits into
masterfrom
fix/test-file-pairing-conventions

Conversation

@HeliosHawk

Copy link
Copy Markdown
Collaborator

What this changes

Test files are now paired with their production file by trying the common naming
conventions, instead of removing the first four characters of the filename.
ExampleTest.java, ExampleTests.java, ExampleTestCase.java and
ExampleIT.java now pair correctly alongside the original testExample.java.

An unmatched test file is skipped and reported rather than throwing a
NullPointerException that aborted the whole run — previously one oddly named file
meant a project of any size analyzed nothing.

Also fixes an operator precedence bug in test-file collection, where && bound
tighter than || so the duplicate check only applied to one branch.

Also corrects documentation that attributed the pairing convention to the engine;
it is plugin code. Removes a stale limitation stating detection runs on the UI
thread, which was fixed in #73.

Testing

Eclipse 2026-09, on a project covering every supported convention plus one
deliberately unmatched file:

CalculatorTest.java  -> Calculator.java   (the reported failure)
InventoryIT.java     -> Inventory.java
OrderTests.java      -> Order.java
testLegacy.java      -> Legacy.java       (original convention, regression)
OrphanTest.java      -> skipped

Result: Analyzed 4 test file(s), with one dialog naming only OrphanTest.java.
The run completed instead of aborting on the unmatched file.

Regression: SmellFixture still reports 20 smells.

@HeliosHawk
HeliosHawk merged commit ef0e3a9 into master Nov 18, 2026
1 check passed
@HeliosHawk
HeliosHawk deleted the fix/test-file-pairing-conventions branch November 18, 2026 14:35
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

Successfully merging this pull request may close these issues.

1 participant