<?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.jboss.as</groupId>
        <artifactId>jboss-as-testsuite-integration-agg</artifactId>
        <version>7.1.0.Final</version>
    </parent>

    <!-- ********************************************************************************** -->
    <!-- *********************************** IIOP       *********************************** -->
    <!-- ********************************************************************************** -->
    <groupId>org.jboss.as</groupId>
    <artifactId>jboss-as-testsuite-integration-iiop</artifactId>
    <version>7.1.0.Final</version>

    <name>JBoss Application Server Test Suite: Integration - IIOP</name>

    <properties>
        <jbossas.ts.integ.dir>${basedir}/..</jbossas.ts.integ.dir>
        <jbossas.ts.dir>${jbossas.ts.integ.dir}/..</jbossas.ts.dir>
        <jbossas.project.dir>${jbossas.ts.dir}/..</jbossas.project.dir>
    </properties>

    <!--  TODO move this to parent? -->
    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
            <testResource>
                <directory>src/test/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </testResource>
        </testResources>
    </build>

    <profiles>

        <profile>
            <id>iiop.integration.tests.profile</id>
            <activation>
                <property>
                    <name>!ts.noIIOP</name>
                </property>
            </activation>
            <properties>
            </properties>
            <!--
                Server configuration executions.
            -->
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions combine.children="append">
                            <execution>
                                <id>build-clustering.server</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <!-- build the UDP server configs in target-->
                                        <ant antfile="${jbossas.ts.integ.dir}/src/test/scripts/iiop-build.xml">
                                            <target name="build-iiop"/>
                                        </ant>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!--
                       Surefire test executions
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions combine.children="append">

                            <!-- Disable default-test execution. -->
                            <execution>
                                <id>default-test</id>
                                <goals><goal>test</goal></goals>
                                <phase>none</phase>
                            </execution>
                            <!-- Multi node clustering tests. -->
                            <execution>
                                <id>tests-iiop-multi-node.surefire</id>
                                <phase>test</phase>
                                <goals><goal>test</goal></goals>
                                <configuration>
                                    <!-- Tests to execute. -->
                                    <includes>
                                        <include>org/jboss/as/test/iiop/**/*TestCase.java</include>
                                    </includes>

                                    <!-- Parameters to test cases. -->
                                    <systemPropertyVariables>
                                        <arquillian.launch>iiop</arquillian.launch>
                                        <jboss.server.config.file.name>standalone-full.xml</jboss.server.config.file.name>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>


    </profiles>
</project>
