<?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.ei</groupId>
        <artifactId>mediation-integration</artifactId>
        <version>4.5.0-beta</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.ei.tests.sample</artifactId>
    <name>MI test Module - Sample</name>
    <packaging>jar</packaging>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
                <executions>
                    <execution>
                        <id>default-testCompile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <inherited>false</inherited>
                <configuration>

                    <argLine>-Xms512m -Xmx1024m </argLine>
                    <disableXmlReport>false</disableXmlReport>
                    <parallel>false</parallel>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <systemProperties>
                        <property>
                            <name>framework.resource.location</name>
                            <value>
                                ${basedir}/src/test/resources/
                            </value>
                        </property>
                        <property>
                            <name>server.list</name>
                            <value>
                                ESB
                            </value>
                        </property>
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                        <sec.verifier.dir>${basedir}/target/security-verifier/</sec.verifier.dir>
                        <maven.test.haltafterfailure>false</maven.test.haltafterfailure>
                        <carbon.zip>
                            ${basedir}/../../../distribution/target/wso2mi-${project.version}.zip
                        </carbon.zip>
                        <instr.file>${basedir}/../coverage-report/instrumentation.txt</instr.file>
                        <filters.file>${basedir}/../coverage-report/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>unpack-mar-jks</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wso2.ei</groupId>
                                    <artifactId>wso2mi</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${basedir}/target/tobeCopied/</outputDirectory>
                                    <includes>**/*.jks,**/*.mar,**/synapse_sample*.xml</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <!--

                                        <execution>
                                            <id>copy-jar-dependencies</id>
                                            <phase>compile</phase>
                                            <goals>
                                                <goal>copy-dependencies</goal>
                                            </goals>
                                            <configuration>
                                                <outputDirectory>${basedir}/src/test/resources/artifacts/ESB/jar
                                                </outputDirectory>
                                                <includeTypes>jar</includeTypes>
                                                <includeArtifactIds>
                                                    groovy-all,jruby-complete,mysql-connector-java,activemq-core,geronimo-j2ee-management_1.1_spec,geronimo-jms_1.1_spec
                                                </includeArtifactIds>
                                                <excludeTransitive>true</excludeTransitive>
                                            </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.ei</groupId>
                                                        <artifactId>wso2ei</artifactId>
                                                        <version>${project.version}</version>
                                                        <type>zip</type>
                                                        <overWrite>true</overWrite>
                                                        <outputDirectory>${basedir}/target/tobeCopied/</outputDirectory>
                                                        <includes>**/*.jks,**/*.mar,**/synapse_sample*.xml</includes>
                                                    </artifactItem>
                                                </artifactItems>
                                            </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-samples</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/samples</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/../../samples/
                                    </directory>
                                    <includes>
                                        <include>**</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/wso2mi-${project.version}/repository/deployment/client/modules
                                    </directory>
                                    <includes>
                                        <include>**/*.mar</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-samples-jar</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/src/test/resources/artifacts/ESB/server/dropins
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/../../samples/product/target/
                                    </directory>
                                    <includes>
                                        <include>**/*samples*.jar</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>

                    <!--<execution>
                        <id>copy-axis2-server</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                ${basedir}/target/axis2Server/
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>
                                        ${basedir}/../tests-common/integration-test-utils/resources/axis2Server
                                    </directory>
                                    <includes>
                                        <include>**</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>-->

                     <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/wso2mi-${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/wso2mi-${project.version}/repository/resources/security/
                                     </directory>
                                     <includes>
                                         <include>**/*.jks</include>
                                     </includes>
                                 </resource>
                             </resources>
                         </configuration>
                     </execution>
        <!--             <execution>
                         <id>copy-sample-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/wso2ei-${project.version}/samples/service-bus/resources/security/
                                     </directory>
                                     <includes>
                                         <include>**/*.jks</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/wso2mi-${project.version}/repository/deployment/client/modules-->
                    <!--                                </directory>-->
                    <!--                                <includes>-->
                    <!--                                    <include>**/*.mar</include>-->
                    <!--                                </includes>-->
                    <!--                            </resource>-->
                    <!--                        </resources>-->
                    <!--                    </configuration>-->
                    <!--                </execution>-->
                    <!--                <execution>-->
                    <!--                    <id>copy-samples</id>-->
                    <!--                    <phase>compile</phase>-->
                    <!--                    <goals>-->
                    <!--                        <goal>copy-resources</goal>-->
                    <!--                    </goals>-->
                    <!--                    <configuration>-->
                    <!--                        <outputDirectory>${basedir}/src/test/resources/artifacts/ESB/samples/-->
                    <!--                        </outputDirectory>-->
                    <!--                        <resources>-->
                    <!--                            <resource>-->
                    <!--                                <directory>-->
                    <!--                                    ${basedir}/target/tobeCopied/wso2ei-${project.version}/samples/service-bus/-->
                    <!--                                </directory>-->
                    <!--                                <includes>-->
                    <!--                                    <include>**/*.xml</include>-->
                    <!--                                </includes>-->
                    <!--                            </resource>-->
                    <!--                        </resources>-->
                    <!--                    </configuration>-->
                    <!--                </execution>-->
                </executions>
            </plugin>

        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.wso2.ei</groupId>
            <artifactId>admin-clients</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.wso2.carbon.mediation</groupId>
                    <artifactId>org.wso2.carbon.rest.api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.wso2.ei</groupId>
            <artifactId>integration-test-utils</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.wso2.carbon.mediation</groupId>
                    <artifactId>org.wso2.carbon.rest.api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.wso2.ei</groupId>
            <artifactId>service-samples</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.ibatis</groupId>
            <artifactId>ibatis-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jms_1.1_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.fusesource.hawtbuf</groupId>
            <artifactId>hawtbuf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-broker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-complete</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.ei</groupId>
            <artifactId>automation-extensions</artifactId>
        </dependency>
        <!-- Jacoco Dependency-->
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>
