]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-1033: Fixed 'No suitable driver' error in IDServiceJdbcImplTest
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 19 Feb 2010 21:53:42 +0000 (21:53 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 19 Feb 2010 21:53:42 +0000 (21:53 +0000)
services/id/service/src/test/java/org/collectionspace/services/id/test/IDServiceJdbcImplTest.java

index e7fcd422614ce2dc8edfa3ef324e365e3b13942a..38c9e7526401f908807d059d28dfca284c46260b 100644 (file)
@@ -30,6 +30,7 @@ import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.id.*;
 
 import org.testng.Assert;
+import org.testng.annotations.BeforeSuite;
 import org.testng.annotations.Test;
 
 /**        
@@ -56,6 +57,19 @@ public class IDServiceJdbcImplTest {
     
     final static String CURRENT_YEAR = YearIDGeneratorPart.getCurrentYear();
 
+    // FIXME: Hard-coded driver name here should instead come from
+    // external configuration.
+    final String JDBC_DRIVER_CLASSNAME = "com.mysql.jdbc.Driver";
+
+    @BeforeSuite
+    public void init() {
+        try {
+            Class.forName(JDBC_DRIVER_CLASSNAME).newInstance();
+        } catch (Exception e) {
+            Assert.fail("Error locating required JDBC driver " + JDBC_DRIVER_CLASSNAME);
+        }
+    }
+
 
     @Test
     public void hasRequiredDatabaseTable() {