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

  <parent>
    <groupId>org.torquebox</groupId>
    <artifactId>torquebox-parent</artifactId>
    <version>2.1.2.redhat.1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.torquebox</groupId>
  <artifactId>torquebox-integration-tests</artifactId>
  <packaging>jar</packaging>
  <name>TorqueBox Integration Tests</name>
  <description />

  <properties>
    <version.haml>~&gt;3.0</version.haml>
    <version.jboss-server-manager>1.0.3.GA</version.jboss-server-manager>
    <version.sinatra>1.2.3</version.sinatra>
    <version.old_rack>1.1.0</version.old_rack>
    <version.dm_core>1.1.0</version.dm_core>
    <version.dm_serializer>1.1.0</version.dm_serializer>
    <version.json>1.4.6</version.json>
    <assembly.dir>${project.basedir}/../build/assembly/target/stage/torquebox</assembly.dir>
    <integ.dist.dir>target/integ-dist</integ.dist.dir>
    <rspec.max.heap>1280m</rspec.max.heap>
    <jboss.max.heap>1024m</jboss.max.heap>
    <jboss.lazy>false</jboss.lazy>
    <driver.type>headless</driver.type>
    <domain.mode>false</domain.mode>
    <ruby.compat.version>1.8</ruby.compat.version>
    <spec.dir>spec</spec.dir>
    <integ.debug>false</integ.debug>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.0.1</version>
      </dependency>
    </dependencies>
  </dependencyManagement>


  <dependencies>
    <dependency>
      <groupId>org.torquebox</groupId>
      <artifactId>torquebox-build-assembly</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
      <scope>runtime</scope>
    </dependency>

    <!-- Because both Akephalos and Celerity bring in lots of common
         jars with differing versions we have to be explicit here 
         or we get ClassNotFoundExceptions & ClassCastExceptions -->
    <dependency>
      <groupId>net.sourceforge.htmlunit</groupId>
      <artifactId>htmlunit</artifactId>
      <version>2.8</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.1</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.1</version>
    </dependency>
    <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
      <version>2.8.1</version>
    </dependency>
    <dependency>
      <groupId>xalan</groupId>
      <artifactId>xalan</artifactId>
      <version>2.7.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.james</groupId>
      <artifactId>apache-mime4j</artifactId>
      <version>0.6.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpmime</artifactId>
      <version>4.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.1.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <version>4.1.4</version>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>rspec</artifactId>
      <type>gem</type>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>torquespec</artifactId>
      <version>0.5.0</version>
      <type>gem</type>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>selenium-webdriver</artifactId>
      <version>2.8.0</version>
      <type>gem</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>capybara</artifactId>
      <version>0.4.0</version>
      <type>gem</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>rubygems</groupId>
          <artifactId>ffi</artifactId>
        </exclusion>
        <exclusion>
          <groupId>rubygems</groupId>
          <artifactId>nokogiri</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>nokogiri</artifactId>
      <version>1.5.3</version>
      <type>gem</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>akephalos</artifactId>
      <version>0.2.5</version>
      <type>gem</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>rubygems</groupId>
          <artifactId>ffi</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>ffi</artifactId>
      <version>1.0.7</version>
      <type>gem</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>rake</artifactId>
      <type>gem</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>jmx4r</artifactId>
      <version>0.1.3</version>
      <type>gem</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>torquebox-rake-support</artifactId>
      <type>gem</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>torquebox-messaging</artifactId>
      <type>gem</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>torquebox-stomp</artifactId>
      <type>gem</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>torquebox-core</artifactId>
      <type>gem</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>torquebox-security</artifactId>
      <type>gem</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>torquebox-cache</artifactId>
      <type>gem</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-complete</artifactId>
      <version>${version.jruby}</version>
    </dependency>

    <dependency>
      <groupId>org.hornetq</groupId>
      <artifactId>hornetq-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hornetq</groupId>
      <artifactId>hornetq-jms</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.netty</groupId>
      <artifactId>netty</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.spec.javax.transaction</groupId>
      <artifactId>jboss-transaction-api_1.1_spec</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.spec.javax.jms</groupId>
      <artifactId>jboss-jms-api_1.1_spec</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Dependencies below only for jmx-remoting support -->
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-ejb-client</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-remote-naming</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.marshalling</groupId>
      <artifactId>jboss-marshalling</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.marshalling</groupId>
      <artifactId>jboss-marshalling-river</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.remoting3</groupId>
      <artifactId>jboss-remoting</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.sasl</groupId>
      <artifactId>jboss-sasl</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.ejb</groupId>
      <artifactId>jboss-ejb-api_3.1_spec</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.xnio</groupId>
      <artifactId>xnio-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.xnio</groupId>
      <artifactId>xnio-nio</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.remotingjmx</groupId>
      <artifactId>remoting-jmx</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- end jmx-remoting dependencies -->

    <dependency>
      <groupId>org.torquebox</groupId>
      <artifactId>torquebox-ruby-test-support</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jvnet.winp</groupId>
      <artifactId>winp</artifactId>
      <version>1.14</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>dm-core</artifactId>
      <type>gem</type>
      <version>${version.dm_core}</version>
    </dependency>
    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>dm-serializer</artifactId>
      <type>gem</type>
      <version>${version.dm_serializer}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>json</artifactId>
      <type>gem</type>
      <version>${version.json}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>rubygems</groupId>
      <artifactId>stilts-stomp-client</artifactId>
      <version>${version.org.projectodd.stilts}</version>
      <type>gem</type>
      <scope>test</scope>
    </dependency>



  </dependencies>

  <profiles>
    <profile>
      <id>domain</id>
      <properties>
        <domain.mode>true</domain.mode>
        <spec.dir>spec-domain</spec.dir>
        <rspec.max.heap>512m</rspec.max.heap>
        <jboss.max.heap>896m</jboss.max.heap>
      </properties>
    </profile>
    <profile>
      <id>ci</id>
      <properties>
        <driver.type>headless</driver.type>
        <jboss.max.heap>1536m</jboss.max.heap>
      </properties>
    </profile>
    <profile>
      <id>browser</id>
      <properties>
        <driver.type>browser</driver.type>
      </properties>
    </profile>
    <profile>
      <id>19</id>
      <properties>
        <ruby.compat.version>1.9</ruby.compat.version>
      </properties>
    </profile>
    <profile>
      <id>fork you, windows</id>
      <activation>
        <os>
          <family>Windows</family>
        </os>
      </activation>
      <properties>
        <jboss.max.heap>2048m</jboss.max.heap>
        <jboss.lazy>false</jboss.lazy>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>de.saumya.mojo</groupId>
            <artifactId>rspec-maven-plugin</artifactId>
            <configuration>
              <jrubyFork>false</jrubyFork>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>surgical testing</id>
      <activation>
        <property>
          <name>test</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>de.saumya.mojo</groupId>
            <artifactId>rspec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>run-specs</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
      <testResource>
        <directory>src/test/java</directory>
        <filtering>false</filtering>
        <includes>
          <include>**/*.rb</include>
        </includes>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.basedir}/apps</directory>
              <includes>
                <include>**/Gemfile.lock</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>de.saumya.mojo</groupId>
        <artifactId>jruby-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>prepare-as</id>
            <phase>compile</phase>
            <goals>
              <goal>jruby</goal>
            </goals>
            <configuration>
              <jrubyFork>false</jrubyFork>
              <file>bin/setup-integ-dist.rb</file>
              <args>${assembly.dir} ${integ.dist.dir}</args>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>de.saumya.mojo</groupId>
        <artifactId>jruby-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>install-integ-gems</id>
            <inherited>true</inherited>
            <phase>compile</phase>
            <goals>
              <goal>jruby</goal>
            </goals>
            <configuration>
              <file>bin/install-integ-gems.rb</file>
              <gemHome>./target/integ-dist/jruby/lib/ruby/gems/1.8</gemHome>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration> 
          <systemProperties>
            <property>
              <name>log4j.configuration</name>
              <value>test-log4j.xml</value>
            </property>
            <property>
              <name>jruby.home</name>
              <value>${integ.dist.dir}/jruby</value>
            </property>
          </systemProperties>
        </configuration>    
      </plugin>
      <plugin>
        <groupId>de.saumya.mojo</groupId>
        <artifactId>rspec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>run-specs</id>
            <phase>test</phase>
            <configuration>
              <jrubyJvmArgs>-XX:MaxPermSize=256m -Xms64m -Xmx${rspec.max.heap}</jrubyJvmArgs>
              <specSourceDirectory>${spec.dir}</specSourceDirectory>
              <systemProperties>
                <property>
                  <name>max.heap</name>
                  <value>${jboss.max.heap}</value>
                </property>
                <property>
                  <name>jboss.lazy</name>
                  <value>${jboss.lazy}</value>
                </property>
                <property>
                  <name>jruby.home</name>
                  <value>${project.basedir}/${integ.dist.dir}/jruby</value>
                </property>
                <property>
                  <name>org.jboss.modules</name>
                  <value>TRACE</value>
                </property>
                <property>
                  <name>driver.type</name>
                  <value>${driver.type}</value>
                </property>
                <property>
                  <name>domain.mode</name>
                  <value>${domain.mode}</value>
                </property>
                <property>
                  <name>integ.debug</name>
                  <value>${integ.debug}</value>
                </property>
              </systemProperties>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <nonFilteredFileExtensions>
            <nonFilteredFileExtension>war</nonFilteredFileExtension>
          </nonFilteredFileExtensions>
        </configuration>
      </plugin>
    </plugins>

    <pluginManagement>
    	<plugins>
    		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
    		<plugin>
    			<groupId>org.eclipse.m2e</groupId>
    			<artifactId>lifecycle-mapping</artifactId>
    			<version>1.0.0</version>
    			<configuration>
    				<lifecycleMappingMetadata>
    					<pluginExecutions>
    						<pluginExecution>
    							<pluginExecutionFilter>
    								<groupId>de.saumya.mojo</groupId>
    								<artifactId>
    									jruby-maven-plugin
    								</artifactId>
    								<versionRange>
    									[0.28.4-SNAPSHOT,)
    								</versionRange>
    								<goals>
    									<goal>jruby</goal>
    								</goals>
    							</pluginExecutionFilter>
    							<action>
    								<ignore />
    							</action>
    						</pluginExecution>
    					</pluginExecutions>
    				</lifecycleMappingMetadata>
    			</configuration>
    		</plugin>
    	</plugins>
    </pluginManagement>
  </build>


</project>
