db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r475045 - in /db/torque/test/trunk/test-project/src/java/org/apache/torque: map/DatabaseMapTest.java om/OMByNameMethodsTest.java
Date Tue, 14 Nov 2006 23:05:52 GMT
Author: tfischer
Date: Tue Nov 14 15:05:51 2006
New Revision: 475045

URL: http://svn.apache.org/viewvc?view=rev&rev=475045
Log:
Fixed test cases in the test project after applying TORQUE-44.
This is part of the Fix for TORQUE-64.
Thanks to Greg Monroe for reporting the error and the patch.

Modified:
    db/torque/test/trunk/test-project/src/java/org/apache/torque/map/DatabaseMapTest.java
    db/torque/test/trunk/test-project/src/java/org/apache/torque/om/OMByNameMethodsTest.java

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/map/DatabaseMapTest.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/map/DatabaseMapTest.java?view=diff&rev=475045&r1=475044&r2=475045
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/map/DatabaseMapTest.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/map/DatabaseMapTest.java
Tue Nov 14 15:05:51 2006
@@ -1,9 +1,5 @@
 package org.apache.torque.map;
 
-import org.apache.torque.BaseRuntimeTestCase;
-import org.apache.torque.Torque;
-import org.apache.torque.TorqueException;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -23,6 +19,10 @@
  * under the License.
  */
 
