<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.tachyonproject</groupId>
    <artifactId>tachyon-parent</artifactId>
    <version>0.8.2</version>
  </parent>
  <artifactId>tachyon-integration-tests</artifactId>
  <packaging>jar</packaging>
  <name>Tachyon Integration Tests</name>
  <description>Integration tests on other Tachyon modules</description>

  <properties>
    <license.header.path>${project.parent.basedir}/build/license/</license.header.path>
    <checkstyle.path>${project.parent.basedir}/build/checkstyle/</checkstyle.path>
    <findbugs.path>${project.parent.basedir}/build/findbugs/</findbugs.path>
  </properties>

  <dependencies>
    <!-- Test Dependencies -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.curator</groupId>
      <artifactId>curator-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-minicluster</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <!-- To suppress javassist/BlockDoesNotExistException in MasterFaultToleranceTest -->
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.tachyonproject</groupId>
      <artifactId>tachyon-servers</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.tachyonproject</groupId>
      <artifactId>tachyon-common</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.tachyonproject</groupId>
      <artifactId>tachyon-underfs-local</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.tachyonproject</groupId>
      <artifactId>tachyon-minicluster</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>hdfs1Test</id>
      <dependencies>
        <dependency>
          <groupId>org.tachyonproject</groupId>
          <artifactId>tachyon-underfs-hdfs</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <ufs>tachyon.underfs.hdfs.LocalMiniDFSCluster</ufs>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>hdfs2Test</id>
      <dependencies>
        <dependency>
          <groupId>org.tachyonproject</groupId>
          <artifactId>tachyon-underfs-hdfs</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <ufs>tachyon.underfs.hdfs.LocalMiniDFSCluster</ufs>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>glusterfsTest</id>
      <dependencies>
        <dependency>
          <groupId>org.tachyonproject</groupId>
          <artifactId>tachyon-underfs-glusterfs</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.gluster</groupId>
          <artifactId>glusterfs-hadoop</artifactId>
          <version>${glusterfs-hadoop.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <ufs>tachyon.underfs.glusterfs.GlusterFSCluster</ufs>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>s3Test</id>
      <dependencies>
        <dependency>
          <groupId>org.tachyonproject</groupId>
          <artifactId>tachyon-underfs-s3</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <ufs>tachyon.underfs.s3.S3UnderStorageCluster</ufs>
                <!-- Change "myAccessKey" to your access key for this test -->
                <accessKey>myAccessKey</accessKey>
                <!-- Change "mySecreteKey" to your secrete key for this test -->
                <secretKey>mySecretKey</secretKey>
                <!-- Change "s3n://my-bucket/tachyon-test" to the name of your
                     S3 bucket for this test -->
                <s3Bucket>s3n://my-bucket/tachyon-test</s3Bucket>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>contractTest</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <testExcludes combine.self="override" />
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <testExcludes>
            <!--By default we skip tests in hadoop/contract, unless contractTest profile is used-->
            <exclude>**/hadoop/contract/**</exclude>
          </testExcludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
