elharo commented on code in PR #97:
URL: https://github.com/apache/xerces-j/pull/97#discussion_r3546491624


##########
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:
   The assertion message is redundant. remove it



##########
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:
   not need to call fail here or catch the exception. Unexpected exceptions 
fail the test without a catch



##########
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:
   not need to call fail here or catch the exception. Unexpected exceptions 
fail the test without a catch



-- 
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]

Reply via email to