Skip to content

Integrate JUnit migration hardening from #1467 and #1468 - #1474

Merged
carstenartur merged 154 commits into
mainfrom
integration/junit-migration-hardening
Aug 14, 2026
Merged

Integrate JUnit migration hardening from #1467 and #1468#1474
carstenartur merged 154 commits into
mainfrom
integration/junit-migration-hardening

Conversation

@carstenartur

@carstenartur carstenartur commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Purpose

Integrate the coherent JUnit migration hardening developed in #1468 and #1467 without decomposing the working multi-file semantics into artificial micro-slices.

Integration strategy

Additional stabilization

  • suppress the expected Equinox launcher error dialog without changing the cleanup exit-code contract;
  • preserve each source file's original uniform line delimiter after project-wide cleanup;
  • perform delimiter restoration through strict charset decoding/encoding and preserve UTF-8/UTF-16 byte-order marks, avoiding raw-byte corruption;
  • add focused UTF-8, UTF-16LE and UTF-16BE regression tests.

Deliberately deferred follow-ups

Merge policy

The PR is ready for an early squash merge once the repository's required Maven verification succeeds and GitHub reports it mergeable. Additional non-required evidence workflows may continue independently; they are not a reason to grow this PR further.

Refs #1367
Refs #1437
Supersedes the integration work from #1467 and #1468.

carstenartur and others added 30 commits August 13, 2026 04:41
Copilot AI lite review requested due to automatic review settings August 14, 2026 07:29
@carstenartur
carstenartur enabled auto-merge (squash) August 14, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Integrates prior JUnit migration hardening work into a single coherent state, adding an explicit “best-effort” execution policy (with diagnostics + TODO scaffolds), tightening multi-file planning determinism, and introducing pinned upstream JDT UI QA workflows and evidence verification.

Changes:

  • Add explicit Best-effort execution mode for JUnit migration (UI option, default off, preset-safe) with structured diagnostics + generated TODO scaffolds for unresolved gaps.
  • Strengthen multi-file JUnit planning/application and add pinned upstream JDT UI corpus QA automation (contracts, verifiers, workflows, evidence artifacts).
  • Add infrastructure hardening (encoded line delimiter preservation, headless cleanup application display ownership, additional diagnostics provider API).

Reviewed changes

