harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r569297 - /harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java
Date Fri, 24 Aug 2007 08:42:57 GMT
Author: tonywu
Date: Fri Aug 24 01:42:56 2007
New Revision: 569297

URL: http://svn.apache.org/viewvc?rev=569297&view=rev
Log:
Fix a bug in DriverManagerTest, which depends on the time that DriverManager was first initialized.
Comment out a test which depends on jdbc provider.

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=569297&r1=569296&r2=569297&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
Fri Aug 24 01:42:56 2007
@@ -54,7 +54,7 @@
 
     static final String INVALIDDRIVER1 = "abc.klm.Foo";
 
-    static String[] driverNames = { DRIVER1, DRIVER2 };
+    static String[] driverNames = { DRIVER1, DRIVER2, DRIVER4, DRIVER5 };
 
     static int numberLoaded;
 
@@ -303,16 +303,18 @@
             Driver validDriver = DriverManager.getDriver(element);
             assertNotNull(validDriver);
         } // end for
-
-        for (String element : invalidURLs) {
-            try {
-                DriverManager.getDriver(element);
-                fail("Should throw SQLException");
-            } catch (SQLException e) {
-                assertEquals("08001", e.getSQLState());
-                assertEquals(exceptionMsg1, e.getMessage());
-            } // end try
-        } // end for
+        
+//      Comment out since it depends on the drivers providered
+//        for (String element : invalidURLs) {
+//            System.out.println(element);
+//            try {
+//                DriverManager.getDriver(element);
+//                fail("Should throw SQLException");
+//            } catch (SQLException e) {
+//                assertEquals("08001", e.getSQLState());
+//                assertEquals(exceptionMsg1, e.getMessage());
+//            } // end try
+//        } // end for
 
     } // end method testGetDriver()
 
@@ -327,8 +329,9 @@
         } // end while
 
         // Check that all the drivers are in the list...
-        assertEquals("testGetDrivers: Don't see all the loaded drivers - ", i,
-                numberLoaded);
+        // There might be other drivers loaded in other classes
+        assertTrue("testGetDrivers: Don't see all the loaded drivers - ",
+                i >= numberLoaded);
     } // end method testGetDrivers()
 
     static int timeout1 = 25;
@@ -518,10 +521,6 @@
          * ClassLoader.
          */
         int numberLoaded = 0;
-        String theSystemDrivers = DRIVER4 + ":" + DRIVER5 + ":"
-                + INVALIDDRIVER1;
-        System.setProperty(JDBC_PROPERTY, theSystemDrivers);
-        numberLoaded += 2;
 
         for (String element : driverNames) {
             try {



Mime
View raw message