<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.infinispan.server</groupId>
        <artifactId>infinispan-server-versions</artifactId>
        <version>6.0.0.CR1</version>
        <relativePath>../versions/pom.xml</relativePath>
    </parent>

    <artifactId>test-suite</artifactId>
    <packaging>jar</packaging>
    <name>Infinispan Server - Test Suite</name>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-arquillian-container-managed</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.logmanager</groupId>
                    <artifactId>jboss-logmanager</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.logmanager</groupId>
                    <artifactId>log4j-jboss-logmanager</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.infinispan.arquillian.container</groupId>
            <artifactId>infinispan-arquillian-impl</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.logmanager</groupId>
                    <artifactId>jboss-logmanager</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-client-hotrod</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.logmanager</groupId>
                    <artifactId>jboss-logmanager</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        
        <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.infinispan.protostream</groupId>
            <artifactId>sample-domain-definition</artifactId>
        </dependency>
        <dependency>
            <groupId>org.infinispan.protostream</groupId>
            <artifactId>sample-domain-implementation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-query-dsl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-remote-query-client</artifactId>
        </dependency>
    </dependencies>

    <properties>
        
        <ispnserver.project.dir>${basedir}/..</ispnserver.project.dir>
        <server.build.dist>${ispnserver.project.dir}/build/target/infinispan-server-${project.version}
        </server.build.dist>
        <server1.dist>${basedir}/target/server/node1</server1.dist>
        <server2.dist>${basedir}/target/server/node2</server2.dist>
        <server3.dist>${basedir}/target/server/node3</server3.dist>
        <resources.dir>${basedir}/src/test/resources</resources.dir>
        <jvm.memory.args>-Xmx512m -XX:MaxPermSize=128m</jvm.memory.args>
        
        <jvm.ip.stack>-Djava.net.preferIPv4Stack=true</jvm.ip.stack>
        <server.jvm.args>${jvm.ip.stack} ${jvm.memory.args}</server.jvm.args>
        <log4j.configuration>log4j.xml</log4j.configuration>
        <suite.manual.phase>test</suite.manual.phase>
        <suite.client.local.phase>test</suite.client.local.phase>
        <suite.client.dist.phase>test</suite.client.dist.phase>
        <suite.client.repl.phase>test</suite.client.repl.phase>
        <suite.manual.include>**/*.java</suite.manual.include>
        <groups.client.local>org.infinispan.server.test.category.ClientLocal</groups.client.local>
        <groups.client.clustered>org.infinispan.server.test.category.ClientClustered</groups.client.clustered>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-distros-and-configs</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <target>
                                <ant antfile="build-testsuite.xml" inheritRefs="true">
                                    <target name="create-all-distros" />
                                </ant>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>once</forkMode>
                    <systemPropertyVariables>
                        <server1.dist>${server1.dist}</server1.dist>
                        <server2.dist>${server2.dist}</server2.dist>
                        <server3.dist>${server3.dist}</server3.dist>
                        <server.jvm.args>${server.jvm.args}</server.jvm.args>
                        <log4j.configuration>${log4j.configuration}</log4j.configuration>
                        <java.util.logging.config.file>${resources.dir}/jul.properties</java.util.logging.config.file>
                    </systemPropertyVariables>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>org.infinispan.server.test.util.TestsuiteListener</value>
                        </property>
                    </properties>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>none</phase>
                    </execution>
                    <execution>
						
                        <id>suite-manual</id>
                        <phase>${suite.manual.phase}</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>${suite.manual.include}</include>
                            </includes>
                            <excludedGroups>org.infinispan.server.test.category.ClientLocal,org.infinispan.server.test.category.ClientClustered</excludedGroups>
                            <systemPropertyVariables>
                                <arquillian.launch>suite-manual</arquillian.launch>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>suite-client-local</id>
                        <phase>${suite.client.local.phase}</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <reportNameSuffix>localmode</reportNameSuffix>
                            <groups>${groups.client.local}</groups>
                            <systemPropertyVariables>
                                <clustering.mode>local</clustering.mode>
                                <arquillian.launch>suite-client-local</arquillian.launch>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>suite-client-dist</id>
                        <phase>${suite.client.dist.phase}</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <reportNameSuffix>distmode</reportNameSuffix>
                            <groups>${groups.client.clustered}</groups>
                            <systemPropertyVariables>
                                <clustering.mode>dist</clustering.mode>
                                <arquillian.launch>suite-client-dist</arquillian.launch>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>suite-client-repl</id>
                        <phase>${suite.client.repl.phase}</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <reportNameSuffix>replmode</reportNameSuffix>
                            <groups>${groups.client.clustered}</groups>
                            <systemPropertyVariables>
                                <clustering.mode>repl</clustering.mode>
                                <arquillian.launch>suite-client-repl</arquillian.launch>
                            </systemPropertyVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>suite.client</id>
            <properties>
                <suite.manual.phase>none</suite.manual.phase>
                <suite.client.local.phase>test</suite.client.local.phase>
                <suite.client.dist.phase>test</suite.client.dist.phase>
                <suite.client.repl.phase>test</suite.client.repl.phase>
            </properties>
        </profile>
        <profile>
            <id>suite.client.local</id>
            <properties>
                <suite.manual.phase>none</suite.manual.phase>
                <suite.client.local.phase>test</suite.client.local.phase>
                <suite.client.dist.phase>none</suite.client.dist.phase>
                <suite.client.repl.phase>none</suite.client.repl.phase>
            </properties>
        </profile>
        <profile>
            <id>suite.client.dist</id>
            <properties>
                <suite.manual.phase>none</suite.manual.phase>
                <suite.client.local.phase>none</suite.client.local.phase>
                <suite.client.dist.phase>test</suite.client.dist.phase>
                <suite.client.repl.phase>none</suite.client.repl.phase>
            </properties>
        </profile>
        <profile>
            <id>suite.client.repl</id>
            <properties>
                <suite.manual.phase>none</suite.manual.phase>
                <suite.client.local.phase>none</suite.client.local.phase>
                <suite.client.dist.phase>none</suite.client.dist.phase>
                <suite.client.repl.phase>test</suite.client.repl.phase>
            </properties>
        </profile>
        <profile>
            <id>suite.examples</id>
            <properties>
                <suite.manual.phase>test</suite.manual.phase>
                <suite.client.local.phase>none</suite.client.local.phase>
                <suite.client.dist.phase>none</suite.client.dist.phase>
                <suite.client.repl.phase>none</suite.client.repl.phase>
                <suite.manual.include>org/infinispan/server/test/configs/ExampleConfigsTest.java</suite.manual.include>
            </properties>
        </profile>
        <profile>
            <id>suite.others</id>
            <properties>
                <suite.manual.phase>test</suite.manual.phase>
                <suite.client.local.phase>none</suite.client.local.phase>
                <suite.client.dist.phase>none</suite.client.dist.phase>
                <suite.client.repl.phase>none</suite.client.repl.phase>
            </properties>
        </profile>
        <profile>
            <id>client.rest</id>
            <properties>
                <suite.manual.phase>none</suite.manual.phase>
                <suite.client.local.phase>test</suite.client.local.phase>
                <suite.client.dist.phase>test</suite.client.dist.phase>
                <suite.client.repl.phase>test</suite.client.repl.phase>
                <groups.client.local>org.infinispan.server.test.category.RESTLocal</groups.client.local>
                <groups.client.clustered>org.infinispan.server.test.category.RESTClustered</groups.client.clustered>
            </properties>
        </profile>
        <profile>
            <id>client.hotrod</id>
            <properties>
                <suite.manual.phase>none</suite.manual.phase>
                <suite.client.local.phase>test</suite.client.local.phase>
                <suite.client.dist.phase>test</suite.client.dist.phase>
                <suite.client.repl.phase>test</suite.client.repl.phase>
                <groups.client.local>org.infinispan.server.test.category.HotRodLocal</groups.client.local>
                <groups.client.clustered>org.infinispan.server.test.category.HotRodClustered</groups.client.clustered>
            </properties>
        </profile>
        <profile>
            <id>client.memcached</id>
            <properties>
                <suite.manual.phase>none</suite.manual.phase>
                <suite.client.local.phase>test</suite.client.local.phase>
                <suite.client.dist.phase>test</suite.client.dist.phase>
                <suite.client.repl.phase>test</suite.client.repl.phase>
                <groups.client.local>org.infinispan.server.test.category.MemcachedLocal</groups.client.local>
                <groups.client.clustered>org.infinispan.server.test.category.MemcachedClustered</groups.client.clustered>
            </properties>
        </profile>
    </profiles>

</project>