Skip to content

Cover remaining gaps and stop excluding tested classes from JaCoCo - #22

Merged
lpenap merged 1 commit into
masterfrom
lpenap/coverage-phase-1
Sep 16, 2026
Merged

lpenap merged 1 commit into
masterfrom
lpenap/coverage-phase-1

Conversation

@lpenap

@lpenap lpenap commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

First PR of the coverage plan (phases 1 and 2).

New tests

  • FactoryTests: unknown product type throws IllegalArgumentException
  • ChainTests: request nobody handles returns "unhandled"; last handler without a next returns "unhandled"
  • GuiAppenderTests: afterPropertiesSet attaches the appender to the root logger and starts it (detached in cleanup)
  • ProducerTests: producer stops when interrupted

Code fix

  • Producer restores the interrupt flag and returns on InterruptedException instead of swallowing it and continuing the loop

JaCoCo excludes removed (classes already fully covered by existing tests)

  • **/*ExampleRunner* (the nine pattern runners; ProducerConsumerExampleRunner stays excluded until phase 3)
  • **/Messages*, **/ApplicationProperties*

Coverage

Instructions Branches
Before 321 / 342 = 93.9% 12 / 15 = 80%
After 673 / 673 = 100% 17 / 17 = 100%

Merging will trigger a badge regeneration PR from the maven build workflow.

Next

Phase 3: make ExamplesCommandLineRunner, Consumer/ProducerConsumerExampleRunner, ObservableAbstract and HyperlinkMouseListener testable and drop their excludes. Phase 4: raise the JaCoCo thresholds.

🤖 Generated with Claude Code

Add tests for the unknown product type in ProductFactory, the
"unhandled" end of the handler chain, GuiAppender attaching itself to
the root logger, and Producer stopping when interrupted. Producer now
restores the interrupt flag and returns instead of swallowing the
interruption.

Remove the JaCoCo excludes for the pattern ExampleRunner classes and
the two properties classes, which already have full test coverage.
Reported scope grows from 342 to 673 instructions at 100% instruction
and branch coverage.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@lpenap
lpenap merged commit d7f3f5f into master Sep 16, 2026
3 checks passed
@lpenap
lpenap deleted the lpenap/coverage-phase-1 branch September 16, 2026 18:55
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