Skip to content

Convert dom.serialize.TestNS to JUnit - #107

Open
elharo wants to merge 4 commits into
mainfrom
convert-testns-to-junit
Open

Convert dom.serialize.TestNS to JUnit#107
elharo wants to merge 4 commits into
mainfrom
convert-testns-to-junit

Conversation

@elharo

@elharo elharo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Convert the dom.serialize.TestNS test harness from main()-driven to JUnit 3.

  • Extends TestCase
  • Creates in-memory namespace document and verifies serialization output
  • Registered in batchtest in build.xml

@elharo
elharo force-pushed the convert-testns-to-junit branch from 400a9d9 to 4f728f0 Compare July 7, 2026 22:03
@elharo
elharo requested a review from Copilot July 8, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Converts the legacy dom.serialize.TestNS namespace-serialization harness from a main()-driven utility into an Ant-executed JUnit 3 test case, so it runs as part of the regular test suite.

Changes:

  • Replaced command-line parsing + file-based I/O with an in-memory DOM construction and JUnit 3 TestCase assertions.
  • Added TestNS to the Ant batchtest fileset so it runs in build.xml-driven test runs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/dom/serialize/TestNS.java Rewritten into a JUnit 3 TestCase that builds a DOM, serializes it, and asserts expected namespace-related output.
build.xml Registers dom/serialize/TestNS.class in the JUnit batchtest includes so the new test executes in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/dom/serialize/TestNS.java
Comment thread tests/dom/serialize/TestNS.java
@elharo elharo changed the title [XERCESJ-1796] Convert dom.serialize.TestNS to JUnit 3 Convert dom.serialize.TestNS to JUnit 3 Jul 8, 2026
@elharo
elharo marked this pull request as draft July 8, 2026 15:00
@elharo elharo changed the title Convert dom.serialize.TestNS to JUnit 3 Convert dom.serialize.TestNS to JUnit Jul 8, 2026
@elharo
elharo force-pushed the convert-testns-to-junit branch from 8ef4dc4 to f6b874a Compare July 16, 2026 14:40
…alization test

The assertion checking for 'xx:attr' in serialized output is incorrect.
When xx is already bound to 'foo' via an xmlns:xx declaration on the
same element, an attribute with prefix xx in namespace http://rsa2
creates a prefix collision. The serializer's namespace-fixup algorithm
correctly assigns a new prefix (e.g. NS1:attr). Replace the assertion
with one that checks for the namespace URI instead.
@elharo
elharo requested a review from mrglavas July 16, 2026 15:38
@elharo
elharo marked this pull request as ready for review July 16, 2026 15:38
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