Author: [email protected]
Date: Mon Mar 16 16:27:28 2009
New Revision: 5024

Added:
    trunk/user/src/com/google/gwt/user/client/rpc/impl/FailedRequest.java
       - copied unchanged from r5023,  
/releases/1.6/user/src/com/google/gwt/user/client/rpc/impl/FailedRequest.java
     
trunk/user/src/com/google/gwt/user/client/rpc/impl/FailingRequestBuilder.java
       - copied unchanged from r5023,  
/releases/1.6/user/src/com/google/gwt/user/client/rpc/impl/FailingRequestBuilder.java
    trunk/user/test/com/google/gwt/user/client/rpc/FailedRequestTest.java
       - copied unchanged from r5023,  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/FailedRequestTest.java
     
trunk/user/test/com/google/gwt/user/client/rpc/FailingRequestBuilderTest.java
       - copied, changed from r5023,  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/FailingRequestBuilderTest.java
    trunk/user/test/com/google/gwt/user/client/rpc/MixedSerializable.java
       - copied unchanged from r5023,  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/MixedSerializable.java
     
trunk/user/test/com/google/gwt/user/client/rpc/MixedSerializableEchoService.java
       - copied unchanged from r5023,  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/MixedSerializableEchoService.java
     
trunk/user/test/com/google/gwt/user/client/rpc/MixedSerializableEchoServiceAsync.java
       - copied unchanged from r5023,  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/MixedSerializableEchoServiceAsync.java
     
trunk/user/test/com/google/gwt/user/client/rpc/RunTimeSerializationErrorsTest.java
       - copied unchanged from r5023,  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/RunTimeSerializationErrorsTest.java
     
trunk/user/test/com/google/gwt/user/server/rpc/MixedSerializableEchoServiceImpl.java
       - copied unchanged from r5023,  
/releases/1.6/user/test/com/google/gwt/user/server/rpc/MixedSerializableEchoServiceImpl.java
Modified:
    trunk/   (props changed)
    trunk/dev/core/src/com/google/gwt/core/ext/ServletContainer.java    
(props changed)
     
trunk/dev/core/src/com/google/gwt/core/ext/ServletContainerLauncher.java    
(props changed)
     
trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAggressiveOptimization.java
    
(props changed)
     
trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableAssertions.java  
  
(props changed)
    trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java    
(props changed)
     
trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java   
 
(props changed)
     
trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java   
 
(props changed)
    trunk/distro-source/linux/src/webAppCreator   (props changed)
    trunk/distro-source/mac/src/webAppCreator   (props changed)
    trunk/distro-source/windows/src/webAppCreator.cmd   (props changed)
    trunk/eclipse/samples/Hello/Hello-gwtc.launch   (props changed)
    trunk/samples/dynatable/war/DynaTable.css   (props changed)
    trunk/samples/dynatable/war/DynaTable.html   (props changed)
    trunk/samples/hello/war/Hello.html   (props changed)
    trunk/samples/i18n/war/I18N.css   (props changed)
    trunk/samples/i18n/war/I18N.html   (props changed)
    trunk/samples/json/war/JSON.css   (props changed)
    trunk/samples/json/war/JSON.html   (props changed)
    trunk/samples/mail/war/Mail.css   (props changed)
    trunk/samples/mail/war/Mail.html   (props changed)
    trunk/samples/mail/war/gradient.gif   (props changed)
    trunk/samples/mail/war/leftCorner.gif   (props changed)
    trunk/samples/mail/war/rightCorner.gif   (props changed)
    trunk/samples/showcase/war/Showcase.html   (props changed)
    trunk/samples/simplerpc/war/SimpleRPC.css   (props changed)
    trunk/samples/simplerpc/war/SimpleRPC.html   (props changed)
    trunk/samples/simplexml/war/SimpleXML.css   (props changed)
    trunk/samples/simplexml/war/SimpleXML.html   (props changed)
     
trunk/user/src/com/google/gwt/event/dom/client/HandlesAllFocusEvents.java    
(props changed)
     
trunk/user/src/com/google/gwt/event/dom/client/HandlesAllKeyEvents.java    
(props changed)
     
