db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r506282 - /db/ddlutils/trunk/src/test/org/apache/ddlutils/TestSummaryCreatorTask.java
Date Mon, 12 Feb 2007 05:11:36 GMT
Author: tomdz
Date: Sun Feb 11 21:11:36 2007
New Revision: 506282

URL: http://svn.apache.org/viewvc?view=rev&rev=506282
Log:
Enhanced test summary task

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

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/TestSummaryCreatorTask.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/org/apache/ddlutils/TestSummaryCreatorTask.java?view=diff&rev=506282&r1=506281&r2=506282
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/TestSummaryCreatorTask.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/TestSummaryCreatorTask.java Sun Feb 11
21:11:36 2007
@@ -20,6 +20,7 @@
  */
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -283,7 +284,18 @@
         }
         catch (Exception ex)
         {
-            throw new BuildException("Cannot load database properties from file " + jdbcPropertiesFile);
+            // not on the classpath ? let's try a file
+            File baseDir  = getProject().getBaseDir();
+            File propFile = new File(baseDir, jdbcPropertiesFile);
+
+            if (propFile.exists() && propFile.isFile() && propFile.canRead())
+            {
+                props.load(new FileInputStream(propFile));
+            }
+            else
+            {
+                throw new BuildException("Cannot load database properties from file " + jdbcPropertiesFile);
+            }
         }
 
         try



Mime
View raw message