cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1244944 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/dba/ingres/ test/java/org/apache/cayenne/ test/java/org/apache/cayenne/access/ test/java/org/apache/cayenne/access/trans/ test/java/org...
Date Thu, 16 Feb 2012 11:39:29 GMT
Author: oltka
Date: Thu Feb 16 11:39:28 2012
New Revision: 1244944

URL: http://svn.apache.org/viewvc?rev=1244944&view=rev
Log:
CAY-1666 fix some problem with tests

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresMergerFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextPrimitiveTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ReturnTypesMappingTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/SelectTranslatorTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresMergerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresMergerFactory.java?rev=1244944&r1=1244943&r2=1244944&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresMergerFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ingres/IngresMergerFactory.java
Thu Feb 16 11:39:28 2012
@@ -76,6 +76,7 @@ public class IngresMergerFactory extends
         };
     }
     
+    
     @Override
     public MergerToken createDropRelationshipToDb(
             final DbEntity entity,

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesTest.java?rev=1244944&r1=1244943&r2=1244944&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOQualifiedEntitiesTest.java
Thu Feb 16 11:39:28 2012
@@ -68,18 +68,19 @@ public class CDOQualifiedEntitiesTest ex
     }
 
     private void createReadToManyDataSet() throws Exception {
+        
         tQualified1.insert(1, "OX1", null);
-        tQualified1.insert(2, "OX2", true);
+        tQualified1.insert(2, "OX2", accessStackAdapter.supportsBoolean() ? true : 1);
 
         tQualified2.insert(1, "OY1", null, 1);
-        tQualified2.insert(2, "OY2", true, 1);
+        tQualified2.insert(2, "OY2", accessStackAdapter.supportsBoolean() ? true : 1, 1);
         tQualified2.insert(3, "OY3", null, 2);
-        tQualified2.insert(4, "OY4", true, 2);
+        tQualified2.insert(4, "OY4", accessStackAdapter.supportsBoolean() ? true : 1, 2);
     }
 
     private void createReadToOneDataSet() throws Exception {
         tQualified1.insert(1, "OX1", null);
-        tQualified1.insert(2, "OX2", true);
+        tQualified1.insert(2, "OX2", accessStackAdapter.supportsBoolean() ? true : 1);
 
         tQualified2.insert(1, "OY1", null, 2);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextPrimitiveTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextPrimitiveTest.java?rev=1244944&r1=1244943&r2=1244944&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextPrimitiveTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextPrimitiveTest.java
Thu Feb 16 11:39:28 2012
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne;
 
+import java.sql.Types;
 import java.util.List;
 
 import org.apache.cayenne.di.Inject;
@@ -27,6 +28,7 @@ import org.apache.cayenne.test.jdbc.DBHe
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.mt.ClientMtTablePrimitives;
 import org.apache.cayenne.testdo.mt.MtTablePrimitives;
+import org.apache.cayenne.unit.UnitDbAdapter;
 import org.apache.cayenne.unit.di.client.ClientCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
@@ -35,6 +37,9 @@ public class CayenneContextPrimitiveTest
 
     @Inject
     private CayenneContext context;
+    
+    @Inject
+    private UnitDbAdapter accessStackAdapter;
 
     @Inject
     private DBHelper dbHelper;
@@ -45,13 +50,18 @@ public class CayenneContextPrimitiveTest
     protected void setUpAfterInjection() throws Exception {
         dbHelper.deleteAll("MT_TABLE_PRIMITIVES");
 
+        int bool = accessStackAdapter.supportsBoolean() ? Types.BOOLEAN : Types.INTEGER;
+        
         tMtTablePrimitives = new TableHelper(dbHelper, "MT_TABLE_PRIMITIVES");
-        tMtTablePrimitives.setColumns("ID", "BOOLEAN_COLUMN", "INT_COLUMN");
+        tMtTablePrimitives.setColumns("ID", "BOOLEAN_COLUMN", "INT_COLUMN").setColumnTypes(
+                Types.INTEGER,
+                bool,
+                Types.INTEGER);
     }
 
     private void createTwoPrimitivesDataSet() throws Exception {
-        tMtTablePrimitives.insert(1, true, 0);
-        tMtTablePrimitives.insert(2, false, 5);
+        tMtTablePrimitives.insert(1, accessStackAdapter.supportsBoolean() ? true : 1, 0);
+        tMtTablePrimitives.insert(2, accessStackAdapter.supportsBoolean() ? false : 0, 5);
     }
 
     public void testSelectPrimitives() throws Exception {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ReturnTypesMappingTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ReturnTypesMappingTest.java?rev=1244944&r1=1244943&r2=1244944&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ReturnTypesMappingTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/ReturnTypesMappingTest.java
Thu Feb 16 11:39:28 2012
@@ -287,6 +287,9 @@ public class ReturnTypesMappingTest exte
             NamedQuery q = new NamedQuery("SelectReturnTypesLobsMap1");
             DataRow testRead = (DataRow) context.performQuery(q).get(0);
             Object columnValue = testRead.get(columnName);
+            if (columnValue == null && testRead.containsKey(columnName.toLowerCase()))
{
+                columnValue = testRead.get(columnName.toLowerCase());
+            }
             assertNotNull(columnValue);
             assertEquals(String.class, columnValue.getClass());
             assertEquals(clobValue, columnValue);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/SelectTranslatorTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/SelectTranslatorTest.java?rev=1244944&r1=1244943&r2=1244944&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/SelectTranslatorTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/trans/SelectTranslatorTest.java
Thu Feb 16 11:39:28 2012
@@ -132,8 +132,10 @@ public class SelectTranslatorTest extend
                     if (generatedSql.contains("RTRIM")) {
                         assertTrue(generatedSql.indexOf("ARTIST_NAME) = ") > generatedSql
                                 .indexOf("RTRIM("));
-                    }
-                    else {
+                    } else if (generatedSql.contains("TRIM")) {
+                        assertTrue(generatedSql.indexOf("ARTIST_NAME) = ") > generatedSql
+                                .indexOf("TRIM("));
+                    } else {
                         assertTrue(generatedSql.indexOf("ARTIST_NAME = ") > 0);
                     }
                 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java?rev=1244944&r1=1244943&r2=1244944&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/IngresUnitDbAdapter.java
Thu Feb 16 11:39:28 2012
@@ -33,6 +33,11 @@ public class IngresUnitDbAdapter extends
 //    }
     
     @Override
+    public boolean supportsBoolean() {
+        return false;
+    }
+    
+    @Override
     public boolean supportsLobs() {
         return true;
     }



Mime
View raw message