集成测试运行时 Cargo 取消部署战争?
我有单独的集成测试配置文件,当运行此配置文件时,我注意到 Cargo 启动并部署应用程序,然后 selenium 服务器启动,当集成测试开始时,Cargo 取消部署战争,这是错误的:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running integration.MyTest
[WARNING] [talledLocalContainer] Jan 17, 2012 3:06:20 PM org.apache.catalina.startup.HostConfig checkResources
[WARNING] [talledLocalContainer] INFO: Undeploying context [/MyAPP]
这是我的配置文件:
<profile>
<id>it</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.4</version>
<configuration>
<wait>false</wait>
<container>
<containerId>tomcat7x</containerId>
<home>${env.CATALINA_HOME}</home>
<timeout>300000</timeout>
</container>
<configuration>
<type>standalone</type>
<home>target/tomcat7x</home>
<properties>
<cargo.jvmargs>-XX:PermSize=256m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled</cargo.jvmargs>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
<logOutput>true</logOutput>
</configuration>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<configuration>
<skipTests>true</skipTests>
</configuration>
</execution>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/integration/*Test.java</include>
</includes>
<skipTests>false</skipTests>
</configuration>
</execution>
</executions>
<configuration>
<argLine>-Xms256M -Xmx768M -XX:MaxPermSize=256M</argLine>
</configuration>
</plugin>
</plugins>
</build>
<activation>
<property>
<name>it</name>
</property>
</activation>
</profile>
请告诉我为什么这样行为发生以及如何解决它,提前致谢。
i have separate profile for integration test, and when running this profile i notice that Cargo starts and deploys the application, then selenium server starts, and when integration test stars cargo undeploys the war which is wrong:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running integration.MyTest
[WARNING] [talledLocalContainer] Jan 17, 2012 3:06:20 PM org.apache.catalina.startup.HostConfig checkResources
[WARNING] [talledLocalContainer] INFO: Undeploying context [/MyAPP]
here's my profile:
<profile>
<id>it</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.4</version>
<configuration>
<wait>false</wait>
<container>
<containerId>tomcat7x</containerId>
<home>${env.CATALINA_HOME}</home>
<timeout>300000</timeout>
</container>
<configuration>
<type>standalone</type>
<home>target/tomcat7x</home>
<properties>
<cargo.jvmargs>-XX:PermSize=256m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled</cargo.jvmargs>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
<logOutput>true</logOutput>
</configuration>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<configuration>
<skipTests>true</skipTests>
</configuration>
</execution>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/integration/*Test.java</include>
</includes>
<skipTests>false</skipTests>
</configuration>
</execution>
</executions>
<configuration>
<argLine>-Xms256M -Xmx768M -XX:MaxPermSize=256M</argLine>
</configuration>
</plugin>
</plugins>
</build>
<activation>
<property>
<name>it</name>
</property>
</activation>
</profile>
please tell me why such behavior occurs and how to fix it, thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将启动容器的执行更改为如下后工作正常:
worked fine after changing the the execution of start-container to be as follows: