db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r462981 - /db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java
Date Wed, 11 Oct 2006 21:53:45 GMT
Author: tomdz
Date: Wed Oct 11 14:53:44 2006
New Revision: 462981

URL: http://svn.apache.org/viewvc?view=rev&rev=462981
Log:
Added test for DDLUTILS-54

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

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java?view=diff&rev=462981&r1=462980&r2=462981
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java Wed Oct 11 14:53:44
2006
@@ -18,10 +18,12 @@
 
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Properties;
 
 import junit.framework.Test;
 
 import org.apache.commons.beanutils.DynaBean;
+import org.apache.ddlutils.model.Database;
 import org.apache.ddlutils.platform.sybase.SybasePlatform;
 
 /**
@@ -1737,5 +1739,33 @@
 
         assertEquals(new Integer(1), beans.get(0), "pk");
         assertEquals((Object)"test", beans.get(0), "avalue");
+    }
+
+    /**
+     * Test for DDLUTILS-54.
+     */
+    public void testIssue54() throws Exception
+    {
+        final String modelXml = 
+            "<?xml version='1.0' encoding='ISO-8859-1'?>\n" +
+            "<database name='test'>\n" +
+            "  <table name='coltype'>\n" +
+            "    <column name='COL_FLOAT' primaryKey='false' required='false' type='FLOAT'/>\n"
+
+            "    <column name='COL_BOOLEAN' primaryKey='false' required='false' type='BOOLEAN'/>\n"
+
+            "  </table>\n" +
+            "</database>";
+
+        createDatabase(modelXml);
+
+        Properties props   = getTestProperties();
+        String     catalog = props.getProperty(DDLUTILS_PROPERTY_PREFIX + "catalog");
+        String     schema  = props.getProperty(DDLUTILS_PROPERTY_PREFIX + "schema");
+        Database   model   = parseDatabaseFromString(modelXml);
+
+        getPlatform().setSqlCommentsOn(false);
+
+        String alterationSql = getPlatform().getAlterTablesSql(catalog, schema, null, model);
+
+        assertEqualsIgnoringWhitespaces("", alterationSql);
     }
 }



Mime
View raw message