Груз разворачивает войну, когда проходит интеграционный тест? - PullRequest
1 голос
/ 17 января 2012

У меня есть отдельный профиль для тестирования интеграции, и при запуске этого профиля я замечаю, что 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>

Скажите, пожалуйста, почему такое поведение происходит и как это исправить, заранее спасибо.

1 Ответ

1 голос
/ 17 января 2012

работал нормально после изменения выполнения start-container следующим образом:

<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>60000</pingTimeout>
                                    <properties>
                                        <context>${project.artifactId}</context>
                                    </properties>
                                    </deployable>
                                </deployables>
                            </deployer>
                        </configuration>

                    </execution>
...