01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.user.client.rpc;
17:
18: import com.google.gwt.core.client.GWT;
19: import com.google.gwt.junit.client.GWTTestCase;
20:
21: /**
22: * This test case is used to check that the RemoteServiceServlet walks the class
23: * hierarchy looking for the service interface. Prior to this test the servlet
24: * would only look into the concrete class but not in any of its super classes.
25: *
26: * See <a
27: * href="http://code.google.com/p/google-web-toolkit/issues/detail?id=50&can=3&q=">Bug
28: * 50</a> for more details.
29: * <p>
30: * This test works in conjunction with
31: * {@link com.google.gwt.user.server.rpc.RemoteServiceServletTestServiceImpl}.
32: * </p>
33: */
34: public class RemoteServiceServletTest extends GWTTestCase {
35: private static final int TEST_DELAY = Integer.MAX_VALUE;
36:
37: private static RemoteServiceServletTestServiceAsync getAsyncService() {
38: RemoteServiceServletTestServiceAsync service = (RemoteServiceServletTestServiceAsync) GWT
39: .create(RemoteServiceServletTestService.class);
40:
41: ((ServiceDefTarget) service).setServiceEntryPoint(GWT
42: .getModuleBaseURL()
43: + "servlettest");
44:
45: return service;
46: }
47:
48: public String getModuleName() {
49: return "com.google.gwt.user.RPCSuite";
50: }
51:
52: public void testServiceInterfaceLocation() {
53: RemoteServiceServletTestServiceAsync service = getAsyncService();
54:
55: delayTestFinish(TEST_DELAY);
56:
57: service.test(new AsyncCallback() {
58:
59: public void onFailure(Throwable caught) {
60: TestSetValidator.rethrowException(caught);
61: }
62:
63: public void onSuccess(Object result) {
64: finishTest();
65: }
66: });
67: }
68: }
|