<?xml version="1.0" encoding="UTF-8"?>
<!--suppress ALL -->
<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.brs</groupId>
        <artifactId>integration</artifactId>
        <version>2.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>integration-sample-test</artifactId>
    <name>WSO2 BRS - Integration Test Module</name>
    <packaging>jar</packaging>


    <build>
        <plugins>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>source-code-generation</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <path id="wsdl2java.classpath">
                                    <!--     <pathelement
                                    location="${settings.localRepository}/org/apache/axis2/wso2/axis2-client/${orbit.version.axis2}/axis2-client-${orbit.version.axis2}.jar"/>
                            <pathelement
                                    location="${settings.localRepository}/org/apache/axis2/wso2/axis2/${orbit.version.axis2}/axis2-${orbit.version.axis2}.jar"/>-->
                                    <path id="wsdl2java.classpath">
                                        <pathelement
                                                location="${settings.localRepository}/org/apache/ws/commons/axiom/wso2/axiom/${orbit.version.axiom}/axiom-${orbit.version.axiom}.jar"/>
                                        <pathelement
                                                location="${settings.localRepository}/org/apache/axis2/wso2/axis2-client/${orbit.version.axis2}/axis2-client-${orbit.version.axis2}.jar"/>
                                        <pathelement
                                                location="${settings.localRepository}/org/apache/axis2/wso2/axis2/${orbit.version.axis2}/axis2-${orbit.version.axis2}.jar"/>
                                    </path>

                                </path>


                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/OrderApprovalService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/orderApproval=org.wso2.carbon.samples.test.orderApprovalService.stub,http://com.test/placeorder=org.wso2.carbon.samples.test.orderApprovalService.order"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/BankingService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/Banking=org.wso2.carbon.samples.test.bankingService.stub,http://com.test/deposit=org.wso2.carbon.samples.test.bankingService.deposit,http://com.test/withDraw=org.wso2.carbon.samples.test.bankingService.withdraw"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/CallChargingService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/callCharge=org.wso2.carbon.samples.test.callChargingService.charges,http://com.test/callcharging=org.wso2.carbon.samples.test.callChargingService.stub"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/CarRentalService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/carrental=org.wso2.carbon.samples.test.carRentalService.stub,http://com.test/carReservation=org.wso2.carbon.samples.test.carRentalService.reservation"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/GetQuoteService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/placeCustomerDetail=org.wso2.carbon.samples.test.quoteService.customerDetail,http://com.test/quotation=org.wso2.carbon.samples.test.quoteService.stub"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/GreetingService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/greeting=org.wso2.carbon.samples.test.greetingService.greeting"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/HealthCareService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/HeathCareService=org.wso2.carbon.samples.test.healthCareService.stub,http://com.test/patientDetail=org.wso2.carbon.samples.test.healthCareService.patientDetail"/>
                                    <classpath refid="wsdl2java.classpath"/>

                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/InsuranceService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/applyForInsurance=org.wso2.carbon.samples.test.insuranceService.insurance,http://com.test/insurance=org.wso2.carbon.samples.test.insuranceService.stub"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/MIPCalculateService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/MIPCalculateService=org.wso2.carbon.samples.test.mipCalculateService.stub,http://com.test/placeClientDetail=org.wso2.carbon.samples.test.mipCalculateService.clientDetail"/>
                                    <classpath refid="wsdl2java.classpath"/>
                                </java>

                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/test/resources/wsdl/ShoppingService.wsdl -u -uw
                                     -o target/generated-code
                                     -ns2p http://com.test/addProduct=org.wso2.carbon.samples.test.shoppingService.product,http://com.test/purchaseOrder=org.wso2.carbon.samples.test.shoppingService.purchaseOrder,http://com.test/shopping=org.wso2.carbon.samples.test.shoppingService.stub"/>
                                    <classpath refid="wsdl2java.classpath"/>


                                </java>

                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>
                                    target/generated-code/src
                                </source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <includes>
                        <include>**/*TestServerManager.java</include>
                        <include>**/*TestCase.java</include>
                    </includes>
                    <systemProperties>
                        <maven.test.haltafterfailure>false</maven.test.haltafterfailure>
                        <carbon.zip>
                            ${basedir}/../../distribution/target/wso2brs-${project.version}.zip
                        </carbon.zip>
                        <samples.dir>${basedir}/../org.wso2.carbon.brs.integration.services
                        </samples.dir>
                        <extracted.dir>wso2brs-${project.version}</extracted.dir>
                        <sec.verifier.dir>
                            ${basedir}/target/security-verifier/
                        </sec.verifier.dir>
                        <emma.home>${basedir}/target/emma</emma.home>
                        <emma.output>${basedir}/target/emma</emma.output>
                    </systemProperties>
                    <workingDirectory>${basedir}/target</workingDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-emma-dependencies</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/emma</outputDirectory>
                            <includeTypes>jar</includeTypes>
                            <includeArtifactIds>emma,org.wso2.carbon.integration.framework</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>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.integration.framework</artifactId>
            <version>${carbon.version}</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.1.1</version>
        </dependency>

        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.rule.ws.stub</artifactId>
            <version>4.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.rule.common</artifactId>
            <version>${carbon.version}</version>
        </dependency>
        <dependency>
            <artifactId>commons-fileupload</artifactId>
            <groupId>commons-fileupload.wso2</groupId>
            <version>1.2.2.wso2v1</version>
        </dependency>
        <dependency>
            <groupId>emma</groupId>
            <artifactId>emma</artifactId>
            <version>${emma.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>SecVerifier</artifactId>
            <version>4.0.2</version>
            <type>aar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom.wso2</groupId>
            <artifactId>axiom</artifactId>
            <version>1.2.11.wso2v2</version>
        </dependency>
    </dependencies>
</project>
