<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
    and other contributors as indicated by the @author tags.

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

  <parent>
    <groupId>org.hawkular.btm</groupId>
    <artifactId>hawkular-btm</artifactId>
    <version>0.7.2.Final</version>
    <relativePath>../../../pom.xml</relativePath>
  </parent>

  <artifactId>hawkular-btm-tests-containers-vertx</artifactId>
  <packaging>jar</packaging>

  <name>Hawkular BTM::Tests::Containers::Vertx</name>

  <properties>
    <hawkular-btm.lib>${project.build.directory}/lib</hawkular-btm.lib>
    <hawkular-btm.instrumentation>${project.basedir}/target/test-classes/instrumentation</hawkular-btm.instrumentation>
  </properties>

  <dependencies>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hawkular.btm</groupId>
      <artifactId>hawkular-btm-agent-rest</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hawkular.btm</groupId>
      <artifactId>hawkular-btm-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hawkular.btm</groupId>
      <artifactId>hawkular-btm-tests-common</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hawkular.btm</groupId>
      <artifactId>hawkular-btm-tests-server-mock</artifactId>
      <scope>test</scope>
    </dependency>

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

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>get-client-all</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.hawkular.btm</groupId>
                  <artifactId>hawkular-btm-agent-rest</artifactId>
                  <overWrite>true</overWrite>
                  <outputDirectory>${hawkular-btm.lib}</outputDirectory>
                  <destFileName>hawkular-btm-agent-rest.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>unpack</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.hawkular.btm</groupId>
                  <artifactId>hawkular-btm-btxn-instrumentation</artifactId>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${hawkular-btm.instrumentation}</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <threadCount>1</threadCount>
          <threadCountClasses>1</threadCountClasses>
          <argLine>
              -javaagent:${hawkular-btm.lib}/hawkular-btm-agent-rest.jar
              -Dhawkular-btm.config=${hawkular-btm.instrumentation}
              -Dhawkular-btm.base-uri=http://localhost:8180/hawkular/btm
              -Dhawkular-btm.username=jdoe
              -Dhawkular-btm.password=password
              -Dhawkular-btm.log.level=INFO
          </argLine>
        </configuration>
        <executions>
          <execution>
            <id>exec-standalone-tests</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/*Test.java</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>final-verify</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
