GWT Junit - 错误=“没有看到该类型的编译单元”
我正在尝试在示例应用程序中运行 GWT 单元测试。 我将
cmd /c /java/gwt-windows-1.6.4/webAppCreator.cmd -out gwttasks com.gwttasks.GwtTasks
junit-4.5.jar 中的复制运行到 lib 目录中,并将其添加到类路径中。
Ran:
cmd /c /java/gwt-windows-1.6.4/junitCreator.cmd -junit lib/junit-4.5.jar -module com.gwttasks.GwtTasks -eclipse GwtTasks com.gwt tasks.unit.GwtJunit
当我尝试运行任何生成的 cmd 文件(例如 GwtJunit-hosted.cmd)或任何启动文件时,出现以下错误。 我见过的所有网页都说将测试源添加到类路径中,但它已经存在,所以这不是问题。 还有其他人看过这个吗?
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.gwttasks.unit.GwtJunit' was not found in module 'com.gwttasks.GwtTasks'; no compilation unit for that type was seen at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:390) at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:626) ...
I'm trying to run a GWT unit test in a sample app. I ran
cmd /c /java/gwt-windows-1.6.4/webAppCreator.cmd -out gwttasks com.gwttasks.GwtTasks
Copied in junit-4.5.jar into a lib directory, and added that to the classpath.
Ran:
cmd /c /java/gwt-windows-1.6.4/junitCreator.cmd -junit lib/junit-4.5.jar -module com.gwttasks.GwtTasks -eclipse GwtTasks com.gwt tasks.unit.GwtJunit
When I try to run any of the generated cmd file (such as GwtJunit-hosted.cmd) or any of the launch files, I get the following error. All the web pages I've seen say to add the test source to the classpath, but it's already there, so that's not the problem. Anyone else seen this?
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.gwttasks.unit.GwtJunit' was not found in module 'com.gwttasks.GwtTasks'; no compilation unit for that type was seen at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:390) at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:626) ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
答案可以在这里找到:
http://raibledesigns.com/rd/entry/testing_gwt_applications
The answer could be found here :
http://raibledesigns.com/rd/entry/testing_gwt_applications
在 netbeans 中,我将 src/java 和 test 添加到类路径中,并且调试工作正常!!!!!
谢谢
In netbeans I added the src/java and test to the class path and debugging worked!!!!!
THANKS
我只想补充一点,我也遇到了同样的问题,因为我犯了一个(非常愚蠢的)错误,没有将 GWTTestCase 类放入“client”目录中,而是放入另一个目录中。 难怪没找到;)
I just want to add that I had the same problem, because I did the (very silly) mistake to not put the GWTTestCase class into the "client" directory, but into another one. No wonder it wasn't found ;)