Skip to content

Blog: JUnit 5 tests for Codename One apps#5079

Closed
shai-almog wants to merge 1 commit into
masterfrom
blog-junit-5-for-codename-one
Closed

Blog: JUnit 5 tests for Codename One apps#5079
shai-almog wants to merge 1 commit into
masterfrom
blog-junit-5-for-codename-one

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

  • June 3 follow-up post covering the com.codename1.testing.junit package shipped in PR Add JUnit 5 test support for the JavaSE simulator #5032.
  • Walks through the annotation set (@CodenameOneTest, @RunOnEdt, @SimulatorProperty / @SimulatorProperties, @Theme, @DarkMode, @LargerText, @Orientation, @RTL), the EDT-batched application of visual config, the dependency-scope change (junit-jupiter testprovided so it does not leak onto the simulator runtime classpath), and the "AbstractTest stays for on-device tests" framing.
  • Explains why a simulator-only JUnit path is genuinely useful (full JVM reflection, Mockito / AssertJ / Testcontainers all just work).

File

  • docs/website/content/blog/junit-5-for-codename-one-apps.md — single new file.

Sequencing

Branches off master; intended to publish after the share result callback post (#5078). Front matter date is 2026-06-03.

Test plan

  • Hugo build of docs/website succeeds.
  • Post renders correctly on the blog index and as a standalone page.
  • Header image is generated at /static/blog/junit-5-for-codename-one-apps.jpg.

Covers the new com.codename1.testing.junit package from PR #5032:
standard @test methods against the JavaSE simulator, with annotations
for @RunOnEdt, @SimulatorProperty / @SimulatorProperties, and the
visual-config set (@theme, @DarkMode, @LargerText, @orientation,
@rtl).

Calls out:
- Simulator-only by design so tests get full JVM reflection (Mockito,
  AssertJ, etc.).
- Annotations resolve method-over-class and are applied in a single
  batched setup on the EDT with one theme refresh.
- junit-jupiter moves from test to provided scope so it does not leak
  onto the simulator's runtime classpath for non-opted-in apps.
- AbstractTest / DeviceRunner stays for on-device and screenshot
  tests; the two frameworks are complementary.
@github-actions
Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
Copy link
Copy Markdown
Collaborator Author

Superseded — consolidating the follow-up posts so this release week ships fewer, broader posts. New merged versions in the follow-up PRs to this one.

@shai-almog shai-almog closed this May 29, 2026
@shai-almog shai-almog deleted the blog-junit-5-for-codename-one branch May 29, 2026 08:08
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