Revision: 619
http://openutils.svn.sourceforge.net/openutils/?rev=619&view=rev
Author: fgiust
Date: 2008-02-17 01:11:48 -0800 (Sun, 17 Feb 2008)
Log Message:
-----------
comparison using strings
Modified Paths:
--------------
trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java
Modified: trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java
===================================================================
--- trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java 2008-02-17 09:03:04 UTC (rev 618)
+++ trunk/openutils-testing/src/main/java/it/openutils/testing/DateAssert.java 2008-02-17 09:11:48 UTC (rev 619)
@@ -69,17 +69,20 @@
{
throw new AssertionError("Date is null");
}
- if (!date.equals(expected))
+
+ String expDate;
+ String actDate;
+
+ synchronized (format)
{
- synchronized (format)
- {
- throw new AssertionError("Expected <"
- + format.format(expected)
- + ">, actual <"
- + format.format(date)
- + ">");
- }
+ expDate = format.format(expected);
+ actDate = format.format(date);
}
+
+ if (!expDate.equals(actDate))
+ {
+ throw new AssertionError("Expected <" + expDate + ">, actual <" + actDate + ">");
+ }
}
/**
@@ -112,7 +115,6 @@
*/
public static void dateTimeEqual(String expectedDateAsString, Date date) throws IllegalArgumentException
{
-
performComparison(expectedDateAsString, date, dtf);
}
@@ -124,7 +126,7 @@
*/
public static void dateTimeEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException
{
- dateTimeEqual(expectedDateAsString, date.getTime());
+ performComparison(expectedDateAsString, date.getTime(), dtf);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|