<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.atlassian.crowd</groupId>
        <artifactId>atlassian-embedded-crowd</artifactId>
        <version>1.5-stash-m6</version>
    </parent>

    <artifactId>embedded-crowd-test-runner</artifactId>
    <name>Atlassian Embedded Crowd - Integration Test Runner</name>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>embedded-crowd-admin-plugin-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>embedded-crowd-admin-plugin</artifactId>
            <type>atlassian-plugin</type>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-pageobjects</artifactId>
            <version>${refapp.version}</version>
            <scope>test</scope>
        </dependency>
       
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-webdriver-confluence</artifactId>
            <version>${atlassian.selenium.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-webdriver-jira</artifactId>
            <version>${atlassian.selenium.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>embedded-crowd-refapp-plugin</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>embedded-crowd-admin-plugin-test</artifactId>
                                    <version>${project.version}</version>
                                    <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <systemPropertyVariables>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                    </systemPropertyVariables>

                    <products>
                        <product>
                            <id>refapp</id>
                            <version>${refapp.version}</version>
                            <bundledArtifacts>
                                <bundledArtifact>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>embedded-crowd-refapp-plugin</artifactId>
                                    <version>${project.version}</version>
                                </bundledArtifact>
                            </bundledArtifacts>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>embedded-crowd-admin-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                        </product>
                        <product>
                            <id>confluence</id>
                            <version>3.5.1</version>
                            <dataPath>${project.basedir}/src/test/amps/confluence-plugin-test-resources-3.5-websudo-disabled.zip</dataPath>
                            <bundledArtifacts>
                                <bundledArtifact>
                                    <groupId>com.atlassian.ldap</groupId>
                                    <artifactId>atlassian-ldap-test-plugin</artifactId>
                                    <version>7</version>
                                </bundledArtifact>
                            </bundledArtifacts>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>embedded-crowd-admin-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                        </product>
                        <product>
                            <id>jira</id>
                            <version>4.4.3</version>
                            <dataVersion>${jira.data.version}</dataVersion>
                            <bundledArtifacts>
                                <bundledArtifact>
                                    <groupId>com.atlassian.ldap</groupId>
                                    <artifactId>atlassian-ldap-test-plugin</artifactId>
                                    <version>7</version>
                                </bundledArtifact>
                            </bundledArtifacts>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>embedded-crowd-admin-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                            <systemProperties>
                                <!-- DEVSPEED-185 -->
                                <property>
                                    <name>jira.websudo.is.disabled</name>
                                    <value>true</value>
                                </property>
                            </systemProperties>
                        </product>
                        <product>
                            <!-- Crowd-as-a-Crowd-Server -->
                            <id>crowd</id>
                            <version>2.3.6</version>
                            <dataPath>${project.basedir}/src/test/amps/crowd-plugin-test-resources-2.2.4-generic-application.zip</dataPath>
                        </product>
                        <product>
                            <!-- JAACS instance -->
                            <id>jira</id>
                            <instanceId>jira-jaacs</instanceId>
                            <version>4.4.3</version>
                            <dataPath>${project.basedir}/src/test/amps/jira-plugin-test-resources-4.0-generic-application.zip</dataPath>
                            <httpPort>2991</httpPort>
                        </product>
                    </products>

                    <testGroups>
                        <testGroup>
                            <id>refapp</id>
                            <productIds>
                                <productId>refapp</productId>
                            </productIds>
                            <includes>
                                <include>it/**</include>
                            </includes>
                            <systemProperties>
                                <tested.app>com.atlassian.webdriver.refapp.RefappTestedProduct</tested.app>
                            </systemProperties>
                        </testGroup>
                        <testGroup>
                            <id>confluence</id>
                            <productIds>
                                <productId>confluence</productId>
                                <productId>crowd</productId>
                                <productId>jira-jaacs</productId>
                            </productIds>
                            <includes>
                                <include>it/**</include>
                            </includes>
                            <systemProperties>
                                <tested.app>com.atlassian.webdriver.confluence.ConfluenceTestedProduct</tested.app>
                            </systemProperties>
                        </testGroup>
                        <testGroup>
                            <id>jira</id>
                            <productIds>
                                <productId>jira</productId>
                                <productId>crowd</productId>
                                <productId>jira-jaacs</productId>
                            </productIds>
                            <includes>
                                <include>it/**</include>
                            </includes>
                            <systemProperties>
                                <tested.app>com.atlassian.webdriver.jira.JiraTestedProduct</tested.app>
                            </systemProperties>
                        </testGroup>
                    </testGroups>

                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>it/**/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <plugins.library.version>2.7.1</plugins.library.version>
        <rest.version>2.0.0</rest.version>

        <!-- used for OSGi version checking, so these should NOT be patch versions -->
        <plugins.osgi.version>2.5.0</plugins.osgi.version>

        <!-- Whether the functional tests should be run detached from the current screen -->
        <xvfb.enable>true</xvfb.enable>

        <testGroups>refapp</testGroups>
        
        <!-- We need a version with r148079 -->
        <jira.version>4.4.3</jira.version>
        <jira.data.version>4.0</jira.data.version>
        <confluence.version>3.5.1</confluence.version>
        <crowd.product.version>2.3.6</crowd.product.version>
        <stash.version>1.0-SNAPSHOT</stash.version>
    </properties>

</project>
