You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by to...@apache.org on 2007/02/12 06:11:36 UTC
svn commit: r506282 -
/db/ddlutils/trunk/src/test/org/apache/ddlutils/TestSummaryCreatorTask.java
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