Skip to content

Raise test coverage to 93% and add Claude Code project context - #105

Merged
comtel2000 merged 4 commits into
devfrom
test/improve-coverage
Nov 18, 2026
Merged

comtel2000 merged 4 commits into
devfrom
test/improve-coverage

Conversation

@comtel2000

Copy link
Copy Markdown
Owner

Requested by sunny · project thread

Raise test coverage to 93% and add Claude Code project context

Line coverage of fx-onscreen-keyboard goes from 11.2% (152/1356) to 93.0% (1263/1358), branch coverage 85.8%. 112 tests (was 4), all passing on JDK 21 under Xvfb.

Changes

  • New tests for KeyboardPane, KeyboardRegion (XML layout parser, all embedded layouts), KeyButtonEventHandler (every special key), the key buttons and timelines, MultiKeyPopup, KeyBoardPopup and its builders, FXRobotHandler (real key events into a focused TextField), FXOK and more XmlHelper cases.

  • FxTestSupport: starts the JavaFX toolkit once, disables implicit exit, and skips FX tests when no display is available instead of hanging until the timeout (the old KeyButtonTest behaviour). KeyButtonTest now uses it, and its @DisabledOnJre(JAVA_25) is removed.

  • Bug fix: an empty keyLabelStyle or keyIconStyle attribute threw StringIndexOutOfBoundsException and silently aborted parsing the rest of the layout. Empty values are now ignored (covered by KeyboardRegionTest.emptyStyleAttributesAreIgnored).

  • JaCoCo 0.8.14 report bound to the test phase (target/site/jacoco).

  • CI: runs mvn test under xvfb-run, uploads surefire reports from all modules (the old path pointed at the root target/ and was always empty), and uploads the coverage report from the JDK 17 job.

  • Claude Code project context: AGENTS.md, CLAUDE.md, and .claude/ agents (maven-command-runner), docs (running tests, test guidelines, Java conventions, keyboard layouts, documentation) and the add-keyboard-layout skill. The test docs describe the new FxTestSupport, xvfb-run and the JaCoCo report.

Not covered

  • fx-onscreen-keyboard-swing still has no tests.
  • KeyboardTextFieldSkin/KeyboardTextAreaSkin and the jar branch of KeyboardLocales.

Note

JDK 25 could not be tested locally. It used to be disabled because of the Monocle setup; with Xvfb it should not need Monocle, but please watch the JDK 25 CI job.


Generated by Claude Code

claude and others added 4 commits November 18, 2026 21:06
- Add tests for KeyboardPane, KeyboardRegion (layout parser),
  KeyButtonEventHandler, key buttons, timelines, MultiKeyPopup,
  KeyBoardPopup and its builders, FXRobotHandler and FXOK
- Add FxTestSupport: starts the JavaFX toolkit once and skips FX tests
  when no display is available instead of hanging until timeout
- Fix crash on empty keyLabelStyle/keyIconStyle attributes, which
  aborted parsing of the rest of the layout
- Add JaCoCo coverage report (target/site/jacoco)
- CI: run tests under xvfb, upload surefire reports from all modules
  and the coverage report

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GVKTE7YjM5Y9LLQ8NcRuzC
…skills)

Mirrors the eclipse-milo .claude layout: CLAUDE.md imports AGENTS.md, a
maven-command-runner agent, focused docs for tests, conventions, docs and
keyboard layouts, plus an add-keyboard-layout skill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GVKTE7jdB7EUYDA7qUT95U
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GVKTE7YjM5Y9LLQ8NcRuzC
On CI the text field bounds include the 1.4px focus ring while the popup
lands on the whole pixel, so compare with a 2px tolerance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GVKTE7YjM5Y9LLQ8NcRuzC
@comtel2000
comtel2000 merged commit 349676e into dev Nov 18, 2026
7 checks passed
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.

2 participants