Skip to content

Migrate try-catch-fail patterns to assertThrows in tests#4053

Merged
akurtakov merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:migrate-test-assertthrows
Jun 3, 2026
Merged

Migrate try-catch-fail patterns to assertThrows in tests#4053
akurtakov merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:migrate-test-assertthrows

Conversation

@HeikoKlare
Copy link
Copy Markdown
Contributor

@HeikoKlare HeikoKlare commented Jun 2, 2026

Replace legacy try { ...; fail(...); } catch (XException e) {} patterns with JUnit 5 assertThrows().

Also fixes a latent test bug in TextStoreTest and LineTrackerTest3: offsets[offsets.length] always threw ArrayIndexOutOfBoundsException before getLineInformationOfOffset was called; replaced with a properly computed out-of-bounds offset.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Test Results

   861 files  ±0     861 suites  ±0   53m 21s ⏱️ - 3m 24s
 8 034 tests +1   7 791 ✅ +1  243 💤 ±0  0 ❌ ±0 
20 541 runs  +3  19 886 ✅ +3  655 💤 ±0  0 ❌ ±0 

Results for commit 7bcc033. ± Comparison against base commit 6481ecf.

♻️ This comment has been updated with latest results.

Replace legacy try { ...; fail(...); } catch (XException e) {}
patterns with JUnit 5 assertThrows().

Also fix a latent test bug: offsets[offsets.length] always threw
ArrayIndexOutOfBoundsException before getLineInformationOfOffset
was called; replaced with a properly computed out-of-bounds offset.
@HeikoKlare HeikoKlare force-pushed the migrate-test-assertthrows branch from cc80f33 to 7bcc033 Compare June 2, 2026 15:32
@HeikoKlare HeikoKlare marked this pull request as ready for review June 2, 2026 16:17
@akurtakov akurtakov merged commit 2c05fab into eclipse-platform:master Jun 3, 2026
18 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