<?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/maven-v4_0_0.xsd">
	<parent>
		<artifactId>teiid-test-integration</artifactId>
		<groupId>org.jboss.teiid</groupId>
        <version>9.0.0.Beta1</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>test-integration-common</artifactId>
	<name>Common Integration Tests</name>
	<description>Common Integration tests that do not require external dependencies</description>
    <dependencies>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
        </dependency>
        <dependency>
            <artifactId>teiid-jboss-integration</artifactId>
            <groupId>org.jboss.teiid</groupId>
        </dependency>
        <dependency>
            <groupId>org.jboss.teiid</groupId>
            <artifactId>teiid-runtime</artifactId>
            <type>test-jar</type>
        </dependency>
        <dependency>
            <artifactId>translator-ws</artifactId>
            <groupId>org.jboss.teiid.connectors</groupId>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <scope>test</scope>
        </dependency>
            <dependency>
                <groupId>org.jboss.arquillian.junit</groupId>
                <artifactId>arquillian-junit-container</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.arquillian.testenricher</groupId>
                <artifactId>arquillian-testenricher-initialcontext</artifactId>
            </dependency>
            <dependency>
                <groupId>org.wildfly.arquillian</groupId>
                <artifactId>wildfly-arquillian-container-managed</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.wildfly.arquillian</groupId>
                <artifactId>wildfly-arquillian-protocol-jmx</artifactId>
                <scope>test</scope>
            </dependency>
          
    </dependencies>
    <profiles>
    <profile>
        <id>arquillian-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>${version.dependency.plugin}</version>
                        <executions>
                            <execution>
                                <id>unpack</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.teiid</groupId>
                                            <artifactId>teiid</artifactId>
                                            <version>${project.version}</version>
                                            <classifier>wildfly-server</classifier>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>2.6</version>
                        <executions>
                            <execution>
                                <id>copy-resources2</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/teiid-${project.version}/standalone/configuration</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>src/test/resources/arquillian/credentials</directory>
                                            <includes>
                                            <include>*.properties</include>
                                            </includes>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>                            
                        </executions>
                    </plugin>                    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <jbossHome>${project.build.directory}/teiid-${project.version}</jbossHome>
                                        <serverConfig>standalone-teiid.xml</serverConfig>
                                    </systemPropertyVariables>
                                    <includes>
                                        <include>**/IntegrationTest*</include>
                                    </includes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>        
    </profile>     
    </profiles>
</project>
