代码之家  ›  专栏  ›  技术社区  ›  Don Branson marios

GWT Junit-错误=“未看到该类型的编译单元”

  •  7
  • Don Branson marios  · 技术社区  · 17 年前

    我正在尝试在示例应用程序中运行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)
        ...
    
    3 回复  |  直到 17 年前
        1
  •  10
  •   user267077    16 年前
        2
  •  4
  •   Norm Wright    15 年前

    在netbeans中,我向类路径添加了src/java和test,调试成功了!!!!! 谢谢

        3
  •  4
  •   Harald Schilly    15 年前

    我只想补充一点,我也有同样的问题,因为我犯了(非常愚蠢的)错误 将GWTTestCase类放入“client”目录,但放入另一个目录。难怪没有找到;)