elharo commented on code in PR #97:
URL: https://github.com/apache/xerces-j/pull/97#discussion_r4486282456
##########
tests/dom/registry/Test.java:
##########
@@ -39,30 +38,30 @@ public static void main(String argv[])
DOMImplementationRegistry registry = null;
try {
registry = DOMImplementationRegistry.newInstance();
- Assertion.verify(registry != null);
+ assertNotNull("registry should not be null", registry);
Review Comment:
Removed the redundant assertion message in 831022fbe.
##########
tests/dom/registry/Test.java:
##########
@@ -39,30 +38,30 @@ public static void main(String argv[])
DOMImplementationRegistry registry = null;
try {
registry = DOMImplementationRegistry.newInstance();
- Assertion.verify(registry != null);
+ assertNotNull("registry should not be null", registry);
} catch (Exception e) {
- e.printStackTrace();
+ fail("Unexpected exception: " + e.getMessage());
}
try {
DOMImplementation i = registry.getDOMImplementation("XML");
- Assertion.verify(i ==
- CoreDOMImplementationImpl.getDOMImplementation());
+ assertSame(CoreDOMImplementationImpl.getDOMImplementation(),
+ i);
} catch (Exception e) {
- e.printStackTrace();
+ fail("Unexpected exception: " + e.getMessage());
Review Comment:
Removed the try/catch and `fail` calls; `testRegistry()` now declares
`throws Exception` so unexpected exceptions fail the test directly. Fixed in
831022fbe.
##########
tests/dom/registry/Test.java:
##########
@@ -39,30 +38,30 @@ public static void main(String argv[])
DOMImplementationRegistry registry = null;
try {
registry = DOMImplementationRegistry.newInstance();
- Assertion.verify(registry != null);
+ assertNotNull("registry should not be null", registry);
} catch (Exception e) {
- e.printStackTrace();
+ fail("Unexpected exception: " + e.getMessage());
}
try {
DOMImplementation i = registry.getDOMImplementation("XML");
- Assertion.verify(i ==
- CoreDOMImplementationImpl.getDOMImplementation());
+ assertSame(CoreDOMImplementationImpl.getDOMImplementation(),
+ i);
} catch (Exception e) {
- e.printStackTrace();
+ fail("Unexpected exception: " + e.getMessage());
}
try {
DOMImplementation i =
registry.getDOMImplementation("XML MutationEvents");
- Assertion.verify(i ==
- DOMImplementationImpl.getDOMImplementation());
+ assertSame(DOMImplementationImpl.getDOMImplementation(),
+ i);
} catch (Exception e) {
- e.printStackTrace();
+ fail("Unexpected exception: " + e.getMessage());
Review Comment:
Removed the try/catch and `fail` calls; `testRegistry()` now declares
`throws Exception` so unexpected exceptions fail the test directly. Fixed in
831022fbe.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]