incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r344227 - /incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
Date Mon, 14 Nov 2005 20:48:05 GMT
Author: clombart
Date: Mon Nov 14 12:48:02 2005
New Revision: 344227

URL: http://svn.apache.org/viewcvs?rev=344227&view=rev
Log:
small changes in this unit test : add more check for Date fields

Modified:
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java?rev=344227&r1=344226&r2=344227&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
Mon Nov 14 12:48:02 2005
@@ -74,7 +74,8 @@
         try
         {
         	PersistenceManager persistenceManager = getPersistenceManager();
-        	
+        	Date date = new Date();
+        	Calendar calendar = Calendar.getInstance();
             // --------------------------------------------------------------------------------
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
@@ -85,10 +86,11 @@
             a.setIntegerObject(new Integer(100));
             a.setIntPrimitive(200);
             a.setString("Test String");
-            a.setDate(new Date());
+            a.setDate(date);
+            
             byte[] content = "Test Byte".getBytes();
             a.setByteArray(content);
-            a.setCalendar(Calendar.getInstance());
+            a.setCalendar(calendar);
             a.setDoubleObject(new Double(2.12));
             a.setDoublePrimitive(1.23);
             long now = System.currentTimeMillis();
@@ -119,7 +121,11 @@
             assertTrue("Incorrect byte object", new String(a.getByteArray()).equals("Test
Byte"));
             
             assertNotNull("date object is null", a.getDate());
+            assertTrue("Invalid date", a.getDate().equals(date));            
             assertNotNull("calendar object is null", a.getCalendar());
+            
+            log.debug("Calendar : " + a.getCalendar().get(Calendar.YEAR) + "-" + a.getCalendar().get(Calendar.MONTH)
+ "-" + a.getCalendar().get(Calendar.DAY_OF_MONTH));
+            assertTrue("Invalid calendar object", a.getCalendar().equals(calendar));
             
             assertNotNull("Double object is null", a.getDoubleObject());
             assertTrue("Incorrect double object", a.getDoubleObject().doubleValue() == 2.12);



Mime
View raw message