<?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.gadgets</groupId>
        <artifactId>atlassian-gadgets</artifactId>
        <version>4.5.1</version>
    </parent>

    <artifactId>atlassian-gadgets-tests</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>Gadget Integration Tests</name>
    <description>Plugin used for integration tests.  Also the module to run to debug gadgets on the refapp</description>

    <properties>
        <atlassian.plugin.key>com.atlassian.gadgets.tests</atlassian.plugin.key>
        <!-- super.batch.for: all, ie, none -->
        <super.batch.for>none</super.batch.for>
        <context.batch.for>none</context.batch.for>
        <webdriver.browser>firefox-44.0</webdriver.browser>
        <xvfb.enable>true</xvfb.enable>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <version>${plug.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.gadgets</groupId>
            <artifactId>atlassian-gadgets-pageobjects</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-pageobjects</artifactId>
            <version>${apl.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-spi</artifactId>
            <version>${apl.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-api</artifactId>
            <version>${apl.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.qunit</groupId>
            <artifactId>atlassian-qunit-plugin-util</artifactId>
            <version>${atlassian.qunit.plugin.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <!-- atlassian-refapp-pageobjects dependencies -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-func-test-rest-common</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.refapp</groupId>
            <artifactId>atlassian-refapp-pageobjects</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>refapp-maven-plugin</artifactId>
                <configuration>
                    <productVersion>${atlassian.refapp.version}</productVersion>
                    <log4jProperties>src/main/resources/log4j.properties</log4jProperties>
                    <containerId>tomcat85x</containerId>
                    <functionalTestPattern>**/*Test.java</functionalTestPattern>
                    <output>${project.build.outputDirectory}/output.log</output>
                    <systemPropertyVariables>
                        <super.batch.for>all</super.batch.for>
                        <context.batch.for>${context.batch.for}</context.batch.for>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                        <webdriver.browser>${webdriver.browser}</webdriver.browser>
                        <plugin.resource.directories>
                            ${basedir}/src/main/resources,
                            ${basedir}/../dashboard-plugin/src/main/resources,
                            ${basedir}/../directory-plugin/src/main/resources,
                            ${basedir}/../embedded-plugin/src/main/resources,
                            ${basedir}/../publisher-plugin/src/main/resources,
                            ${basedir}/../opensocial-plugin/src/main/resources,
                            ${basedir}/../refimpl-dashboard-ui-plugin/src/main/resources
                        </plugin.resource.directories>
                        <qunit.testoutput.location>${project.build.directory}/surefire-reports</qunit.testoutput.location>
                    </systemPropertyVariables>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-api</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-spi</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-opensocial-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-dashboard-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-embedded-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-refimpl-dashboard-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-refimpl-dashboard-ui-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-directory-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-publisher-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-sample-gadgets-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>atlassian-gadgets-oauth-service-provider-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.bundles</groupId>
                            <artifactId>nekohtml</artifactId>
                            <version>1.9.12-1</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.qunit</groupId>
                            <artifactId>atlassian-qunit-plugin</artifactId>
                            <version>${atlassian.qunit.plugin.version}</version>
                        </pluginArtifact>

                        <pluginArtifact>
                            <groupId>com.atlassian.applinks</groupId>
                            <artifactId>applinks-plugin</artifactId>
                            <version>${apl.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.applinks</groupId>
                            <artifactId>applinks-basicauth-plugin</artifactId>
                            <version>${apl.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.applinks</groupId>
                            <artifactId>applinks-cors-plugin</artifactId>
                            <version>${apl.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.applinks</groupId>
                            <artifactId>applinks-oauth-plugin</artifactId>
                            <version>${apl.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.applinks</groupId>
                            <artifactId>applinks-trustedapps-plugin</artifactId>
                            <version>${apl.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.applinks</groupId>
                            <artifactId>applinks-tests</artifactId>
                            <version>${apl.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugin</groupId>
                            <artifactId>jslibs</artifactId>
                            <version>1.2.4</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.labs.plugins</groupId>
                            <artifactId>quickreload</artifactId>
                            <version>${quickreload.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-whitelist-api-plugin</artifactId>
                            <version>${atlassian.whitelist.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-whitelist-core-plugin</artifactId>
                            <version>${atlassian.whitelist.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-whitelist-ui-plugin</artifactId>
                            <version>${atlassian.whitelist.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>whitelist-5</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>refapp-maven-plugin</artifactId>
                        <configuration>
                            <pluginArtifacts combine.children="append">
                                <pluginArtifact>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-whitelist-refimpl-plugin</artifactId>
                                    <version>${atlassian.whitelist.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>bamboo</id>
            <properties>
                <xvfb.enable>true</xvfb.enable>
            </properties>
        </profile>

        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <browser.arch>windows</browser.arch>
            </properties>
        </profile>

        <profile>
            <id>linux</id>
            <activation>
                <os>
                    <name>linux</name>
                    <arch>i386</arch>
                </os>
            </activation>
            <properties>
                <browser.arch>linux</browser.arch>
            </properties>
        </profile>

        <profile>
            <id>linux64</id>
            <activation>
                <os>
                    <name>linux</name>
                    <arch>amd64</arch>
                </os>
            </activation>
            <properties>
                <browser.arch>linux64</browser.arch>
            </properties>
        </profile>

        <profile>
            <id>macosx</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <browser.arch>osx</browser.arch>
            </properties>
        </profile>

        <profile>
            <id>ie</id>
            <properties>
                <webdriver.browser>ie</webdriver.browser>
            </properties>
        </profile>

        <profile>
            <id>firefox</id>
            <properties>
                <webdriver.browser>firefox-44.0-nofirebug</webdriver.browser>
                <firefox.version>44.0</firefox.version>
                <firefox.profile.version>44.0</firefox.profile.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian.browsers</groupId>
                    <artifactId>firefox</artifactId>
                    <version>${firefox.version}</version>
                    <classifier>${browser.arch}</classifier>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.browsers</groupId>
                    <artifactId>firefox-profile</artifactId>
                    <version>${firefox.profile.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>chrome</id>
            <properties>
                <webdriver.browser>chrome-15</webdriver.browser>
                <webdriver.chrome.switches>--allow-outdated-plugins,--always-authorize-plugins,--no-default-browser-check</webdriver.chrome.switches>
                <chrome.version>15</chrome.version>
                <chrome.profile.version>15</chrome.profile.version>
                <install.java.plugin.dest>${basedir}/target/webdriverTmp/chrome-${browser.arch}/plugins/</install.java.plugin.dest>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian.browsers</groupId>
                    <artifactId>chrome</artifactId>
                    <version>${chrome.version}</version>
                    <classifier>${browser.arch}</classifier>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.browsers</groupId>
                    <artifactId>chrome-profile</artifactId>
                    <version>${chrome.profile.version}</version>
                    <classifier>${browser.arch}</classifier>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
