Revision: 10238
Author: [email protected]
Date: Fri May 27 04:59:21 2011
Log: Add BatchedRequestScope utility class to aggregate all requests
made within a single tick of the event loop.
Add FanoutReceiver utility class.
Remove redundant tests from RequestFactoryGwtJreSuite.
Patch by: bobv
Review by: rjrjr
Review at http://gwt-code-reviews.appspot.com/1449804
http://code.google.com/p/google-web-toolkit/source/detail?r=10238
Added:
/trunk/user/src/com/google/web/bindery/requestfactory/gwt/client/RequestBatcher.java
/trunk/user/src/com/google/web/bindery/requestfactory/shared/FanoutReceiver.java
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/client/RequestBatcherTest.java
/trunk/user/test/com/google/web/bindery/requestfactory/server/FanoutReceiverJreTest.java
/trunk/user/test/com/google/web/bindery/requestfactory/shared/FanoutReceiverTest.java
Modified:
/trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/RequestFactoryGwtJreSuite.java
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/RequestFactorySuite.java
/trunk/user/test/com/google/web/bindery/requestfactory/vm/RequestFactoryJreSuite.java
=======================================
--- /dev/null
+++
/trunk/user/src/com/google/web/bindery/requestfactory/gwt/client/RequestBatcher.java
Fri May 27 04:59:21 2011
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2011 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.
+ */
+package com.google.web.bindery.requestfactory.gwt.client;
+
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.web.bindery.requestfactory.shared.Receiver;
+import com.google.web.bindery.requestfactory.shared.RequestContext;
+import com.google.web.bindery.requestfactory.shared.RequestFactory;
+import
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext;
+
+/**
+ * A RequestBatcher is a convenience class that allows RequestFactory
operations
+ * to be aggregated over a single tick of the event loop and sent as one
HTTP
+ * request. Instances of RequestBatcher are reusable, so they may be used
as
+ * application-wide singleton objects or within a particular subsystem or
UI.
+ * <p>
+ * Subclasses need only to provide the instance of the RequestFactory used
by
+ * the application and a method to provide a "default" RequestContext from
the
+ * RequestFactory.
+ *
+ * <pre>
+ * public class MyRequestBatcher extends RequestBatcher<MyRequestFactory,
MyRequestContext> {
+ * public MyRequestBatcher() {
+ * // MyRequestFactory could also be injected
+ * super(GWT.create(MyRequestFactory.class));
+ * }
+ *
+ * protected MyRequestContext createContext(MyRequestFactory factory) {
+ * return factory.myRequestContext();
+ * }
+ * }
+ * </pre>
+ * A singleton or otherwise scoped instance of RequestBatcher should be
injected
+ * into consuming classes. The {@link RequestContext#fire()} and
+ * {@link com.google.web.bindery.requestfactory.shared.Request#fire()
+ * Request.fire()} methods reachable from the RequestContext returned from
+ * {@link #get()} will not trigger an HTTP request. The
+ * {@link RequestContext#fire(Receiver)} and
+ * {@link
com.google.web.bindery.requestfactory.shared.Request#fire(Receiver)
+ * Request.fire(Receiver)} methods will register their associated
Receivers as
+ * usual. This allows consuming code to be written that can be used with or
+ * without a RequestBatcher.
+ * <p>
+ * When an application uses multiple RequestContext types, the
+ * {@link RequestContext#append(RequestContext)} method can be used to
chain
+ * multiple RequestContext objects together:
+ *
+ * <pre>
+ * class MyRequestBatcher {
+ * public OtherRequestContext otherContext() {
+ * return get().append(getFactory().otherContext());
+ * }
+ * }
+ * </pre>
+ *
+ * @param <F> the type of RequestFactory
+ * @param <C> any RequestContext type
+ * @see Scheduler#scheduleFinally(ScheduledCommand)
+ */
+public abstract class RequestBatcher<F extends RequestFactory, C extends
RequestContext> {
+ private C openContext;
+ private AbstractRequestContext openContextImpl;
+ private final F requestFactory;
+
+ protected RequestBatcher(F requestFactory) {
+ this.requestFactory = requestFactory;
+ }
+
+ /**
+ * Returns a mutable {@link RequestContext}.
+ */
+ public C get() {
+ return get(null);
+ }
+
+ /**
+ * Returns a mutable {@link RequestContext} and enqueues the given
receiver to
+ * be called as though it had been passed directly to
+ * {@link RequestContext#fire(Receiver)}.
+ */
+ public C get(Receiver<Void> receiver) {
+ if (openContext == null) {
+ openContext = createContext(requestFactory);
+ openContextImpl = (AbstractRequestContext) openContext;
+ openContextImpl.setFireDisabled(true);
+ getScheduler().scheduleFinally(new ScheduledCommand() {
+ @Override
+ public void execute() {
+
assert !openContextImpl.isLocked() : "AbstractRequestContext.fire() should
have been a no-op";
+ openContextImpl.setFireDisabled(false);
+ openContext.fire();
+ openContext = null;
+ openContextImpl = null;
+ }
+ });
+ }
+ if (receiver != null) {
+ // Queue a final callback receiver
+ openContextImpl.fire(receiver);
+ }
+ return openContext;
+ }
+
+ /**
+ * Convenience access to the RequestFactory instance to aid developers
using
+ * multiple RequestContext types.
+ *
+ * <pre>
+ * RequestBatcher{@literal <MyRequestFactory, MyRequestContext>} batcher;
+ *
+ * public void useOtherRequestContext() {
+ * OtherRequestContext ctx =
batcher.get().append(batcher.getFactory().otherContext());
+ * ctx.someOtherMethod().to(someReceiver);
+ * }
+ * </pre>
+ */
+ public F getRequestFactory() {
+ return requestFactory;
+ }
+
+ /**
+ * Subclasses must implement this method to return an instance of a
+ * RequestContext.
+ */
+ protected abstract C createContext(F requestFactory);
+
+ /**
+ * Returns {@link Scheduler#get()}, but may be overridden for testing
+ * purposes.
+ */
+ protected Scheduler getScheduler() {
+ return Scheduler.get();
+ }
+}
=======================================
--- /dev/null
+++
/trunk/user/src/com/google/web/bindery/requestfactory/shared/FanoutReceiver.java
Fri May 27 04:59:21 2011
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2011 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.
+ */
+package com.google.web.bindery.requestfactory.shared;
+
+import com.google.web.bindery.event.shared.UmbrellaException;
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+
+/**
+ * A FanoutReceiver will forward its callbacks to zero or more other
Receivers.
+ * Any exceptions thrown by the queued Receivers will be re-thrown as an
+ * {@link UmbrellaException} after all Receivers have been invoked.
+ *
+ * @param <T> the type of data being received
+ */
+public class FanoutReceiver<T> extends Receiver<T> {
+ private List<Receiver<? super T>> toCall;
+ private Set<Throwable> toThrow;
+
+ /**
+ * Register a receiver to be called by the fanout.
+ *
+ * @throws IllegalArgumentException if {@code receiver} is {@code null}
+ */
+ public void add(Receiver<? super T> receiver) {
+ if (receiver == null) {
+ throw new IllegalArgumentException();
+ }
+ if (toCall == null) {
+ toCall = new ArrayList<Receiver<? super T>>();
+ }
+ toCall.add(receiver);
+ }
+
+ @Override
+ public void onConstraintViolation(Set<ConstraintViolation<?>>
violations) {
+ try {
+ if (toCall != null) {
+ for (Receiver<? super T> r : toCall) {
+ try {
+ r.onConstraintViolation(violations);
+ } catch (Throwable t) {
+ onUncaughtThrowable(t);
+ }
+ }
+ }
+ } finally {
+ finish();
+ }
+ }
+
+ @Override
+ public void onFailure(ServerFailure error) {
+ try {
+ if (toCall != null) {
+ for (Receiver<? super T> r : toCall) {
+ try {
+ r.onFailure(error);
+ } catch (Throwable t) {
+ onUncaughtThrowable(t);
+ }
+ }
+ }
+ } finally {
+ finish();
+ }
+ }
+
+ @Override
+ public void onSuccess(T response) {
+ try {
+ if (toCall != null) {
+ for (Receiver<? super T> r : toCall) {
+ try {
+ r.onSuccess(response);
+ } catch (Throwable t) {
+ onUncaughtThrowable(t);
+ }
+ }
+ }
+ } finally {
+ finish();
+ }
+ }
+
+ @Deprecated
+ @Override
+ public void onViolation(Set<Violation> errors) {
+ try {
+ if (toCall != null) {
+ for (Receiver<? super T> r : toCall) {
+ try {
+ r.onViolation(errors);
+ } catch (Throwable t) {
+ onUncaughtThrowable(t);
+ }
+ }
+ }
+ } finally {
+ finish();
+ }
+ }
+
+ /**
+ * Called after all Receivers have been executed.
+ */
+ protected void finish() {
+ if (toThrow != null) {
+ // Reset if the user wants to re-fire the Request
+ Set<Throwable> causes = toThrow;
+ toThrow = null;
+ throw new UmbrellaException(causes);
+ }
+ }
+
+ /**
+ * Subclasses may override this method to alter how the FanoutReceiver
+ * collects exceptions that escape from the queued Receivers.
+ */
+ protected void onUncaughtThrowable(Throwable t) {
+ if (toThrow == null) {
+ toThrow = new LinkedHashSet<Throwable>();
+ }
+ toThrow.add(t);
+ }
+}
=======================================
--- /dev/null
+++
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/client/RequestBatcherTest.java
Fri May 27 04:59:21 2011
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2011 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.
+ */
+package com.google.web.bindery.requestfactory.gwt.client;
+
+import com.google.web.bindery.requestfactory.shared.Receiver;
+import com.google.web.bindery.requestfactory.shared.SimpleBarRequest;
+import com.google.web.bindery.requestfactory.shared.SimpleFooRequest;
+import com.google.web.bindery.requestfactory.shared.SimpleRequestFactory;
+import
com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Runtime test for RequestBatcher.
+ */
+public class RequestBatcherTest extends RequestFactoryTestBase {
+
+ private class MyBatcher extends RequestBatcher<SimpleRequestFactory,
SimpleFooRequest> {
+ public MyBatcher() {
+ super(req);
+ }
+
+ public SimpleBarRequest simpleBarRequest() {
+ return get().append(getRequestFactory().simpleBarRequest());
+ }
+
+ @Override
+ protected SimpleFooRequest createContext(SimpleRequestFactory
requestFactory) {
+ return requestFactory.simpleFooRequest();
+ }
+ }
+
+ private static final int TEST_DELAY = 500000;
+
+ @Override
+ public String getModuleName() {
+ return "com.google.web.bindery.requestfactory.gwt.RequestFactorySuite";
+ }
+
+ /**
+ * Check automatic firing, chaining, and Void callbacks.
+ */
+ public void test() {
+ delayTestFinish(TEST_DELAY);
+ final List<Boolean> ok = new ArrayList<Boolean>();
+ MyBatcher batcher = new MyBatcher();
+ batcher.get().add(3, 5).to(new Receiver<Integer>() {
+ @Override
+ public void onSuccess(Integer response) {
+ assertEquals(8, response.intValue());
+ ok.add(true);
+ }
+ });
+ // Verify that Request.fire() only enqueues the Receiver
+ batcher.simpleBarRequest().countSimpleBar().fire(new Receiver<Long>() {
+ @Override
+ public void onSuccess(Long response) {
+ assertEquals(2, response.longValue());
+ ok.add(true);
+ }
+ });
+ // Same check for RequestContext.fire()
+ batcher.get().fire(new Receiver<Void>() {
+ @Override
+ public void onSuccess(Void response) {
+ ok.add(true);
+ }
+ });
+ // Test final callbacks through RequestBatcher
+ batcher.get(new Receiver<Void>() {
+ @Override
+ public void onSuccess(Void response) {
+ assertEquals(3, ok.size());
+ finishTestAndReset();
+ }
+ });
+ assertFalse(((AbstractRequestContext) batcher.get()).isLocked());
+ }
+}
=======================================
--- /dev/null
+++
/trunk/user/test/com/google/web/bindery/requestfactory/server/FanoutReceiverJreTest.java
Fri May 27 04:59:21 2011
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2011 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.
+ */
+package com.google.web.bindery.requestfactory.server;
+
+import com.google.web.bindery.requestfactory.shared.FanoutReceiverTest;
+
+/**
+ * JRE version of FanoutReceiverTest.
+ */
+public class FanoutReceiverJreTest extends FanoutReceiverTest {
+ @Override
+ public String getModuleName() {
+ return null;
+ }
+}
=======================================
--- /dev/null
+++
/trunk/user/test/com/google/web/bindery/requestfactory/shared/FanoutReceiverTest.java
Fri May 27 04:59:21 2011
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2011 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.
+ */
+package com.google.web.bindery.requestfactory.shared;
+
+import com.google.gwt.junit.client.GWTTestCase;
+import com.google.web.bindery.event.shared.UmbrellaException;
+
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+
+/**
+ * A simple unit test of FanoutReceiver.
+ */
+public class FanoutReceiverTest extends GWTTestCase {
+ private static class CountingReceiver extends Receiver<Integer> {
+ private boolean explode;
+ private int onConstraintViolation;
+ private int onFailure;
+ private int onSuccess;
+ private int onViolation;
+
+ public void check() {
+ assertEquals(1, onConstraintViolation);
+ assertEquals(1, onFailure);
+ assertEquals(1, onSuccess);
+ assertEquals(1, onViolation);
+ }
+
+ private void maybeExplode() {
+ if (explode) {
+ throw new RuntimeException(MESSAGE);
+ }
+ }
+
+ @Override
+ public void onConstraintViolation(Set<ConstraintViolation<?>>
violations) {
+ maybeExplode();
+ onConstraintViolation++;
+ }
+
+ @Override
+ public void onFailure(ServerFailure error) {
+ maybeExplode();
+ onFailure++;
+ }
+
+ @Override
+ public void onSuccess(Integer response) {
+ maybeExplode();
+ assertEquals(EXPECTED_VALUE, response.intValue());
+ onSuccess++;
+ }
+
+ @Deprecated
+ @Override
+ public void onViolation(Set<Violation> errors) {
+ maybeExplode();
+ onViolation++;
+ }
+
+ public void setExplode(boolean explode) {
+ this.explode = explode;
+ }
+ }
+
+ private static final int EXPECTED_VALUE = 42;
+ private static final String MESSAGE = "It didn't work!";
+
+ @Override
+ public String getModuleName() {
+ return "com.google.web.bindery.requestfactory.gwt.RequestFactorySuite";
+ }
+
+ @SuppressWarnings("deprecation")
+ public void test() {
+ CountingReceiver c1 = new CountingReceiver();
+ CountingReceiver c2 = new CountingReceiver();
+ FanoutReceiver<Integer> fan = new FanoutReceiver<Integer>();
+ fan.add(c1);
+ fan.add(c2);
+ fan.onConstraintViolation(null);
+ fan.onFailure(null);
+ fan.onSuccess(EXPECTED_VALUE);
+ fan.onViolation(null);
+ c1.check();
+ c2.check();
+ }
+
+ public void testAddNull() {
+ try {
+ new FanoutReceiver<Void>().add(null);
+ fail();
+ } catch (IllegalArgumentException expected) {
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void testExceptions() {
+ CountingReceiver c1 = new CountingReceiver();
+ c1.setExplode(true);
+ CountingReceiver c2 = new CountingReceiver();
+ FanoutReceiver<Integer> fan = new FanoutReceiver<Integer>();
+ fan.add(c1);
+ fan.add(c2);
+ try {
+ fan.onConstraintViolation(null);
+ fail("Expected UmbrellaException");
+ } catch (UmbrellaException ex) {
+ assertEquals(1, ex.getCauses().size());
+ assertEquals(MESSAGE, ex.getCause().getMessage());
+ }
+ try {
+ fan.onFailure(null);
+ fail("Expected UmbrellaException");
+ } catch (UmbrellaException ex) {
+ assertEquals(1, ex.getCauses().size());
+ assertEquals(MESSAGE, ex.getCause().getMessage());
+ }
+ try {
+ fan.onSuccess(EXPECTED_VALUE);
+ fail("Expected UmbrellaException");
+ } catch (UmbrellaException ex) {
+ assertEquals(1, ex.getCauses().size());
+ assertEquals(MESSAGE, ex.getCause().getMessage());
+ }
+ try {
+ fan.onViolation(null);
+ fail("Expected UmbrellaException");
+ } catch (UmbrellaException ex) {
+ assertEquals(1, ex.getCauses().size());
+ assertEquals(MESSAGE, ex.getCause().getMessage());
+ }
+ // Make sure that c2 stil gets called
+ c2.check();
+ }
+}
=======================================
---
/trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
Thu Apr 21 12:44:49 2011
+++
/trunk/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
Fri May 27 04:59:21 2011
@@ -33,6 +33,7 @@
import com.google.web.bindery.requestfactory.shared.BaseProxy;
import com.google.web.bindery.requestfactory.shared.EntityProxy;
import com.google.web.bindery.requestfactory.shared.EntityProxyChange;
+import com.google.web.bindery.requestfactory.shared.FanoutReceiver;
import com.google.web.bindery.requestfactory.shared.Receiver;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import
com.google.web.bindery.requestfactory.shared.RequestTransport.TransportReceiver;
@@ -97,6 +98,12 @@
protected static class State {
public final AbstractRequestContext canonical;
public final DialectImpl dialect;
+ public FanoutReceiver<Void> fanout;
+ /**
+ * When {@code true} the {@link AbstractRequestContext#fire()} method
will
+ * be a no-op.
+ */
+ public boolean fireDisabled;
public final List<AbstractRequest<?>> invocations = new
ArrayList<AbstractRequest<?>>();
public boolean locked;
@@ -618,6 +625,10 @@
return state.requestFactory.isValueType(clazz);
};
+ public void setFireDisabled(boolean disabled) {
+ state.fireDisabled = disabled;
+ }
+
/**
* Called by generated subclasses to enqueue a method invocation.
*/
@@ -1005,7 +1016,24 @@
return clone;
}
- private void doFire(final Receiver<Void> receiver) {
+ private void doFire(Receiver<Void> receiver) {
+ final Receiver<Void> finalReceiver;
+ if (state.fireDisabled) {
+ if (receiver != null) {
+ if (state.fanout == null) {
+ state.fanout = new FanoutReceiver<Void>();
+ }
+ state.fanout.add(receiver);
+ }
+ return;
+ } else if (state.fanout != null) {
+ if (receiver != null) {
+ state.fanout.add(receiver);
+ }
+ finalReceiver = state.fanout;
+ } else {
+ finalReceiver = receiver;
+ }
checkLocked();
state.locked = true;
@@ -1014,11 +1042,11 @@
String payload = state.dialect.makePayload();
state.requestFactory.getRequestTransport().send(payload, new
TransportReceiver() {
public void onTransportFailure(ServerFailure failure) {
- fail(receiver, failure);
+ fail(finalReceiver, failure);
}
public void onTransportSuccess(String payload) {
- state.dialect.processPayload(receiver, payload);
+ state.dialect.processPayload(finalReceiver, payload);
}
});
}
=======================================
---
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/RequestFactoryGwtJreSuite.java
Tue Apr 5 10:47:39 2011
+++
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/RequestFactoryGwtJreSuite.java
Fri May 27 04:59:21 2011
@@ -16,16 +16,6 @@
package com.google.web.bindery.requestfactory.gwt;
import
com.google.web.bindery.requestfactory.gwt.rebind.model.RequestFactoryModelTest;
-import
com.google.web.bindery.requestfactory.server.BoxesAndPrimitivesJreTest;
-import com.google.web.bindery.requestfactory.server.ComplexKeysJreTest;
-import com.google.web.bindery.requestfactory.server.FindServiceJreTest;
-import com.google.web.bindery.requestfactory.server.LocatorJreTest;
-import
com.google.web.bindery.requestfactory.server.RequestFactoryExceptionPropagationJreTest;
-import
com.google.web.bindery.requestfactory.server.RequestFactoryInterfaceValidatorTest;
-import com.google.web.bindery.requestfactory.server.RequestFactoryJreTest;
-import
com.google.web.bindery.requestfactory.server.RequestFactoryUnicodeEscapingJreTest;
-import
com.google.web.bindery.requestfactory.server.ServiceInheritanceJreTest;
-import
com.google.web.bindery.requestfactory.shared.impl.SimpleEntityProxyIdTest;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -41,18 +31,8 @@
public class RequestFactoryGwtJreSuite {
public static Test suite() {
TestSuite suite = new TestSuite(
- "requestfactory package tests that require the JRE");
- suite.addTestSuite(BoxesAndPrimitivesJreTest.class);
- suite.addTestSuite(ComplexKeysJreTest.class);
- suite.addTestSuite(FindServiceJreTest.class);
- suite.addTestSuite(LocatorJreTest.class);
- suite.addTestSuite(RequestFactoryExceptionPropagationJreTest.class);
- suite.addTestSuite(RequestFactoryInterfaceValidatorTest.class);
- suite.addTestSuite(RequestFactoryJreTest.class);
+ "requestfactory package tests that require the JRE and gwt-user");
suite.addTestSuite(RequestFactoryModelTest.class);
- suite.addTestSuite(RequestFactoryUnicodeEscapingJreTest.class);
- suite.addTestSuite(ServiceInheritanceJreTest.class);
- suite.addTestSuite(SimpleEntityProxyIdTest.class);
return suite;
}
=======================================
---
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/RequestFactorySuite.java
Tue Apr 5 10:47:39 2011
+++
/trunk/user/test/com/google/web/bindery/requestfactory/gwt/RequestFactorySuite.java
Fri May 27 04:59:21 2011
@@ -16,6 +16,7 @@
package com.google.web.bindery.requestfactory.gwt;
import com.google.gwt.junit.tools.GWTTestSuite;
+import com.google.web.bindery.requestfactory.gwt.client.RequestBatcherTest;
import com.google.web.bindery.requestfactory.gwt.client.FindServiceTest;
import
com.google.web.bindery.requestfactory.gwt.client.RequestFactoryExceptionHandlerTest;
import
com.google.web.bindery.requestfactory.gwt.client.RequestFactoryExceptionPropagationTest;
@@ -25,6 +26,7 @@
import com.google.web.bindery.requestfactory.gwt.client.ui.EditorTest;
import com.google.web.bindery.requestfactory.shared.BoxesAndPrimitivesTest;
import com.google.web.bindery.requestfactory.shared.ComplexKeysTest;
+import com.google.web.bindery.requestfactory.shared.FanoutReceiverTest;
import com.google.web.bindery.requestfactory.shared.LocatorTest;
import com.google.web.bindery.requestfactory.shared.ServiceInheritanceTest;
@@ -37,9 +39,11 @@
public static Test suite() {
GWTTestSuite suite = new GWTTestSuite(
"Test suite for requestfactory gwt code.");
+ suite.addTestSuite(RequestBatcherTest.class);
suite.addTestSuite(BoxesAndPrimitivesTest.class);
suite.addTestSuite(ComplexKeysTest.class);
suite.addTestSuite(EditorTest.class);
+ suite.addTestSuite(FanoutReceiverTest.class);
suite.addTestSuite(FindServiceTest.class);
suite.addTestSuite(LocatorTest.class);
suite.addTestSuite(RequestFactoryTest.class);
=======================================
---
/trunk/user/test/com/google/web/bindery/requestfactory/vm/RequestFactoryJreSuite.java
Tue Apr 19 04:54:26 2011
+++
/trunk/user/test/com/google/web/bindery/requestfactory/vm/RequestFactoryJreSuite.java
Fri May 27 04:59:21 2011
@@ -17,6 +17,7 @@
import
com.google.web.bindery.requestfactory.server.BoxesAndPrimitivesJreTest;
import com.google.web.bindery.requestfactory.server.ComplexKeysJreTest;
+import com.google.web.bindery.requestfactory.server.FanoutReceiverJreTest;
import com.google.web.bindery.requestfactory.server.FindServiceJreTest;
import com.google.web.bindery.requestfactory.server.LocatorJreTest;
import
com.google.web.bindery.requestfactory.server.RequestFactoryExceptionPropagationJreTest;
@@ -32,18 +33,15 @@
/**
* Suite of RequestFactory tests that require the JRE (without GWT).
- * <p>
- * Note: these tests require gwt-user src on the classpath. To run in
- * Eclipse, use Google Plugin for Eclipse to run as a GWT JUnit test
- * or edit the Eclipse launch config and add the src folder to the
classpath
- * (click Classpath tab, User entries, Advanced..., Add folders)
+ *
+ * @see com.google.web.bindery.requestfactory.gwt.RequestFactoryGwtJreSuite
*/
public class RequestFactoryJreSuite {
public static Test suite() {
- TestSuite suite = new TestSuite(
- "requestfactory package tests that require the JRE");
+ TestSuite suite = new TestSuite("requestfactory package tests that
require the JRE");
suite.addTestSuite(BoxesAndPrimitivesJreTest.class);
suite.addTestSuite(ComplexKeysJreTest.class);
+ suite.addTestSuite(FanoutReceiverJreTest.class);
suite.addTestSuite(FindServiceJreTest.class);
suite.addTestSuite(LocatorJreTest.class);
suite.addTestSuite(RequestFactoryExceptionPropagationJreTest.class);
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors