<?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>dk.sds.dgws-idws-proxy</groupId>
		<artifactId>wsproxy-parent</artifactId>
		<version>1.7.17-SNAPSHOT</version>
	</parent>

    <artifactId>integrationtest</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>dk.sds.dgws-idws-proxy</groupId>
            <artifactId>testservice-schemas</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>dk.sds.dgws-idws-proxy</groupId>
            <artifactId>testutils</artifactId>
            <version>${project.parent.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>dk.sds.dgws-idws-proxy</groupId>
            <artifactId>testservice</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>dk.sds.dgws-idws-proxy</groupId>
            <artifactId>wsproxy</artifactId>
            <version>${project.parent.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>dk.sosi.seal</groupId>
            <artifactId>seal</artifactId>
            <version>${seal.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>dk.itst.oiosaml</groupId>
            <artifactId>oiosaml.java_idws</artifactId>
            <version>20150416103404</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/../lib/oiosaml.java_idws-20180627114917.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>dk.itst.oiosaml</groupId>
            <artifactId>oiosaml-trust_idws</artifactId>
            <version>20140415112521</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/../lib/oiosaml-trust_idws-20140415112521.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml</artifactId>
            <version>2.6.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.11.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>1.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.22</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-test-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                            <overwrite>true</overwrite>
                            <resources>
                                <resource>
                                    <directory>${basedir}/../testutils/src/main/resources</directory>
                                    <includes>
                                        <include>*</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.20.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- Note: This is required to handle a problem with Seal being initialized multiple times.
                    Exception: "Could not initialize class dk.sosi.seal.model.SignatureUtil", "Unable to register STR-Transform"
                    Seemingly only occurs on Mac. -->
                    <forkMode>always</forkMode>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.1.4</version>
                <executions>
                    <execution>
                        <id>start-container</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-container</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <container>
                        <containerId>tomcat7x</containerId>
                        <zipUrlInstaller>
                            <url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.82/bin/apache-tomcat-7.0.82.zip
                            </url>
                        </zipUrlInstaller>
                    </container>
                    <deployer>
                        <deployables>
                            <deployable>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>testservice</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>testservice</context>
                                </properties>
                                <pingURL>${functionaltest.urlprefix}/testservice/isalive</pingURL>
                                <pingTimeout>30000</pingTimeout>
                            </deployable>
                            <deployable>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>wsproxy</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>example</context>
                                </properties>
                                <pingURL>${functionaltest.urlprefix}/example/proxy/isalive</pingURL>
                                <pingTimeout>30000</pingTimeout>
                            </deployable>
                        </deployables>
                    </deployer>
                    <configuration>
                        <properties>
                            <cargo.servlet.port>${functionaltest.serverport}</cargo.servlet.port>
                            <!-- cargo.jvmargs>-Doiosaml.home=${project.parent.basedir}/wsproxy/etc/localhost-saml-config</cargo.jvmargs -->
                            <!-- cargo.jvmargs>-Dwsproxy.configuration.dir=${project.parent.basedir}/wsproxy/src/main/resources</cargo.jvmargs -->
                        </properties>
                        <files>
                            <file>
                                <file>${basedir}/src/test/resources</file>
                                <todir>shared/classes</todir>
                            </file>
                        </files>
                    </configuration>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
