2011-10-25 7 views
8

में मैवेन एकीकरण परीक्षण में समस्या निवारण समस्या मैं मैवेन 3.0.3 के साथ विन XP पर एक्लिप्स इंडिगो का उपयोग कर रहा हूं। मैंने एक सेलेनियम 2 परीक्षण बनाया है जिसे मैं ग्रहण में डीबग करना चाहता हूं। यह मेवेन एकीकरण परीक्षण चरण में चलाने के लिए स्थापित है। मैं कंटेनर के रूप में टोमकैट के साथ मेवेन कार्गो प्लगइन का उपयोग कर रहा हूं। यहाँ मेरी pom.xml से प्रासंगिक अनुभाग है ...ग्रहण

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

समस्या है, जब मैं ठीक है, ग्रहण में अपने एकीकरण परीक्षण पर क्लिक करें का चयन करें "डीबग के रूप में" और फिर चुनें मेरा डीबग विन्यास (जो सिर्फ Maven है लक्ष्य "क्लीन इंस्टॉल -डिस्ट = टेबलइन्टिशनटेस्ट"), निष्पादन मैंने सेट ब्रेकपॉइंट (http://screencast.com/t/at0AKWwxslE) को मारने के बिना चलाया है। मैं एक्लिप्स में जुनीट/सेलेनियम एकीकरण परीक्षण पर चरण-दर-डिबगिंग कैसे कर सकता हूं?

उत्तर

16

मास्क के एकीकरण परीक्षण डिफ़ॉल्ट रूप से एक फोर्क किए गए JVM में चलाए जाते हैं। इसलिए, ग्रहण फोर्क किए गए JVM से अटैच करने में असमर्थ है और ब्रेकपॉइंट्स देखता है।

आप एक ही JVM में चलाने के लिए एकीकरण-परीक्षण को मजबूर कर सकते हैं -DforkMode = कभी विकल्प नहीं।

अधिक यहाँ: http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html

संपादित करें: अपडेट किया गया लिंक