<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>artificer</artifactId>
    <groupId>org.artificer</groupId>
    <version>1.0.0.Beta2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>artificer-test</artifactId>
  <name>Artificer Test</name>
  <description>A general test package supporting various integration tests.</description>

  <properties>
    <version.org.switchyard.quickstarts>1.1.0.Final</version.org.switchyard.quickstarts>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-client</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-common</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-server</artifactId>
      <classifier>classes</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-server</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.artificer</groupId>
      <artifactId>artificer-integration-switchyard</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-ant</artifactId>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>javax.jms</groupId>
      <artifactId>jms</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>jaxrs-api</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- Skipped tests if no container is included by a profile! -->
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-qs</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.switchyard.quickstarts.demos</groupId>
                  <artifactId>switchyard-quickstart-demo-multi-order-consumer</artifactId>
                  <version>${version.org.switchyard.quickstarts}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/sample-files/switchyard</outputDirectory>
                  <destFileName>order-consumer.jar</destFileName>
                </artifactItem>
                <artifactItem>
                   <groupId>org.switchyard.quickstarts.demos</groupId>
                   <artifactId>switchyard-quickstart-demo-multi-order-service</artifactId>
                   <version>${version.org.switchyard.quickstarts}</version>
                   <type>jar</type>
                   <overWrite>true</overWrite>
                   <outputDirectory>${project.build.directory}/sample-files/switchyard</outputDirectory>
                   <destFileName>order-service.jar</destFileName>
                </artifactItem>
                <artifactItem>
                   <groupId>org.switchyard.quickstarts.demos</groupId>
                   <artifactId>switchyard-quickstart-demo-multi-artifacts</artifactId>
                   <version>${version.org.switchyard.quickstarts}</version>
                   <type>jar</type>
                   <overWrite>true</overWrite>
                   <outputDirectory>${project.build.directory}/sample-files/switchyard</outputDirectory>
                   <destFileName>artifacts.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skipTests>true</skipTests>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>eap64-integration-test</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skipTests>false</skipTests>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <ant antfile="${basedir}/src/test/resources/install-container.xml" target="install-eap64" />
                    <ant antfile="${basedir}/src/test/resources/install-artificer.xml" target="install-artificer-eap64" />
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <arquillian.launch>eap64</arquillian.launch>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <dependencyManagement>
        <dependencies>
          <!-- Override transitive dependencies - a few are different in the techpreview repo. -->
          <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-controller</artifactId>
            <version>7.5.0.Final-redhat-17</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-managed</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.artificer</groupId>
          <artifactId>artificer-server-eap6</artifactId>
          <type>war</type>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.artificer</groupId>
          <artifactId>artificer-ui-eap6</artifactId>
          <type>war</type>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.hornetq</groupId>
          <artifactId>hornetq-jms-client</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-server-overlay</artifactId>
          <type>zip</type>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jboss-modules</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.wildfly</groupId>
              <artifactId>wildfly-dist</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>wildfly8-integration-test</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skipTests>false</skipTests>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <ant antfile="${basedir}/src/test/resources/install-container.xml" target="install-wildfly8" />
                    <ant antfile="${basedir}/src/test/resources/install-artificer.xml" target="install-artificer-wildfly8" />
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <arquillian.launch>wildfly8</arquillian.launch>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.wildfly</groupId>
            <artifactId>wildfly-arquillian-container-managed</artifactId>
            <version>8.2.0.Final</version>
          </dependency>
          <dependency>
            <groupId>org.wildfly</groupId>
            <artifactId>wildfly-jms-client-bom</artifactId>
            <version>8.2.0.Final</version>
            <type>pom</type>
          </dependency>
          <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-api</artifactId>
            <version>3.3.0.Final</version>
          </dependency>
          <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-nio</artifactId>
            <version>3.3.0.Final</version>
          </dependency>
          <dependency>
            <groupId>org.hornetq</groupId>
            <artifactId>hornetq-core-client</artifactId>
            <version>2.4.5.Final</version>
          </dependency>
          <dependency>
            <groupId>org.hornetq</groupId>
            <artifactId>hornetq-jms-client</artifactId>
            <version>2.4.5.Final</version>
          </dependency>
          <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-remote-naming</artifactId>
            <version>2.0.1.Final</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.wildfly</groupId>
          <artifactId>wildfly-arquillian-container-managed</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.artificer</groupId>
          <artifactId>artificer-server-wildfly8</artifactId>
          <type>war</type>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.artificer</groupId>
          <artifactId>artificer-ui-wildfly8</artifactId>
          <type>war</type>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.wildfly</groupId>
          <artifactId>wildfly-jms-client-bom</artifactId>
          <scope>test</scope>
          <type>pom</type>
        </dependency>
        <dependency>
          <groupId>org.keycloak</groupId>
          <artifactId>keycloak-server-overlay</artifactId>
          <type>zip</type>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <groupId>org.keycloak</groupId>
              <artifactId>keycloak-jboss-modules</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.wildfly</groupId>
              <artifactId>wildfly-dist</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
