0

我使用 Maven 在 GWT 中创建了一个带有默认模块的项目。并用 *Test.java 重命名测试用例类并执行命令mvn package

它没有成功执行测试用例,并 以错误的测试终止:initializationError(com.gwt.example.project.testing.client.GwtTesttestingTest): com/google/gwt/dev/cfg/Condition。

如果我添加,<mode>htmlunit</mode>并且<htmlunit>IE7</htmlunit>到 pom 然后gwt:test目标工作正常

如果我尝试通过右键单击在eclipse中执行测试用例并作为GWT Junit Test运行,它会继续执行而不会停止,

这是在 Eclipse 中执行测试用例时的输出。

Validating newly compiled units
   Ignored 12 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Starting http://10.1.1.2:57354/com.gwt.example.project.testing.testingJUnit.JUnit/junit-standards.html?gwt.codesvr=10.1.1.2:57348 on browser FF3
200 - GET /com.gwt.example.project.testing.testingJUnit.JUnit/junit-standards.html?gwt.codesvr=10.1.1.2:57348 (10.1.1.2) 2449 bytes
logging for HtmlUnit thread
   [WARN] Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://10.1.1.2:57354/com.gwt.example.project.testing.testingJUnit.JUnit/com.gwt.example.project.testing.testingJUnit.JUnit.nocache.js', but got 'application/x-javascript'.
200 - GET /com.gwt.example.project.testing.testingJUnit.JUnit/com.gwt.example.project.testing.testingJUnit.JUnit.nocache.js (10.1.1.2) 6344 bytes
200 - GET /com.gwt.example.project.testing.testingJUnit.JUnit/hosted.html?com_gwt_example_project_testing_testingJUnit_JUnit (10.1.1.2) 11757 bytes
200 - GET /com.gwt.example.project.testing.testingJUnit.JUnit/gwt/standard/standard.css (10.1.1.2) 26953 bytes
Validating newly compiled units
   Ignored 12 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Module com.gwt.example.project.testing.testingJUnit.JUnit has been loaded
200 - POST /com.gwt.example.project.testing.testingJUnit.JUnit/junithost (10.1.1.2) 434 bytes
All clients connected (Limiting future permutations to: gecko1_8)
200 - POST /com.gwt.example.project.testing.testingJUnit.JUnit/junithost (10.1.1.2) 434 bytes
[WARN] Too many clients: expected 1, found 2
200 - POST /com.gwt.example.project.testing.testingJUnit.JUnit/junithost (10.1.1.2) 434 bytes
[WARN] Too many clients: expected 1, found 3
200 - POST /com.gwt.example.project.testing.testingJUnit.JUnit/junithost (10.1.1.2) 434 bytes
[WARN] Too many clients: expected 1, found 4
200 - POST /com.gwt.example.project.testing.testingJUnit.JUnit/junithost (10.1.1.2) 434 bytes
[WARN] Too many clients: expected 1, found 5
200 - POST /com.gwt.example.project.testing.testingJUnit.JUnit/junithost (10.1.1.2) 434 bytes
4

1 回答 1

0

您可能会在这里查看一个轻量级项目:https ://github.com/fastnsilver/gwt-datehandling-example

GWTTestCase通过一个套件运行一个单一的。

定义了一些配置文件,因此请查看自述文件。Maven pom.xml 中用于引导 GWT 测试的大部分内容都直接取自文档。

于 2012-11-17T04:54:20.417 回答