Copilot reviewed 83 out of 93 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sandbox_usage_view_test/src/org/sandbox/jdt/ui/helper/views/JUnitBestEffortCleanupDialogSWTBotTest.java New SWTBot test asserting the best-effort option is visible and default-disabled in the real UI dialog.
sandbox_oomph/jdt-migration-qa.setup New Oomph project setup to provision pinned Eclipse/JDT sources for migration QA.
sandbox_oomph/jdt-migration-qa.configuration.setup New Oomph configuration (installation/workspace) for reproducible upstream migration QA.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/preferences/cleanup/SaveActionCleanUpOptionsInitializer.java Removes save-action defaults initializer (stop exposing migration as Save Action).
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/preferences/cleanup/SandboxCodeTabPage.java Adds best-effort checkbox and wires it into JUnit preset/option mapping.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/preferences/cleanup/DefaultCleanUpOptionsInitializer.java Sets default for best-effort option to false.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/preferences/cleanup/CleanUpMessages.properties Adds localized label for best-effort option and updates preset label text.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/preferences/cleanup/CleanUpMessages.java Adds NLS field for best-effort label.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/fix/ReportingJUnitCleanUpCore.java New cleanup core wrapper that retains planning diagnostics JSON per project.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/fix/JUnitCleanUpCore.java Adds best-effort gap analysis, strict atomicity gating, TODO scaffolds, and import cleanup support.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/fix/JUnitCleanUp.java Switches wrapper to reporting core and exposes diagnostics provider API.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/multifile/JUnitMultiFilePlanner.java Refines ExternalResource planning to avoid empty no-op subclass rewrites.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/JUnitMigrationOptions.java New option key holder for migration execution policy (best-effort).
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/JUnit4MigrationPresets.java Makes “all supported” preset explicitly strict and ensures best-effort is never enabled by presets.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/SuiteMethodJUnitPlugin.java Extends JUnit 3 suite migration to handle legacy suite initializers via @BeforeSuite.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/RunWithMigrationEligibility.java New shared fail-closed runner eligibility assessment for strict/best-effort analysis.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/RuleTestnameJUnitPlugin.java Tightens TestName migration to binding-proven semantics and exact method-name mapping.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/RuleImportCleanupSupport.java New coordinator to safely remove shared org.junit.Rule import when all @Rule fields are migrated.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/ParameterizedTestJUnitPlugin.java Uses shared Parameterized eligibility contract and resolves parent type via ASTNodes.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/ParameterizedMigrationEligibility.java Broadens eligibility to accept explicit RunWith(value=...) syntax and improves diagnostics.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/lib/JUnit3LegacyShape.java New helper for fail-closed recognition/removal of redundant JUnit 3 legacy members.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/helper/lib/ExternalResourceRefactorer.java Refines ExternalResource hierarchy adaptation and callback interface decisions.
sandbox_junit_cleanup/src/org/sandbox/jdt/internal/corext/fix/ClosedParameterizedTestJUnitPlugin.java Expands patterns to match both @RunWith syntaxes.
sandbox_junit_cleanup/plugin.xml Removes Save Action registration and initializer; keeps explicit cleanup configuration only.
sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/ui/preferences/cleanup/JUnitSaveActionRegistrationTest.java New regression test ensuring migration isn’t registered as a save action.
sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/multifile/ParameterizedMigrationDiagnosticsTest.java Updates diagnostic expectations for explicit @RunWith(value=...) acceptance.
sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/multifile/JUnitBestEffortSupportTest.java New tests for best-effort gap analysis JSON + remediation contracts.
sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/multifile/JUnitBestEffortMigrationCleanUpTest.java New end-to-end tests: strict quarantines whole CU; best-effort applies partial + TODO scaffold.
sandbox_junit_cleanup_test/src/org/sandbox/jdt/internal/corext/fix/JUnit4MigrationPresetsTest.java Updates preset expectations to ensure strict “all supported” and best-effort forced off.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/RuleCleanupPrecedenceTest.java Adjusts expected output to preserve migrated field visibility.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/ParameterizedMigrationContractTest.java Updates contract to expect explicit @RunWith(value=...) migration.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MultiFileExternalResourceNoOpSubclassTest.java New regression coverage: leave callback-free subclass unchanged while migrating base + usage.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MultiFileExternalResourceMigrationTest.java Updates expected callback signatures (throws Exception) for ExternalResource migration.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MultiFileExternalResourceLifecycleTest.java Updates expected callback signatures (throws Exception) for lifecycle cases.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationRulesToExtensionsTest.java Updates expected TestName/TempDir visibility and semantics, plus temp-path behaviors.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationJUnit3Test.java Adds explicit JUnit 5 method order preservation expectations.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationJUnit3RealWorldShapesTest.java New tests derived from pinned JDT Core shapes (constructors/suites/initializers).
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationExceptionsTest.java Adjusts expected message assertions to preserve substring semantics.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/MigrationCombinationsTest.java Updates combined rule migration expectations (visibility + TestInfo semantics).
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/JUnitMigrationCleanUpTest.java Updates expected ExternalResource callbacks to throws Exception.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/JUnitCleanupCases.java Updates fixture callback signatures and removes invalid super calls.
sandbox_junit_cleanup_test/src/org/eclipse/jdt/ui/tests/quickfix/Java8/JUnit3CleanupCases.java Updates ordering expectations for JUnit 3 → Jupiter migration.
sandbox_junit_cleanup_help/toc.xml Adds Help TOC entry for best-effort documentation page.
sandbox_junit_cleanup_help/html/usage.html Expands usage guidance for strict vs best-effort workflows and screenshot QA.
sandbox_junit_cleanup_help/html/reference.html Documents strict/best-effort safety model, evidence outputs, and limitations.
sandbox_junit_cleanup_help/html/index.html Adds overview of strict vs best-effort modes and updates screenshot alt text.
sandbox_junit_cleanup_help/html/best-effort.html New Help page documenting markers, diagnostics, and manual completion workflow.
sandbox_int_to_enum/src/org/sandbox/jdt/internal/corext/fix/helper/IntToEnumHelper.java Refines stale/missing-binding recovery logic for invocation matching.
sandbox_common_core/src/test/java/org/sandbox/jdt/cleanup/io/EncodedLineDelimiterPreserverTest.java New tests for delimiter + BOM preservation across encodings.
sandbox_common_core/src/main/java/org/sandbox/jdt/cleanup/multifile/api/IMultiFileCleanUpDiagnosticsProvider.java New optional API to expose last planning diagnostics JSON for multi-file cleanups.
sandbox_common_core/src/main/java/org/sandbox/jdt/cleanup/io/EncodedLineDelimiterPreserver.java New utility to preserve original delimiter/BOM while keeping encoding stable.
sandbox_common_core/META-INF/MANIFEST.MF Exports new cleanup.io package.
sandbox_cleanup_application/src/org/sandbox/jdt/core/cleanupapp/HeadlessProjectWideCodeCleanupApplication.java New headless wrapper owning SWT Display lifecycle to avoid cross-thread disposal deadlocks.
sandbox_cleanup_application/plugin.xml Registers new headless application entry point.
sandbox_cleanup_application/META-INF/MANIFEST.MF Adds dependency on sandbox_common_core for shared utilities/APIs.
qa/upstream-jdt/verify_jdt_ui_corpus.py New verifier ensuring strict/best-effort evidence matches contract and changed-file inventories.
qa/upstream-jdt/verify_jdt_ui_contract.py New contract self-test/validator (pins, profiles, runner markers, verifier self-tests).
qa/upstream-jdt/verify_corpus_result.py Adds/updates corpus result verification for named real-corpus JDT sources.
qa/upstream-jdt/README.md Documents reproducible upstream JDT QA setup and evidence expectations.
qa/upstream-jdt/pins.env Adds pinned upstream reproducibility contract (repos/refs/commits).
qa/upstream-jdt/overlays/jdt-core-r4_40-jupiter.patch Adds Jupiter API imports overlay for pinned upstream builds.
qa/upstream-jdt/junit4-to-jupiter.properties Adds strict profile for pinned JDT UI JUnit 4 migration QA.
qa/upstream-jdt/junit4-to-jupiter-best-effort.properties Adds best-effort profile for pinned JDT UI QA with scaffolding/diagnostics.
qa/upstream-jdt/junit3-to-jupiter.properties Adds JUnit 3 strict profile for pinned JDT Core QA.
qa/upstream-jdt/jdt-ui-junit4-corpus.json Adds pinned JDT UI corpus contract with strict quarantine + best-effort marker requirements.
qa/upstream-jdt/expected-test-mapping.json Adds baseline test identity mapping contract (currently empty).
qa/upstream-jdt/expected-corpus.json Adds JDT Core named corpus requirements for migration verification.
qa/upstream-jdt/compare_test_inventory.py Adds baseline vs migrated JUnit XML inventory comparison tool.
.github/workflows/jdt-ui-junit4-strict-qa.yml New CI workflow running pinned JDT UI strict before/after QA + whitespace regression checks.
.github/workflows/eclipse-help-screenshots.yml Removes write permissions and auto-commit behavior; keeps reproducibility verification.
Suppressed comments (1)

sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/preferences/cleanup/CleanUpMessages.properties:16

  • Line contains trailing whitespace (# ). This can trigger whitespace checks (e.g., git diff --check) and should be replaced with a plain comment marker.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sandbox_junit_cleanup/src/org/sandbox/jdt/internal/ui/fix/JUnitCleanUp.java Outdated
Preserve the real cleanup preview and Help infrastructure already merged on main while retaining the JUnit migration implementation and its dedicated QA. Resolve unrelated screenshot baselines in favor of main.
@carstenartur
carstenartur merged commit 5fb82da into main Aug 14, 2026
18 of 20 checks passed
@carstenartur
carstenartur deleted the integration/junit-migration-hardening branch August 14, 2026 19:00
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.

3 participants