<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">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.crowd</groupId>
        <artifactId>atlassian-crowd</artifactId>
        <version>6.0.2</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>crowd-dao-database-test</artifactId>
    <name>Atlassian Crowd - DAO database tests</name>

    <description>An acceptance test to run Crowd's Hibernate DAO tests against
         real databases. Uses HSQLDB by default.</description>

    <dependencies>
        <!-- Test fundamentals -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-test-utils</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.dbunit</groupId>
            <artifactId>dbunit</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>io.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j2-impl</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-1.2-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-acceptance-test</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-analytics-plugin</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-hibernate5-dialects</artifactId>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.github.springtestdbunit</groupId>
            <artifactId>spring-test-dbunit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.profiling</groupId>
            <artifactId>atlassian-profiling</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>start</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-jdbc-test-properties</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <!-- The current embedded databases are close enough that a 'clean' preamble and common script makes sense. -->
                                <concat destfile="${project.build.testOutputDirectory}/database-crowd-2.1.sql">
                                    <fileset file="src/test/resources/${test-database}-clean.sql" />
                                    <fileset file="src/test/resources/database-crowd-2.1.sql" />
                                </concat>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <systemPropertyVariables>
                        <hibernate.show_sql>false</hibernate.show_sql>
                        <hibernate.format_sql>false</hibernate.format_sql>
                        <hibernate.jdbc.batch_size>0</hibernate.jdbc.batch_size>
                        <hibernate.max_fetch_depth>1</hibernate.max_fetch_depth>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <includes>
                                <!-- these tests are DB-independent and can be run always -->
                                <include>com/atlassian/crowd/acceptance/tests/persistence/dbindependent/**/*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>h2</id>

            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <properties>
                <test-database>h2</test-database>
                <docker.skip>true</docker.skip>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>com.h2database</groupId>
                    <artifactId>h2</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <skip>false</skip>
                                    <includes>
                                        <include>com/atlassian/crowd/acceptance/tests/persistence/**/*.java</include>
                                    </includes>
                                    <systemPropertyVariables>
                                        <hibernate.connection.driver_class>org.h2.Driver</hibernate.connection.driver_class>
                                        <hibernate.dialect>org.hibernate.dialect.H2Dialect</hibernate.dialect>
                                        <hibernate.connection.url>jdbc:h2:mem:dao-test-db;DB_CLOSE_DELAY=-1</hibernate.connection.url>
                                        <hibernate.connection.username>sa</hibernate.connection.username>
                                        <hibernate.connection.password />
                                        <dbunit.datatypefactory_class>org.dbunit.ext.h2.H2DataTypeFactory</dbunit.datatypefactory_class>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>hsql</id>

            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <properties>
                <test-database>hsql</test-database>
                <docker.skip>true</docker.skip>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.hsqldb</groupId>
                    <artifactId>hsqldb</artifactId>
                    <classifier>jdk8</classifier>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <skip>false</skip>
                                    <includes>
                                        <!-- run all tests, even the HSQLDB-specific ones -->
                                        <include>com/atlassian/crowd/acceptance/tests/persistence/**/*.java</include>
                                    </includes>
                                    <systemPropertyVariables>
                                        <hibernate.connection.driver_class>org.hsqldb.jdbc.JDBCDriver</hibernate.connection.driver_class>
                                        <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
                                        <hibernate.connection.url>jdbc:hsqldb:mem:crowdexport;hsqldb.tx=mvcc</hibernate.connection.url>
                                        <hibernate.connection.username>sa</hibernate.connection.username>
                                        <hibernate.connection.password />
                                        <dbunit.datatypefactory_class>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory</dbunit.datatypefactory_class>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <id>mysql</id>

            <properties>
                <test-database>mysql</test-database>
                <db.artifactGroup>mysql</db.artifactGroup>
                <db.artifactId>mysql-connector-java</db.artifactId>
                <db.artifactVersion>8.0.19</db.artifactVersion>
                <docker.image>mysql:5.5</docker.image>
                <db.hibernate.connection.driver_class>com.mysql.jdbc.Driver</db.hibernate.connection.driver_class>
                <db.hibernate.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.hibernate.dialect>
                <docker.wait.log>starting.as.process\s1\s</docker.wait.log>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>${db.artifactGroup}</groupId>
                    <artifactId>${db.artifactId}</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <images>
                                <image>
                                    <name>${docker.image}</name>

                                    <run>
                                        <ports>
                                            <port>db.port:3306</port>
                                        </ports>
                                        <cmd>--character-set-server=utf8 --collation-server=utf8_bin --transaction-isolation=READ-COMMITTED</cmd>
                                        <env>
                                            <MYSQL_DATABASE>crowd</MYSQL_DATABASE>
                                            <MYSQL_USER>crowd</MYSQL_USER>
                                            <MYSQL_PASSWORD>crowd</MYSQL_PASSWORD>
                                            <MYSQL_ROOT_PASSWORD>crowd</MYSQL_ROOT_PASSWORD>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>120000</time>
                                        </wait>
                                        <log>
                                            <prefix>mysql</prefix>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <db.port>${db.port}</db.port>
                                <hibernate.connection.driver_class>${db.hibernate.connection.driver_class}</hibernate.connection.driver_class>
                                <hibernate.dialect>${db.hibernate.dialect}</hibernate.dialect>
                                <hibernate.connection.url>jdbc:mysql://localhost:${db.port}/crowd</hibernate.connection.url>
                                <hibernate.connection.username>crowd</hibernate.connection.username>
                                <hibernate.connection.password>crowd</hibernate.connection.password>
                                <dbunit.datatypefactory_class>org.dbunit.ext.mysql.MySqlDataTypeFactory</dbunit.datatypefactory_class>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>postgres</id>

            <properties>
                <test-database>postgres</test-database>
                <db.username>postgres</db.username>
                <docker.image>postgres:9.2</docker.image>
                <docker.wait.log>PostgreSQL init process complete</docker.wait.log>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <images>
                                <image>
                                    <name>${docker.image}</name>

                                    <run>
                                        <ports>
                                            <port>db.port:5432</port>
                                        </ports>
                                        <env>
                                            <POSTGRES_DB>crowd</POSTGRES_DB>
                                            <POSTGRES_USER>crowd</POSTGRES_USER>
                                            <POSTGRES_PASSWORD>crowd</POSTGRES_PASSWORD>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>1200000</time>
                                        </wait>
                                        <log>
                                            <prefix>postgres</prefix>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <db.port>${db.port}</db.port>
                                <hibernate.dialect>org.hibernate.dialect.PostgreSQLDialect</hibernate.dialect>
                                <hibernate.connection.driver_class>org.postgresql.Driver</hibernate.connection.driver_class>
                                <hibernate.connection.url>jdbc:postgresql://localhost:${db.port}/crowd</hibernate.connection.url>
                                <hibernate.connection.username>crowd</hibernate.connection.username>
                                <hibernate.connection.password>crowd</hibernate.connection.password>
                                <dbunit.datatypefactory_class>org.dbunit.ext.postgresql.PostgresqlDataTypeFactory</dbunit.datatypefactory_class>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>oracle</id>

            <properties>
                <test-database>oracle</test-database>
                <docker.image>docker.atl-paas.net/buildeng/oracle-database:12.1.0.2-ee</docker.image>
                <db.artifactGroup>com.oracle.jdbc</db.artifactGroup>
                <db.artifactId>ojdbc8</db.artifactId>
                <db.connection.url.sid>ORCLPDB1</db.connection.url.sid>
                <docker.wait.log>DATABASE IS READY TO USE</docker.wait.log>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>${db.artifactGroup}</groupId>
                    <artifactId>${db.artifactId}</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <images>
                                <image>
                                    <name>${docker.image}</name>

                                    <run>
                                        <ports>
                                            <port>db.port:1521</port>
                                        </ports>
                                        <env>
                                            <WEB_CONSOLE>false</WEB_CONSOLE>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>1200000</time>
                                        </wait>
                                        <log>
                                            <prefix>oracle</prefix>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sql-maven-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>${db.artifactGroup}</groupId>
                                <artifactId>${db.artifactId}</artifactId>
                                <version>${ojdbc.version}</version>
                            </dependency>
                        </dependencies>

                        <configuration>
                            <username>SYS AS SYSDBA</username>
                            <password>oracle</password>
                            <url>jdbc:oracle:thin:@localhost:${db.port}:${db.connection.url.sid}</url>
                            <driver>oracle.jdbc.OracleDriver</driver>
                            <skip>${skipTests}</skip>
                        </configuration>

                        <executions>
                            <execution>
                                <id>create-db</id>
                                <phase>integration-test</phase>

                                <goals>
                                    <goal>execute</goal>
                                </goals>

                                <configuration>
                                    <autocommit>true</autocommit>
                                    <srcFiles>
                                        <srcFile>src/test/bin/create-crowd-user.sql</srcFile>
                                    </srcFiles>
                                    <onError>continue</onError>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <db.port>${db.port}</db.port>
                                <hibernate.dialect>com.atlassian.crowd.util.persistence.hibernate.CustomOracle10gDialect</hibernate.dialect>
                                <hibernate.connection.driver_class>oracle.jdbc.OracleDriver</hibernate.connection.driver_class>
                                <hibernate.connection.url>jdbc:oracle:thin:@localhost:${db.port}:${db.connection.url.sid}</hibernate.connection.url>
                                <hibernate.connection.username>crowd</hibernate.connection.username>
                                <hibernate.connection.password>crowd</hibernate.connection.password>
                                <dbunit.datatypefactory_class>org.dbunit.ext.oracle.Oracle10DataTypeFactory</dbunit.datatypefactory_class>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>sqlserver-use-intl</id>
            <properties>
                <sqlserver.dialect>com.atlassian.crowd.util.persistence.hibernate.SQLServerIntlDialect</sqlserver.dialect>
            </properties>
        </profile>

        <profile>
            <!--
            Microsoft SQL Server: Want to use this profile (i.e. run MS SQL Server DAO tests)?
            1) Modify sqlserver-jdbc.test.properties to point to your MS SQL Server install
            2) run the sql script at src/test/bin/setup-crowd-db-in-sqlserver-for-dao-tests.sql against your MS SQL
               Server install
            3) mvn -o -am -Psqlserver -pl crowd-test-runner/crowd-dao-database-test clean install

            Please take note that there is another profile, sqlserver-2017-docker which duplicates some values from here
            -->
            <id>sqlserver</id>

            <properties>
                <test-database>sqlserver</test-database>
                <db.artifactGroup>net.sourceforge.jtds</db.artifactGroup>
                <db.artifactId>jtds</db.artifactId>
                <db.artifactVersion>1.3.1</db.artifactVersion>
                <docker.skip>true</docker.skip>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>net.sourceforge.jtds</groupId>
                    <artifactId>jtds</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sql-maven-plugin</artifactId>

                        <dependencies>
                            <dependency>
                                <groupId>${db.artifactGroup}</groupId>
                                <artifactId>${db.artifactId}</artifactId>
                                <version>${db.artifactVersion}</version>
                            </dependency>
                        </dependencies>

                        <configuration>
                            <username>sa</username>
                            <password>@!1234abc</password>
                            <url>jdbc:jtds:sqlserver://localhost:1433</url>
                            <driver>net.sourceforge.jtds.jdbc.Driver</driver>
                            <skip>${skipTests}</skip>
                        </configuration>

                        <executions>
                           <execution>
                                <id>create-db</id>
                                <phase>package</phase>

                                <goals>
                                    <goal>execute</goal>
                                </goals>

                                <configuration>
                                    <autocommit>true</autocommit>
                                    <delimiterType>row</delimiterType>
                                    <delimiter>GO</delimiter>
                                    <enableFiltering>true</enableFiltering>
                                    <srcFiles>
                                        <srcFile>src/test/bin/setup-crowd-db-in-sqlserver-for-dao-tests.sql</srcFile>
                                    </srcFiles>
                                    <onError>abort</onError>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <db.port>1433</db.port>
                                <hibernate.connection.driver_class>net.sourceforge.jtds.jdbc.Driver</hibernate.connection.driver_class>
                                <hibernate.dialect>${sqlserver.dialect}</hibernate.dialect>
                                <hibernate.connection.url>jdbc:jtds:sqlserver://localhost:${db.port}/crowd</hibernate.connection.url>
                                <hibernate.connection.username>crowd</hibernate.connection.username>
                                <hibernate.connection.password>crowd</hibernate.connection.password>
                                <dbunit.datatypefactory_class>org.dbunit.ext.mssql.MsSqlDataTypeFactory</dbunit.datatypefactory_class>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>sqlserver-2017-docker</id>
            <properties>
                <docker.image>mcr.microsoft.com/mssql/server:2017-CU14-ubuntu</docker.image>
                <docker.wait.log>SQL Server is now ready for client connections. This is an informational message; no user action is required.</docker.wait.log>


                <test-database>sqlserver</test-database>
                <db.artifactGroup>net.sourceforge.jtds</db.artifactGroup>
                <db.artifactId>jtds</db.artifactId>
                <db.artifactVersion>1.3.1</db.artifactVersion>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>net.sourceforge.jtds</groupId>
                    <artifactId>jtds</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <configuration>
                            <images>
                                <image>
                                    <name>${docker.image}</name>

                                    <run>
                                        <ports>
                                            <port>db.port:1433</port>
                                        </ports>
                                        <env>
                                            <ACCEPT_EULA>Y</ACCEPT_EULA>
                                            <SA_PASSWORD>@!1234abc</SA_PASSWORD>
                                        </env>
                                        <wait>
                                            <log>${docker.wait.log}</log>
                                            <time>1200000</time>
                                        </wait>
                                        <log>
                                            <prefix>sqlserver</prefix>
                                        </log>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sql-maven-plugin</artifactId>

                        <dependencies>
                            <dependency>
                                <groupId>${db.artifactGroup}</groupId>
                                <artifactId>${db.artifactId}</artifactId>
                                <version>${db.artifactVersion}</version>
                            </dependency>
                        </dependencies>

                        <configuration>
                            <username>sa</username>
                            <password>@!1234abc</password>
                            <url>jdbc:jtds:sqlserver://localhost:${db.port}</url>
                            <driver>net.sourceforge.jtds.jdbc.Driver</driver>
                            <skip>${skipTests}</skip>
                        </configuration>

                        <executions>
                            <execution>
                                <id>create-db</id>
                                <phase>pre-integration-test</phase>

                                <goals>
                                    <goal>execute</goal>
                                </goals>

                                <configuration>
                                    <autocommit>true</autocommit>
                                    <delimiterType>row</delimiterType>
                                    <delimiter>GO</delimiter>
                                    <enableFiltering>true</enableFiltering>
                                    <srcFiles>
                                        <srcFile>src/test/bin/setup-crowd-db-in-sqlserver-for-dao-tests.sql</srcFile>
                                    </srcFiles>
                                    <onError>abort</onError>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <db.port>${db.port}</db.port>
                                <hibernate.connection.driver_class>net.sourceforge.jtds.jdbc.Driver</hibernate.connection.driver_class>
                                <hibernate.dialect>${sqlserver.dialect}</hibernate.dialect>
                                <hibernate.connection.url>jdbc:jtds:sqlserver://localhost:${db.port}/crowd</hibernate.connection.url>
                                <hibernate.connection.username>crowd</hibernate.connection.username>
                                <hibernate.connection.password>crowd</hibernate.connection.password>
                                <dbunit.datatypefactory_class>org.dbunit.ext.mssql.MsSqlDataTypeFactory</dbunit.datatypefactory_class>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <properties>
        <maven.test.skip>false</maven.test.skip>
        <skipTests>${maven.test.skip}</skipTests>
        <docker.skip>${skipTests}</docker.skip>
        <license.scope>test</license.scope>
        <sqlserver.dialect>org.hibernate.dialect.SQLServerDialect</sqlserver.dialect>
    </properties>
</project>
