[MRM-1164] Move Cargo plugin config into a profile which is active by default. To run TestNG tests against an existing Archiva instance, use -Dcontainer=existing.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@770866 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Wendy Smoak 2009-05-02 00:11:22 +00:00
parent c2c281cdde
commit 6f0984adf3
2 changed files with 178 additions and 151 deletions

View File

@ -1,9 +1,12 @@
ReadMe
----------
Run selenium tests in src/test/testng with Maven and TestNG
- mvn clean install -f testng-pom.xml
Run Selenium tests in src/test/testng against an existing Archiva instance
- Start Archiva
- Configure admin user for archiva (match values in src/test/resources/testng.properties )
- modify src/test/resources/testng.properties as needed
- mvn clean install -f testng-pom.xml
- mvn clean install -f testng-pom.xml -Dcontainer-existing
For the default values in the scripts, to pass all the tests, you need to add an artifact in internal repository.

View File

@ -124,110 +124,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dependency-maven-plugin</artifactId>
<executions>
<execution>
<id>unzip-archiva-webapp</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>archiva-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/${container.name}conf/webapps/archiva</outputDirectory>
</configuration>
</execution>
<execution>
<id>prepare-provided-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.apache.derby,javax.mail,javax.activation</includeGroupIds>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.directory}/providedDependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${project.build.directory}/appserver-base">
<fileset dir="src/test/it-resources/appserver-base" />
</copy>
<copy todir="${project.build.directory}/repository">
<fileset dir="src/test/it-resources/repository" />
</copy>
<copy todir="${project.build.directory}/index">
<fileset dir="src/test/it-resources/index" />
</copy>
<copy todir="${project.build.directory}/snapshots">
<fileset dir="src/test/it-resources/snapshots" />
</copy>
<copy todir="${project.build.directory}/projects">
<fileset dir="src/test/it-resources/projects" />
</copy>
<copy todir="${project.build.directory}/local-repo">
<fileset dir="src/test/it-resources/local-repo" />
</copy>
</tasks>
</configuration>
</execution>
<execution>
<id>copy-container-conf</id>
<phase>package</phase>
<configuration>
<tasks>
<copy todir="${project.build.directory}/${container.name}conf">
<fileset dir="src/test/${container.name}" />
</copy>
<copy
todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.26/apache-tomcat-5.5.26/common/lib">
<fileset dir="${project.build.directory}/providedDependencies">
<include name="**/*.jar" />
</fileset>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>check-archiva-loaded</id>
<phase>integration-test</phase>
<configuration>
<tasks>
<get src="http://localhost:9696/archiva/" dest="${project.build.directory}/index.html" />
<delete file="${project.build.directory}/index.html" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -261,51 +157,6 @@
<background>true</background>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<wait>false</wait>
<container>
<containerId>${container.name}</containerId>
<zipUrlInstaller>
<url>${container.url}</url>
<installDir>${project.build.directory}/installs/${container.name}</installDir>
</zipUrlInstaller>
<log>${project.build.directory}/logs/${container.name}.log</log>
<output>${project.build.directory}/logs/${container.name}.out</output>
<timeout>600000</timeout>
<systemProperties>
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<appserver.home>${project.build.directory}/appserver-base</appserver.home>
</systemProperties>
</container>
<configuration>
<home>${project.build.directory}/${container.name}conf</home>
<type>existing</type>
<properties>
<cargo.servlet.port>9696</cargo.servlet.port>
</properties>
</configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@ -327,10 +178,183 @@
</plugins>
</build>
<profiles>
<profile>
<id>create-container</id>
<activation>
<property>
<name>!container</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dependency-maven-plugin</artifactId>
<executions>
<execution>
<id>unzip-archiva-webapp</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>archiva-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/${container.name}conf/webapps/archiva</outputDirectory>
</configuration>
</execution>
<execution>
<id>prepare-provided-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.apache.derby,javax.mail,javax.activation</includeGroupIds>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.directory}/providedDependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${project.build.directory}/appserver-base">
<fileset dir="src/test/it-resources/appserver-base" />
</copy>
<copy todir="${project.build.directory}/repository">
<fileset dir="src/test/it-resources/repository" />
</copy>
<copy todir="${project.build.directory}/index">
<fileset dir="src/test/it-resources/index" />
</copy>
<copy todir="${project.build.directory}/snapshots">
<fileset dir="src/test/it-resources/snapshots" />
</copy>
<copy todir="${project.build.directory}/projects">
<fileset dir="src/test/it-resources/projects" />
</copy>
<copy todir="${project.build.directory}/local-repo">
<fileset dir="src/test/it-resources/local-repo" />
</copy>
</tasks>
</configuration>
</execution>
<execution>
<id>copy-container-conf</id>
<phase>package</phase>
<configuration>
<tasks>
<copy todir="${project.build.directory}/${container.name}conf">
<fileset dir="src/test/${container.name}" />
</copy>
<copy
todir="${project.build.directory}/installs/${container.name}/apache-tomcat-5.5.26/apache-tomcat-5.5.26/common/lib">
<fileset dir="${project.build.directory}/providedDependencies">
<include name="**/*.jar" />
</fileset>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>check-archiva-loaded</id>
<phase>integration-test</phase>
<configuration>
<tasks>
<get src="http://localhost:9696/archiva/" dest="${project.build.directory}/index.html" />
<delete file="${project.build.directory}/index.html" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<wait>false</wait>
<container>
<containerId>${container.name}</containerId>
<zipUrlInstaller>
<url>${container.url}</url>
<installDir>${project.build.directory}/installs/${container.name}</installDir>
</zipUrlInstaller>
<log>${project.build.directory}/logs/${container.name}.log</log>
<output>${project.build.directory}/logs/${container.name}.out</output>
<timeout>600000</timeout>
<systemProperties>
<appserver.base>${project.build.directory}/appserver-base</appserver.base>
<appserver.home>${project.build.directory}/appserver-base</appserver.home>
</systemProperties>
</container>
<configuration>
<home>${project.build.directory}/${container.name}conf</home>
<type>existing</type>
<properties>
<cargo.servlet.port>9696</cargo.servlet.port>
</properties>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>existing-container</id>
<activation>
<property>
<name>container</name>
<value>existing</value>
</property>
</activation>
<!-- edit src/test/resources/testng.properties as needed -->
</profile>
<profile>
<id>tomcat5x</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>!container</name>
</property>
</activation>
<properties>
<container.name>tomcat5x</container.name>