<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Fuse EAP :: Testsuite :: Standalone
  %%
  Copyright (C) 2015 RedHat
  %%
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  
       http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  #L%
  -->

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
	    <groupId>com.redhat.fuse.eap</groupId>
        <artifactId>fuse-eap-itests</artifactId>
        <version>6.2.1.redhat-107</version>
    </parent>

    <name>Fuse EAP :: Testsuite :: Standalone</name>

    <artifactId>fuse-eap-itests-standalone</artifactId>

    <!-- Properties -->
    <properties>
        <target.dir>${project.build.directory}</target.dir>
        <jboss.home>${target.dir}/jboss-eap-6.4</jboss.home>
        <jvmArgs>-Xmx1G -XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true -DexportedPathsTxt=target/exported-paths.txt</jvmArgs>
        <jvmDebugArgs>-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n</jvmDebugArgs>
        <server.config>standalone-full.xml</server.config>
    </properties>
    
    <!-- Dependencies -->
    <dependencies>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-itests-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-itests-standalone-basic</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-itests-standalone-smoke</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-example-itests</artifactId>
        </dependency>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-as7-tests</artifactId>
            <version>${version.switchyard}</version>
            <type>test-jar</type>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-as7-standalone-dist</artifactId>
            <version>${version.switchyard}</version>
            <type>test-jar</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        
        <!-- [TODO] Remove explicit xnio override -->
        <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-api</artifactId>
            <version>${version.jboss.xnio}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-nio</artifactId>
            <version>${version.jboss.xnio}</version>
            <scope>test</scope>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-arquillian-container-managed</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-testenricher</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.picketlink</groupId>
            <artifactId>picketlink-federation</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-bpel-say-hello</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>tranql</groupId>
                    <artifactId>tranql-connector</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-bean-service</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-bpel-jms-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-bpel-loan-approval</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-atom-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-file-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-bus-cdi</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-cxf-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-hl7</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-jpa-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-mail-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-mqtt-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-netty-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-quartz-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-rss-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-saxon</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-service</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-sql-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-soap-proxy</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-soap-proxy-reverse-service</artifactId>
            <version>${version.switchyard}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-ear-deployment-ear-assembly</artifactId>
            <version>${version.switchyard}</version>
            <type>ear</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-http-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-jca-inflow-hornetq</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-jca-outbound-hornetq</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-jms-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-remote-invoker</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-rest-binding</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-soap-addressing</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-soap-attachment</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-soap-binding-rpc</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-soap-mtom</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-transform-dozer</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-transform-jaxb</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-transform-json</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-transform-smooks</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-validate-xml</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-transform-xslt</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts.demos</groupId>
            <artifactId>switchyard-demo-orders</artifactId>
            <version>${version.switchyard}</version>
            <type>war</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts.demos</groupId>
            <artifactId>switchyard-demo-policy-security-basic</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts.demos</groupId>
            <artifactId>switchyard-demo-policy-security-cert</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts.demos</groupId>
            <artifactId>switchyard-demo-policy-security-saml</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts.demos</groupId>
            <artifactId>switchyard-demo-policy-security-wss-signencrypt</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts.demos</groupId>
            <artifactId>switchyard-demo-policy-security-wss-username</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts.demos</groupId>
            <artifactId>switchyard-demo-policy-transaction</artifactId>
            <version>${version.switchyard}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                       <id>unpack-wildfly</id>
                       <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jboss.as</groupId>
                                    <artifactId>jboss-as-dist</artifactId>
                                    <version>${version.wildfly}</version>
                                    <type>zip</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${target.dir}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-eap-installer</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.redhat.fuse.eap</groupId>
                                    <artifactId>fuse-eap-installer</artifactId>
                                    <version>${project.version}</version>
                                    <outputDirectory>${jboss.home}</outputDirectory>
                                    <destFileName>fuse-eap-installer.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-wfc-example-wars</id>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeGroupIds>org.wildfly.camel,com.icegreen</includeGroupIds>
                            <includeTypes>war</includeTypes>
                            <stripVersion>true</stripVersion>
                            <outputDirectory>${target.dir}/examples</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-xmlbeans</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.switchyard</groupId>
                                    <artifactId>switchyard-as7-tests</artifactId>
                                    <type>test-jar</type>
                                    <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
                                    <includes>*.properties,cxf.xml,test-ds.xml,OrderService.wsdl</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-user-properties</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${jboss.home}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>etc/jboss-eap</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>run-fuse-eap-installer</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>java</executable>
                            <arguments>
                                <argument>-jar</argument>
                                <argument>${jboss.home}/fuse-eap-installer.jar</argument>
                                <argument>${jboss.home}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <redirectTestOutputToFile>false</redirectTestOutputToFile>
                    <environmentVariables>
                        <JBOSS_HOME>${jboss.home}</JBOSS_HOME>
                        <SWITCHYARD_VERSION>${version.switchyard}</SWITCHYARD_VERSION>
                    </environmentVariables>
                    <systemPropertyVariables>
                        <jboss.home>${jboss.home}</jboss.home>
                    </systemPropertyVariables>
                    <dependenciesToScan>
                        <dependency>org.wildfly.camel:wildfly-camel-itests-standalone-smoke</dependency>
                        <dependency>org.wildfly.camel:wildfly-camel-itests-standalone-basic</dependency>
                        <dependency>org.wildfly.camel:wildfly-camel-example-itests</dependency>
                        <dependency>org.switchyard:switchyard-as7-tests</dependency>
                    </dependenciesToScan>
                    <excludes>
                        <!-- Switchyard -->
                        <exclude>**/CamelJpaBindingQuickstartTest.*</exclude>
                        <exclude>**/BpelServiceSayHelloQuickstartTest.*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>modules-check</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <properties>
                                <!-- [TODO] Fail the build where duplicate module dependencies are detected -->
                                <failonerror>false</failonerror>
                            </properties>
                            <source>${project.basedir}/scripts/module-checker.groovy</source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jboss.shrinkwrap.resolver</groupId>
                <artifactId>shrinkwrap-resolver-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>propagate-execution-context</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
