<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>crowd-user-management</artifactId>
        <version>0.42</version>
    </parent>

    <artifactId>user-provisioning-acceptance-tests</artifactId>
    <packaging>jar</packaging>
    <name>Atlassian User Management - User Provisioning Tests</name>

    <properties>
        <jira.cargo.servlet.port>2990</jira.cargo.servlet.port>
        <jira.testkit.version>6.0.42</jira.testkit.version>
        <confluence.cargo.servlet.port>1990</confluence.cargo.servlet.port>
        <testClassDirectory>${project.build.testOutputDirectory}</testClassDirectory>
    </properties>

    <dependencies>
        <!-- Start Test Dependencies -->
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-web-app</artifactId>
            <type>war</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-acceptance-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-rest-common</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>user-provisioning-plugin</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.qunit</groupId>
            <artifactId>atlassian-qunit-plugin-util</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-pageobjects</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- atlassian-pageobjects requires at least 2.5 -->
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.jira.tests</groupId>
            <artifactId>jira-testkit-client</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <!-- confluence-test-support provides most of the shared acceptance testing API
                 and includes many dependencies. -->
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-test-support</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- End Test Dependencies -->
    </dependencies>

    <profiles>
        <!-- Don't re-run the acceptance tests in release:perform -->
        <profile>
            <id>release</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
        </profile>
        <profile>
            <id>ide</id>
            <dependencies>
                <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-simple</artifactId>
                    <version>${slf4j.version}</version>
                    <scope>runtime</scope>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.crowd</groupId>
                    <artifactId>user-provisioning-plugin</artifactId>
                    <version>${project.version}</version>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- Exclude everything: we don't have any unit tests here, and we don't want the classed we've
                     unpacked from crowd-acceptance-test to be picked up -->
                    <excludes>
                        <exclude>**/*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <installPlugin>true</installPlugin>
                    <excludeAllTestDependencies>true</excludeAllTestDependencies>
                    <products>
                        <product>
                            <id>jira</id>
                            <version>${jira.version}</version>
                            <dataVersion>${jira.data.version}</dataVersion>
                            <bundledArtifacts>
                                <bundledArtifact>
                                    <groupId>com.atlassian.qunit</groupId>
                                    <artifactId>atlassian-qunit-plugin</artifactId>
                                    <version>${qunit.version}</version>
                                </bundledArtifact>
                            </bundledArtifacts>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>user-provisioning-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.jira.tests</groupId>
                                    <artifactId>jira-testkit-plugin</artifactId>
                                    <version>${jira.testkit.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                            <jvmDebugPort>5006</jvmDebugPort>
                            <output>${project.build.directory}/jira.log</output>
                            <systemPropertyVariables>
                                <homedir>${project.build.outputDirectory}/jira/home</homedir>
                                <acceptance.test.jira.port>${jira.cargo.servlet.port}</acceptance.test.jira.port>
                                <qunit.testoutput.location>${project.build.directory}/qunit-surefire-reports</qunit.testoutput.location>
                                <xvfb.enable>${xvfb.enable}</xvfb.enable>
                                <http.port>2990</http.port>
                                <jira.host>localhost</jira.host>
                                <context.path>/jira</context.path>
                                <http.jira.port>2990</http.jira.port>
                                <baseurl>http://localhost:2990/jira</baseurl>
                            </systemPropertyVariables>
                        </product>
                        <product>
                            <id>confluence</id>
                            <version>${confluence.version}</version>
                            <dataVersion>${confluence.data.version}</dataVersion>
                            <bundledArtifacts>
                                <bundledArtifact>
                                    <groupId>com.atlassian.qunit</groupId>
                                    <artifactId>atlassian-qunit-plugin</artifactId>
                                    <version>${qunit.version}</version>
                                </bundledArtifact>
                            </bundledArtifacts>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>user-provisioning-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                            <jvmDebugPort>5005</jvmDebugPort>
                            <output>${project.build.directory}/confluence.log</output>
                            <systemPropertyVariables>
                                <homedir>${project.build.outputDirectory}/confluence/home</homedir>
                                <acceptance.test.confluence.port>${confluence.cargo.servlet.port}</acceptance.test.confluence.port>
                                <qunit.testoutput.location>${project.build.directory}/qunit-surefire-reports</qunit.testoutput.location>
                                <xvfb.enable>${xvfb.enable}</xvfb.enable>
                                <http.port>1990</http.port>
                                <confluence.host>localhost</confluence.host>
                                <context.path>/confluence</context.path>
                                <http.confluence.port>1990</http.confluence.port>
                                <baseurl>http://localhost:1990/confluence</baseurl>
                            </systemPropertyVariables>
                        </product>
                        <product>
                            <id>bamboo</id>
                            <version>${bamboo.version}</version>
                            <dataVersion>${bamboo.data.version}</dataVersion>
                            <bundledArtifacts>
                                <bundledArtifact>
                                    <groupId>com.atlassian.qunit</groupId>
                                    <artifactId>atlassian-qunit-plugin</artifactId>
                                    <version>${qunit.version}</version>
                                </bundledArtifact>
                            </bundledArtifacts>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.crowd</groupId>
                                    <artifactId>user-provisioning-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                            <jvmDebugPort>5005</jvmDebugPort>
                            <output>${project.build.directory}/confluence.log</output>
                            <systemPropertyVariables>
                                <homedir>${project.build.outputDirectory}/bamboo/home</homedir>
                                <qunit.testoutput.location>${project.build.directory}/qunit-surefire-reports</qunit.testoutput.location>
                                <xvfb.enable>${xvfb.enable}</xvfb.enable>
                                <http.port>6990</http.port>
                                <bamboo.host>localhost</bamboo.host>
                                <context.path>/bamboo</context.path>
                                <http.bamboo.port>6990</http.bamboo.port>
                                <baseurl>http://localhost:6990/bamboo</baseurl>
                            </systemPropertyVariables>
                        </product>
                    </products>
                    <testGroups>
                        <testGroup>
                            <id>jira</id>
                            <productIds>
                                <productId>jira</productId>
                            </productIds>
                            <includes>
                                <include>it/**/Jira*Test.java</include>
                            </includes>
                        </testGroup>
                        <testGroup>
                            <id>confluence</id>
                            <productIds>
                                <productId>confluence</productId>
                            </productIds>
                            <includes>
                                <include>it/**/Confluence*Test.java</include>
                            </includes>
                        </testGroup>
                        <testGroup>
                            <id>bamboo</id>
                            <productIds>
                                <productId>bamboo</productId>
                            </productIds>
                            <includes>
                                <include>it/**/Bamboo*Test.java</include>
                            </includes>
                        </testGroup>
                    </testGroups>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
