db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r371023 - in /db/ddlutils/trunk/src: doc/src/documentation/content/xdocs/index.xml java/org/apache/ddlutils/platform/PlatformImplBase.java test/org/apache/ddlutils/TestDatabaseWriterBase.java test/org/apache/ddlutils/io/RoundtripTestBase.java
Date Sat, 21 Jan 2006 12:35:10 GMT
Author: tomdz
Date: Sat Jan 21 04:34:27 2006
New Revision: 371023

URL: http://svn.apache.org/viewcvs?rev=371023&view=rev
Log:
Minor changes & additional comments

Modified:
    db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/index.xml
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java

Modified: db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/index.xml?rev=371023&r1=371022&r2=371023&view=diff
==============================================================================
--- db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/index.xml (original)
+++ db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/index.xml Sat Jan 21 04:34:27
2006
@@ -40,7 +40,7 @@
       </p>
       <source><![CDATA[
 <?xml version="1.0"?>      
- <database>
+ <database name="testdb">
   <table name="author">
     <column name="author_id"
             type="INTEGER"

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java?rev=371023&r1=371022&r2=371023&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java Sat Jan
21 04:34:27 2006
@@ -751,6 +751,8 @@
         } 
         finally 
         {
+            // the iterator should return the connection automatically
+            // so this is usuallynot necessary (but just in case)
             closeStatement(statement);
             returnConnection(connection);
         }

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=371023&r1=371022&r2=371023&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/TestDatabaseWriterBase.java Sat Jan 21
04:34:27 2006
@@ -69,10 +69,13 @@
      */
     private void init()
     {
+        // the data source won't change during the tests, hence
+        // it is static and needs to be initialized only once
         if (_dataSource != null)
         {
             return;
         }
+
         Properties props    = new Properties();
         String     propFile = System.getProperty(JDBC_PROPERTIES_PROPERTY);
 

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java?rev=371023&r1=371022&r2=371023&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java Sat Jan 21 04:34:27
2006
@@ -370,19 +370,22 @@
                      expected.getForeignKeyCount(),
                      actual.getForeignKeyCount());
         // order is not assumed with the way foreignkeys are returned.
-        for (int fkIdx = 0; fkIdx < actual.getForeignKeyCount(); fkIdx++)
+        for (int expectedFkIdx = 0; expectedFkIdx < expected.getForeignKeyCount(); expectedFkIdx++)
         {
-            ForeignKey fk_expected = expected.getForeignKey(fkIdx);
-            ForeignKey fk_actual = null;
-            for (int i = 0; i < actual.getForeignKeyCount(); i++)
+            ForeignKey expectedFk   = expected.getForeignKey(expectedFkIdx);
+            String     expectedName = expectedFk.getName();
+
+            for (int actualFkIdx = 0; actualFkIdx < actual.getForeignKeyCount(); actualFkIdx++)
             {
-                fk_actual = actual.getForeignKey(i);
-                if (fk_actual.getName().equalsIgnoreCase(fk_expected.getName()))
+                ForeignKey actualFk   = actual.getForeignKey(actualFkIdx);
+                String     actualName = actualFk.getName();
+
+                if ((_useDelimitedIdentifiers  && expectedName.equals(actualName))
||
+                    (!_useDelimitedIdentifiers && expectedName.equalsIgnoreCase(actualName)))
                 {
-                    break;
+                    assertEquals(expectedFk, actualFk);
                 }
             }
-            assertEquals(fk_expected, fk_actual);
         }
         assertEquals("Not the same number of indices in table "+actual.getName(),
                      expected.getIndexCount(),



Mime
View raw message