1

필자는 maven 웹 애플리케이션 (Spring + ApacheCXF webservices)을 가지고 있으며 몇 가지 IntegrationTests (* IT.java)를 가지고있다. cargo-maven plugin을 사용하여 war 파일을 배포하여 failsafe plugin을 사용하여 통합 테스트를 실행하고 싶습니다. 여기 cargo-maven 플러그인을 사용하여 JBoss-5.1.0.GA에 WAR를 배포하고 통합 테스트를 실행하기 전에 배포되기까지 기다리는 방법은 무엇입니까?

내 치어 구성입니다 :

<plugins> 
    <plugin> 
     <groupId>org.codehaus.cargo</groupId> 
     <artifactId>cargo-maven2-plugin</artifactId> 
     <version>1.0.3</version> 
     <configuration> 
      <container> 
      <containerId>jboss51x</containerId> 
      <home>C:/jboss-5.1.0.GA</home> 
      <append>false</append> 
      <log>${project.build.directory}/logs/jboss51x.log</log> 
      <output>${project.build.directory}/logs/jboss51x.out</output> 
      <timeout>300000</timeout> 
      </container> 
      <configuration> 
      <type>existing</type> 
      <home>C:/jboss-5.1.0.GA/server/default</home> 
      <properties> 
       <cargo.servlet.port>8080</cargo.servlet.port> 
       <cargo.jboss.configuration>default</cargo.jboss.configuration> 
       <cargo.rmi.port>1099</cargo.rmi.port> 
       <cargo.logging>high</cargo.logging> 
      </properties> 
      <deployables>    
       <deployable> 
       <groupId>${project.groupId}</groupId> 
       <artifactId>admin-services</artifactId> 
       <type>war</type>     
       </deployable> 
      </deployables> 
      </configuration> 
     </configuration> 
     <executions> 
      <execution> 
       <id>start-container</id> 
       <phase>pre-integration-test</phase> 
       <goals> 
        <goal>deployer-deploy</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>stop-container</id> 
       <phase>post-integration-test</phase> 
       <goals> 
        <goal>deployer-undeploy</goal> 
       </goals> 
      </execution>    
     </executions> 
     </plugin> 

     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>failsafe-maven-plugin</artifactId> 
     <executions> 
      <execution> 
      <goals> 
       <goal>integration-test</goal> 
       <goal>verify</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
</plugin> 

그러나 문제는 테스트가 실패 있도록 배포되지 않은화물 플러그인이 WAR 파일을 배포 즉시 안전 장치 플러그인이 IntegrationTests을 실행하기 위해 노력하고, 그 시간 응용 프로그램입니다 .

동일한 구성으로 두 단계의 통합 테스트를 성공적으로 실행할 수 있습니다. 1.화물을 실행하십시오 : deployer-deploy 2. 통합 테스트 실행

화물 플러그인으로 어플리케이션을 전개 한 후에 만 ​​failsafe 플러그인을 트리거 할 수 있습니까? 또한 거기에 지원하는 응용 프로그램을 배포해야 당신이 그나마화물을 사용 http://cargo.codehaus.org/Maven2+Plugin+Reference+Guide

참조 :

답변