test: restore 5 silently-dropped tests; remove dead JUnit 4 infra#1324
Merged
joaodinissf merged 2 commits intoMay 6, 2026
Merged
Conversation
This was referenced Apr 30, 2026
This was referenced May 5, 2026
3c9c270 to
6088f97
Compare
rubenporras
approved these changes
May 6, 2026
The Oct 2025 JUnit 5 migration silently dropped 5 test classes from their suites (50 @test methods total): CheckCoreTestSuite was missing: CheckValidationTest (30 @test) CheckJavaValidatorUtilTest (13 @test) CheckApiAccessValidationsTest (3 @test) ExportTestSuite was missing: ExportValidationOkTest (1 @test) GeneratorTestSuite was missing: XbaseGeneratorFragmentTest (3 @test) The CheckCoreTestSuite drops trace to a single mistake in d5328e1: the migration also changed `public class CheckJavaValidatorUtilTest extends TestCase` -> `class CheckJavaValidatorUtilTest`, making the class package-private. That broke the cross-package import in the suite, and rather than restore visibility the import was deleted -- silently dropping the other two CheckCoreTestSuite tests as collateral. ExportValidationOkTest was added to xtext.export.test in d08ea19 but never included in any suite at any point. XbaseGeneratorFragmentTest was orphaned much earlier (Feb 2022, by 45aed05 + e59c902) during a legacy-generator cleanup. Restoring it now requires updating its mocks to track Xtext API drift: XbaseUsageDetector now navigates `rule.eResource().getResourceSet().getEObject(URI, true)` and compares via EcoreUtil2.isAssignableFrom (was a package-name comparison). The mock setup is updated so the resource-set lookup yields a shared mock EClass that matching rules also return -- reference equality preserves the original test intent. Discovered by computing @SelectClasses transitive closure from AllTests and diffing against all classes containing @test methods. Verified locally: 307 -> 357 tests run (+50), 0 new errors or failures. The 5 restored classes appear in surefire reports for the first time since the migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Oct 2025 JUnit 5 migration left two parallel test-infrastructure
trees in place: the old JUnit 4 base classes / runners / filters in
the original packages, and the new Jupiter-based equivalents in
.../jupiter/ subpackages. Test classes have been migrated to the
jupiter versions for some time (every external import resolves to a
jupiter package), so the old tree is unreachable from any live test.
Delete the dead tree in one cohesive cut. One file (ValidationHelper)
is migrated rather than deleted because jupiter/AbstractXtextTestUtil
still uses it -- its dependency on
AbstractValidationTest.assertNoErrorsOnResource is inlined and
switched to org.junit.jupiter.api.Assertions.fail.
Removed - JUnit 4 runner/filter subsystem (test.core/junit/runners/):
ClassRunner, DiscerningSuite, DynamicSuite, FilterRegistry,
NegatedFilter, SorterUtil
+ 14 *MethodFilter / *ClassFilter / *Filter classes:
DebugClassFilter, DebugMethodFilter, FixedIssueFilter,
FlakyMethodFilter, IntegrationTestMethodFilter,
ModuleTestMethodFilter, NameMethodFilter,
PerformanceTestMethodFilter, SwtBotClassFilter,
SystemTestMethodFilter, TestLabelFilter (junit/runners/
duplicate), UnitTestMethodFilter, UnresolvedBugMethodFilter,
UnresolvedIssueFilter
Removed - recording-runner support (test.ui, xtext.test.core):
SwtBotRecordingTestRunner, TestRunRecording,
SwtBotRecordingXtextTestRunner, XtextClassRunner
Removed - non-jupiter rules / helpers in test.core (rule logic now
lives in test.core.jupiter equivalents):
AbstractSystemTest, BugTestAwareRule, IssueAwareRule, LoggingRule,
StatementFactory, TestLabelFilter, TestPlan
Removed - non-jupiter base test classes in xtext.test.core (replaced
by .../xtext/test/jupiter/ siblings):
AbstractTest, AbstractXtextTest, AbstractXtextTestUtil,
AbstractXtextMarkerBasedTest, AbstractFormattingTest,
AbstractGeneratorTest, AbstractAcfContentAssistTest,
AbstractScopingTest, AbstractValidationTest, AbstractLinkingTest,
AbstractValueConverterServiceTest, AbstractModelInferrerTest,
AbstractJvmModelInferrerTest, AbstractResourceDescriptionManagerTest
Removed - duplicated/dead test classes in xtext.test:
AbstractFormatterTest, FormatterTest (orphaned non-jupiter
duplicate; live twin xtext.jupiter.formatter.FormatterTest is in
XtextTestSuite), FormatterTestUtil
Migrated - ValidationHelper: imports
org.junit.jupiter.api.Assertions.fail; assertNoSyntaxOrLinkingErrors
inlines the resource-error check that previously delegated to the
deleted AbstractValidationTest.assertNoErrorsOnResource.
Verified locally: 357 tests run (unchanged from the restore commit),
0 errors.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6088f97 to
ecbd49a
Compare
Collaborator
Author
|
@rubenporras I just checked and there's quite a bit of blast radius in the downstream projects, we should probably finish the clean-up there before merging this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Step 2 of the staged JUnit cleanup. Stacks on #1323 — review/merge that first; this PR's diff shows step-1's commits at the bottom until #1323 lands.
Two related changes uncovered while restoring test discovery in #1323:
Restored tests (commit 1)
CheckCoreTestSuite:CheckValidationTest(30),CheckJavaValidatorUtilTest(13),CheckApiAccessValidationsTest(3) — all dropped when the migration silently downgradedCheckJavaValidatorUtilTestto package-private.ExportTestSuite:ExportValidationOkTest(1) — never in any suite since creation.GeneratorTestSuite:XbaseGeneratorFragmentTest(3) — orphaned in Feb 2022; restored with mock chain rewrite to track Xtext API drift inXbaseUsageDetector.Discovered by computing
@SelectClassestransitive closure fromAllTestsand diffing against all classes containing@Testmethods.Deletions (commit 2)
49 files / ~9.9k lines: JUnit 4 runner+filter subsystem (
test.core/junit/runners/), recording-runner support, non-jupiter rules/helpers, non-jupiter base test classes (AbstractTest,AbstractXtextTest, etc.), and the orphanedFormatterTestduplicate. All dead — every external import resolved to the.../jupiter/siblings before this PR.ValidationHelperis migrated rather than deleted (still used byjupiter/AbstractXtextTestUtil); its dependency onAbstractValidationTest.assertNoErrorsOnResourceis inlined and switched toorg.junit.jupiter.api.Assertions.fail.Verification
Local
mvn verify(macOS aarch64): 357 tests, 0 errors.Step 2 of 4
Step 2 follow-up (#1325) migrates remaining
Assert→Assertionscalls in helpers. Step 3 (#1326) dropsorg.junit 4.13.2and vintage-engine from the target. Step 4 (#1327) atomically upgrades to JUnit 6 + Eclipse 4.39.🤖 Generated with Claude Code