harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r589774 - /harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
Date Mon, 29 Oct 2007 17:57:36 GMT
Author: odeakin
Date: Mon Oct 29 10:57:33 2007
New Revision: 589774

URL: http://svn.apache.org/viewvc?rev=589774&view=rev
Log:
Let JUnit deal with unexpected Exceptions rather than catching them ourselves - sql module.

Modified:
    harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java?rev=589774&r1=589773&r2=589774&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
Mon Oct 29 10:57:33 2007
@@ -79,7 +79,7 @@
      * 
      * @throws SQLException
      */
-    public void testDeregisterDriver() throws SQLException {
+    public void testDeregisterDriver() throws Exception {
         // First get one of the drivers loaded by the test
         Driver aDriver;
         aDriver = DriverManager.getDriver(baseURL4);
@@ -103,24 +103,17 @@
         // TODO - need to load a driver with a different classloader!!
         aDriver = DriverManager.getDriver(baseURL1);
 
-        try {
-            Class<?> driverClass = Class
-                    .forName(
-                            "org.apache.harmony.sql.tests.java.sql.TestHelper_DriverManager",
-                            true, testClassLoader);
-
-            // Give the Helper class one of our drivers....
-            Class<?>[] methodClasses = { Class.forName("java.sql.Driver") };
-            Method theMethod = driverClass.getDeclaredMethod("setDriver",
-                    methodClasses);
-            Object[] args = { aDriver };
-            theMethod.invoke(null, args);
-        } catch (Exception e) {
-            System.out
-                    .println("testDeregisterDriver: Got exception allocating TestHelper");
-            e.printStackTrace();
-            return;
-        } // end try
+        Class<?> driverClass = Class
+                .forName(
+                        "org.apache.harmony.sql.tests.java.sql.TestHelper_DriverManager",
+                        true, testClassLoader);
+
+        // Give the Helper class one of our drivers....
+        Class<?>[] methodClasses = { Class.forName("java.sql.Driver") };
+        Method theMethod = driverClass.getDeclaredMethod("setDriver",
+                methodClasses);
+        Object[] args = { aDriver };
+        theMethod.invoke(null, args);
 
         // Check that the driver was not deregistered
         assertTrue(



Mime
View raw message