【问题标题】:JUnit testing gwt web app with 2 modules使用 2 个模块的 JUnit 测试 gwt Web 应用程序
【发布时间】:2011-10-19 17:55:16
【问题描述】:

我目前每晚使用 gwt 2.3 和 smartgwtpower 2.5,并在 Linux 上使用 Eclipse。我的 Web 应用程序使用公共代码,内部开发,并打包到一个名为 commonsmartgwt.jar 的 jar 中。在这个 jar 中是入口点类,并且有自己的 gwt.xml 文件。在我的网络应用程序的 gwt.xml 文件中,我从入口点类继承

    <inherits
    name="common.code.Common"/>

我使用入口点 common.code.client.Common 作为我的网络应用程序的入口点。我的网络应用程序中的所有类都扩展了公共代码中的类。编译运行作品 很好,但是当我尝试使用 eclipse 方法 Run As > GWT Junit Test 运行测试时,出现以下错误。 无法在您的类路径中找到 common/code/Common.gwt.xml;可能是笔误, 或者您可能忘记包含源的类路径条目。 如果我在 classes 下创建文件夹 common/code/ 并从 commonsmartgwt.jar 中提取 .gwt.xml 文件并将其放入该目录中,则会出现不同的错误。

    'my.package.client.MyFirstTest' was not found in module
    'common.client.Common'; no compilation unit for that type was seen

有没有办法对这个应用程序进行单元测试。如果我的情况不清楚,请告诉我。如果我将入口点从公共代码移动到我的 Web 应用程序会怎样?我尝试按照此处的说明进行操作:[错误解决][1]

  [1]: http://raibledesigns.com/rd/entry/testing_gwt_applications "Link"

但这不起作用。

【问题讨论】:

    标签: eclipse gwt junit smartgwt smartclient


    【解决方案1】:

    我在 getModuleName 测试方法中返回了不正确的模块名称。

    【讨论】:

      猜你喜欢
      • 2020-02-08
      • 1970-01-01
      • 2016-07-30
      • 1970-01-01
      • 2012-03-23
      • 2012-10-15
      • 1970-01-01
      • 2014-02-11
      • 2012-06-06
      相关资源
      最近更新 更多