<?xml version="1.0"?>

<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you 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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>continuum-distributed</artifactId>
    <groupId>org.apache.continuum</groupId>
    <version>1.5-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>continuum-distributed-tests</artifactId>
  <packaging>war</packaging>
  <name>Continuum :: Distributed Build :: Transport :: Tests</name>
  <dependencies>
    <dependency>
      <groupId>org.apache.continuum</groupId>
      <artifactId>continuum-distributed-slave-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.continuum</groupId>
      <artifactId>continuum-distributed-slave-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.continuum</groupId>
      <artifactId>continuum-distributed-master-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.continuum</groupId>
      <artifactId>continuum-distributed-master-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.continuum</groupId>
      <artifactId>continuum-buildagent-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-slf4j-logging</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

  <build>
    <testSourceDirectory>src/test/it</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <configuration>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <contextPath>/</contextPath>
          <stopKey>stopkey</stopKey>
          <stopPort>9192</stopPort>
          <jettyEnvXml>${basedir}/src/jetty-env.xml</jettyEnvXml>
          <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>9191</port>
              <maxIdleTime>60000</maxIdleTime>
            </connector>
          </connectors>
          <systemProperties>
            <systemProperty>
              <name>appserver.base</name>
              <value>${project.build.directory}/appserver-base</value>
            </systemProperty>
          </systemProperties>
        </configuration>
        <executions>
          <execution>
            <id>start-jetty</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <scanIntervalSeconds>0</scanIntervalSeconds>
              <daemon>true</daemon>
            </configuration>
          </execution>
          <execution>
            <id>stop-jetty</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
        <executions>
          <execution>
            <id>integration-tests</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>false</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
