<?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">

    <parent>
        <groupId>org.wso2.appserver</groupId>
        <artifactId>test-integration-appSever</artifactId>
        <version>5.3.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <name>WSO2 AppServer - Integration Test Module</name>
    <artifactId>org.wso2.appserver.integration.tests</artifactId>
    <packaging>jar</packaging>

    <build>
        <testResources>
            <testResource>
                <directory>${project.basedir}/src/test/resources</directory>
            </testResource>
            <testResource>
                <directory>${project.basedir}/target/resources</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <argLine>-Xmx1024m -XX:-UseSplitVerifier</argLine>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng-server-mgt.xml</suiteXmlFile>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>

                    <systemProperties>
                        <property>
                            <name>maven.test.haltafterfailure</name>
                            <value>false</value>
                        </property>
                        <property>
                            <name>java.io.tmpdir</name>
                            <value>${basedir}/target/</value>
                        </property>
                        <property>
                            <name>carbon.zip</name>
                            <value>
                                ${basedir}/../../../distribution/target/wso2as-${project.version}.zip
                            </value>
                        </property>
                        <property>
                            <name>framework.resource.location</name>
                            <value>
                                ${basedir}/src/test/resources/
                            </value>
                        </property>
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                        <sec.verifier.dir>${basedir}/target/security-verifier/</sec.verifier.dir>
                        <instr.file>${basedir}/src/test/resources/instrumentation.txt</instr.file>
                        <filters.file>${basedir}/src/test/resources/filters.txt</filters.file>
                    </systemProperties>
                    <workingDirectory>${basedir}/target</workingDirectory>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-jacoco-dependencies</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/jacoco</outputDirectory>
                            <includeTypes>jar</includeTypes>
                            <includeArtifactIds>org.jacoco.agent</includeArtifactIds>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-secVerifier</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/security-verifier</outputDirectory>
                            <includeTypes>aar</includeTypes>
                            <includeArtifactIds>SecVerifier</includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>unpack-mar-jks</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wso2.appserver</groupId>
                                    <artifactId>wso2as</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${basedir}/target/tobeCopied/</outputDirectory>
                                    <includes>**/*.jks,**/*.mar,**/axis2_client.xml</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-spring3-restful</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/spring</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>
                                spring3-restful-simple-service, spring3-restful-jndi-service,
                                spring3-restful-webapp-classloading, spring3-restful-faulty-service,
                                spring4-restful-simple-service, spring4-restful-jndi-service,
                                spring4-restful-webapp-classloading, spring4-restful-faulty-service
                            </includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>unpack-spring3-restful-runtime-libs</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wso2.appserver</groupId>
                                    <artifactId>spring3-restful-runtime-libs</artifactId>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${basedir}/target/resources/artifacts/AS/spring</outputDirectory>
                                    <includes>**/*.jar</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-jaxrs-restful</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/jaxrs/client</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>
                                jaxrs-client-api-test-webapp
                            </includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-hibernate-war</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/war/hibernate</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>
                                hibernate-example
                            </includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-logging-artifacts</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/war</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>
                                access-logs-test-webapp,
                                commons-logging-test-webapp,
                                slf4j-logging-test-webapp,
                                carbon-logging-test-webapp,
                                jul-logs-test-webapp
                            </includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-carbon-context-app</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/war</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>carbon-context</includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-example-webapp</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/war</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>example</includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-CarbonSaaS-webapp</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/war</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>CarbonSaasApp</includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>copy-carbon-cache-webapp</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/resources/artifacts/AS/war</outputDirectory>
                            <includeTypes>war</includeTypes>
                            <includeArtifactIds>carbon-cache</includeArtifactIds>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>copy-resources-jks</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/src/test/resources/keystores/products
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/target/tobeCopied/wso2as-${project.version}/repository/resources/security/
                                    </directory>
                                    <includes>
                                        <include>**/*.jks</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-stratos-jks</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/src/test/resources/keystores/stratos
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/target/tobeCopied/wso2as-${project.version}/repository/resources/security/
                                    </directory>
                                    <includes>
                                        <include>**/*.jks</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-axis2files</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/src/test/resources/axis2config
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/target/tobeCopied/wso2as-${project.version}/repository/conf/axis2/
                                    </directory>
                                    <includes>
                                        <include>**/*.xml</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-resources-mar</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/src/test/resources/client/modules
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/target/tobeCopied/wso2as-${project.version}/repository/deployment/client/modules
                                    </directory>
                                    <includes>
                                        <include>**/*.mar</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/test/java</directory>
                <includes>
                    <include>*.properties</include>
                </includes>
            </resource>
        </resources>

    </build>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>SecVerifier</artifactId>
            <type>aar</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>org.wso2.appserver.integration.common.utils</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>org.wso2.appserver.integration.common.clients</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.automation</groupId>
            <artifactId>org.wso2.carbon.automation.test.utils</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.automation</groupId>
            <artifactId>org.wso2.carbon.automation.engine</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.automation</groupId>
            <artifactId>org.wso2.carbon.automation.extensions</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.automationutils</groupId>
            <artifactId>org.wso2.carbon.integration.common.extensions</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.automationutils</groupId>
            <artifactId>org.wso2.carbon.integration.common.utils</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.automationutils</groupId>
            <artifactId>org.wso2.carbon.integration.common.tests</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.commons</groupId>
            <artifactId>org.wso2.carbon.wsdl2code.stub</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.registry</groupId>
            <artifactId>org.wso2.carbon.registry.resource.stub</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.registry</groupId>
            <artifactId>org.wso2.carbon.registry.info.stub</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.xfer</groupId>
            <artifactId>wso2xfer</artifactId>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
            <version>1.2.3</version>
        </dependency>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.tomcat</groupId>
            <artifactId>tomcat</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.tyrus.bundles</groupId>
            <artifactId>tyrus-standalone-client</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database.wso2</groupId>
            <artifactId>h2-database-engine</artifactId>
        </dependency>

        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>jpa-contacts-database</artifactId>
            <version>${project.parent.version}</version>
            <classifier>classes</classifier>
            <scope>test</scope>
        </dependency>

        <!-- Spring Service Integration Test Common Artifacts -->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring3-restful-simple-service</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring3-restful-jndi-service</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring3-restful-webapp-classloading</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring3-restful-runtime-libs</artifactId>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring3-restful-faulty-service</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring4-restful-simple-service</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring4-restful-jndi-service</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring4-restful-faulty-service</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>spring4-restful-webapp-classloading</artifactId>
            <type>war</type>
        </dependency>

        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>hibernate-example</artifactId>
            <type>war</type>
        </dependency>

        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>jaxrs-client-api-test-webapp</artifactId>
            <type>war</type>
        </dependency>

        <!-- Logging Test Common Artifacts-->
        <!--Access logs Test webapp dependency-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>access-logs-test-webapp</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
        <!--Commons logs Test webapp dependency-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>commons-logging-test-webapp</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
        <!--Slf4j logs Test webapp dependency-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>slf4j-logging-test-webapp</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
        <!--Carbon logs Test webapp dependency-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>carbon-logging-test-webapp</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
        <!--JUL logs Test webapp dependency-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>jul-logs-test-webapp</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>

        <!--CarbonContext Test Artifact-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>carbon-context</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>

        <!--Example webb app. This is use to test Registry and user mgt as well-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>example</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>

        <!--CarbonSaaS webb app. This is use to test Registry and user mgt as well-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>CarbonSaasApp</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>

        <!--Cache Test Artifact-->
        <dependency>
            <groupId>org.wso2.appserver</groupId>
            <artifactId>carbon-cache</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>
