cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From evg...@apache.org
Subject svn commit: r899162 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test: java/org/apache/cayenne/access/ReturnTypesMappingTest.java resources/testmap.map.xml
Date Thu, 14 Jan 2010 11:27:52 GMT
Author: evgeny
Date: Thu Jan 14 11:27:51 2010
New Revision: 899162

URL: http://svn.apache.org/viewvc?rev=899162&view=rev
Log:
CAY-1354
Fix Float mapping test to be working on Derby + h2. Fix Schema generation to be Derby compatible
(varchar not longer then 255)

Modified:
    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/resources/testmap.map.xml

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=899162&r1=899161&r2=899162&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 Jan 14 11:27:51 2010
@@ -391,8 +391,9 @@
         DataRow testRead = (DataRow) context.performQuery(q).get(0);
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
-        assertEquals(Float.class, columnValue.getClass());
-        assertEquals(floatValue, columnValue);
+        assertTrue(Float.class.equals(columnValue.getClass())
+                || Double.class.equals(columnValue.getClass()));
+        assertEquals(floatValue.floatValue(), ((Number)columnValue).floatValue());
     }
 
     public void testFLOAT2() throws Exception {
@@ -624,7 +625,8 @@
         Object columnValue = testRead.get(columnName);
         assertNotNull(columnValue);
         assertEquals(Date.class, columnValue.getClass());
-        assertEquals(timeValue.toString(), new Time(((Date)columnValue).getTime()).toString());
+        assertEquals(timeValue.toString(), new Time(((Date) columnValue).getTime())
+                .toString());
     }
 
     public void testTIME2() throws Exception {
@@ -644,7 +646,7 @@
         assertEquals(Date.class, columnValue.getClass());
         assertEquals(timeValue.toString(), new Time(columnValue.getTime()).toString());
     }
-    
+
     public void testSQLTemplateTime() throws Exception {
         DateTestEntity test = (DateTestEntity) context.newObject("DateTestEntity");
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml?rev=899162&r1=899161&r2=899162&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/testmap.map.xml
Thu Jan 14 11:27:51 2010
@@ -239,7 +239,7 @@
 		<db-attribute name="BIGINT_COLUMN" type="BIGINT"/>
 		<db-attribute name="BIT_COLUMN" type="BIT"/>
 		<db-attribute name="BOOLEAN_COLUMN" type="BOOLEAN"/>
-		<db-attribute name="CHAR_COLUMN" type="CHAR" length="500"/>
+		<db-attribute name="CHAR_COLUMN" type="CHAR" length="255"/>
 		<db-attribute name="CLOB_COLUMN" type="CLOB"/>
 		<db-attribute name="DATE_COLUMN" type="DATE"/>
 		<db-attribute name="DECIMAL_COLUMN" type="DECIMAL" length="12" scale="5"/>
@@ -253,7 +253,7 @@
 		<db-attribute name="TIMESTAMP_COLUMN" type="TIMESTAMP"/>
 		<db-attribute name="TIME_COLUMN" type="TIME"/>
 		<db-attribute name="TINYINT_COLUMN" type="TINYINT"/>
-		<db-attribute name="VARCHAR_COLUMN" type="VARCHAR" length="1000"/>
+		<db-attribute name="VARCHAR_COLUMN" type="VARCHAR" length="255"/>
 	</db-entity>
 	<db-entity name="TYPES_MAPPING_TEST2">
 		<db-attribute name="AAAID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>



Mime
View raw message