trunk/user/src/com/google/gwt/event/dom/client/HandlesAllMouseEvents.java    
(props changed)
    trunk/user/src/com/google/gwt/event/dom/client/KeyCodes.java   (props  
changed)
    trunk/user/src/com/google/gwt/event/dom/client/PrivateMap.java   (props  
changed)
     
trunk/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java  
  
(props changed)
     
trunk/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java    
(props changed)
     
trunk/user/src/com/google/gwt/event/logical/shared/ValueChangeHandler.java    
(props changed)
     
trunk/user/src/com/google/gwt/event/shared/DefaultHandlerRegistration.java    
(props changed)
    trunk/user/src/com/google/gwt/event/shared/GwtEvent.java   (props  
changed)
    trunk/user/src/com/google/gwt/event/shared/HandlerRegistration.java    
(props changed)
    trunk/user/src/com/google/gwt/http/client/Request.java
    trunk/user/src/com/google/gwt/user/client/ui/ListenerWrapper.java    
(props changed)
    trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
    trunk/user/src/com/google/gwt/user/tools/WebAppCreator.java   (props  
changed)
    trunk/user/test/com/google/gwt/event/dom/client/DomEventTest.java    
(props changed)
     
trunk/user/test/com/google/gwt/event/logical/shared/LogicalEventsTest.java    
(props changed)
    trunk/user/test/com/google/gwt/user/RPCSuite.gwt.xml
    trunk/user/test/com/google/gwt/user/RPCSuite.java

Log:
Cherry-pick merge of r5023.



Modified: trunk/user/src/com/google/gwt/http/client/Request.java
==============================================================================
--- trunk/user/src/com/google/gwt/http/client/Request.java      (original)
+++ trunk/user/src/com/google/gwt/http/client/Request.java      Mon Mar 16  
16:27:28 2009
@@ -148,6 +148,16 @@
     * and set this field to null.
     */
    private XMLHttpRequest xmlHttpRequest;
+
+  /**
+   * Only used for building a
+   * {...@link com.google.gwt.user.client.rpc.impl.FailedRequest}.
+   */
+  protected Request() {
+    timeoutMillis = 0;
+    xmlHttpRequest = null;
+    timer = null;
+  }

    /**
     * Constructs an instance of the Request object.

Modified: trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
==============================================================================
--- trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java      
(original)
+++ trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java     Mon Mar 
 
16 16:27:28 2009
@@ -39,6 +39,8 @@
  import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
  import com.google.gwt.user.client.rpc.SerializationException;
  import com.google.gwt.user.client.rpc.impl.ClientSerializationStreamWriter;
+import com.google.gwt.user.client.rpc.impl.FailedRequest;
+import com.google.gwt.user.client.rpc.impl.FailingRequestBuilder;
  import com.google.gwt.user.client.rpc.impl.RemoteServiceProxy;
  import  
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.ResponseReader;
  import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
@@ -485,7 +487,25 @@
        String exceptionName = nameFactory.createName("ex");
        w.println(exceptionName + ") {");
        w.indent();
-      w.println(callbackName + ".onFailure(" + exceptionName + ");");
+      if (!asyncReturnType.getQualifiedSourceName().equals(
+          RequestBuilder.class.getName())) {
+        /*
+         * If the method returns void or Request, signal the serialization  
error
+         * immediately. If the method returns RequestBuilder, the error  
will be
+         * signaled whenever RequestBuilder.send() is invoked.
+         */
+        w.println(callbackName + ".onFailure(" + exceptionName + ");");
+      }
+      if (asyncReturnType.getQualifiedSourceName().equals(
+          RequestBuilder.class.getName())) {
+        w.println("return new " + FailingRequestBuilder.class.getName()  
+ "("
+            + exceptionName + ", " + callbackName + ");");
+      } else if (asyncReturnType.getQualifiedSourceName().equals(
+          Request.class.getName())) {
+        w.println("return new " + FailedRequest.class.getName() + "();");
+      } else {
+        assert asyncReturnType == JPrimitiveType.VOID;
+      }
        w.outdent();
        w.println("}");
      }

Modified: trunk/user/test/com/google/gwt/user/RPCSuite.gwt.xml
==============================================================================
--- trunk/user/test/com/google/gwt/user/RPCSuite.gwt.xml        (original)
+++ trunk/user/test/com/google/gwt/user/RPCSuite.gwt.xml        Mon Mar 16  
16:27:28 2009
@@ -18,7 +18,7 @@
    <define-property name='rpc.enforceTypeVersioning' values="true, false" />
    <set-property name='rpc.enforceTypeVersioning' value='true' />

