【发布时间】:2017-03-30 11:08:24
【问题描述】:
我已将 gwt 版本升级到 2.8 和 java 1.8。测试在 gwt 2.7 和 java 1.7 上运行良好。我是否需要在 gwt.xml 中添加额外的配置或在 pom 中添加任何依赖项
pom:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>2.8</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>2.8</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>2.8</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>20.0</version>
</dependency>
测试代码:
public class Test extends GWTTestCase {
Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
/* (non-Javadoc)
* @see com.google.gwt.junit.client.GWTTestCase#getModuleName()
*/
@Override
public String getModuleName() {
return "org.field.TestJUnit";
}
public void testRenderAndBindTopScene() {
GWT.log("hi");
PageEx pageEx = GWT.create(PageEx.class);
}
}
TestJUnit.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="Field">
<!-- Inherit our applications main module. -->
<inherits name='org.field.Field' />
<source path="client" />
<source path="shared" />
</module>
【问题讨论】:
-
到底是什么问题?测试失败了吗?还是这是设置断点和调试的问题?
-
如果我在 getModuleName() 方法中放置一个断点,它会被命中,但测试用例中的任何断点都不会被命中。
-
您将版本放在范围字段中。
标签: java maven gwt junit gwttestcase