2011-10-25 34 views
8

Tôi đang sử dụng Eclipse Indigo trên Win XP, với Maven 3.0.3. Tôi đã tạo ra một bài kiểm tra Selenium 2 mà tôi muốn gỡ lỗi trong Eclipse. Nó được thiết lập để chạy trong giai đoạn thử nghiệm tích hợp Maven. Tôi đang sử dụng plugin Maven Cargo với Tomcat làm vùng chứa. Dưới đây là phần có liên quan từ pom.xml của tôi ...Gặp sự cố khi gỡ lỗi thử nghiệm tích hợp Maven trong Eclipse

 <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> 

Vấn đề là, khi tôi nhấp chuột phải vào thử nghiệm hội nhập của tôi trong Eclipse, chọn "Debug As" và sau đó chọn gỡ lỗi cấu hình của tôi (mà chỉ là maven mục tiêu "clean install -Dtest = TableIntegrationTest"), việc thực hiện chạy mà không cần nhấn điểm ngắt mà tôi đã đặt (http://screencast.com/t/at0AKWwxslE). Làm thế nào tôi có thể thực hiện gỡ rối từng bước trong một bài kiểm tra tích hợp JUnit/Selenium trong Eclipse?

Trả lời

16

Kiểm tra tích hợp của Maven theo mặc định chạy trong một JVM được chia hai. Do đó, nhật thực không thể đính kèm vào JVM được chia rẽ và xem các điểm ngắt.

Bạn có thể bắt buộc thử nghiệm tích hợp chạy trong cùng một JVM với tùy chọn -DforkMode = never.

More đây: http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html

Edit: Cập nhật link

Các vấn đề liên quan