<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors.
-
- 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.
--><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>org.jboss.integration.fuse</groupId>
      <artifactId>eap-release-parent</artifactId>
      <version>1.2.0.redhat-005</version>
   </parent>

   <artifactId>fuse-integration-eap-itests</artifactId>
   <packaging>jar</packaging>
   <name>Fuse Integration: AS7 Release Distribution Tests</name>
   <description>Fuse BXMS Integration AS7 Release Distribution Tests</description>

   <properties>
      <temp.switchyard.unpack>${project.build.directory}/temp/switchyard-distro</temp.switchyard.unpack>
      <temp.fuse.integration.unpack>${project.build.directory}/temp/fuse-integration</temp.fuse.integration.unpack>
   </properties>
   
   <dependencies>
      <dependency>
         <groupId>org.switchyard</groupId>
         <artifactId>switchyard-test</artifactId>
      </dependency>
      <dependency>
         <groupId>org.switchyard</groupId>
         <artifactId>switchyard-remote</artifactId>
      </dependency>
      <dependency>
         <groupId>org.switchyard.components</groupId>
         <artifactId>switchyard-component-bean</artifactId>
      </dependency>
      <dependency>
         <groupId>org.switchyard.components</groupId>
         <artifactId>switchyard-component-jca</artifactId>
      </dependency>
      <dependency>
         <groupId>org.switchyard.components</groupId>
         <artifactId>switchyard-component-soap</artifactId>
      </dependency>
      <dependency>
         <groupId>org.switchyard.components</groupId>
         <artifactId>switchyard-component-test-mixin-hornetq</artifactId>
      </dependency>
      <dependency>
         <groupId>org.switchyard.components</groupId>
         <artifactId>switchyard-component-test-mixin-http</artifactId>
      </dependency>
      <dependency>
         <groupId>org.switchyard</groupId>
         <artifactId>switchyard-release-testutil</artifactId>
      </dependency>
      <dependency>
         <groupId>org.wildfly.camel</groupId>
         <artifactId>wildfly-camel-itests-standalone-basic</artifactId>
         <version>${version.wildfly.camel}</version>
      </dependency>
      <dependency>
         <groupId>org.wildfly.camel</groupId>
         <artifactId>wildfly-camel-itests-standalone-smoke</artifactId>
         <version>${version.wildfly.camel}</version>
      </dependency>

      <!-- Test Dependencies -->
      <dependency>
         <groupId>org.jboss.integration.fuse</groupId>
         <artifactId>fuse-integration-eap-installer</artifactId>
         <version>${project.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.integration.fuse.quickstarts</groupId>
         <artifactId>switchyard-rules-csv</artifactId>
         <scope>test</scope>
      </dependency>      
      <dependency>
         <groupId>org.jboss.arquillian.junit</groupId>
         <artifactId>arquillian-junit-container</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.arquillian.container</groupId>
         <artifactId>arquillian-container-test-api</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.jboss.as</groupId>
         <artifactId>jboss-as-arquillian-common</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.as</groupId>
         <artifactId>jboss-as-arquillian-testenricher-msc</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.as</groupId>
         <artifactId>jboss-as-arquillian-protocol-jmx</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.shrinkwrap.descriptors</groupId>
         <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
         <scope>test</scope>
      </dependency>
      <!-- CXF client dependencies -->
      <dependency>
         <groupId>org.jboss.ws.cxf</groupId>
         <artifactId>jbossws-cxf-client</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.ws.cxf</groupId>
         <artifactId>jbossws-cxf-factories</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.ws.cxf</groupId>
         <artifactId>jbossws-cxf-transports-httpserver</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-core</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-frontend-simple</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-frontend-jaxws</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-bindings-soap</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-bindings-xml</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-databinding-jaxb</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-hl7</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-mina2</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.picketlink</groupId>
         <artifactId>picketlink-federation</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <profiles>
      <profile>
         <id>default</id>
         <activation>
            <property>
               <name>!eap.home</name>
            </property>
         </activation>
         <properties>
            <eap.home>${project.build.directory}/jboss-eap-6.4</eap.home>
         </properties>
         <build>
            <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.org.jboss.as}</version>
                                    <type>zip</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>

   <build>
      <testResources>
         <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
         </testResource>
      </testResources>
      <plugins>
         <!-- [#28] Disable managed version checking -->
         <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <configuration>
               <fail>false</fail>
            </configuration>
         </plugin>
         <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
               <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>${version.fuse.eap}</version>
                           <outputDirectory>${eap.home}</outputDirectory>
                           <destFileName>fuse-eap-installer.jar</destFileName>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.jboss.integration.fuse</groupId>
                           <artifactId>fuse-integration-eap-installer</artifactId>
                           <version>${project.version}</version>
                           <outputDirectory>${eap.home}</outputDirectory>
                           <destFileName>fuse-integration-eap-installer.jar</destFileName>
                        </artifactItem>
                     </artifactItems>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
               <execution>
                  <id>install-fuse-eap</id>
                  <phase>generate-resources</phase>
                  <goals>
                     <goal>exec</goal>
                  </goals>
                  <configuration>
                     <executable>java</executable>
                     <arguments>
                        <argument>-jar</argument>
                        <argument>${eap.home}/fuse-eap-installer.jar</argument>
                        <argument>${eap.home}</argument>
                     </arguments>
                  </configuration>
               </execution>
               <execution>
                  <id>install-fuse-integration</id>
                  <phase>generate-resources</phase>
                  <goals>
                     <goal>exec</goal>
                  </goals>
                  <configuration>
                     <executable>java</executable>
                     <arguments>
                        <argument>-jar</argument>
                        <argument>${eap.home}/fuse-integration-eap-installer.jar</argument>
                        <argument>${eap.home}</argument>
                     </arguments>
                  </configuration>
               </execution>
            </executions>
         </plugin>

         <!-- Configure the Surefire plugin for running the tests. Be sure 
            to make these same setting if running in your IDE... -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <argLine>-Xms512m -Xmx512m</argLine>
               <environmentVariables>
                  <JBOSS_HOME>${eap.home}</JBOSS_HOME>
                  <SWITCHYARD_VERSION>${project.version}</SWITCHYARD_VERSION>
               </environmentVariables>
               <systemProperties>
                  <property>
                     <name>jboss.options</name>
                     <value>-Xmx1024m -XX:MaxPermSize=512m</value>
                  </property>
               </systemProperties>
               <dependenciesToScan>
                  <dependency>org.wildfly.camel:wildfly-camel-itests-standalone-smoke</dependency>
                  <dependency>org.wildfly.camel:wildfly-camel-itests-standalone-basic</dependency>
               </dependenciesToScan>
               <trimStackTrace>false</trimStackTrace>
               <printSummary>true</printSummary>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-maven-plugin</artifactId>
         </plugin>
      </plugins>
   </build>
</project>