+import org.apache.torque.BaseRuntimeTestCase;
+import org.apache.torque.Torque;
+import org.apache.torque.TorqueException;
+
 /**
  * Test code for Database Map functions
  *
@@ -105,10 +105,13 @@
         {
             String cName = columns[i].getColumnName();
             String expected = COLUMN_NAMES[i];
+            // Handle torque.deprecated.uppercasePeer=true problems
+            String upperCaseExpected = expected.toUpperCase();
             assertTrue("TableMap for " + TABLE_NAME1
                     + " did not preserve XML column order!  Expected "
                     + expected + " but found " + 
-                    cName, cName.equals(expected));
+                    cName, cName.equals(expected) || 
+                        cName.equals(upperCaseExpected));
         }
     }
 
@@ -200,6 +203,10 @@
         TableMap table = map.getTable(TABLE_NAME1);
 
         ColumnMap column = table.getColumn("id");
+        // Handle torque.deprecated.uppercasePeer=true problems
+        if ( column == null ) {
+            column = table.getColumn("ID");  
+        }
 
         validateAttribute("Column JavaName", "Id", column.getJavaName());
         validateAttribute("Column description", "id column", column
@@ -221,6 +228,10 @@
                 column.getType() instanceof Integer);
 
         column = table.getColumn("one");
+        // Handle torque.deprecated.uppercasePeer=true problems
+        if ( column == null ) {
+            column = table.getColumn("ONE");  
+        }
         assertTrue(
             "Column isProtected attribute returned false instead of true!",
             column.isProtected());
@@ -229,6 +240,10 @@
                 .getDefault());
 
         column = table.getColumn("three");
+        // Handle torque.deprecated.uppercasePeer=true problems
+        if ( column == null ) {
+            column = table.getColumn("THREE");  
+        }
         assertTrue("Column position attribute != 4", 
                     column.getPosition() == 4);
         assertTrue("Column isForeignKey attribute was false instead of true!",

Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/om/OMByNameMethodsTest.java
URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/om/OMByNameMethodsTest.java?view=diff&rev=475045&r1=475044&r2=475045
==============================================================================
--- db/torque/test/trunk/test-project/src/java/org/apache/torque/om/OMByNameMethodsTest.java
(original)
+++ db/torque/test/trunk/test-project/src/java/org/apache/torque/om/OMByNameMethodsTest.java
Tue Nov 14 15:05:51 2006
@@ -26,6 +26,8 @@
 import org.apache.torque.TorqueException;
 import org.apache.torque.test.TypesObject;
 import org.apache.torque.test.TypesPrimitive;
+import org.apache.torque.test.TypesPrimitivePeer;
+import org.apache.torque.test.TypesObjectPeer;
 
 /**
  * Test the various setBy and getBy methods that can be used to access field
@@ -153,56 +155,56 @@
 
     public static final String[] OBJECT_PEER_NAMES =
     {
-            "types_object.o_bit",
-            "types_object.o_tinyint",
-            "types_object.o_smallint",
-            "types_object.o_bigint",
-            "types_object.o_float",
-            "types_object.o_real",
-            "types_object.o_numeric",
-            "types_object.o_decimal",
-            "types_object.o_char",
-            "types_object.o_varchar",
-            "types_object.o_longvarchar",
-            "types_object.o_date",
-            "types_object.o_time",
-            "types_object.o_integer",
-            "types_object.o_timestamp",
-            "types_object.o_binary",
-            "types_object.o_varbinary",
-            "types_object.o_longvarbinary",
-            "types_object.o_blob",
-            "types_object.o_clob",
-            "types_object.o_booleanint",
-            "types_object.o_booleanchar",
-            "types_object.o_double"
+        TypesObjectPeer.O_BIT,
+        TypesObjectPeer.O_TINYINT,
+        TypesObjectPeer.O_SMALLINT,
+        TypesObjectPeer.O_BIGINT,
+        TypesObjectPeer.O_FLOAT,
+        TypesObjectPeer.O_REAL,
+        TypesObjectPeer.O_NUMERIC,
+        TypesObjectPeer.O_DECIMAL,
+        TypesObjectPeer.O_CHAR,
+        TypesObjectPeer.O_VARCHAR,
+        TypesObjectPeer.O_LONGVARCHAR,
+        TypesObjectPeer.O_DATE,
+        TypesObjectPeer.O_TIME,
+        TypesObjectPeer.O_INTEGER,
+        TypesObjectPeer.O_TIMESTAMP,
+        TypesObjectPeer.O_BINARY,
+        TypesObjectPeer.O_VARBINARY,
+        TypesObjectPeer.O_LONGVARBINARY,
+        TypesObjectPeer.O_BLOB,
+        TypesObjectPeer.O_CLOB,
+        TypesObjectPeer.O_BOOLEANINT,
+        TypesObjectPeer.O_BOOLEANCHAR,
+        TypesObjectPeer.O_DOUBLE
     };
 
     public static final String[] PRIMITIVE_PEER_NAMES =
     {
-            "types_primitive.p_bit",
-            "types_primitive.p_tinyint",
-            "types_primitive.p_smallint",
-            "types_primitive.p_bigint",
-            "types_primitive.p_float",
-            "types_primitive.p_real",
-            "types_primitive.p_numeric",
-            "types_primitive.p_decimal",
-            "types_primitive.p_char",
-            "types_primitive.p_varchar",
-            "types_primitive.p_longvarchar",
-            "types_primitive.p_date",
-            "types_primitive.p_time",
-            "types_primitive.p_integer",
-            "types_primitive.p_timestamp",
-            "types_primitive.p_binary",
-            "types_primitive.p_varbinary",
-            "types_primitive.p_longvarbinary",
-            "types_primitive.p_blob",
-            "types_primitive.p_clob",
-            "types_primitive.p_booleanint",
-            "types_primitive.p_booleanchar",
-            "types_primitive.p_double"
+        TypesPrimitivePeer.P_BIT,
+        TypesPrimitivePeer.P_TINYINT,
+        TypesPrimitivePeer.P_SMALLINT,
+        TypesPrimitivePeer.P_BIGINT,
+        TypesPrimitivePeer.P_FLOAT,
+        TypesPrimitivePeer.P_REAL,
+        TypesPrimitivePeer.P_NUMERIC,
+        TypesPrimitivePeer.P_DECIMAL,
+        TypesPrimitivePeer.P_CHAR,
+        TypesPrimitivePeer.P_VARCHAR,
+        TypesPrimitivePeer.P_LONGVARCHAR,
+        TypesPrimitivePeer.P_DATE,
+        TypesPrimitivePeer.P_TIME,
+        TypesPrimitivePeer.P_INTEGER,
+        TypesPrimitivePeer.P_TIMESTAMP,
+        TypesPrimitivePeer.P_BINARY,
+        TypesPrimitivePeer.P_VARBINARY,
+        TypesPrimitivePeer.P_LONGVARBINARY,
+        TypesPrimitivePeer.P_BLOB,
+        TypesPrimitivePeer.P_CLOB,
+        TypesPrimitivePeer.P_BOOLEANINT,
+        TypesPrimitivePeer.P_BOOLEANCHAR,
+        TypesPrimitivePeer.P_DOUBLE
     };
 
     public OMByNameMethodsTest(String name)



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message