Skip to content

Fix tests portability for Windows#2472

Merged
kthoms merged 2 commits into
mainfrom
fix/tests-portability-windows-jdk25
Mar 1, 2026
Merged

Fix tests portability for Windows#2472
kthoms merged 2 commits into
mainfrom
fix/tests-portability-windows-jdk25

Conversation

@hauptmedia

Copy link
Copy Markdown
Collaborator

Summary

This PR improves test portability across environments, especially Windows.

Problem

On Windows 11, tests failed due to platform-dependent formatting:

  • XML assertions depended on exact pretty-print indentation/newlines
  • stack trace assertion in ExceptionUtilTest used hard-coded \n

Changes

  • Updated XML DOM tests in spin/dataformat-xml-dom to use XMLUnit structural comparison:
    • and(expected).ignoreWhitespace().areIdentical()
  • Updated engine/.../ExceptionUtilTest to build expected stack traces with
    System.lineSeparator() instead of hard-coded line breaks.

Why This Helps

  • Removes false negatives caused by OS/JDK-specific formatting differences
  • Keeps strict semantic checks for XML structure/content
  • Keeps strict full-string stack trace assertion, now platform-safe

Environment (where failures were observed)

  • OS: Windows 11 (10.0, amd64)
  • Java: OpenJDK 25.0.2 (Eclipse Temurin)
  • Runtime: temurin-25.0.2
  • Maven: 3.9.9

Julian Haupt added 2 commits February 28, 2026 15:55
- builds expected stack trace with System.lineSeparator
- removes hard-coded "\n" that fails on Windows
- replace string-equality XML checks
- ignore insignificant whitespace in comparisons
@hauptmedia hauptmedia requested a review from kthoms February 28, 2026 15:00
@sonarqubecloud

Copy link
Copy Markdown

@kthoms kthoms 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.

LGTM

I also heard from a user that there were problems on Windows with ExceptionUtilTest. Good that this is fixed.

@kthoms kthoms added the scope:tests Changes affecting only test code label Mar 1, 2026
@kthoms kthoms added this to the 2.0.0-M4 milestone Mar 1, 2026
@kthoms kthoms merged commit 79794cd into main Mar 1, 2026
21 checks passed
@kthoms kthoms deleted the fix/tests-portability-windows-jdk25 branch March 1, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:tests Changes affecting only test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants