db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r711689 - in /db/ddlutils/trunk/src: main/java/org/apache/ddlutils/task/ test/java/org/apache/ddlutils/ test/java/org/apache/ddlutils/task/
Date Wed, 05 Nov 2008 20:33:35 GMT
Author: tomdz
Date: Wed Nov  5 12:33:31 2008
New Revision: 711689

URL: http://svn.apache.org/viewvc?rev=711689&view=rev
Log:
Fix for DDLUTILS-229: writedatatofile Ant task not using the database model and retrieves all db objects ignoring the schema pattern
Task tests tweaks

Added:
    db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToFileCommand.java   (with props)
Modified:
    db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/PlatformConfiguration.java
    db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/WriteDataToFileCommand.java
    db/ddlutils/trunk/src/test/java/org/apache/ddlutils/TestAgainstLiveDatabaseBase.java
    db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestTaskBase.java
    db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToDatabaseCommand.java
    db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteSchemaToFileCommand.java

Modified: db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/PlatformConfiguration.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/PlatformConfiguration.java?rev=711689&r1=711688&r2=711689&view=diff
==============================================================================
--- db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/PlatformConfiguration.java (original)
+++ db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/PlatformConfiguration.java Wed Nov  5 12:33:31 2008
@@ -47,6 +47,8 @@
     private String _catalogPattern;
     /** The schema pattern. */
     private String _schemaPattern;
+    /** The platform object. */
+    private Platform _platform;
 
     /**
      * Returns the database type.
@@ -197,40 +199,41 @@
      */
     public Platform getPlatform() throws BuildException
     {
-        Platform platform = null;
-
-        if (_databaseType == null)
+        if (_platform == null)
         {
-            if (_dataSource == null)
+            if (_databaseType == null)
             {
-                throw new BuildException("No database specified.");
+                if (_dataSource == null)
+                {
+                    throw new BuildException("No database specified.");
+                }
+                if (_databaseType == null)
+                {
+                    _databaseType = new PlatformUtils().determineDatabaseType(_dataSource.getDriverClassName(),
+                                                                              _dataSource.getUrl());
+                }
+                if (_databaseType == null)
+                {
+                    _databaseType = new PlatformUtils().determineDatabaseType(_dataSource);
+                }
             }
-            if (_databaseType == null)
+            try
             {
-                _databaseType = new PlatformUtils().determineDatabaseType(_dataSource.getDriverClassName(),
-                                                                          _dataSource.getUrl());
+                _platform = PlatformFactory.createNewPlatformInstance(_databaseType);
             }
-            if (_databaseType == null)
+            catch (Exception ex)
             {
-                _databaseType = new PlatformUtils().determineDatabaseType(_dataSource);
+                throw new BuildException("Database type "+_databaseType+" is not supported.", ex);
             }
+            if (_platform == null)
+            {
+                throw new BuildException("Database type "+_databaseType+" is not supported.");
+            }
+            _platform.setDataSource(_dataSource);
+            _platform.setDelimitedIdentifierModeOn(isUseDelimitedSqlIdentifiers());
+            _platform.setForeignKeysSorted(isSortForeignKeys());
         }
-        try
-        {
-            platform = PlatformFactory.createNewPlatformInstance(_databaseType);
-        }
-        catch (Exception ex)
-        {
-            throw new BuildException("Database type "+_databaseType+" is not supported.", ex);
-        }
-        if (platform == null)
-        {
-            throw new BuildException("Database type "+_databaseType+" is not supported.");
-        }
-        platform.setDataSource(_dataSource);
-        platform.setDelimitedIdentifierModeOn(isUseDelimitedSqlIdentifiers());
-        platform.setForeignKeysSorted(isSortForeignKeys());
 
-        return platform;
+        return _platform;
     }
 }

Modified: db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/WriteDataToFileCommand.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/WriteDataToFileCommand.java?rev=711689&r1=711688&r2=711689&view=diff
==============================================================================
--- db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/WriteDataToFileCommand.java (original)
+++ db/ddlutils/trunk/src/main/java/org/apache/ddlutils/task/WriteDataToFileCommand.java Wed Nov  5 12:33:31 2008
@@ -79,13 +79,20 @@
     /**
      * {@inheritDoc}
      */
+    public boolean isRequiringModel()
+    {
+        return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void execute(DatabaseTaskBase task, Database model) throws BuildException
     {
         try
         {
             getDataIO().setDetermineSchema(_determineSchema);
-            getDataIO().setSchemaPattern(task.getPlatformConfiguration().getSchemaPattern());
-            getDataIO().writeDataToXML(getPlatform(),
+            getDataIO().writeDataToXML(getPlatform(), model,
                                        new FileOutputStream(_outputFile), _encoding);
             _log.info("Written data XML to file" + _outputFile.getAbsolutePath());
         }

Modified: db/ddlutils/trunk/src/test/java/org/apache/ddlutils/TestAgainstLiveDatabaseBase.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/java/org/apache/ddlutils/TestAgainstLiveDatabaseBase.java?rev=711689&r1=711688&r2=711689&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/java/org/apache/ddlutils/TestAgainstLiveDatabaseBase.java (original)
+++ db/ddlutils/trunk/src/test/java/org/apache/ddlutils/TestAgainstLiveDatabaseBase.java Wed Nov  5 12:33:31 2008
@@ -342,6 +342,16 @@
     }
 
     /**
+     * Determines whether the test shall use delimited identifiers.
+     * 
+     * @return Whether to use delimited identifiers
+     */
+    protected boolean isUseDelimitedIdentifiers()
+    {
+        return _useDelimitedIdentifiers;
+    }
+
+    /**
      * Returns the data source.
      * 
      * @return The data source
@@ -528,8 +538,9 @@
      * 
      * @param tableName    The name of the table (case insensitive)
      * @param columnValues The values for the columns in order of definition
+     * @return The dyna bean for the row
      */
-    protected void insertRow(String tableName, Object[] columnValues)
+    protected DynaBean insertRow(String tableName, Object[] columnValues)
     {
         Table    table = getModel().findTable(tableName);
         DynaBean bean  = getModel().createDynaBeanFor(table);
@@ -541,6 +552,7 @@
             bean.set(column.getName(), columnValues[idx]);
         }
         getPlatform().insert(getModel(), bean);
+        return bean;
     }
 
     /**
@@ -549,8 +561,9 @@
      * @param tableName    The name of the table (case insensitive)
      * @param oldBean      The bean representing the current row
      * @param columnValues The values for the columns in order of definition
+     * @returne The dyna bean for the new row
      */
-    protected void updateRow(String tableName, DynaBean oldBean, Object[] columnValues)
+    protected DynaBean updateRow(String tableName, DynaBean oldBean, Object[] columnValues)
     {
         Table    table = getModel().findTable(tableName);
         DynaBean bean  = getModel().createDynaBeanFor(table);
@@ -562,6 +575,7 @@
             bean.set(column.getName(), columnValues[idx]);
         }
         getPlatform().update(getModel(), oldBean, bean);
+        return bean;
     }
 
     /**
@@ -930,7 +944,9 @@
      */
     protected Database getAdjustedModel()
     {
-        return adjustModel(getModel());
+        Database model = getModel();
+
+        return model == null ? null : adjustModel(model);
     }
 
     /**

Modified: db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestTaskBase.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestTaskBase.java?rev=711689&r1=711688&r2=711689&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestTaskBase.java (original)
+++ db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestTaskBase.java Wed Nov  5 12:33:31 2008
@@ -56,7 +56,7 @@
         task.addConfiguredDatabase((BasicDataSource)getDataSource());
         task.setCatalogPattern(catalog);
         task.setSchemaPattern(schema);
-        task.setUseDelimitedSqlIdentifiers(getPlatform().isDelimitedIdentifierModeOn());
+        task.setUseDelimitedSqlIdentifiers(isUseDelimitedIdentifiers());
         return task;
     }
 
@@ -82,7 +82,7 @@
         task.addConfiguredDatabase((BasicDataSource)getDataSource());
         task.setCatalogPattern(catalog);
         task.setSchemaPattern(schema);
-        task.setUseDelimitedSqlIdentifiers(getPlatform().isDelimitedIdentifierModeOn());
+        task.setUseDelimitedSqlIdentifiers(isUseDelimitedIdentifiers());
         return task;
     }
 }

Modified: db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToDatabaseCommand.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToDatabaseCommand.java?rev=711689&r1=711688&r2=711689&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToDatabaseCommand.java (original)
+++ db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToDatabaseCommand.java Wed Nov  5 12:33:31 2008
@@ -52,7 +52,6 @@
             subTask.setFailOnError(true);
             subTask.setUseBatchMode(useBatchMode);
             subTask.setEnsureForeignKeyOrder(ensureFkOrder);
-            task.setUseDelimitedSqlIdentifiers(getPlatform().isDelimitedIdentifierModeOn());
             task.addWriteDataToDatabase(subTask);
             task.setModelName("roundtriptest");
             task.execute();

Added: db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToFileCommand.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToFileCommand.java?rev=711689&view=auto
==============================================================================
--- db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToFileCommand.java (added)
+++ db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToFileCommand.java Wed Nov  5 12:33:31 2008
@@ -0,0 +1,184 @@
+package org.apache.ddlutils.task;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.Test;
+
+import org.apache.commons.beanutils.DynaBean;
+import org.apache.ddlutils.dynabean.SqlDynaClass;
+import org.apache.ddlutils.io.DataReader;
+import org.apache.ddlutils.io.DataSink;
+import org.apache.ddlutils.io.DataSinkException;
+import org.apache.ddlutils.io.DatabaseIO;
+
+/**
+ * Tests the writeDataToFile sub task.
+ * 
+ * @version $Revision: $
+ */
+public class TestWriteDataToFileCommand extends TestTaskBase
+{
+    /**
+     * Parameterized test case pattern.
+     * 
+     * @return The tests
+     */
+    public static Test suite() throws Exception
+    {
+        return getTests(TestWriteDataToFileCommand.class);
+    }
+
+    /**
+     * Adds the writeDataToFile sub task to the given task, executes it, and checks its output.
+     *
+     * @param task         The task
+     * @param expectedData A map table name -> list of dyna beans sorted by the pk value that is expected
+     */
+    private void runTask(DatabaseToDdlTask task, Map expectedData) throws IOException
+    {
+        WriteDataToFileCommand subTask = new WriteDataToFileCommand();
+        File                   tmpFile = File.createTempFile("data", ".xml");
+
+        try
+        {
+            subTask.setOutputFile(tmpFile);
+            task.addWriteDataToFile(subTask);
+            task.setModelName("roundtriptest");
+            task.execute();
+
+            DataReader dataReader = new DataReader();
+            final Map  readData   = new HashMap();
+
+            dataReader.setModel(getAdjustedModel());
+            dataReader.setSink(new DataSink() {
+                public void addBean(DynaBean bean) throws DataSinkException
+                {
+                    String key   = ((SqlDynaClass)bean.getDynaClass()).getTableName();
+                    List   beans = (List)readData.get(key);
+
+                    if (beans == null)
+                    {
+                        beans = new ArrayList();
+                        readData.put(key, beans);
+                    }
+                    beans.add(bean);
+                }
+
+                public void end() throws DataSinkException
+                {
+                }
+
+                public void start() throws DataSinkException
+                {
+                }
+            });
+            dataReader.read(tmpFile);
+
+            assertEquals("Not the same tables in the expected and actual data", expectedData.keySet(), readData.keySet());
+        }
+        finally
+        {
+            if (!tmpFile.delete())
+            {
+                getLog().warn("Could not delete temporary file " + tmpFile.getAbsolutePath());
+            }
+        }
+    }
+
+    /**
+     * Tests the task against an empty database. 
+     */
+    public void testEmptyDatabase() throws IOException
+    {
+        runTask(getDatabaseToDdlTaskInstance(), new HashMap());
+    }
+
+    /**
+     * Tests against a simple model. 
+     */
+    public void testSimpleModel() throws IOException
+    {
+        final String modelXml = 
+            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+            "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
+            "  <table name='roundtrip'>\n"+
+            "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
+            "    <column name='avalue' type='INTEGER'/>\n"+
+            "  </table>\n"+
+            "</database>";
+
+        createDatabase(modelXml);
+
+        List beans = new ArrayList();
+
+        beans.add(insertRow("roundtrip", new Object[] { "test1", new Integer(1) }));
+        beans.add(insertRow("roundtrip", new Object[] { "test2", null }));
+
+        Map expected = new HashMap();
+
+        expected.put("roundtrip", beans);
+        runTask(getDatabaseToDdlTaskInstance(), expected);
+    }
+
+    /**
+     * Tests against a model with multiple tables and foreign keys. 
+     */
+    public void testComplexModel() throws IOException
+    {
+        final String modelXml = 
+            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+            "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
+            "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
+            "    <column name='avalue' type='INTEGER'/>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
+            "      <reference local='avalue' foreign='pk'/>\n"+
+            "    </foreign-key>\n"+
+            "  </table>\n"+
+            "  <table name='Roundtrip_2'>\n"+
+            "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
+            "    <column name='avalue' type='INTEGER'/>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
+            "      <reference local='avalue' foreign='pk'/>\n"+
+            "    </foreign-key>\n"+
+            "  </table>\n"+
+            "  <table name='Roundtrip_3'>\n"+
+            "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
+            "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
+            "      <reference local='avalue' foreign='pk'/>\n"+
+            "    </foreign-key>\n"+
+            "  </table>\n"+
+            "</database>";
+
+        createDatabase(modelXml);
+
+        List beans1 = new ArrayList();
+        List beans2 = new ArrayList();
+        List beans3 = new ArrayList();
+
+        beans1.add(insertRow("Roundtrip_1", new Object[] { "test1", null }));
+        beans2.add(insertRow("Roundtrip_2", new Object[] { new Integer(3), null }));
+        beans3.add(insertRow("Roundtrip_3", new Object[] { new Integer(1), "test1" }));
+        beans2.add(insertRow("Roundtrip_2", new Object[] { new Integer(2), new Integer(1) }));
+        beans1.add(insertRow("Roundtrip_1", new Object[] { "test2", new Integer(1) }));
+        beans3.add(insertRow("Roundtrip_3", new Object[] { new Integer(3), null }));
+        beans3.add(insertRow("Roundtrip_3", new Object[] { new Integer(4), "test2" }));
+        beans1.add(insertRow("Roundtrip_1", new Object[] { "test3", new Integer(3) }));
+        beans3.add(insertRow("Roundtrip_3", new Object[] { new Integer(2), "test3" }));
+        beans2.add(insertRow("Roundtrip_2", new Object[] { new Integer(1), new Integer(2) }));
+
+        Map expected = new HashMap();
+
+        expected.put("Roundtrip_1", beans1);
+        expected.put("Roundtrip_2", beans2);
+        expected.put("Roundtrip_3", beans3);
+        runTask(getDatabaseToDdlTaskInstance(), expected);
+    }
+
+}

