Revision: 8597
Author: [email protected]
Date: Fri Aug 20 05:05:26 2010
Log: 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)

http://code.google.com/p/google-web-toolkit/source/detail?r=8597

Modified:
/trunk/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java

=======================================
--- /trunk/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java Wed Aug 18 15:57:33 2010 +++ /trunk/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java Fri Aug 20 05:05:26 2010
@@ -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());

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to