2012-01-24 7 views
2

私はGWT 2.4を使用しています。最近私が新しいパッケージで作成したGWTTestCaseファイルを実行するのに問題があります。私は、既存のパッケージで正しく動作しているファイルを持っており、なぜ以下のようなテストが失敗するのか理解できません。私はこれらを起動するためにMaven 3.0.3を使用しています。ここでGWTテストケース:そのタイプのコンパイルユニットは見られませんでした...なぜですか?

package com.myco.product.client.view; 
... 
public class GwtTestAppView extends GWTTestCase { 

private AppView appView; 

@Override 
public String getModuleName() { 
    return "com.myco.clearing.product.ProductPlusJUnit"; 
} // getModuleName 

public void gwtSetUp() { 
    appView = new AppView(); 
    RootPanel.get().add(appView); 
} // gwtSetup 

public void testShowLoading() { 
    testShowLoading(true); 
} // testShowLoading 

、ここでは、私は「MVNを実行したとき、私は取得エラーです...ここで

 <!-- GWT Maven Plugin --> 
     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>gwt-maven-plugin</artifactId> 
      <version>${gwtVersion}</version> 
      <executions> 
       <execution> 
        <id>clean-compile</id> 
        <goals> 
         <goal>clean</goal> 
         <goal>compile</goal> 
        </goals> 
       </execution> 
       <execution> 
        <id>run-gwt-tests</id> 
        <phase>test</phase> 
        <goals> 
         <goal>test</goal> 
        </goals> 
       </execution> 
      </executions> 
      <!-- Plugin configuration. There are many available options, see gwt-maven-plugin 
       documentation at codehaus.org --> 
      <configuration> 
       <runTarget>index.html</runTarget> 
       <hostedWebapp>${webappDirectory}</hostedWebapp> 
       <i18nMessagesBundle>com.myco.clearing.product.client.Messages</i18nMessagesBundle> 
      </configuration> 
     </plugin> 

は、テストファイルのテストの主要部分である...私は私のプラグインが設定されている方法ですクリーンテスト」

[INFO] ------------------------------------------------------- 
[INFO] T E S T S 
[INFO] ------------------------------------------------------- 
[INFO] Running [email protected] 
[INFO] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.656 sec <<< FAILURE! 
[INFO] testShowLoading(com.myco.product.client.view.GwtTestAppView) Time elapsed: 2.656 sec <<< ERROR! 
[INFO] com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.myco.product.client.view.GwtTestAppView' was not found in module 'com.myco.clearing.product.ProductPlusJUnit'; no compilation unit for that type was seen 
[INFO] at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:743) 
[INFO] at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1346) 
[INFO] at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1309) 
[INFO] at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:653) 
[INFO] at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:441) 

[INFO] at junit.framework.TestCase.runBare(TestCase.java:134) 
[INFO] at junit.framework.TestResult$1.protect(TestResult.java:110) 
[INFO] at junit.framework.TestResult.runProtected(TestResult.java:128) 
[INFO] at junit.framework.TestResult.run(TestResult.java:113) 
[INFO] at junit.framework.TestCase.run(TestCase.java:124) 
[INFO] at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:296) 
[INFO] at junit.framework.TestSuite.runTest(TestSuite.java:232) 
[INFO] at junit.framework.TestSuite.run(TestSuite.java:227) 
[INFO] at junit.framework.TestSuite.runTest(TestSuite.java:232) 
[INFO] at junit.framework.TestSuite.run(TestSuite.java:227) 
[INFO] at org.codehaus.mojo.gwt.test.MavenTestRunner.doRun(MavenTestRunner.java:105) 
[INFO] at junit.textui.TestRunner.start(TestRunner.java:180) 
[INFO] at org.codehaus.mojo.gwt.test.MavenTestRunner.main(MavenTestRunner.java:63) 
[INFO] 
[INFO] testHideLoading(com.myco.product.client.view.GwtTestAppView) Time elapsed: 0 sec <<< ERROR! 

私が言ったように、私はGWTが異なるパッケージ(命名com.myco.product.client.xmltohtml)に配置されている微細なテストを実行することができるよ、私は把握することはできません何が違うの?何が問題ですか?

答えて

2

私のテストクラスは、私がロードしていたモジュールで認識されたパッケージにはありませんでした。パッケージは "com.myco.clearing.product.client.view"であったはずです。パッケージを変更するとすべてが修正されました。

関連する問題