Skip to content

Add headless JUnit tests for docking, layout persistence and themes - #34

Merged
sylvestre merged 5 commits into
opencollab:masterfrom
danilovesky:more-junit-tests
Nov 21, 2026
Merged

sylvestre merged 5 commits into
opencollab:masterfrom
danilovesky:more-junit-tests

Conversation

@danilovesky

@danilovesky danilovesky commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

This change adds headless JUnit tests as part of #18, one commit per area:

  • theme configuration and inheritance
  • docking ports and sibling lookup
  • layout export, import and restoration
  • saving and loading perspectives as XML files
  • split proportion on layout import

Three newly discovered bugs are recorded as expected failures, so the tests start failing once a bug is fixed:

@mergify

mergify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

This pull request is merged.

Configurator and PlafManager had no automated coverage, so a wrong
extends or inherits rule only shows as a different titlebar.
ThemeInheritanceTest reads a test flexdock-themes.xml (the user
preferences), not the shipped themes.

A custom theme with missing UIs cannot be created under a look and feel
without a mapping, such as Aqua on macOS. Record this as an expected
failure, using Nimbus to get the same result on every platform.
The SiblingTest and ViewRestorationTest demos check nothing. Cover the
same layouts headless. Split divider proportions are applied later on
the event queue, so only orientation and the XML round trip of the
percentage are asserted.
Layout.apply, Layout and Perspective state and the restoration
handlers were not covered. A frame cannot be created headless, so
PerspectiveManager store, restore and display stay untested: apply a
layout to a new viewport and call the handlers one by one instead.
Only the DockingPath and DockingPortNode serializers were tested. Add
the other serializers and the key to file mapping of
FilePersistenceHandler. A key without a separator is only resolved,
never stored, to keep the home directory untouched.

A group whose bounds were never set cannot be serialized yet. Record
this as an expected failure that starts failing once the bug is fixed.
@danilovesky

Copy link
Copy Markdown
Contributor Author

@sylvestre All your comments are addressed now.
Note that I will update the tests for "known bugs" together with the bug-fixes, so all test will continue to pass.

Workcraft enables constant percent, so pin that a stored proportion
survives an import in that mode.

Without constant percent the proportion is lost and the split comes
back at 0.5. Record this as an expected failure that starts failing
once the bug is fixed, as a reminder to turn it into a plain test.
@sylvestre
sylvestre merged commit 97e672b into opencollab:master Nov 21, 2026
7 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

@danilovesky
danilovesky deleted the more-junit-tests branch November 21, 2026 15:47
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