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


##########
tests/dom/registry/Test.java:
##########
@@ -23,46 +23,25 @@
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.bootstrap.DOMImplementationRegistry;
 
-import dom.util.Assertion;
+import junit.framework.TestCase;
 
-public class Test {
+public class Test extends TestCase {
 
-    public static void main(String argv[])
-    {                                  
-        
+    public void testRegistry() throws Exception
+    {
         System.out.println("Running dom.registry.Test...");

Review Comment:
   remove this println call



##########
tests/dom/registry/Test.java:
##########
@@ -23,46 +23,25 @@
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.bootstrap.DOMImplementationRegistry;
 
-import dom.util.Assertion;
+import junit.framework.TestCase;
 
-public class Test {
+public class Test extends TestCase {
 
-    public static void main(String argv[])
-    {                                  
-        
+    public void testRegistry() throws Exception
+    {
         System.out.println("Running dom.registry.Test...");
         // set DOMImplementationSource
         System.setProperty(DOMImplementationRegistry.PROPERTY,
                           "org.apache.xerces.dom.DOMImplementationSourceImpl" +
                           " 
org.apache.xerces.dom.DOMXSImplementationSourceImpl");
 
-        DOMImplementationRegistry registry = null;
-        try {
-            registry = DOMImplementationRegistry.newInstance();
-            Assertion.verify(registry != null);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        DOMImplementationRegistry registry = 
DOMImplementationRegistry.newInstance();
+        assertNotNull(registry);
 
-        try {
-            DOMImplementation i = registry.getDOMImplementation("XML");
+        DOMImplementation implementation = 
registry.getDOMImplementation("XML");
+        assertSame(CoreDOMImplementationImpl.getDOMImplementation(), 
implementation);
 
-            Assertion.verify(i ==
-                             CoreDOMImplementationImpl.getDOMImplementation());
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        try {
-            DOMImplementation i =
-                registry.getDOMImplementation("XML MutationEvents");
-
-            Assertion.verify(i ==
-                             DOMImplementationImpl.getDOMImplementation());
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        implementation = registry.getDOMImplementation("XML MutationEvents");

Review Comment:
   this is two different tests that should be in different methods, one per 
implementation



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