Author: jcosta(a)redhat.com
Date: 2009-01-14 09:10:36 -0500 (Wed, 14 Jan 2009)
New Revision: 15780
Modified:
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java
Log:
ANN-795 - Added DateFormat to compare dates, otherwise, there are problems with Sybase
Modified:
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java
===================================================================
---
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java 2009-01-14
13:59:49 UTC (rev 15779)
+++
annotations/branches/v3_2_1_GA_CP/src/test/org/hibernate/test/annotations/EntityTest.java 2009-01-14
14:10:36 UTC (rev 15780)
@@ -1,6 +1,8 @@
//$Id$
package org.hibernate.test.annotations;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
@@ -17,9 +19,11 @@
* @author Emmanuel Bernard
*/
public class EntityTest extends TestCase {
-
+ private DateFormat df;
+
public EntityTest(String x) {
super( x );
+ df = SimpleDateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
}
public void testLoad() throws Exception {
@@ -324,10 +328,10 @@
Flight copyAirFrance = (Flight) q.uniqueResult();
assertNotNull( airFrance );
assertEquals(
- new Date( 05, 06, 21 ),
- copyAirFrance.getDepartureDate()
+ df.format(new Date( 05, 06, 21 )).toString(),
+ df.format(copyAirFrance.getDepartureDate()).toString()
);
- assertEquals( airFrance.getBuyDate(), copyAirFrance.getBuyDate());
+ assertEquals( df.format(airFrance.getBuyDate()),
df.format(copyAirFrance.getBuyDate()));
s.delete( copyAirFrance );
tx.commit();
s.close();
Show replies by date