<?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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.atlassian.confluence</groupId>
        <artifactId>confluence-test</artifactId>
        <version>5.9.0-m10</version>
    </parent>

    <artifactId>confluence-hallelujah-support</artifactId>
    <packaging>jar</packaging>
    <name>Confluence Hallelujah Support</name>

    <properties>
        <!-- empty = first line from /tmp/jmsconfig -->
        <hallelujah.broker.url />
        <!-- empty = second line from /tmp/jmsconfig -->
        <hallelujah.test.name.queue />
        <!-- empty = third line from /tmp/jmsconfig -->
        <hallelujah.test.result.queue />
        <!-- empty = fourth line from /tmp/jmsconfig or random string, see com.atlassian.buildeng.hallelujah.jms.JMSConfiguration.JMSConfiguration(File) -->
        <hallelujah.id />
        <!-- empty = 5 minutes, see com.atlassian.studio.test.integration.hallelujah.ConfluenceHallelujahTemplate.getTimeoutInMillis() -->
        <hallelujah.timeout.minutes />
        <!-- empty = no retries -->
        <hallelujah.test.failure.max.retries />
        <!-- used to share the same configuration between batched and unbatched runs -->
        <scanning.suite.configuration.classname>com/atlassian/confluence/hallelujah/ConfluenceHallelujahSmokeTest.java</scanning.suite.configuration.classname>
        <!-- use JUnit >= 4 for Hallelujah servers as a runner by default -->
        <hallelujah.server.class>com/atlassian/confluence/hallelujah/ConfluenceHallelujahJUnit4Server.java</hallelujah.server.class>
        <!-- use JUnit >= 4 for Hallelujah clients as a runner by default -->
        <hallelujah.client.class>com/atlassian/confluence/hallelujah//ConfluenceHallelujahJUnit4Client.java</hallelujah.client.class>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <!-- Test doesn't run reliably.  Disabling tests as per fkramer's recommendation -->
                    <skipTests>true</skipTests>
                    <parallel>classes</parallel>
                    <useUnlimitedThreads>true</useUnlimitedThreads>
                    <systemPropertyVariables>
                        <hallelujah.scanning.suite.configuration.classname>${scanning.suite.configuration.classname}</hallelujah.scanning.suite.configuration.classname>
                        <hallelujah.broker.url>${hallelujah.broker.url}</hallelujah.broker.url>
                        <hallelujah.test.name.queue>${hallelujah.test.name.queue}</hallelujah.test.name.queue>
                        <hallelujah.test.result.queue>${hallelujah.test.result.queue}</hallelujah.test.result.queue>
                        <hallelujah.id>${hallelujah.id}</hallelujah.id>
                        <hallelujah.timeout.minutes>${hallelujah.timeout.minutes}</hallelujah.timeout.minutes>
                        <hallelujah.test.failure.max.retries>${hallelujah.test.failure.max.retries}</hallelujah.test.failure.max.retries>
                        <hallelujah.local>true</hallelujah.local>
                        <hallelujah.config.file.skip>true</hallelujah.config.file.skip>
                    </systemPropertyVariables>
                    <includes>
                        <include>${hallelujah.server.class}</include>
                        <include>${hallelujah.client.class}</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>pre-integration-test</phase>
                        <configuration>
                            <tasks>
                                <copy todir="${project.build.testOutputDirectory}">
                                    <fileset dir="${project.build.outputDirectory}">
                                        <include name="**/ConfluenceHallelujahJUnit4Client.class" />
                                        <include name="**/ConfluenceHallelujahJUnit4Server.class" />
                                    </fileset>
                                </copy>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-testutils</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.buildeng.hallelujah</groupId>
            <artifactId>server</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.buildeng.hallelujah</groupId>
            <artifactId>client</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit-dep</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>

        <!-- BUILDENG-5183 use this until hallelujah gets to guava 11 -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.compatibility.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.ow2.asm</groupId>
                    <artifactId>asm-all</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

</project>
