Reviewers: fabbott,

Description:
JsonpRequestTest calls delayTestFinish() after its asynchronous RPC
calls, which sometimes results in unexpected failures.

Please review this at http://gwt-code-reviews.appspot.com/64807

Affected files:
   user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java


Index: user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java
===================================================================
--- user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java (revision  
6088)
+++ user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java (working  
copy)
@@ -103,33 +103,33 @@
    }

    public void testBooleanFalse() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestBoolean(echo("false"), new AssertSuccessCallback<Boolean>(
          Boolean.FALSE));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testBooleanTrue() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestBoolean(echo("true"), new AssertSuccessCallback<Boolean>(
          Boolean.TRUE));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testDouble() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestDouble(echo("123.456"), new AssertSuccessCallback<Double>(
          123.456));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testFailureCallback() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.setFailureCallbackParam("failureCallback");
      jsonp.requestString(echoFailure("ERROR"),
          new AssertFailureCallback<String>("ERROR"));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testInteger() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestInteger(echo("123"), new  
AssertSuccessCallback<Integer>(123));
-    delayTestFinish(RESPONSE_DELAY);
    }

    /**
@@ -137,46 +137,46 @@
     * only a 'callback' parameter, and sends back the error to it.
     */
    public void testNoFailureCallback() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.setFailureCallbackParam(null);
      jsonp.requestString(echoFailure("ERROR"),
          new AssertSuccessCallback<String>("ERROR"));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testNullBoolean() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestBoolean(echo("null"), new  
AssertSuccessCallback<Boolean>(null));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testNullDouble() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestDouble(echo("null"), new  
AssertSuccessCallback<Double>(null));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testNullInteger() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestInteger(echo("null"), new  
AssertSuccessCallback<Integer>(null));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testNullString() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestString(echo("null"), new  
AssertSuccessCallback<String>(null));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testString() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.requestString(echo("'Hello'"), new AssertSuccessCallback<String>(
          "Hello"));
-    delayTestFinish(RESPONSE_DELAY);
    }

    public void testTimeout() {
+    delayTestFinish(jsonp.getTimeout() + 500);
      jsonp.requestString(echoTimeout(), new  
AssertTimeoutExceptionCallback<String>());
-    delayTestFinish(jsonp.getTimeout() + 500);
    }

    public void testVoid() {
+    delayTestFinish(RESPONSE_DELAY);
      jsonp.send(echo(null), new AssertSuccessCallback<Void>(null));
-    delayTestFinish(RESPONSE_DELAY);
    }

    @Override



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

Reply via email to