GWT Junit - 错误='没有看到该类型的编译单元'

Don*_*son 7 gwt junit

我正在尝试在示例应用程序中运行GWT单元测试.我跑了

cmd /c /java/gwt-windows-1.6.4/webAppCreator.cmd -out gwttasks com.gwttasks.GwtTasks

在junit-4.5.jar中复制到lib目录中,并将其添加到类路径中.

冉:

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)
    ...

小智 10

答案可以在这里找到:http: //raibledesigns.com/rd/entry/testing_gwt_applications

  • 如果链接断开,在 StackOverflow 上有这个答案会很好: * 要解决此问题,请打开运行对话框 * 单击“类路径”选项卡,然后单击“用户条目”。* 单击高级按钮并选择添加文件夹。* 在文件夹选择对话框中,选择您的源和测试目录(例如 src/main/java 和 src/test/java)。 (2认同)