<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.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>
        <artifactId>jira-project</artifactId>
        <groupId>com.atlassian.jira</groupId>
        <version>7.3.0-QR-20161011103914</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <name>Atlassian JIRA - zDistribution - Integration Tests</name>
    <artifactId>jira-integration-tests</artifactId>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- configure test ports, locations, etc -->
        <cargo.warlocation>${project.build.directory}/atlassian-jira</cargo.warlocation>
        <atlassian.test.suite.numbatches>1</atlassian.test.suite.numbatches>
        <atlassian.test.suite.batch>1</atlassian.test.suite.batch>
        <atlassian.test.run.only.quarantined>false</atlassian.test.run.only.quarantined>
        <atlassian.test.suite.includes>webdriver_test</atlassian.test.suite.includes>
        <atlassian.test.target.dir>${project.build.directory}</atlassian.test.target.dir>
        <selenium.browser>*firefox</selenium.browser>
        <selenium.browser.path>/home/bamboo-agent-1/firefox-3.5.4/firefox</selenium.browser.path>
        <selenium.browser.startstring>${selenium.browser} ${selenium.browser.path}</selenium.browser.startstring>
        <selenium.port>4501</selenium.port>
        <http.port>18402</http.port>
        <rmi.port>18403</rmi.port>
        <refapp.host>localhost</refapp.host>
        <refapp.http.port>5990</refapp.http.port>
        <refapp.context.path>/refapp</refapp.context.path>
        <confluence.version>4.0</confluence.version>
        <jira.cargo.edition>enterprise</jira.cargo.edition>
        <jira.seleniumtest.jvmargs>-Xmx768m -XX:MaxPermSize=384m -XX:+HeapDumpOnOutOfMemoryError ${jira.user.jvmargs} -server -Dmail.mime.decodeparameters=true -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dfile.encoding=utf-8 -Djava.awt.headless=true -Djira.dump=true -Djira.websudo.is.disabled=true</jira.seleniumtest.jvmargs>
        <jira.test.edition>all</jira.test.edition>
        <jira.context>/atlassian-jira</jira.context>
        <jira.functest.seleniumproperties>integration.seleniumtest.properties</jira.functest.seleniumproperties>
        <webdriver.browser>firefox</webdriver.browser>
        <jira2.http.port>2990</jira2.http.port>
        <jira2.context.path>/jira2</jira2.context.path>
        <license.scope>test</license.scope>
    </properties>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
            <testResource>
                <directory>src/test/xml</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
               <artifactId>maven-enforcer-plugin</artifactId>
               <executions>
                  <execution>
                     <id>enforce-build-environment</id>
                     <phase>none</phase>
                  </execution>
                  <execution>
                     <id>enforce-versions</id>
                     <phase>none</phase>
                  </execution>
               </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>it/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>run-integration-tests</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                        <configuration>
                            <skipTests>${maven.test.selenium.skip}</skipTests>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <systemPropertyVariables>
                        <atlassian.test.suite.includes>${atlassian.test.suite.includes}</atlassian.test.suite.includes>
                        <test.server.properties>integration.localtest.properties</test.server.properties>
                        <test.jira2.server.properties>integration.jira2test.properties</test.jira2.server.properties>
                        <jira.functest.containerproperties>${project.build.testOutputDirectory}/integration.container.properties</jira.functest.containerproperties>
                        <jira.functest.seleniumproperties>${jira.functest.seleniumproperties}</jira.functest.seleniumproperties>
                        <jira.functest.warlocation>${cargo.warlocation}</jira.functest.warlocation>
                        <atlassian.test.suite.numbatches>${atlassian.test.suite.numbatches}</atlassian.test.suite.numbatches>
                        <atlassian.test.suite.batch>${atlassian.test.suite.batch}</atlassian.test.suite.batch>
                        <atlassian.test.run.only.quarantined>${atlassian.test.run.only.quarantined}</atlassian.test.run.only.quarantined>
                        <webdriver.browser>${webdriver.browser}</webdriver.browser>
                        <atlassian.test.target.dir>${atlassian.test.target.dir}</atlassian.test.target.dir>
                    </systemPropertyVariables>
                    <products>
                        <product>
                            <id>refapp</id>
                            <instanceId>refapp1</instanceId>
                            <version>2.11.0</version>
                            <server>${refapp.host}</server>
                            <httpPort>${refapp.http.port}</httpPort>
                            <contextPath>${refapp.context.path}</contextPath>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.applinks</groupId>
                                    <artifactId>applinks-plugin</artifactId>
                                    <version>${applinks.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                            <libArtifacts>
                                <libArtifact>
                                    <groupId>com.atlassian.applinks</groupId>
                                    <artifactId>applinks-api</artifactId>
                                    <version>${applinks.version}</version>
                                </libArtifact>
                                <libArtifact>
                                    <groupId>com.atlassian.applinks</groupId>
                                    <artifactId>applinks-host</artifactId>
                                    <version>${applinks.version}</version>
                                </libArtifact>
                                <libArtifact>
                                    <groupId>com.atlassian.applinks</groupId>
                                    <artifactId>applinks-spi</artifactId>
                                    <version>${applinks.version}</version>
                                </libArtifact>
                            </libArtifacts>
                        </product>
                        <product>
                            <id>jira</id>
                            <instanceId>jira2</instanceId>
                            <version>${project.version}</version>
                            <dataVersion>${project.version}</dataVersion>
                            <httpPort>${jira2.http.port}</httpPort>
                            <contextPath>${jira2.context.path}</contextPath>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.jira</groupId>
                                    <artifactId>jira-func-test-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.jira.tests</groupId>
                                    <artifactId>jira-testkit-plugin</artifactId>
                                    <version>${testkit.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                        </product>
                        <product>
                            <id>confluence</id>
                            <version>${confluence.version}</version>
                            <httpPort>1990</httpPort>
                            <dataPath>${project.basedir}/src/test/amps/confluence-test-resources.zip</dataPath>
                        </product>
                    </products>
                    <testGroups>
                        <testGroup>
                            <id>just_jira</id>
                            <productIds>
                                <productId>jira2</productId>
                            </productIds>
                            <includes>
                                <include>**/IntegrationCargoWebTestSuite.java</include>
                            </includes>
                            <systemProperties>
                                <atlassian.test.suite.package>it.com.atlassian.jira.webtest.tests.just_jira</atlassian.test.suite.package>
                            </systemProperties>
                        </testGroup>
                        <testGroup>
                            <id>just_confluence</id>
                            <productIds>
                                <productId>confluence</productId>
                            </productIds>
                            <includes>
                                <include>**/IntegrationCargoWebTestSuite.java</include>
                            </includes>
                            <systemProperties>
                                <atlassian.test.suite.package>it.com.atlassian.jira.webtest.tests.just_confluence</atlassian.test.suite.package>
                            </systemProperties>
                        </testGroup>
                    </testGroups>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
                <!-- copy the value of ${skipTests} into JIRA's ${maven.test.func.skip} -->
        <profile>
            <id>copy-skiptests-value</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>skipTests</name>
                </property>
            </activation>
            <properties>
                <maven.test.selenium.skip>${skipTests}</maven.test.selenium.skip>
            </properties>
        </profile>
        <!-- put all this in a conditional profile, to speed things up when we don't run integration tests -->
        <profile>
            <id>prepare-integration-tests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>!maven.test.selenium.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.1-atlassian-2</version>
                        <executions>
                            <!-- unpack the JIRA WAR, to be used by the cargo test harness -->
                            <execution>
                                <id>unpack-war</id>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <includeArtifactIds>jira-webapp-dist</includeArtifactIds>
                                    <outputDirectory>${cargo.warlocation}</outputDirectory>
                                </configuration>
                            </execution>
                            <!-- these JARs are used by JIRA at runtime -->
                            <execution>
                                <id>copy-tomcat-jars</id>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <includeScope>provided</includeScope>
                                    <outputDirectory>${project.build.testOutputDirectory}/jira-jars-tomcat5</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-func-test-dependencies</id>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <includeArtifactIds>jira-func-test-plugin,jira-testkit-plugin</includeArtifactIds>
                                    <outputDirectory>${project.build.directory}/jirahome/plugins/installed-plugins</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Artifact Passing requires a producer build in Bamboo to provide the <dependencies> -->
        <profile>
            <id>use-artifact-passing</id>
            <activation>
                <property>
                    <name>jira.use.artifact.passing</name>
                    <value>true</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <!-- without this Mr Surefire is not so sure what lib to use to fire the tests -->
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.jira</groupId>
                    <artifactId>jira-webapp-dist</artifactId>
                    <version>${project.version}</version>
                    <type>war</type>
                    <scope>system</scope>
                    <systemPath>${basedir}/PassedArtifacts/jira-webapp-dist-${project.version}.war</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.jira</groupId>
                    <artifactId>jira-webdriver-tests</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${basedir}/PassedArtifacts/jira-webdriver-tests-${project.version}-jar-with-dependencies.jar</systemPath>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.jira</groupId>
                    <artifactId>jira-func-test-plugin</artifactId>
                    <version>${project.version}</version>
                    <scope>system</scope>
                    <systemPath>${basedir}/PassedArtifacts/jira-func-test-plugin-${project.version}.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
        <!-- END OF Artifact Passing Profile -->
    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${apache.httpclient.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-webdriver-tests</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-webapp-dist</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-func-test-plugin</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira.tests</groupId>
            <artifactId>jira-testkit-plugin</artifactId>
            <version>${testkit.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</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>

        <!-- dependencies needed by JIRA at runtime. see integration.container.properties -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>${h2.jdbc.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>${hsql.jdbc.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>carol</groupId>
            <artifactId>carol</artifactId>
            <version>1.5.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>carol</groupId>
            <artifactId>carol-properties</artifactId>
            <version>1.5.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jotm</groupId>
            <artifactId>jotm</artifactId>
            <version>1.4.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jotm</groupId>
            <artifactId>jotm-jrmp_stubs</artifactId>
            <version>1.4.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ots-jts</groupId>
            <artifactId>ots-jts</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jotm</groupId>
            <artifactId>jonas_timer</artifactId>
            <version>1.4.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jotm</groupId>
            <artifactId>jotm-iiop_stubs</artifactId>
            <version>1.4.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jta</groupId>
            <artifactId>jta</artifactId>
            <version>1.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>xapool</groupId>
            <artifactId>xapool</artifactId>
            <version>1.3.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jotm</groupId>
            <artifactId>objectweb-datasource</artifactId>
            <version>1.4.3</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>
