2

Maven 3.0.3을 사용하고 있습니다. 내 테스트 단계에서 일부 Junit 테스트를 실행하고 통합 테스트 단계에서는 다른 테스트를 실행하고 싶습니다. 문제는 통합 테스트 단계에서 아무 것도 실행되지 않습니다. 나는 명령을 실행합니다.Maven : 통합 테스트 단계에서 실행되도록 테스트를 구성하려면 어떻게합니까?

mvn clean install 

모든 것을 차 단합니다. 여기에 ... 내 확실한 - 플러그인을 구성한 방법입니다

 <plugin> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.6</version> 
      <configuration> 
       <skip>false</skip> 
       <additionalClasspathElements> 
        <additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement> 
        <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement> 
       </additionalClasspathElements> 
       <useManifestOnlyJar>false</useManifestOnlyJar> 
       <forkMode>always</forkMode> 
       <systemProperties> 
        <property> 
         <name>gwt.args</name> 
         <value>-out \${webAppDirectory}</value> 
        </property> 
       </systemProperties> 
       <excludes> 
        <exclude>**/integration/**</exclude> 
       </excludes> 
      </configuration> 
      <executions> 
       <execution> 
        <phase>integration-test</phase> 
        <goals> 
         <goal>test</goal> 
        </goals> 
        <configuration> 
         <skip>false</skip> 
         <includes> 
          <include>**/integration/**</include> 
         </includes> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

내 "통합"디렉토리에 두 개의 JUnit 테스트가 있습니다. 통합 단계에서 Maven Cargo 플러그인을 사용하여 서버를 가동시킵니다. 여기에 그 구성이 있습니다 ...

 <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>${tomcat.servlet.port}</cargo.servlet.port> 
         <cargo.tomcat.ajp.port>${tomcat.ajb.port}</cargo.tomcat.ajp.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:${tomcat.servlet.port}/${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> 

내 통합 테스트가 실행되도록 구성을 어떻게 변경/향상시킬 수 있습니까? - 데이브

답변

2
+0

당신이 승리의 랩을하는 기분이 경우 한 번 봐, 당신은 왜 확실한 - 플러그인 테스트 및 통합 테스트 단계에 실패 모두에서 실행하려고 노력에 정교한 수 있나요? – Dave

+0

@Dave 질문에 대한 답변을 제공해 주시겠습니까? –

관련 문제