db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r635260 - /db/ddlutils/trunk/src/test/org/apache/ddlutils/task/TestTaskBase.java
Date Sun, 09 Mar 2008 15:32:12 GMT
Author: tomdz
Date: Sun Mar  9 08:32:01 2008
New Revision: 635260

URL: http://svn.apache.org/viewvc?rev=635260&view=rev
Log:
Added additional check for the type of the datasource (which needs to be a BasicDataSource
for the Ant tests)

Modified:
    db/ddlutils/trunk/src/test/org/apache/ddlutils/task/TestTaskBase.java

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/task/TestTaskBase.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/org/apache/ddlutils/task/TestTaskBase.java?rev=635260&r1=635259&r2=635260&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/task/TestTaskBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/task/TestTaskBase.java Sun Mar  9 08:32:01
2008
@@ -21,6 +21,8 @@
 
 import java.util.Properties;
 
+import javax.sql.DataSource;
+
 import org.apache.commons.dbcp.BasicDataSource;
 import org.apache.ddlutils.TestDatabaseWriterBase;
 import org.apache.tools.ant.Project;
@@ -49,11 +51,16 @@
      */
     protected DatabaseToDdlTask getDatabaseToDdlTaskInstance()
     {
-        DatabaseToDdlTask task    = new DatabaseToDdlTask();
-        Properties        props   = getTestProperties();
-        String            catalog = props.getProperty(DDLUTILS_CATALOG_PROPERTY);
-        String            schema  = props.getProperty(DDLUTILS_SCHEMA_PROPERTY);
+        DatabaseToDdlTask task       = new DatabaseToDdlTask();
+        Properties        props      = getTestProperties();
+        String            catalog    = props.getProperty(DDLUTILS_CATALOG_PROPERTY);
+        String            schema     = props.getProperty(DDLUTILS_SCHEMA_PROPERTY);
+        DataSource        dataSource = getDataSource();
 
+        if (!(dataSource instanceof BasicDataSource))
+        {
+            fail("Datasource needs to be of type " + BasicDataSource.class.getName());
+        }
         task.setProject(new Project());
         task.addConfiguredDatabase((BasicDataSource)getDataSource());
         task.setCatalogPattern(catalog);



Mime
View raw message