Propchange: db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteDataToFileCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteSchemaToFileCommand.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteSchemaToFileCommand.java?rev=711689&r1=711688&r2=711689&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteSchemaToFileCommand.java (original)
+++ db/ddlutils/trunk/src/test/java/org/apache/ddlutils/task/TestWriteSchemaToFileCommand.java Wed Nov  5 12:33:31 2008
@@ -29,11 +29,10 @@
     /**
      * Adds the writeSchemaToFile sub task to the given task, executes it, and checks its output.
      *
-     * @param task                    The task
-     * @param useDelimitedIdentifiers Whether to run with delimited identifiers
-     * @param expectedModel           The expected model
+     * @param task          The task
+     * @param expectedModel The expected model
      */
-    private void runTask(DatabaseToDdlTask task, boolean useDelimitedIdentifiers, Database expectedModel) throws IOException
+    private void runTask(DatabaseToDdlTask task, Database expectedModel) throws IOException
     {
         WriteSchemaToFileCommand subTask = new WriteSchemaToFileCommand();
         File                     tmpFile = File.createTempFile("schema", ".xml");
@@ -41,14 +40,13 @@
         try
         {
             subTask.setOutputFile(tmpFile);
-            task.setUseDelimitedSqlIdentifiers(useDelimitedIdentifiers);
             task.addWriteSchemaToFile(subTask);
             task.setModelName("roundtriptest");
             task.execute();
 
             assertEquals(expectedModel,
                          new DatabaseIO().read(tmpFile),
-                         useDelimitedIdentifiers);
+                         isUseDelimitedIdentifiers());
         }
         finally
         {
@@ -64,7 +62,7 @@
      */
     public void testEmptyDatabase() throws IOException
     {
-        runTask(getDatabaseToDdlTaskInstance(), false, new Database("roundtriptest"));
+        runTask(getDatabaseToDdlTaskInstance(), new Database("roundtriptest"));
     }
 
     /**
@@ -92,7 +90,7 @@
             "</database>";
 
         createDatabase(modelXml);
-        runTask(getDatabaseToDdlTaskInstance(), false, readModelFromDatabase("roundtriptest"));
+        runTask(getDatabaseToDdlTaskInstance(), readModelFromDatabase("roundtriptest"));
     }
 
     /**
@@ -100,6 +98,11 @@
      */
     public void testSimpleModelWithDelimitedIdentifiers() throws IOException
     {
+        if (!isUseDelimitedIdentifiers())
+        {
+            return;
+        }
+
         final String modelXml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
@@ -119,9 +122,8 @@
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(modelXml);
-        runTask(getDatabaseToDdlTaskInstance(), true, readModelFromDatabase("roundtriptest"));
+        runTask(getDatabaseToDdlTaskInstance(), readModelFromDatabase("roundtriptest"));
     }
 
     /**
@@ -157,8 +159,15 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTables("roundtrip1");
-        runTask(task, false, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTables("roundtrip1");
+        }
+        else
+        {
+            task.setIncludeTables("ROUNDTRIP1");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -189,10 +198,17 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTables("roundtrip1");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTables("roundtrip1");
+        }
+        else
+        {
+            task.setIncludeTables("ROUNDTRIP1");
+        }
         try
         {
-            runTask(task, false, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -209,14 +225,14 @@
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
@@ -224,19 +240,25 @@
         final String model2Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(model1Xml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTableFilter("Round.*\\s1");
-        runTask(task, true, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTableFilter("Round.*1");
+        }
+        else
+        {
+            task.setIncludeTableFilter("ROUND.*1");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -247,31 +269,37 @@
         final String modelXml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(modelXml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTableFilter("Round.*\\s1");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTableFilter("Round.*1");
+        }
+        else
+        {
+            task.setIncludeTableFilter("ROUND.*1");
+        }
         try
         {
-            runTask(task, true, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -330,8 +358,15 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTables("roundtrip1,roundtrip3");
-        runTask(task, false, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTables("roundtrip1,roundtrip3");
+        }
+        else
+        {
+            task.setIncludeTables("ROUNDTRIP1,ROUNDTRIP3");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -369,10 +404,17 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTables("roundtrip1,roundtrip3");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTables("roundtrip1,roundtrip3");
+        }
+        else
+        {
+            task.setIncludeTables("ROUNDTRIP1,ROUNDTRIP3");
+        }
         try
         {
-            runTask(task, false, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -389,24 +431,24 @@
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 3'>\n"+
+            "  <table name='Roundtrip_3'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
@@ -414,29 +456,35 @@
         final String model2Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 3'>\n"+
+            "  <table name='Roundtrip_3'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(model1Xml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTableFilter(".*trip [1|3]");
-        runTask(task, true, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTableFilter(".*trip_[1|3]");
+        }
+        else
+        {
+            task.setIncludeTableFilter(".*TRIP_[1|3]");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -447,38 +495,44 @@
         final String modelXml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 3'>\n"+
+            "  <table name='Roundtrip_3'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(modelXml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTableFilter(".*trip\\s*[1|3]");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTableFilter(".*trip_*[1|3]");
+        }
+        else
+        {
+            task.setIncludeTableFilter(".*TRIP_*[1|3]");
+        }
         try
         {
-            runTask(task, true, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -520,8 +574,15 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTables("roundtrip2");
-        runTask(task, false, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTables("roundtrip2");
+        }
+        else
+        {
+            task.setExcludeTables("ROUNDTRIP2");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -552,10 +613,17 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTables("roundtrip1");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTables("roundtrip1");
+        }
+        else
+        {
+            task.setExcludeTables("ROUNDTRIP1");
+        }
         try
         {
-            runTask(task, false, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -572,14 +640,14 @@
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
@@ -587,19 +655,25 @@
         final String model2Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(model1Xml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTableFilter("Round.*\\s2");
-        runTask(task, true, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTableFilter("Round.*_2");
+        }
+        else
+        {
+            task.setExcludeTableFilter("ROUND.*_2");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -610,31 +684,37 @@
         final String modelXml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(modelXml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTableFilter("Round.*\\s2");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTableFilter("Round.*_2");
+        }
+        else
+        {
+            task.setExcludeTableFilter("ROUND.*_2");
+        }
         try
         {
-            runTask(task, true, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -683,8 +763,15 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTables("roundtrip1,roundtrip3");
-        runTask(task, false, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTables("roundtrip1,roundtrip3");
+        }
+        else
+        {
+            task.setExcludeTables("ROUNDTRIP1,ROUNDTRIP3");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -722,10 +809,17 @@
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTables("roundtrip1,roundtrip3");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTables("roundtrip1,roundtrip3");
+        }
+        else
+        {
+            task.setExcludeTables("ROUNDTRIP1,ROUNDTRIP3");
+        }
         try
         {
-            runTask(task, false, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -742,24 +836,24 @@
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 3'>\n"+
+            "  <table name='Roundtrip_3'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
@@ -767,22 +861,28 @@
         final String model2Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(model1Xml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTableFilter(".*trip [1|3]");
-        runTask(task, true, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTableFilter(".*trip_[1|3]");
+        }
+        else
+        {
+            task.setExcludeTableFilter(".*TRIP_[1|3]");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -793,38 +893,44 @@
         final String modelXml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 3'>\n"+
+            "  <table name='Roundtrip_3'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(modelXml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setExcludeTableFilter(".*trip\\s*[1|3]");
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setExcludeTableFilter(".*trip_*[1|3]");
+        }
+        else
+        {
+            task.setExcludeTableFilter(".*TRIP_*[1|3]");
+        }
         try
         {
-            runTask(task, true, readModelFromDatabase("roundtriptest"));
+            runTask(task, readModelFromDatabase("roundtriptest"));
             fail();
         }
         catch (BuildException ex)
@@ -841,28 +947,28 @@
         final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 1'>\n"+
+            "  <table name='Roundtrip_1'>\n"+
             "    <column name='pk' type='VARCHAR' size='32' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 3'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_3'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 2'>\n"+
+            "  <table name='Roundtrip_2'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 2'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_2'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 3'>\n"+
+            "  <table name='Roundtrip_3'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='VARCHAR' size='32'/>\n"+
-            "    <foreign-key foreignTable='Roundtrip 1'>\n"+
+            "    <foreign-key foreignTable='Roundtrip_1'>\n"+
             "      <reference local='avalue' foreign='pk'/>\n"+
             "    </foreign-key>\n"+
             "  </table>\n"+
-            "  <table name='Roundtrip 4'>\n"+
+            "  <table name='Roundtrip_4'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
             "  </table>\n"+
@@ -870,20 +976,27 @@
         final String model2Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='roundtriptest'>\n"+
-            "  <table name='Roundtrip 4'>\n"+
+            "  <table name='Roundtrip_4'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "    <column name='avalue' type='INTEGER'/>\n"+
             "  </table>\n"+
             "</database>";
 
-        getPlatform().setDelimitedIdentifierModeOn(true);
         createDatabase(model1Xml);
 
         DatabaseToDdlTask task = getDatabaseToDdlTaskInstance();
 
-        task.setIncludeTables("Roundtrip 1,Roundtrip 3,Roundtrip 4");
-        task.setExcludeTables("Roundtrip 1,Roundtrip 3");
-        runTask(task, true, parseDatabaseFromString(model2Xml));
+        if (isUseDelimitedIdentifiers())
+        {
+            task.setIncludeTables("Roundtrip_1,Roundtrip_3,Roundtrip_4");
+            task.setExcludeTables("Roundtrip_1,Roundtrip_3");
+        }
+        else
+        {
+            task.setIncludeTables("ROUNDTRIP_1,ROUNDTRIP_3,ROUNDTRIP_4");
+            task.setExcludeTables("ROUNDTRIP_1,ROUNDTRIP_3");
+        }
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 
     /**
@@ -932,6 +1045,6 @@
 
         task.setIncludeTableFilter(".*[1|2|3]");
         task.setExcludeTableFilter(".*[1|3]");
-        runTask(task, false, parseDatabaseFromString(model2Xml));
+        runTask(task, parseDatabaseFromString(model2Xml));
     }
 }



Mime
View raw message