cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From evg...@apache.org
Subject svn commit: r898732 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test: java/org/apache/cayenne/access/DateTimeTypesTest.java resources/testmap.map.xml
Date Wed, 13 Jan 2010 12:40:49 GMT
Author: evgeny
Date: Wed Jan 13 12:40:48 2010
New Revision: 898732

URL: http://svn.apache.org/viewvc?rev=898732&view=rev
Log:
CAY-1354
Fixed DateTimeTypesTest to be working on PosgreSQL and SQL Server.

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DateTimeTypesTest.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/DateTimeTypesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DateTimeTypesTest.java?rev=898732&r1=898731&r2=898732&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DateTimeTypesTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DateTimeTypesTest.java
Wed Jan 13 12:40:48 2010
@@ -20,7 +20,6 @@
 package org.apache.cayenne.access;
 
 import java.sql.Time;
-import java.sql.Timestamp;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -143,10 +142,9 @@
 
         NamedQuery q = new NamedQuery("SelectDateTest");
         DataRow testRead = (DataRow) context.performQuery(q).get(0);
-        Object columnValue = testRead.get("TIMESTAMP_COLUMN");
+        Date columnValue = (Date) testRead.get("TIMESTAMP_COLUMN");
         assertNotNull(columnValue);
         assertEquals(now, columnValue);
-        assertEquals(Timestamp.class, columnValue.getClass());
     }
 
     public void testSQLTemplateDate() throws Exception {
@@ -165,10 +163,9 @@
 
         NamedQuery q = new NamedQuery("SelectDateTest");
         DataRow testRead = (DataRow) context.performQuery(q).get(0);
-        Object columnValue = testRead.get("DATE_COLUMN");
+        Date columnValue = (Date) testRead.get("DATE_COLUMN");
         assertNotNull(columnValue);
-        assertEquals(java.sql.Date.class, columnValue.getClass());
-        assertEquals(now.toString(), columnValue.toString());
+        assertEquals(now.toString(), new java.sql.Date(columnValue.getTime()).toString());
     }
 
     public void testSQLTemplateTime() throws Exception {
@@ -187,9 +184,8 @@
 
         NamedQuery q = new NamedQuery("SelectDateTest");
         DataRow testRead = (DataRow) context.performQuery(q).get(0);
-        Object columnValue = testRead.get("TIME_COLUMN");
+        Date columnValue = (Date) testRead.get("TIME_COLUMN");
         assertNotNull(columnValue);
-        assertEquals(Time.class, columnValue.getClass());
-        assertEquals(now.toString(), columnValue.toString());
+        assertEquals(now.toString(), new Time(columnValue.getTime()).toString());
     }
 }

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=898732&r1=898731&r2=898732&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
Wed Jan 13 12:40:48 2010
@@ -635,6 +635,7 @@
 	</query>
 	<query name="SelectDateTest" factory="org.apache.cayenne.map.SQLTemplateBuilder" root="data-map"
root-name="testmap">
 		<property name="cayenne.GenericSelectQuery.fetchingDataRows" value="true"/>
+		<property name="cayenne.SQLTemplate.columnNameCapitalization" value="UPPER"/>
 		<sql><![CDATA[SELECT * FROM DATE_TEST]]></sql>
 	</query>
 	<query name="SelectTestLower" factory="org.apache.cayenne.map.SQLTemplateBuilder" root="data-map"
root-name="testmap">



Mime
View raw message