Re: [PR] Convert dom.mem.Test to JUnit [xerces-j]
elharo (via GitHub) <[email protected]> Fri, 17 Jul 2026 23:39:02 -0000
| Newsgroups | gmane.text.xml.xerces-j.devel |
|---|---|
| Message-ID | <PR_kwDOLzdO6M7vBPAl-0af0ad47-7a0e-47b4-9f03-a4afee043ab2@gitbox.apache.org> |
elharo commented on code in PR #104:
URL: https://github.com/apache/xerces-j/pull/104#discussion_r3606974966
##########
tests/dom/mem/Test.java:
##########
@@ -1300,36 +1155,35 @@ class MyHandler implements UserDataHandler {
}
public void handle(short operation, String key,
Object data, Node src, Node dst) {
- Assertion.verify(operation == UserDataHandler.NODE_CLONED);
- Assertion.verify(key == fKey && data == fData && src == fNode);
- Assertion.verify(dst != null &&
- dst.getNodeType() == fNode.getNodeType());
+ assertEquals(UserDataHandler.NODE_CLONED, operation);
+ assertTrue(key == fKey && data == fData && src == fNode);
Review Comment:
This should be split into three assertEquals or assertSame checks
##########
tests/dom/mem/Test.java:
##########
@@ -1300,36 +1155,35 @@ class MyHandler implements UserDataHandler {
}
public void handle(short operation, String key,
Object data, Node src, Node dst) {
- Assertion.verify(operation == UserDataHandler.NODE_CLONED);
- Assertion.verify(key == fKey && data == fData && src == fNode);
- Assertion.verify(dst != null &&
- dst.getNodeType() == fNode.getNodeType());
+ assertEquals(UserDataHandler.NODE_CLONED, operation);
+ assertTrue(key == fKey && data == fData && src == fNode);
+ assertTrue(dst != null && dst.getNodeType() == fNode.getNodeType());
Review Comment:
This can be one assertEquals check. null check does not need to be explicit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]