2011-10-25 14 views
8

Maven 3.0.3を使用してWin XPでEclipse Indigoを使用しています。 EclipseでデバッグしたいSelenium 2テストを作成しました。これは、Maven統合テスト段階で実行するように設定されています。 TomcatをコンテナとしてMaven Cargoプラグインを使用しています。ここに私のpom.xmlから関連するセクションです...EclipseでのMaven統合テストのトラブルシューティング

 <plugin> 
      <groupId>org.codehaus.cargo</groupId> 
      <artifactId>cargo-maven2-plugin</artifactId> 
      <configuration> 
       <container> 
        <containerId>tomcat${tomcat.major}x</containerId> 
        <zipUrlInstaller> 
         <url>http://archive.apache.org/dist/tomcat/tomcat-${tomcat.major}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.tar.gz</url> 
         <downloadDir>${project.build.directory}/downloads</downloadDir> 
         <extractDir>${project.build.directory}/extracts</extractDir> 
        </zipUrlInstaller> 
        <output>${project.build.directory}/tomcat${tomcat.major}x.log</output> 
        <log>${project.build.directory}/cargo.log</log> 
       </container> 
       <configuration> 
        <home>${project.build.directory}/tomcat-${tomcat.version}/container</home> 
        <properties> 
         <cargo.logging>high</cargo.logging> 
         <cargo.servlet.port>8080</cargo.servlet.port> 
        </properties> 
       </configuration> 
      </configuration> 
      <executions> 
       <execution> 
        <id>start-container</id> 
        <phase>pre-integration-test</phase> 
        <goals> 
         <goal>start</goal> 
         <goal>deploy</goal> 
        </goals> 
        <configuration> 
         <deployer> 
          <deployables> 
           <deployable> 
            <groupId>${project.groupId}</groupId> 
            <artifactId>${project.artifactId}</artifactId> 
            <type>war</type> 
            <pingURL>http://localhost:8080/${project.artifactId}</pingURL> 
            <pingTimeout>30000</pingTimeout> 
            <properties> 
             <context>${project.artifactId}</context> 
            </properties> 
           </deployable> 
          </deployables> 
         </deployer> 
        </configuration> 
       </execution> 
       <execution> 
        <id>stop-container</id> 
        <phase>post-integration-test</phase> 
        <goals> 
         <goal>stop</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <configuration> 
       <!-- Skip the normal tests, we'll run them in the integration-test phase --> 
       <skip>true</skip> 
      </configuration> 
      <executions> 
       <execution> 
        <phase>integration-test</phase> 
        <goals> 
         <goal>test</goal> 
        </goals> 
        <configuration> 
         <skip>false</skip> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

問題は、私は右のEclipseでの私の統合テストをクリックしたとき、ある、「デバッグAs」を選択し、ちょうど達人である私のデバッグコンフィギュレーションを(選びます目標「クリーンインストール-Dtest = TableIntegrationTest」)、実行はブレークポイントに設定せずに実行されます(http://screencast.com/t/at0AKWwxslE)。 EclipseのJUnit/Selenium統合テストでステップスルー・デバッグを行うにはどうすればよいですか?

答えて

16

Mavenの統合テストは、デフォルトでforkされたJVMで実行されます。したがって、eclipseは分岐したJVMに接続してブレークポイントを見ることができません。

-DforkMode = neverオプションを使用して、同じJVMで統合テストを実行することができます。ここ

より:http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html

編集:更新リンク

関連する問題