db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r373383 - in /db/ddlutils/trunk/src/test/org/apache/ddlutils/io: RoundtripTestBase.java TestConstraints.java TestDatatypes.java
Date Sun, 29 Jan 2006 23:06:27 GMT
Author: tomdz
Date: Sun Jan 29 15:06:22 2006
New Revision: 373383

URL: http://svn.apache.org/viewcvs?rev=373383&view=rev
Log:
Added facilities to specify catalog/schema for running the unit tests

Modified:
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestDatatypes.java

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=373383&r1=373382&r2=373383&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 Sun Jan 29 15:06:22
2006
@@ -301,10 +301,10 @@
     {
         try
         {
-            assertEquals("Model names do not match",
+            assertEquals("Model names do not match.",
                          expected.getName(),
                          actual.getName());
-            assertEquals("Not the same number of tables",
+            assertEquals("Not the same number of tables.",
                          expected.getTableCount(),
                          actual.getTableCount());
             for (int tableIdx = 0; tableIdx < actual.getTableCount(); tableIdx++)
@@ -348,17 +348,17 @@
     {
         if (_useDelimitedIdentifiers)
         {
-            assertEquals("Table names do not match",
+            assertEquals("Table names do not match.",
                          expected.getName(),
                          actual.getName());
         }
         else
         {
-            assertEquals("Table names do not match (ignoring case)",
+            assertEquals("Table names do not match (ignoring case).",
                          expected.getName().toUpperCase(),
                          actual.getName().toUpperCase());
         }
-        assertEquals("Not the same number of columns in table "+actual.getName(),
+        assertEquals("Not the same number of columns in table "+actual.getName()+".",
                      expected.getColumnCount(),
                      actual.getColumnCount());
         for (int columnIdx = 0; columnIdx < actual.getColumnCount(); columnIdx++)
@@ -366,7 +366,7 @@
             assertEquals(expected.getColumn(columnIdx),
                          actual.getColumn(columnIdx));
         }
-        assertEquals("Not the same number of foreign keys in table "+actual.getName(),
+        assertEquals("Not the same number of foreign keys in table "+actual.getName()+".",
                      expected.getForeignKeyCount(),
                      actual.getForeignKeyCount());
         // order is not assumed with the way foreignkeys are returned.
@@ -387,7 +387,7 @@
                 }
             }
         }
-        assertEquals("Not the same number of indices in table "+actual.getName(),
+        assertEquals("Not the same number of indices in table "+actual.getName()+".",
                      expected.getIndexCount(),
                      actual.getIndexCount());
         for (int indexIdx = 0; indexIdx < actual.getIndexCount(); indexIdx++)
@@ -407,29 +407,29 @@
     {
         if (_useDelimitedIdentifiers)
         {
-            assertEquals("Column names do not match",
+            assertEquals("Column names do not match.",
                          expected.getName(),
                          actual.getName());
         }
         else
         {
-            assertEquals("Column names do not match (ignoring case)",
+            assertEquals("Column names do not match (ignoring case).",
                          expected.getName().toUpperCase(),
                          actual.getName().toUpperCase());
         }
-        assertEquals("Primary key status not the same for column "+actual.getName(),
+        assertEquals("Primary key status not the same for column "+actual.getName()+".",
                      expected.isPrimaryKey(),
                      actual.isPrimaryKey());
-        assertEquals("Required status not the same for column "+actual.getName(),
+        assertEquals("Required status not the same for column "+actual.getName()+".",
                      expected.isRequired(),
                      actual.isRequired());
-        assertEquals("Auto-increment status not the same for column "+actual.getName(),
+        assertEquals("Auto-increment status not the same for column "+actual.getName()+".",
                      expected.isAutoIncrement(),
                      actual.isAutoIncrement());
-        assertEquals("Type code not the same for column "+actual.getName(),
+        assertEquals("Type code not the same for column "+actual.getName()+".",
                      expected.getTypeCode(),
                      actual.getTypeCode());
-        assertEquals("Parsed default values do not match for column "+actual.getName(),
+        assertEquals("Parsed default values do not match for column "+actual.getName()+".",
                      expected.getParsedDefaultValue(),
                      actual.getParsedDefaultValue());
 
@@ -437,10 +437,10 @@
         if ((expected.getTypeCode() == Types.NUMERIC) ||
             (expected.getTypeCode() == Types.DECIMAL))
         {
-            assertEquals("Precision not the same for column "+actual.getName(),
+            assertEquals("Precision not the same for column "+actual.getName()+".",
                          expected.getSize(),
                          actual.getSize());
-            assertEquals("Scale not the same for column "+actual.getName(),
+            assertEquals("Scale not the same for column "+actual.getName()+".",
                          expected.getScale(),
                          actual.getScale());
         }
@@ -449,7 +449,7 @@
                  (expected.getTypeCode() == Types.BINARY) ||
                  (expected.getTypeCode() == Types.VARBINARY))
         {
-            assertEquals("Size not the same for column "+actual.getName(),
+            assertEquals("Size not the same for column "+actual.getName()+".",
                          expected.getSize(),
                          actual.getSize());
         }
@@ -465,23 +465,23 @@
     {
         if (_useDelimitedIdentifiers)
         {
-            assertEquals("Foreign key names do not match",
+            assertEquals("Foreign key names do not match.",
                          expected.getName(),
                          actual.getName());
-            assertEquals("Referenced table names do not match",
+            assertEquals("Referenced table names do not match.",
                          expected.getForeignTableName(),
                          actual.getForeignTableName());
         }
         else
         {
-            assertEquals("Foreign key names do not match (ignoring case)",
+            assertEquals("Foreign key names do not match (ignoring case).",
                          expected.getName().toUpperCase(),
                          actual.getName().toUpperCase());
-            assertEquals("Referenced table names do not match (ignoring case)",
+            assertEquals("Referenced table names do not match (ignoring case).",
                          expected.getForeignTableName().toUpperCase(),
                          actual.getForeignTableName().toUpperCase());
         }
-        assertEquals("Not the same number of references in foreign key "+actual.getName(),
+        assertEquals("Not the same number of references in foreign key "+actual.getName()+".",
                      expected.getReferenceCount(),
                      actual.getReferenceCount());
         for (int refIdx = 0; refIdx < actual.getReferenceCount(); refIdx++)
@@ -501,19 +501,19 @@
     {
         if (_useDelimitedIdentifiers)
         {
-            assertEquals("Local column names do not match",
+            assertEquals("Local column names do not match.",
                          expected.getLocalColumnName(),
                          actual.getLocalColumnName());
-            assertEquals("Foreign column names do not match",
+            assertEquals("Foreign column names do not match.",
                          expected.getForeignColumnName(),
                          actual.getForeignColumnName());
         }
         else
         {
-            assertEquals("Local column names do not match (ignoring case)",
+            assertEquals("Local column names do not match (ignoring case).",
                          expected.getLocalColumnName().toUpperCase(),
                          actual.getLocalColumnName().toUpperCase());
-            assertEquals("Foreign column names do not match (ignoring case)",
+            assertEquals("Foreign column names do not match (ignoring case).",
                          expected.getForeignColumnName().toUpperCase(),
                          actual.getForeignColumnName().toUpperCase());
         }
@@ -529,20 +529,20 @@
     {
         if (_useDelimitedIdentifiers)
         {
-            assertEquals("Index names do not match",
+            assertEquals("Index names do not match.",
                          expected.getName(),
                          actual.getName());
         }
         else
         {
-            assertEquals("Index names do not match (ignoring case)",
+            assertEquals("Index names do not match (ignoring case).",
                          expected.getName().toUpperCase(),
                          actual.getName().toUpperCase());
         }
-        assertEquals("Unique status not the same for index "+actual.getName(),
+        assertEquals("Unique status not the same for index "+actual.getName()+".",
                      expected.isUnique(),
                      actual.isUnique());
-        assertEquals("Not the same number of columns in index "+actual.getName(),
+        assertEquals("Not the same number of columns in index "+actual.getName()+".",
                      expected.getColumnCount(),
                      actual.getColumnCount());
         for (int columnIdx = 0; columnIdx < actual.getColumnCount(); columnIdx++)
@@ -562,17 +562,17 @@
     {
         if (_useDelimitedIdentifiers)
         {
-            assertEquals("Index column names do not match",
+            assertEquals("Index column names do not match.",
                          expected.getName(),
                          actual.getName());
         }
         else
         {
-            assertEquals("Index column names do not match (ignoring case)",
+            assertEquals("Index column names do not match (ignoring case).",
                          expected.getName().toUpperCase(),
                          actual.getName().toUpperCase());
         }
-        assertEquals("Size not the same for index column "+actual.getName(),
+        assertEquals("Size not the same for index column "+actual.getName()+".",
                      expected.getSize(),
                      actual.getSize());
     }

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java?rev=373383&r1=373382&r2=373383&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestConstraints.java Sun Jan 29 15:06:22
2006
@@ -197,7 +197,7 @@
         createDatabase(modelXml);
 
         assertEquals(getAdjustedModel(),
-                     getPlatform().readModelFromDatabase("roundtriptest"));
+                     readModelFromDatabase("roundtriptest"));
     }
 
     /**

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestDatatypes.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestDatatypes.java?rev=373383&r1=373382&r2=373383&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestDatatypes.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestDatatypes.java Sun Jan 29 15:06:22
2006
@@ -377,7 +377,7 @@
         "<database name='roundtriptest'>\n"+
         "  <table name='roundtrip'>\n"+
         "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
-        "    <column name='avalue' type='TIMESTAMP' required='true' default='1985-06-17
16:17:18.0'/>\n"+
+        "    <column name='avalue' type='TIMESTAMP' required='true' default='1985-06-17
16:17:18'/>\n"+
         "  </table>\n"+
         "</database>";
     /** Test model with a simple BINARY column. */
@@ -490,7 +490,7 @@
         assertEquals(expected2, beans.get(1), "avalue");
 
         assertEquals(getAdjustedModel(),
-                     getPlatform().readModelFromDatabase("roundtriptest"));
+                     readModelFromDatabase("roundtriptest"));
     }
 
     /**
@@ -618,7 +618,7 @@
      */
     public void testFloatWithDefault()
     {
-        performDataTypeTest(TEST_FLOAT_MODEL_WITH_DEFAULT, null, new Double(1e+150), new
Double(12345678.9012345));
+        performDataTypeTest(TEST_FLOAT_MODEL_WITH_DEFAULT, null, new Double(1e+100), new
Double(12345678.9012345));
     }
 
     /**
@@ -634,7 +634,7 @@
      */
     public void testDoubleWithDefault()
     {
-        performDataTypeTest(TEST_DOUBLE_MODEL_WITH_DEFAULT, new Double(-1e+150), null, new
Double(-987654321.098765));
+        performDataTypeTest(TEST_DOUBLE_MODEL_WITH_DEFAULT, new Double(-1e+100), null, new
Double(-987654321.098765));
     }
 
     /**
@@ -658,7 +658,7 @@
      */
     public void testDecimalWithScale()
     {
-        performDataTypeTest(TEST_DECIMAL_MODEL_WITH_SCALE, new BigDecimal("0.0100000"), new
BigDecimal("-87654321.1234567"));
+        performDataTypeTest(TEST_DECIMAL_MODEL_WITH_SCALE, new BigDecimal("0.0100001"), new
BigDecimal("-87654321.1234567"));
     }
 
     /**
@@ -666,7 +666,7 @@
      */
     public void testDecimalWithScaleAndDefault()
     {
-        performDataTypeTest(TEST_DECIMAL_MODEL_WITH_SCALE_AND_DEFAULT, new BigDecimal("1.0000000"),
null, new BigDecimal("12345678.7654321"));
+        performDataTypeTest(TEST_DECIMAL_MODEL_WITH_SCALE_AND_DEFAULT, new BigDecimal("1.0000001"),
null, new BigDecimal("12345678.7654321"));
     }
 
     /**
@@ -690,7 +690,7 @@
      */
     public void testNumericWithScale()
     {
-        performDataTypeTest(TEST_NUMERIC_MODEL_WITH_SCALE, new BigDecimal("1234567.89012345"),
new BigDecimal("1.00000000"));
+        performDataTypeTest(TEST_NUMERIC_MODEL_WITH_SCALE, new BigDecimal("1234567.89012345"),
new BigDecimal("1.00000001"));
     }
 
     /**



Mime
View raw message