我寫使用GWTTestCase簡單的測試,這裏是:GWTTestCase給了我一個錯誤
public class SampleTest extends GWTTestCase {
@Override
public String getModuleName() {
return "path.to.my.one.and.only.Module";
}
public void testSome() {
assertNotNull(null);
}
}
但是當我運行MVN測試,測試失敗,下一個錯誤:
[ERROR] Unable to find type 'java.lang.Object'
[ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.648 sec <<< FAILURE!
我有'com.google.gwt.user.User'在我的模塊中。
是的我明白了,就像我說的,我完全有這個模塊在My.gwt.xml模塊中繼承。 – user1289877
提供更多詳情。 –
問題出在班上,它必須以「GwtTest」開頭。所以我將類的名稱更改爲GwtTestSampleTest。下一個問題是我必須運行** mvn gwt:test **而不是** mvn test ** – user1289877