<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Groupon.com
  ~
  ~ 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">
  <parent>
    <groupId>com.arpnetworking.build</groupId>
    <artifactId>arpnetworking-parent-pom</artifactId>
    <version>1.0.20</version>
    <relativePath />
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.arpnetworking.test</groupId>
  <artifactId>performance-test</artifactId>
  <packaging>jar</packaging>
  <name>Performance Test</name>
  <description>Extensions to JUnit and JUnitBenchmarks to execute performance tests with cpu profiling</description>
  <version>1.1.0</version>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>brandonarp</id>
      <email>brandonarp@gmail.com</email>
      <organization>Arp Networking</organization>
      <organizationUrl>http://www.arpnetworking.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
    <developer>
      <id>villekoskela</id>
      <email>vkoskela@groupon.com</email>
      <organization>Groupon</organization>
      <organizationUrl>http://www.groupon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:arpnetworking/performance-test.git</connection>
    <developerConnection>scm:git:git@github.com:arpnetworking/performance-test.git</developerConnection>
    <url>https://github.com/arpnetworking/performance-test</url>
    <tag>performance-test-1.1.0</tag>
  </scm>

  <properties>
    <!--Dependency versions-->
    <cglib.version>3.2.1</cglib.version>
    <arpnetworking.commons.version>1.3.0</arpnetworking.commons.version>
    <commons.io.version>1.3.2</commons.io.version>
    <guava.version>19.0</guava.version>
    <hamcrest.version>2.0.0.0</hamcrest.version>
    <jackson.version>2.7.3</jackson.version>
    <junit.version>4.12</junit.version>
    <junit.benchmarks.version>0.7.2</junit.benchmarks.version>
    <slf4j.version>1.7.12</slf4j.version>

    <!-- Findbugs -->
    <findbugs.exclude>${project.basedir}/findbugs.exclude.xml</findbugs.exclude>

    <!-- Code Coverage -->
    <jacoco.check.line.coverage>0.75</jacoco.check.line.coverage>
    <jacoco.check.branch.coverage>0.60</jacoco.check.branch.coverage>
  </properties>

  <build>
    <plugins>
      <!-- Enable Inherited Plugins -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.rimerosolutions.maven.plugins</groupId>
        <artifactId>wrapper-maven-plugin</artifactId>
        <inherited>false</inherited>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <!-- Google -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <!-- Jackson -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jdk8</artifactId>
      <version>${jackson.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- General -->
    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib</artifactId>
      <version>${cglib.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.arpnetworking.commons</groupId>
      <artifactId>commons</artifactId>
      <version>${arpnetworking.commons.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons.io.version}</version>
    </dependency>
    <dependency>
      <groupId>com.carrotsearch</groupId>
      <artifactId>junit-benchmarks</artifactId>
      <version>${junit.benchmarks.version}</version>
    </dependency>
    <!-- Test - General -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>java-hamcrest</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>performanceTest</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>default-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <includes>
                    <include>**/*PerformanceTest.java</include>
                  </includes>
                  <systemPropertyVariables>
                    <logback.configurationFile>${basedir}/src/test/resources/logback-perf.xml</logback.configurationFile>
                  </systemPropertyVariables>
                  <parallel combine.self="override" />
                  <forkMode>always</forkMode>
                  <forkCount>1</forkCount>
                  <reuseForks>false</reuseForks>
                  <argLine combine.self="override">${argLine} -Xms512m -ea -Duser.timezone="UTC" -agentlib:hprof=cpu=samples,depth=15,interval=10,force=y,verbose=y,doe=n,file=${basedir}/target/perf.profile.hprof.txt</argLine>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
