Revision: 8912
Author: [email protected]
Date: Thu Sep 30 18:35:57 2010
Log: Allow RequestFactoryGenerator to process method signatures of the form:
<P extends EmployeeProxy> P echo(P proxy);
and generate EmployeeProxyImpl, if it has not already been generated.
Added tests to check this stuff.
Broke off the RequestFactoryPolymorphicTest into a separate module because
the
FindRequest constructor is currently tied to a RequestFactoryImpl.
Patch by: amitmanjhi
Review by: cromwellian
http://code.google.com/p/google-web-toolkit/source/detail?r=8912
Added:
/trunk/user/test/com/google/gwt/requestfactory/RequestFactoryPolymorphicSuite.gwt.xml
Modified:
/trunk/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
/trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryPolymorphicTest.java
=======================================
--- /dev/null
+++
/trunk/user/test/com/google/gwt/requestfactory/RequestFactoryPolymorphicSuite.gwt.xml
Thu Sep 30 18:35:57 2010
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit
2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
+<!--
+ Copyright 2010 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ use this file except in compliance with the License. You may obtain a
copy of
+ the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations
under
+ the License.
+-->
+<module>
+ <inherits name='com.google.gwt.requestfactory.RequestFactory'/>
+ <inherits name='com.google.gwt.junit.JUnit'/>
+ <servlet path='/gwtRequest'
+ class='com.google.gwt.requestfactory.server.RequestFactoryServlet' />
+</module>
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
Thu Sep 30 13:49:33 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/rebind/RequestFactoryGenerator.java
Thu Sep 30 18:35:57 2010
@@ -873,7 +873,7 @@
requestClassName = asInnerImplClass(colType == List.class
? "ListRequestImpl" : "SetRequestImpl", returnType);
} else if (isProxyRequest(typeOracle, requestType)) {
- if
(selectorInterface.isAssignableTo(typeOracle.findType(FindRequest.class.getName())))
{
+ if (selectorInterface.isAssignableTo(findRequestType)) {
extraArgs = ", proxyId";
requestClassName = FindRequestObjectImpl.class.getName();
} else {
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryPolymorphicTest.java
Thu Sep 30 12:30:13 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryPolymorphicTest.java
Thu Sep 30 18:35:57 2010
@@ -32,7 +32,11 @@
@Override
public String getModuleName() {
- return "com.google.gwt.requestfactory.RequestFactorySuite";
+ /*
+ * A single test suite can't have 2 RequestFactory because the
compiler runs
+ * just once across a suite.
+ */
+ return "com.google.gwt.requestfactory.RequestFactoryPolymorphicSuite";
}
public void testGenerator() {
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors