Skip to content

Convert dom.registry.Test to JUnit#97

Open
elharo wants to merge 2 commits into
mainfrom
convert-registry-to-junit
Open

Convert dom.registry.Test to JUnit#97
elharo wants to merge 2 commits into
mainfrom
convert-registry-to-junit

Conversation

@elharo

@elharo elharo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Convert the dom.registry.Test test harness from a main()-driven to JUnit 3.

  • Extends TestCase
  • Replaces broken Assertion.verify calls with proper JUnit assertions
  • Registered in batchtest and old java task removed in build.xml

@elharo elharo force-pushed the convert-registry-to-junit branch from 72cd8fb to 4f9580e Compare July 7, 2026 22:04
@elharo elharo changed the title [XERCESJ-1796] Convert dom.registry.Test to JUnit 3 Convert dom.registry.Test to JUnit 3 Jul 8, 2026
@elharo elharo force-pushed the convert-registry-to-junit branch from 4f9580e to 6ed62dc Compare July 8, 2026 11:58
@elharo elharo changed the title Convert dom.registry.Test to JUnit 3 Convert dom.registry.Test to JUnit Jul 8, 2026
Comment thread tests/dom/registry/Test.java Outdated
try {
registry = DOMImplementationRegistry.newInstance();
Assertion.verify(registry != null);
assertNotNull("registry should not be null", registry);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The assertion message is redundant. remove it

Comment thread tests/dom/registry/Test.java Outdated

} catch (Exception e) {
e.printStackTrace();
fail("Unexpected exception: " + e.getMessage());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not need to call fail here or catch the exception. Unexpected exceptions fail the test without a catch

Comment thread tests/dom/registry/Test.java Outdated

} catch (Exception e) {
e.printStackTrace();
fail("Unexpected exception: " + e.getMessage());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not need to call fail here or catch the exception. Unexpected exceptions fail the test without a catch

@elharo elharo force-pushed the convert-registry-to-junit branch from 6ed62dc to 2f30fe8 Compare July 8, 2026 18:51
# Conflicts:
#	build.xml
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.

1 participant