-  <servlet path='/echo'  
class='com.google.gwt.user.server.rpc.EchoServiceImpl' />
+  <servlet path='/echo'  
class='com.google.gwt.user.server.rpc.MixedSerializableEchoServiceImpl' />
    <servlet path='/collections'
      class='com.google.gwt.user.server.rpc.CollectionsTestServiceImpl' />
    <servlet path='/customfieldserializers'

Modified: trunk/user/test/com/google/gwt/user/RPCSuite.java
==============================================================================
--- trunk/user/test/com/google/gwt/user/RPCSuite.java   (original)
+++ trunk/user/test/com/google/gwt/user/RPCSuite.java   Mon Mar 16 16:27:28  
2009
@@ -23,10 +23,13 @@
  import  
com.google.gwt.user.client.rpc.CustomFieldSerializerTestWithTypeObfuscation;
  import com.google.gwt.user.client.rpc.EnumsTest;
  import com.google.gwt.user.client.rpc.EnumsTestWithTypeObfuscation;
+import com.google.gwt.user.client.rpc.FailedRequestTest;
+import com.google.gwt.user.client.rpc.FailingRequestBuilderTest;
  import com.google.gwt.user.client.rpc.InheritanceTest;
  import com.google.gwt.user.client.rpc.InheritanceTestWithTypeObfuscation;
  import com.google.gwt.user.client.rpc.ObjectGraphTest;
  import com.google.gwt.user.client.rpc.ObjectGraphTestWithTypeObfuscation;
+import com.google.gwt.user.client.rpc.RunTimeSerializationErrorsTest;
  import com.google.gwt.user.client.rpc.UnicodeEscapingTest;
  import  
com.google.gwt.user.client.rpc.UnicodeEscapingTestWithTypeObfuscation;
  import com.google.gwt.user.client.rpc.ValueTypesTest;
@@ -70,6 +73,8 @@
      suite.addTestSuite(SerializationPolicyLoaderTest.class);
      suite.addTestSuite(RPCServletUtilsTest.class);
      suite.addTestSuite(RPCRequestTest.class);
+    suite.addTestSuite(FailedRequestTest.class);
+    suite.addTestSuite(FailingRequestBuilderTest.class);

      // GWTTestCases
      suite.addTestSuite(ValueTypesTest.class);
@@ -80,6 +85,7 @@
      suite.addTestSuite(ObjectGraphTest.class);
       
suite.addTestSuite(com.google.gwt.user.client.rpc.RemoteServiceServletTest.class);
      suite.addTestSuite(UnicodeEscapingTest.class);
+    suite.addTestSuite(RunTimeSerializationErrorsTest.class);

      // This test turns on the type-elision feature of RPC
      suite.addTestSuite(ValueTypesTestWithTypeObfuscation.class);

Copied:  
trunk/user/test/com/google/gwt/user/client/rpc/FailingRequestBuilderTest.java  
(from r5023,  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/FailingRequestBuilderTest.java)
==============================================================================
---  
/releases/1.6/user/test/com/google/gwt/user/client/rpc/FailingRequestBuilderTest.java
    
(original)
+++  
trunk/user/test/com/google/gwt/user/client/rpc/FailingRequestBuilderTest.java   
 
Mon Mar 16 16:27:28 2009
@@ -17,21 +17,14 @@

  import com.google.gwt.http.client.RequestBuilder;
  import com.google.gwt.http.client.RequestException;
-import com.google.gwt.junit.client.GWTTestCase;
  import com.google.gwt.user.client.rpc.impl.FailingRequestBuilder;

+import junit.framework.TestCase;
+
  /**
   * Tests the {...@link FailingRequestBuilder} class.
- *
- * TODO(spoon): this does not need to be a GWTTestCase when this class is  
merged
- * to trunk.
   */
-public class FailingRequestBuilderTest extends GWTTestCase {
-  @Override
-  public String getModuleName() {
-    return "com.google.gwt.user.RPCSuite";
-  }
-
+public class FailingRequestBuilderTest extends TestCase {
    public void testBasics() throws RequestException {
      final boolean[] callbackCalled = new boolean[] {false};


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

Reply via email to