empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franci...@apache.org
Subject svn commit: r748941 - /incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/DateUtilsTest.java
Date Sun, 01 Mar 2009 00:17:51 GMT
Author: francisdb
Date: Sun Mar  1 00:17:51 2009
New Revision: 748941

URL: http://svn.apache.org/viewvc?rev=748941&view=rev
Log:
fixed the test case

Modified:
    incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/DateUtilsTest.java

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/DateUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/DateUtilsTest.java?rev=748941&r1=748940&r2=748941&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/DateUtilsTest.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/DateUtilsTest.java
Sun Mar  1 00:17:51 2009
@@ -93,12 +93,13 @@
 		Date pastDate = DateUtils.addDate(date, -1, -2, -3);
 		Calendar past = Calendar.getInstance();
 		past.setTime(pastDate);
-		past.add(Calendar.YEAR, 1);
-		past.add(Calendar.MONTH, 2);
-		past.add(Calendar.DAY_OF_MONTH, 3);
-		assertEquals(now.get(Calendar.YEAR), past.get(Calendar.YEAR));
-		assertEquals(now.get(Calendar.MONTH), past.get(Calendar.MONTH));
-		assertEquals(now.get(Calendar.DAY_OF_MONTH), past.get(Calendar.DAY_OF_MONTH));
+		Calendar copy = (Calendar) now.clone();
+		copy.add(Calendar.YEAR, -1);
+		copy.add(Calendar.MONTH, -2);
+		copy.add(Calendar.DAY_OF_MONTH, -3);
+		assertEquals(past.get(Calendar.YEAR), copy.get(Calendar.YEAR));
+		assertEquals(past.get(Calendar.MONTH), copy.get(Calendar.MONTH));
+		assertEquals(past.get(Calendar.DAY_OF_MONTH), copy.get(Calendar.DAY_OF_MONTH));
 	}
 
 	/**



Mime
View raw message