blob: ebbc3c27cb7cedcac52f78976cbeeb512b4e4b7b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0,
or the Eclipse Distribution License v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<name>EclipseLink Oracle Spatial Extension Test</name>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.oracle.spatial</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<properties>
<!--Properties used for test resources filtering/replacement-->
<!--DB connection properties-->
<dbPlatform>${db.platform.oracle.ext}</dbPlatform>
<dbUser>${db.user}</dbUser>
<dbPassword>${db.pwd}</dbPassword>
<driverClass>${db.driver}</driverClass>
<dbURL>${db.url}</dbURL>
<!--Log level-->
<loglevel>${logging.level}</loglevel>
<test-skip-oracle-spatial>${skipTests}</test-skip-oracle-spatial>
</properties>
<dependencies>
<!--Test dependencies-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!--API dependecies-->
<!--Oracle proprietary dependencies-->
<!--JDBC driver dependencies-->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.spatial</groupId>
<artifactId>sdoapi</artifactId>
<scope>test</scope>
</dependency>
<!--Other modules-->
<!--EclipseLink Core-->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
<scope>test</scope>
</dependency>
<!--EclipseLink Core test framework-->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core.test.framework</artifactId>
<scope>test</scope>
</dependency>
<!--EclipseLink Oracle Extension-->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.oracle</artifactId>
<scope>test</scope>
</dependency>
<!--EclipseLink Oracle Extension test classes (test framework)-->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.oracle</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!--EclipseLink JPA test framework-->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.test.framework</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!--Filtering enables generate/substitute test properties from Maven into *.xml files.-->
<testResources>
<testResource>
<directory>${integration.test.resources.directory}</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<!--Pack test classes due dependency to other modules (JPA Oracle Test)-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>jar-tests</id>
<phase>package</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<dependenciesToScan>
<dependency>org.eclipse.persistence:org.eclipse.persistence.core.test.framework</dependency>
</dependenciesToScan>
<!--Set system properties required for tests-->
<systemPropertiesFile>${test.properties.file}</systemPropertiesFile>
<systemPropertyVariables>
<!--Override db.platform system property loaded from file.
For Oracle DB spatial tests is required: org.eclipse.persistence.platform.database.oracle.Oracle12Platform
instead of: org.eclipse.persistence.platform.database.Oracle12Platform-->
<db.platform>${db.platform.oracle.ext}</db.platform>
</systemPropertyVariables>
<workingDirectory>${project.build.directory}/test-run</workingDirectory>
</configuration>
<executions>
<execution>
<id>clear-database</id>
<phase>process-test-resources</phase>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<skipTests>${test-skip-oracle-spatial}</skipTests>
<reportNameSuffix>clear-database</reportNameSuffix>
<includes>
<include>org.eclipse.persistence.testing.tests.ClearDatabaseSchemaTest</include>
</includes>
</configuration>
</execution>
<execution>
<id>test-oracle-spatial</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<skipTests>${test-skip-oracle-spatial}</skipTests>
<reportNameSuffix>test-oracle-spatial</reportNameSuffix>
<includes>
<include>org.eclipse.persistence.testing.tests.OracleSpatialTestModel</include>
</includes>
</configuration>
</execution>
<execution>
<id>verify-integration-tests</id>
<goals>
<goal>verify</goal>
</goals>
<configuration>
<skip>${integration.test.skip.verify}</skip>
</configuration>
</execution>
</executions>
</plugin>
<!--This plugin sql-maven-plugin must be after maven-surefire-plugin to call dbteardown*.sql scripts after tests-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<!-- common configuration shared by all executions -->
<configuration>
<autocommit>true</autocommit>
<onError>continue</onError>
<!--all executions are ignored if -Dmaven.test.skip=true-->
<skip>${test-skip-oracle-spatial}</skip>
</configuration>
<executions>
<!-- create DB objects -->
<execution>
<id>setup-db-type</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>
CREATE OR REPLACE TYPE MY_GEOMETRY AS OBJECT (id NUMBER, geom MDSYS.SDO_GEOMETRY);
</sqlCommand>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!--Oracle Extension related profiles-->
<profile>
<id>test-oracle-spatial</id>
<properties>
<test-skip-oracle-spatial>false</test-skip-oracle-spatial>
</properties>
</profile>
</profiles>
</project>