updated profile to not affect mvn test

This commit is contained in:
Michael Suzuki
2014-09-05 11:47:22 +01:00
parent 114d66fca1
commit eb583a15fd
2 changed files with 100 additions and 108 deletions

View File

@@ -15,18 +15,15 @@
package org.alfresco.demoamp; package org.alfresco.demoamp;
import org.alfresco.demoamp.po.HelloWorldPage; import org.alfresco.demoamp.po.HelloWorldPage;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@RunWith(JUnit4.class)
public class Demo public class Demo
{ {
private static WebDriver driver; private static WebDriver driver;

View File

@@ -760,123 +760,118 @@
</build> </build>
</profile> </profile>
<profile> <profile>
<id>enable-integration-testing</id> <id>ui-test</id>
<properties> <properties>
<maven.tomcat.fork>true</maven.tomcat.fork> <maven.tomcat.fork>true</maven.tomcat.fork>
</properties> </properties>
<activation>
<file>
<exists>src/integration/java</exists>
</file>
</activation>
<build> <build>
<plugins> <plugins>
<plugin>
<!-- Separates the unit tests from the integration tests. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Skip the default running of this plug-in (or everything is run twice...) -->
<skip>true</skip>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version> <version>1.7</version>
<executions> <executions>
<execution> <execution>
<id>add-test-source</id> <id>add-integration-source</id>
<!-- <phase>pre-integration-test</phase>
This will help m2eclipse to recognize the folder as source <goals>
folder after update project configuration. <goal>add-test-source</goal>
--> </goals>
<phase>process-resources</phase> <configuration>
<!-- <phase>generate-test-sources</phase>--> <sources>
<goals> <source>src/integration/java</source>
<goal>add-test-source</goal> </sources>
</goals> </configuration>
<configuration> </execution>
<sources> </executions>
<source>src/integration/java</source>
<source>src/integration/properties</source>
<source>src/integration/resources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.17</version> <version>2.5</version>
<executions> <executions>
<execution> <execution>
<id>integration-test</id> <id>add-integration-resources</id>
<goals> <phase>pre-integration-test</phase>
<goal>integration-test</goal> <goals>
</goals> <goal>copy-resources</goal>
</execution> </goals>
<execution> <configuration>
<id>verify</id> <outputDirectory>${project.build.directory}/integration-classes</outputDirectory>
<goals> <resources>
<goal>verify</goal> <resource>
</goals> <directory>src/integration/resources</directory>
</execution> </resource>
</executions> </resources>
<configuration> </configuration>
<suiteXmlFiles> </execution>
<suiteXmlFile>src/integration/resources/testng.xml</suiteXmlFile> </executions>
</suiteXmlFiles> </plugin>
</configuration> <!-- In this case the maven-compiler-plugin must be located after the build-helper-maven-plugin -->
</plugin> <plugin>
</plugins> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>compile-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<compilerArguments>
<d>${project.build.directory}/integration-classes</d>
</compilerArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.9</version>
<configuration>
<testSourceDirectory>src/integration/java</testSourceDirectory>
<testClassesDirectory>${project.build.directory}/integration-classes</testClassesDirectory>
<test>**/*.java</test>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>
<artifactId>testng</artifactId> <artifactId>testng</artifactId>
<version>6.3.1</version> <version>6.8.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>share-po</artifactId>
<version>${alfresco.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> <exclusions>
<!-- Add RAD capabilities for remote JUnit test running. Scope=test so the custom JUnit remote runner is found in the Maven test classpath --> <exclusion>
<dependency> <groupId>org.hamcrest</groupId>
<groupId>org.alfresco.maven</groupId> <artifactId>hamcrest-core</artifactId>
<artifactId>alfresco-rad</artifactId> </exclusion>
<version>${maven.alfresco.version}</version> </exclusions>
<scope>test</scope>
</dependency>
<!--
| Requires this explicit test dependency, for a Spring 3.0.5 bug
| See https://jira.springsource.org/browse/SPR-8527
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.6.RELEASE</version>
<scope>provided</scope>
</dependency>
<!-- SDK AMP Testing Dependencies -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>tk.skuro.alfresco</groupId>
<artifactId>h2-support</artifactId>
<version>${h2-support.version}</version>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>
<!-- Enables alfresco testing dependencies if a src/test/java folder is found, by adding appropriate dependencies -->
</profiles> </profiles>
</project> </project>