<?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>
        <artifactId>weld-probe-parent</artifactId>
        <groupId>org.jboss.weld.probe</groupId>
        <version>2.3.2.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jboss.weld.probe</groupId>
    <artifactId>weld-probe-tests</artifactId>
    <version>2.3.2.Final</version>

    <properties>
        <json.version>1.0.4</json.version>
        <json.path.version>2.1.0</json.path.version>
        <tomcat.version>8.0.15</tomcat.version>
    </properties>

    <dependencies>
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.weld.probe</groupId>
            <artifactId>weld-probe-core</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core-test-common</artifactId>
        </dependency>
        
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.2_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.shrinkwrap</groupId>
            <artifactId>shrinkwrap-impl-base</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>${json.version}</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.1_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>net.sourceforge.htmlunit</groupId>
            <artifactId>htmlunit</artifactId>
        </dependency>

        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <version>${json.path.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>${arquillian.version}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-bom</artifactId>
            <version>${arquillian.drone.version}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.graphene</groupId>
            <artifactId>graphene-webdriver</artifactId>
            <version>${arquillian.graphene.version}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-drone-webdriver-depchain</artifactId>
            <version>${arquillian.drone.version}</version>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>!incontainer</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>incontainer</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>incontainer</name>
                    <value>true</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.wildfly.arquillian</groupId>
                    <artifactId>wildfly-arquillian-container-managed</artifactId>
                    <scope>test</scope>
                    <exclusions>
                      <exclusion>
                        <groupId>org.jboss.logmanager</groupId>
                        <artifactId>log4j-jboss-logmanager</artifactId>
                      </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemProperties>
                                <arquillian.xml>arquillian.xml</arquillian.xml>
                                <jacoco.agent>${jacoco.agent}</jacoco.agent>
                                <additional.vm.args>${additional.vm.args}</additional.vm.args>
                                <org.jboss.remoting-jmx.timeout>360</org.jboss.remoting-jmx.timeout>
                            </systemProperties>
                            <test>${test}</test>
                            <parallel>none</parallel>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>tomcat</id>
            <activation>
                <property>
                    <name>incontainer</name>
                    <value>tomcat</value>
                </property>
            </activation>

            <dependencies>
                <dependency>
                    <groupId>org.jboss.arquillian.container</groupId>
                    <artifactId>arquillian-tomcat-embedded-8</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat.embed</groupId>
                    <artifactId>tomcat-embed-core</artifactId>
                    <version>${tomcat.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld.servlet</groupId>
                    <artifactId>weld-servlet-core</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.jboss.weld</groupId>
                    <artifactId>weld-core-impl</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat.embed</groupId>
                    <artifactId>tomcat-embed-logging-juli</artifactId>
                    <version>${tomcat.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.tomcat.embed</groupId>
                    <artifactId>tomcat-embed-jasper</artifactId>
                    <scope>test</scope>
                    <version>${tomcat.version}</version>
                </dependency>
                <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.xml>arquillian-tomcat.xml</arquillian.xml>
                            </systemProperties>
                            <test>${test}</test>
                            <parallel>none</parallel>
                            <excludes>
                                <exclude>**/ProbeSessionBeansTest.java</exclude>
                                <exclude>**/ProbeDeploymentsTest.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>ftest</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-ftest-source</id>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/ftest/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-ftest-resource</id>
                                <goals>
                                    <goal>add-test-resource</goal>
                                </goals>
                                <configuration>
                                    <resources>
                                        <resource>
                                            <directory>src/ftest/java</directory>
                                            <targetPath>.</targetPath>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemProperties>
                                <arquillian.xml>src/ftest/resources/arquillian-ftest.xml</arquillian.xml>
                                <jacoco.agent>${jacoco.agent}</jacoco.agent>
                                <additional.vm.args>${additional.vm.args}</additional.vm.args>
                                <org.jboss.remoting-jmx.timeout>360</org.jboss.remoting-jmx.timeout>
                            </systemProperties>
                            <test>${test}</test>
                            <parallel>none</parallel>
                            <includes>
                                <include>**/ftest/*Test.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
	 
        <profile>
            <id>jacoco</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>jacoco</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>org.jboss.weld.tests.*</exclude>
                                <exclude>org.jboss.weld.probe.tests.*</exclude>
                            </excludes>
                            <propertyName>jacoco.agent</propertyName>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
