cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r450903 - /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java
Date Thu, 28 Sep 2006 15:47:15 GMT
Author: aadamchik
Date: Thu Sep 28 08:47:14 2006
New Revision: 450903

URL: http://svn.apache.org/viewvc?view=rev&rev=450903
Log:
CAY-672 - LongTest with BIGINT - it succeeds now without changing ColumnDescriptor

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java?view=diff&rev=450903&r1=450902&r2=450903
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/NumericTypesTst.java
Thu Sep 28 08:47:14 2006
@@ -31,11 +31,14 @@
 import org.apache.art.BooleanTestEntity;
 import org.apache.art.DecimalPKTest1;
 import org.apache.art.DecimalPKTestEntity;
+import org.apache.art.LongEntity;
 import org.apache.art.SmallintTestEntity;
 import org.apache.art.TinyintTestEntity;
+import org.apache.cayenne.DataRow;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
+import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.unit.CayenneTestCase;
 
@@ -53,6 +56,28 @@
         context = createDataContext();
     }
 
+    public void testLong() throws Exception {
+
+        LongEntity test = (LongEntity) context.newObject(LongEntity.class);
+
+        Long i = new Long(Integer.MAX_VALUE + 10l);
+        test.setLongField(i);
+        context.commitChanges();
+
+        SelectQuery q = new SelectQuery(LongEntity.class);
+        LongEntity testRead = (LongEntity) context.performQuery(q).get(0);
+        assertNotNull(testRead.getLongField());
+        assertEquals(i, testRead.getLongField());
+
+        SQLTemplate q1 = new SQLTemplate(LongEntity.class, "select * from LONG_ENTITY");
+        q1.setFetchingDataRows(true);
+        DataRow row = (DataRow) context.performQuery(q1).get(0);
+        assertEquals(i, row.get("LONG_FIELD"));
+
+        test.setLongField(null);
+        context.commitChanges();
+    }
+
     public void testBigInteger() throws Exception {
 
         BigIntegerEntity test = (BigIntegerEntity) context
@@ -70,7 +95,7 @@
         test.setBigIntegerField(null);
         context.commitChanges();
     }
-    
+
     public void testBigDecimal() throws Exception {
 
         BigDecimalEntity test = (BigDecimalEntity) context



Mime
View raw message