1

我目前每晚使用 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"

但这没有用。

4

1 回答 1

1

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

于 2011-10-20T11:54:27.623 回答