Add new rm automation framework.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@92883 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2015-01-05 23:43:58 +00:00
parent 15a4672b22
commit ce604639a0

312
rm-automation/pom.xml Normal file
View File

@@ -0,0 +1,312 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-parent</artifactId>
<version>2.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-rm-automation</artifactId>
<properties>
<selenium.version>2.43.1</selenium.version>
<spring.version>4.0.5.RELEASE</spring.version>
</properties>
<build>
<plugins>
<!-- Additional source folder to be added: source/compatibility -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-test-source</id>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/unit-test/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
<suiteXmlFiles>
<suiteXmlFile>${project.build.testOutputDirectory}/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<!-- Configuration triggered by mvn antrun:run, used by Bamboo to stop server -->
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<target>
<echo>Stopping Alfresco...</echo>
<exec executable="${basedir}/target/alf-installation/alfresco.sh" dir="target/alf-installation" failonerror="true">
<arg value="stop" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>webdrone</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.htmlelements</groupId>
<artifactId>htmlelements-all</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.properties</groupId>
<artifactId>properties-loader</artifactId>
<version>1.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>install-alfresco</id>
<build>
<plugins>
<!-- Download and install the latest enterprise alfresco installer -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>fetch-installer</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Recreating database...</echo>
<sql driver="org.postgresql.Driver" url="jdbc:postgresql:template1" userid="alfresco" password="alfresco" autocommit="true">drop database if exists alfresco; create database alfresco</sql>
<echo>Downloading Alfresco installer...</echo>
<sshexec username="tomcat" host="pbld01.alfresco.com" keyfile="${user.home}/.ssh/id_rsa" outputproperty="installerPath" command="ls -rt ${enterprise.installer.path} | tail -1 | tr ' ' '?' " />
<scp remoteFile="tomcat@pbld01.alfresco.com:${installerPath}" localTofile="target/alf-installer.bin" keyfile="${user.home}/.ssh/id_rsa" />
<chmod file="target/alf-installer.bin" perm="a+x" verbose="true" />
<echo>Installing Alfresco...</echo>
<exec executable="${basedir}/target/alf-installer.bin" dir="target" failonerror="true">
<arg line="--mode unattended --alfresco_admin_password admin --disable-components postgres,alfrescowcmqs --jdbc_username alfresco --jdbc_password alfresco --prefix ${basedir}/target/alf-installation" />
</exec>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>fetch-amps</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-share</artifactId>
<version>${project.version}</version>
<classifier>amp</classifier>
<type>amp</type>
</artifactItem>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-rm-server</artifactId>
<version>${project.version}</version>
<classifier>amp</classifier>
<type>amp</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/amps</outputDirectory>
<useBaseVersion>true</useBaseVersion>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>install-server-amp</id>
<goals>
<goal>install</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<backup>true</backup>
<ampLocation>${project.build.directory}/amps/alfresco-rm-server-${project.version}-amp.amp</ampLocation>
<warLocation>${project.build.directory}/alf-installation/tomcat/webapps/alfresco.war</warLocation>
<classifier>amp</classifier>
</configuration>
</execution>
<execution>
<id>install-share-amp</id>
<goals>
<goal>install</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<backup>true</backup>
<ampLocation>${project.build.directory}/amps/alfresco-rm-share-${project.version}-amp.amp</ampLocation>
<warLocation>${project.build.directory}/alf-installation/tomcat/webapps/share.war</warLocation>
<classifier>amp</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>run-alfresco</id>
<build>
<plugins>
<!-- Fetch JaCoCo agent and set the argLine property accordingly -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.3.201306030806</version>
<executions>
<execution>
<id>prepare-jacoco</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>org.alfresco.*</include>
</includes>
</configuration>
</plugin>
<!-- Starts/stop the installed Alfresco -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>start-alfresco</id>
<phase>process-test-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Starting Alfresco...</echo>
<exec executable="${basedir}/target/alf-installation/alfresco.sh" dir="target/alf-installation" failonerror="true">
<arg value="start" />
<env key="CATALINA_OPTS" value="${argLine}" />
</exec>
<sleep minutes="5" />
</target>
</configuration>
</execution>
<execution>
<id>stop-alfresco</id>
<phase>post-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Stopping Alfresco...</echo>
<exec executable="${basedir}/target/alf-installation/alfresco.sh" dir="target/alf-installation" failonerror="true">
<arg value="stop" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>