<?xml version="1.0" encoding="UTF-8"?>
<!--
  JBoss, Home of Professional Open Source
  Copyright 2011, Red Hat, Inc., and individual contributors
  by the @authors tag. See the copyright.txt in the distribution for a
  full listing of individual contributors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss.seam.jcr</groupId>
        <artifactId>seam-jcr-parent</artifactId>
        <relativePath>../pom.xml</relativePath>
        <version>3.1.0.Final</version>
    </parent>

    <artifactId>seam-jcr-testsuite</artifactId>
    <name>Seam JCR Test Suite</name>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-api-maven</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.solder</groupId>
            <artifactId>solder-impl</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.seam.jcr</groupId>
            <artifactId>seam-jcr</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <systemProperties>
                        <arquillian.launch>${arquillian}</arquillian.launch>
                        <arquillian>${arquillian}</arquillian>
                    </systemProperties>
                </configuration>

                <executions>
                    <execution>
                        <id>surefire-it</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <redirectTestOutputToFile>true</redirectTestOutputToFile>
                            <trimStackTrace>false</trimStackTrace>
                            <printSummary>true</printSummary>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build> 

    <profiles>

        <!-- There cannot be both jackrabbit and modeshape on classpath for the embedded container, we test just the modeshape tests on weld embedded -->
        <profile>
            <id>weld-ee-embedded-1.1</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>arquillian</name>
                    <value>weld-ee-embedded-1.1</value>
                </property>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.seam.test</groupId>
                    <artifactId>weld-ee-embedded-1.1</artifactId>
                    <type>pom</type>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>org.modeshape</groupId>
                    <artifactId>modeshape-jcr</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemProperties>
                                <arquillian.launch>weld-ee-embedded-1.1</arquillian.launch>
                                <arquillian>weld-ee-embedded-1.1</arquillian>
                            </systemProperties>
                            <includes>
                                <include>**/*ModeshapeTest.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>seam-jcr-jackrabbit</id>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.seam.test</groupId>
                    <artifactId>weld-ee-embedded-1.1</artifactId>
                    <type>pom</type>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>jackrabbit-core</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemProperties>
                                <arquillian.launch>weld-ee-embedded-1.1</arquillian.launch>
                                <arquillian>weld-ee-embedded-1.1</arquillian>
                            </systemProperties>
                            <includes>
                                <include>**/*JackrabbitTest.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>jbossas-managed-7</id>
            <activation>
                <property>
                    <name>arquillian</name>
                    <value>jbossas-managed-7</value>
                </property>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.seam.test</groupId>
                    <artifactId>jbossas-managed-7</artifactId>
                    <type>pom</type>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>org.modeshape</groupId>
                    <artifactId>modeshape-jcr</artifactId>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>jackrabbit-core</artifactId>
                    <scope>test</scope>
                </dependency>

            </dependencies>

            <build>
               <plugins>
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                  </plugin>
               </plugins>
            </build>
        </profile> 
    </profiles>
</project>
