db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r359649 - /db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java
Date Wed, 28 Dec 2005 21:59:44 GMT
Author: tomdz
Date: Wed Dec 28 13:59:40 2005
New Revision: 359649

URL: http://svn.apache.org/viewcvs?rev=359649&view=rev
Log:
Changed test base class so that the database type is only queried from the connection if not
specified directly via the properties
Added call to shutdown the platform after a test

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

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java?rev=359649&r1=359648&r2=359649&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java Wed Dec 28
13:59:40 2005
@@ -96,11 +96,11 @@
             throw new DynaSqlException(ex);
         }
 
-        _databaseName = new PlatformUtils().determineDatabaseType(_dataSource);
+        _databaseName = props.getProperty(PLATFORM_PROPERTY);
         if (_databaseName == null)
         {
-            // could not determine, perhaps the property has been set ?
-            _databaseName = props.getProperty(PLATFORM_PROPERTY);
+            // property not set, then try to determine
+            _databaseName = new PlatformUtils().determineDatabaseType(_dataSource);
             if (_databaseName == null)
             {
                 throw new DynaSqlException("Could not determine platform from datasource,
please specify it in the jdbc.properties via the ddlutils.platform property");
@@ -150,10 +150,17 @@
      */
     protected void tearDown() throws Exception
     {
-        if (_model != null)
+        try
         {
-            dropDatabase();
-            _model = null;
+            if (_model != null)
+            {
+                dropDatabase();
+                _model = null;
+            }
+        }
+        finally
+        {
+            getPlatform().shutdownDatabase();
         }
         super.tearDown();
     }



Mime
View raw message