0
我一直在使用GwtTestCase一段时间,并试图测试一个简单的RestyGwt客户端API。我已经将servlet添加到我的gwt.xml类中,但无法从servlet获取任何日志记录。看起来这个servlet没有被创建。我可以从gwt测试用例中获得servlet日志记录
这里是我简单的servlet,试图从中获取某种信息,包括只抛出一个运行时异常。
public class JerseyTestServlet extends ServletContainer {
{
System.err.println("RUNNING JERESEY TEST SERVLET");
}
private static final long serialVersionUID = -7518118461257020639L;
public JerseyTestServlet() {
super(new RestApplication());
System.out.println("RUNNING JERESEY TEST SERVLET");
throw new RuntimeException("FOOO");
}
}
该类与servlet的类名和包匹配。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='simulator'>
<inherits name="com.testing.NgProductionClient" />
<servlet path='/rest' class='com.testing.JerseyTestServlet'/>
</module>
我想在启动时获取有关servlet的某种调试信息,以便在出现问题时解决路径问题。是否有可能从GwtTestCase中的servlet获取调试信息?