<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss.solder</groupId>
        <artifactId>solder-parent</artifactId>
        <version>3.1.0.Beta5</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>solder-testsuite</artifactId>

    <name>Solder Test Suite</name>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.solder</groupId>
            <artifactId>solder-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.solder</groupId>
            <artifactId>solder-impl</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.solder</groupId>
            <artifactId>solder-tooling</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </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>
        <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>
 
                <!-- EL impl needed for ElTest -->
                <dependency>
                    <groupId>org.glassfish.web</groupId>
                    <artifactId>el-impl</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>
                        </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>
            </dependencies>

            <build>
               <plugins>
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <excludes>
                           <exclude>**/weld/**</exclude>
                        </excludes>
                     </configuration>
                  </plugin>
               </plugins>
            </build>
        </profile> 

        <profile>
            <id>glassfish-embedded-3.1</id>
            <activation>
                <property>
                    <name>arquillian</name>
                    <value>glassfish-embedded-3.1</value>
                </property>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.seam.test</groupId>
                    <artifactId>glassfish-embedded-3.1</artifactId>
                    <type>pom</type>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
               <plugins>
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <excludes>
                           <exclude>**/weld/**</exclude>
                        </excludes>
                     </configuration>
                  </plugin>
               </plugins>
            </build>
        </profile> 

        <profile>
            <id>glassfish-remote-3.1</id>
            <activation>
                <property>
                    <name>arquillian</name>
                    <value>glassfish-remote-3.1</value>
                </property>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.seam.test</groupId>
                    <artifactId>glassfish-remote-3.1</artifactId>
                    <type>pom</type>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
               <plugins>
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <excludes>
                           <exclude>**/weld/**</exclude>
                        </excludes>
                     </configuration>
                  </plugin>
               </plugins>
            </build>
        </profile> 

        <profile>
            <id>jacoco</id>

            <properties>
                <version.jacoco>0.5.3.201107060350</version.jacoco>
                <version.shrinkwrap_shrinkwrap>1.0.0-beta-6</version.shrinkwrap_shrinkwrap>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.arquillian.extension</groupId>
                    <artifactId>arquillian-jacoco</artifactId>
                    <scope>test</scope>
                    <version>1.0.0.Beta1-SNAPSHOT</version>
                </dependency>
                <dependency>
                    <groupId>org.jacoco</groupId>
                    <artifactId>org.jacoco.core</artifactId>
                    <version>${version.jacoco}</version>
                    <scope>provided</scope>
                </dependency>

                <dependency>
                    <groupId>org.jboss.shrinkwrap</groupId>
                    <artifactId>shrinkwrap-api</artifactId>
                    <version>${version.shrinkwrap_shrinkwrap}</version>
                </dependency>

                <dependency>
                    <groupId>org.jboss.shrinkwrap</groupId>
                    <artifactId>shrinkwrap-impl-base</artifactId>
                    <version>${version.shrinkwrap_shrinkwrap}</version>
                </dependency>

                <dependency>
                    <groupId>org.jboss.shrinkwrap</groupId>
                    <artifactId>shrinkwrap-spi</artifactId>
                    <version>${version.shrinkwrap_shrinkwrap}</version>
                </dependency>

            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>add-resource</goal>
                                </goals>
                                <configuration>
                                    <resources>
                                        <resource>
                                            <directory>../impl/target/classes</directory>
                                            <targetPath>.</targetPath>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${version.jacoco}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                               <id>report</id>
                               <phase>post-integration-test</phase>
                               <goals>
                                   <goal>report</goal>
                               </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
