我的GWT应用程序包含必须从客户端的xml文件读取的数据。 为此,我使用的是RequestBuilder。如何在gwttestcase中用junit测试gwt requestbuilder?
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,GWT.getHostPageBaseURL()+"myFile.xml");
尝试{ builder.sendRequest(NULL,新RequestCallback(){ @Override 公共无效onResponseReceived(请求请求,响应应答){
// read out data and put into to a list
}
}); .........
将读出的数据放入列表中,并从该列表中将数据放入视图。 如何测试? 当我尝试这与一些的assertEquals的onResponseReceived内部方法GWTTestCase类我收到此错误消息:
[WARN] 404 - 获取/com.test.app.appName.JUnit/myFile.xml( 192.168.2.102)1466字节 请求标头 主机:192.168.2.102:51731 用户代理:Mozilla/5.0(Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19)Gecko/2010031422 Firefox/3.0 0.19 接受语言:EN-US 接受:/ 连接:保持活动 的Referer:HT T_P://192.168.2.102:51731/com.test.app.appName.JUnit/JUnit的-STANDAR ds.html?gwt.codesvr = 192.168.2.102:51727 Content-Type:text/plain; charset = utf-8 响应标头 Content-Type:text/html; charset = iso-8859-1 Content-Length:1466
我在做什么错了? 请帮忙。