Fixed a bug in JsonRequestProcessor wherein a fast test run could result in failure, because the two Date() calls would return the same millis.
Patch by: amitmanjhi
Review by: rjrjr, cromwellian (tbr)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8597 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java b/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
index f87a40b..aa4a675 100644
--- a/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
+++ b/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
@@ -170,7 +170,8 @@
foo.put("userName", "JSC");
foo.put("intId", 45);
Date now = new Date();
- foo.put("created", "" + now.getTime());
+ long newTime = now.getTime() + 10000;
+ foo.put("created", "" + newTime);
JSONObject result = getResultFromServer(foo);
@@ -179,7 +180,7 @@
fooResult = SimpleFoo.getSingleton();
assertEquals((int) 45, (int) fooResult.getIntId());
assertEquals("JSC", fooResult.getUserName());
- assertEquals(now, fooResult.getCreated());
+ assertEquals(newTime, fooResult.getCreated().getTime());
} catch (Exception e) {
e.printStackTrace();
fail(e.toString());