<?xml version="1.0" encoding="UTF-8"?>
<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.codehaus.sonar</groupId>
    <artifactId>sonar</artifactId>
    <version>2.3</version>
    <relativePath>../..</relativePath>
  </parent>
  <groupId>org.codehaus.sonar.tests</groupId>
  <artifactId>volume</artifactId>
  <name>Sonar :: Volume Testing</name>
  <description>High volume testing, for example to check the Oracle constraint on max number of elements in the clause IN.</description>

  <properties>
    <sonar.url>http://localhost:9000/</sonar.url>
    <sonar.runtimeVersion>${project.version}</sonar.runtimeVersion>
    <projectsCount>1010</projectsCount>
    <packagesCount>5</packagesCount>
    <classesCount>5</classesCount>
  </properties>


  <build>
    <testSourceDirectory>src/it/java</testSourceDirectory>
    <testResources>
      <testResource>
        <filtering>false</filtering>
        <directory>src/it/resources</directory>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.1</version>
        <executions>
          <execution>
            <id>copy</id>

            <!-- must be executed after the ant task that builds the directory target/extensions -->
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.oracle</groupId>
                  <artifactId>ojdbc14</artifactId>
                  <version>10.2.0.3.0</version>
                  <type>jar</type>
                  <overWrite>false</overWrite>
                  <outputDirectory>${basedir}/target/extensions/jdbc-driver/oracle</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-dev-maven-plugin</artifactId>
        <version>0.7</version>
        <executions>
          <execution>
            <id>start-server</id>
            <phase>pre-integration-test</phase>
            <configuration>
              <background>true</background>
              <dropDatabase>false</dropDatabase>
              <extensionsDir>${basedir}/target/extensions</extensionsDir>
            </configuration>
            <goals>
              <goal>start-war</goal>
            </goals>
          </execution>
          <execution>
            <id>stop-server</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop-war</goal>
            </goals>
          </execution>
        </executions>
      </plugin>


      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.4</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-nodeps</artifactId>
            <version>1.7.1</version>
          </dependency>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-junit</artifactId>
            <version>1.7.1</version>
          </dependency>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-trax</artifactId>
            <version>1.7.1</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>analyze-projects</id>
            <phase>pre-integration-test</phase>
            <configuration>
              <tasks>
                <ant dir="${basedir}" inheritRefs="true">
                  <property name="projectsCount" value="${projectsCount}" />
                  <property name="packagesCount" value="${packagesCount}" />
                  <property name="classesCount" value="${classesCount}" />
                  <property name="jdbcDriver" value="${sonar.jdbc.driver}" />
                  <property name="jdbcUrl" value="${sonar.jdbc.url}" />
                  <property name="jdbcUsername" value="${sonar.jdbc.username}" />
                  <property name="jdbcPassword" value="${sonar.jdbc.password}" />
                  <property name="sonarVersion" value="${sonar.runtimeVersion}" />
                  <target name="analyze-projects" />
                </ant>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>selenium-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <id>start-selenium</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start-server</goal>
            </goals>
            <configuration>
              <background>true</background>
            </configuration>
          </execution>
          <execution>
            <id>stop-selenium</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop-server</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!-- Skip the normal tests, we'll run them in the integration-test phase -->
          <skip>true</skip>
        </configuration>
        <executions>
          <execution>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>false</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-nodeps</artifactId>
      <version>1.7.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-junit</artifactId>
      <version>1.7.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-trax</artifactId>
      <version>1.7.1</version>
    </dependency>
    <dependency>
      <groupId>com.oracle</groupId>
      <artifactId>ojdbc14</artifactId>
      <version>10.2.0.3.0</version>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium.client-drivers</groupId>
      <artifactId>selenium-java-client-driver</artifactId>
      <version>1.0.2</version>
    </dependency>
  </dependencies>

  <profiles>

    <!-- BROWSERS -->
    <profile>
      <id>firefox</id>
      <properties>
        <selenium.browser>*firefox</selenium.browser>
      </properties>
    </profile>
    <profile>
      <id>ie</id>
      <properties>
        <selenium.browser>*iexplore</selenium.browser>
      </properties>
    </profile>
    
    <profile>
      <id>oracle</id>
      <properties>
        <sonar.jdbc.url>jdbc:oracle:thin:@localhost/XE</sonar.jdbc.url>
        <sonar.jdbc.username>sonar_volume</sonar.jdbc.username>
        <sonar.jdbc.password>sonar_volume</sonar.jdbc.password>
        <sonar.jdbc.driver>oracle.jdbc.driver.OracleDriver</sonar.jdbc.driver>
      </properties>
    </profile>

    <profile>
      <id>postgresql</id>
      <properties>
        <sonar.jdbc.url>jdbc:postgresql://localhost/sonar</sonar.jdbc.url>
        <sonar.jdbc.username>sonar</sonar.jdbc.username>
        <sonar.jdbc.password>sonar</sonar.jdbc.password>
        <sonar.jdbc.driver>org.postgresql.Driver</sonar.jdbc.driver>
      </properties>
    </profile>

    <profile>
      <id>mssql</id>
      <properties>
        <sonar.jdbc.url>jdbc:jtds:sqlserver://localhost;databaseName=SONAR;SelectMethod=Cursor</sonar.jdbc.url>
        <sonar.jdbc.username>sonar</sonar.jdbc.username>
        <sonar.jdbc.password>sonar</sonar.jdbc.password>
        <sonar.jdbc.driver>net.sourceforge.jtds.jdbc.Driver</sonar.jdbc.driver>
      </properties>
    </profile>
    
    <profile>
      <id>mysql</id>
      <properties>
        <sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8</sonar.jdbc.url>
        <sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
        <sonar.jdbc.username>sonar</sonar.jdbc.username>
        <sonar.jdbc.password>sonar</sonar.jdbc.password>
      </properties>
    </profile>
  </profiles>

</project>