<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>net.java.dev.activeobjects</groupId>
    <artifactId>activeobjects-integration-profiles</artifactId>
    <version>6.1.2-e61d15b22</version>
    <relativePath>../activeobjects-integration-profiles</relativePath>
  </parent>
  <artifactId>activeobjects-integration-test</artifactId>
  <version>6.1.2-e61d15b22</version>
  <name>Active Objects - Integration testing</name>
  <description>This is where the integration testing of the Active Objects library is done!</description>
  <url>https://bitbucket.org/server-platform/activeobjects/activeobjects-integration-profiles/activeobjects-integration-test/</url>
  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>
  <developers>
    <developer>
      <organization>Atlassian</organization>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@bitbucket.org:server-platform/activeobjects.git/activeobjects-integration-profiles/activeobjects-integration-test</connection>
    <developerConnection>scm:git:git@bitbucket.org:server-platform/activeobjects.git/activeobjects-integration-profiles/activeobjects-integration-test</developerConnection>
    <tag>aggregator-6.1.2-e61d15b22</tag>
    <url>https://bitbucket.org/server-platform/activeobjects/activeobjects-integration-profiles/activeobjects-integration-test</url>
  </scm>
  <properties>
    <ao.test.tablenameconverter>atlassian</ao.test.tablenameconverter>
    <ao.test.fieldnameconverter>atlassian</ao.test.fieldnameconverter>
    <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../${jacoco.report.file}</sonar.coverage.jacoco.xmlReportPaths>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.atlassian.profiling</groupId>
      <artifactId>atlassian-profiling</artifactId>
      <version>${atlassian-profiling.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.profiling</groupId>
      <artifactId>atlassian-profiling-micrometer</artifactId>
      <version>${atlassian-profiling.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins</groupId>
      <artifactId>atlassian-plugins-api</artifactId>
      <version>${plugins.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.atlassian.plugins</groupId>
      <artifactId>atlassian-plugins-core</artifactId>
      <version>${plugins.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.java.dev.activeobjects</groupId>
      <artifactId>activeobjects-core</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.java.dev.activeobjects</groupId>
      <artifactId>activeobjects-test</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.java.dev.activeobjects</groupId>
      <artifactId>activeobjects-integration-test-model</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons-io.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>start</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>stop</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skip>${docker.skip}</skip>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <systemPropertyVariables>
            <user.timezone>UTC</user.timezone>
            <ao.test.database>${ao.test.database}</ao.test.database>
            <db.username>${db.username}</db.username>
            <db.password>${db.password}</db.password>
            <db.name>${db.name}</db.name>
            <db.schema>${db.schema}</db.schema>
            <db.url>${db.url}</db.url>
            <ao.test.tablenameconverter>${ao.test.tablenameconverter}</ao.test.tablenameconverter>
            <ao.test.fieldnameconverter>${ao.test.fieldnameconverter}</ao.test.fieldnameconverter>
            <ao.transaction.isolation.level>TRANSACTION_READ_COMMITTED</ao.transaction.isolation.level>
          </systemPropertyVariables>
          <includes>
            <include>**/*Test*.java</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>createDB</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.leberrigaud.maven.plugins</groupId>
            <artifactId>database-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>create-db</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>create</goal>
                </goals>
              </execution>
              <execution>
                <id>drop-db</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>drop</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <skip>${db.skip}</skip>
              <database>${ao.test.database}</database>
              <schema>${db.schema}</schema>
              <name>${db.name}</name>
              <host>${db.host}</host>
              <url>${db.plugin.url}${db.url}</url>
              <username>${db.username}</username>
              <password>${db.password}</password>
              <rootUsername>${db.system.username}</rootUsername>
              <rootPassword>${db.system.password}</rootPassword>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>oracle</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>create-db</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
