使用RESTEasy对GWT和Appengine devmodes进行JUnit集成测试

Ril*_*ark 7 java gwt google-app-engine junit resteasy

我想运行一个测试,我的GWT代码向我的AppEngine服务器发出请求并等待响应.我的服务器使用RESTEasy来设置请求路径.我的客户端使用一些AutoBean魔法,它使用GWT.create(),所以这个测试必须是一个GWTTestCase.

为测试设置appengine开发模式的完整模拟,我需要做什么?该文件提到的方法来建立每个AppEngine上依赖于个人的服务,但我想旋转起来,整个事情.

Ibr*_*ief 0

由于不熟悉 GWTTestCase,我不完全理解你在这里需要什么。不是很简单吗:

public class LocalDatastoreTest 
{
    private final LocalServiceTestHelper helper =
        new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig(),
                                   new LocalUserServiceTestConfig(),
                                   new LocalTaskQueueTestConfig(),
                                   new LocalMemcacheServiceTestConfig(),
                                   new LocalAppIdentityServiceTestConfig() // etc..
                                  );

    @Before
    public void setUp() {
        helper.setUp();
    }
}
Run Code Online (Sandbox Code Playgroud)

您可以根据需要向助手添加更多测试配置,足以设置full simulation of the appengine development mode? 您能否提供有关您需要的更多详细信息?

(这可能应该算作注释,但我尝试编写的代码示例对于注释来说太大了)