| <?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 Extension Test</name> |
| <groupId>org.eclipse.persistence</groupId> |
| <artifactId>org.eclipse.persistence.oracle.test</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--> |
| <pa.connection.user>PAS_CONN</pa.connection.user> |
| <pa.connection.password>${db.pwd}2</pa.connection.password> |
| <pa.proxyuser>PAS_PROXY</pa.proxyuser> |
| <pa.proxyuser.password>password</pa.proxyuser.password> |
| <pa.proxyuser2>${pa.proxyuser}2</pa.proxyuser2> |
| <pa.proxyuser2.password>${pa.proxyuser.password}2</pa.proxyuser2.password> |
| |
| <test-skip-oracle-extension>${skipTests}</test-skip-oracle-extension> |
| </properties> |
| |
| <dependencies> |
| <!--Other modules--> |
| <dependency> |
| <groupId>org.eclipse.persistence</groupId> |
| <artifactId>org.eclipse.persistence.oracle</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <!--API dependecies--> |
| <dependency> |
| <groupId>jakarta.transaction</groupId> |
| <artifactId>jakarta.transaction-api</artifactId> |
| <optional>true</optional> |
| <scope>test</scope> |
| </dependency> |
| <!--Other libraries dependencies--> |
| <!--Oracle proprietary dependencies--> |
| <!--JDBC driver dependencies--> |
| <dependency> |
| <groupId>com.oracle.database.jdbc</groupId> |
| <artifactId>ojdbc8</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>com.oracle.database.xml</groupId> |
| <artifactId>xmlparserv2</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>com.oracle.database.jdbc</groupId> |
| <artifactId>ucp</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>com.oracle.database.xml</groupId> |
| <artifactId>xdb</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>com.oracle.database.observability</groupId> |
| <artifactId>dms</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <!--Test dependencies--> |
| <dependency> |
| <groupId>junit</groupId> |
| <artifactId>junit</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <!--API dependecies--> |
| <dependency> |
| <groupId>javax.transaction</groupId> |
| <artifactId>javax.transaction-api</artifactId> |
| <version>1.3</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>javax.jms</groupId> |
| <artifactId>javax.jms-api</artifactId> |
| <version>2.0.1</version> |
| <scope>test</scope> |
| </dependency> |
| <!--Oracle proprietary dependencies--> |
| <dependency> |
| <groupId>com.oracle.database.messaging</groupId> |
| <artifactId>aqapi</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <!--Other modules--> |
| <!--EclipseLink JPA--> |
| <dependency> |
| <groupId>org.eclipse.persistence</groupId> |
| <artifactId>org.eclipse.persistence.jpa</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 Core test classes--> |
| <dependency> |
| <groupId>org.eclipse.persistence</groupId> |
| <artifactId>org.eclipse.persistence.core.test</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> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-surefire-plugin</artifactId> |
| <configuration> |
| <skip>true</skip> |
| </configuration> |
| </plugin> |
| <!--Pack test classes due dependency to other modules (Oracle Spatial 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-source-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>jar-test-sources</id> |
| <phase>package</phase> |
| <goals> |
| <goal>test-jar-no-fork</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-dependency-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>copy-to-distribution-module</id> |
| <phase>install</phase> |
| <goals> |
| <goal>copy</goal> |
| </goals> |
| </execution> |
| </executions> |
| <configuration> |
| <artifactItems> |
| <artifactItem> |
| <groupId>${project.groupId}</groupId> |
| <artifactId>${project.artifactId}</artifactId> |
| <version>${project.version}</version> |
| <type>test-jar</type> |
| <classifier>tests</classifier> |
| <destFileName>${project.artifactId}-tests.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>${project.groupId}</groupId> |
| <artifactId>${project.artifactId}</artifactId> |
| <version>${project.version}</version> |
| <type>test-jar</type> |
| <classifier>test-sources</classifier> |
| <destFileName>${project.artifactId}-test-sources.jar</destFileName> |
| </artifactItem> |
| </artifactItems> |
| <outputDirectory>${distribution.directory}</outputDirectory> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| |
| <profiles> |
| <!--Oracle Extension related profiles--> |
| <profile> |
| <id>oracle</id> |
| <build> |
| <plugins> |
| <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> |
| <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-extension}</skipTests> |
| <reportNameSuffix>clear-database</reportNameSuffix> |
| <includes> |
| <test>org.eclipse.persistence.testing.tests.ClearDatabaseSchemaTest</test> |
| </includes> |
| </configuration> |
| </execution> |
| <execution> |
| <id>test-oracle-extension</id> |
| <goals> |
| <goal>integration-test</goal> |
| </goals> |
| <configuration> |
| <skipTests>${test-skip-oracle-extension}</skipTests> |
| <reportNameSuffix>test-oracle-extension</reportNameSuffix> |
| <argLine>-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory</argLine> |
| <systemPropertyVariables> |
| <pa.connection.user>${pa.connection.user}</pa.connection.user> |
| <pa.connection.password>${pa.connection.password}</pa.connection.password> |
| <pa.proxyuser>${pa.proxyuser}</pa.proxyuser> |
| <pa.proxyuser.password>${pa.proxyuser.password}</pa.proxyuser.password> |
| <pa.proxyuser2>${pa.proxyuser2}</pa.proxyuser2> |
| <pa.proxyuser2.password>${pa.proxyuser2.password}</pa.proxyuser2.password> |
| <!--Override db.platform system property loaded from file. |
| For Oracle DB Extension 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> |
| <includes> |
| <include>org.eclipse.persistence.testing.tests.OracleTestModel</include> |
| <include>org.eclipse.persistence.testing.tests.xdb.XDBTestModel</include> |
| <include>org.eclipse.persistence.testing.tests.xdb.XDBTestModelMWIntegration</include> |
| <include>org.eclipse.persistence.testing.tests.unwrappedconnection.UnwrapConnectionXDBTestModel</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> |
| <username>${db.sys.user} as sysdba</username> |
| <password>${db.sys.pwd}</password> |
| <autocommit>true</autocommit> |
| <onError>continue</onError> |
| <!--all executions are ignored if -Dmaven.test.skip=true--> |
| <skip>${test-skip-oracle-extension}</skip> |
| </configuration> |
| <executions> |
| <!-- create proxy user and grant permissions --> |
| <execution> |
| <id>setup-connuser</id> |
| <phase>process-test-resources</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <sqlCommand> |
| DROP USER ${pa.connection.user} CASCADE; |
| |
| CREATE USER ${pa.connection.user} IDENTIFIED BY ${pa.connection.password} ACCOUNT UNLOCK; |
| GRANT CONNECT TO ${pa.connection.user}; |
| GRANT RESOURCE TO ${pa.connection.user}; |
| GRANT CREATE SESSION TO ${pa.connection.user}; |
| GRANT UNLIMITED TABLESPACE TO ${pa.connection.user}; |
| GRANT CREATE ANY VIEW TO ${pa.connection.user}; |
| GRANT CREATE ANY context TO ${pa.connection.user}; |
| GRANT DROP ANY context TO ${pa.connection.user}; |
| GRANT EXECUTE ON dbms_flashback TO ${pa.connection.user}; |
| GRANT EXECUTE ON dbms_rls TO ${pa.connection.user}; |
| GRANT EXECUTE ON dbms_session TO ${pa.connection.user}; |
| GRANT change notification TO ${pa.connection.user}; |
| GRANT CREATE ANY directory TO ${pa.connection.user}; |
| GRANT DROP ANY directory TO ${pa.connection.user}; |
| </sqlCommand> |
| </configuration> |
| </execution> |
| <execution> |
| <id>setup-proxy-authentication</id> |
| <phase>process-test-resources</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <sqlCommand> |
| DROP USER ${pa.proxyuser} CASCADE; |
| DROP USER ${pa.proxyuser2} CASCADE; |
| |
| CREATE USER ${pa.proxyuser} IDENTIFIED BY ${pa.proxyuser.password} ACCOUNT UNLOCK; |
| CREATE USER ${pa.proxyuser2} IDENTIFIED BY ${pa.proxyuser2.password} ACCOUNT UNLOCK; |
| GRANT UNLIMITED TABLESPACE TO ${pa.proxyuser}; |
| GRANT UNLIMITED TABLESPACE TO ${pa.proxyuser2}; |
| GRANT CONNECT TO ${pa.proxyuser}; |
| GRANT CONNECT TO ${pa.proxyuser2}; |
| GRANT RESOURCE TO ${pa.proxyuser}; |
| GRANT CREATE SESSION TO ${pa.proxyuser}; |
| ALTER USER ${pa.proxyuser} GRANT CONNECT THROUGH ${pa.connection.user}; |
| ALTER USER ${pa.proxyuser2} GRANT CONNECT THROUGH ${pa.connection.user}; |
| </sqlCommand> |
| </configuration> |
| </execution> |
| <execution> |
| <id>setup-proxy-authentication-create-employee-table</id> |
| <phase>process-test-resources</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <username>${pa.connection.user}</username> |
| <password>${pa.connection.password}</password> |
| <sqlCommand> |
| CREATE TABLE JPA_PROXY_EMPLOYEE ( |
| EMP_ID NUMBER (15) NOT NULL, |
| F_NAME VARCHAR2 (40) NULL, |
| L_NAME VARCHAR2 (40) NULL, |
| PRIMARY KEY (EMP_ID) |
| ); |
| CREATE TABLE PROXY_EMPLOYEE_SEQ ( |
| SEQ_NAME VARCHAR2 (50) NOT NULL, |
| SEQ_COUNT NUMBER (38) NULL, |
| PRIMARY KEY (SEQ_NAME) |
| ); |
| INSERT INTO PROXY_EMPLOYEE_SEQ (SEQ_NAME, SEQ_COUNT) VALUES ('PROXY_EMPLOYEE_SEQ', 1); |
| </sqlCommand> |
| </configuration> |
| </execution> |
| <execution> |
| <id>setup-proxy-authentication-create-phonenumber-table</id> |
| <phase>process-test-resources</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <username>${pa.proxyuser}</username> |
| <password>${pa.proxyuser.password}</password> |
| <sqlCommand> |
| CREATE TABLE PROXY_PHONENUMBER ( |
| OWNER_ID NUMBER (15) NOT NULL, |
| TYPE VARCHAR2 (15) NOT NULL, |
| AREA_CODE VARCHAR2 (3) NULL, |
| NUMB VARCHAR2 (8) NULL, |
| PRIMARY KEY (OWNER_ID, TYPE) |
| ); |
| </sqlCommand> |
| </configuration> |
| </execution> |
| <execution> |
| <id>grant-permissions-to-proxyuser</id> |
| <phase>process-test-resources</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <sqlCommand> |
| GRANT ALTER ON ${pa.connection.user}.JPA_PROXY_EMPLOYEE TO ${pa.proxyuser}; |
| GRANT DELETE ON ${pa.connection.user}.JPA_PROXY_EMPLOYEE TO ${pa.proxyuser}; |
| GRANT INSERT ON ${pa.connection.user}.JPA_PROXY_EMPLOYEE TO ${pa.proxyuser}; |
| GRANT SELECT ON ${pa.connection.user}.JPA_PROXY_EMPLOYEE TO ${pa.proxyuser}; |
| GRANT UPDATE ON ${pa.connection.user}.JPA_PROXY_EMPLOYEE TO ${pa.proxyuser}; |
| GRANT INDEX ON ${pa.connection.user}.JPA_PROXY_EMPLOYEE TO ${pa.proxyuser}; |
| |
| GRANT ALTER ON ${pa.connection.user}.PROXY_EMPLOYEE_SEQ TO ${pa.proxyuser}; |
| GRANT DELETE ON ${pa.connection.user}.PROXY_EMPLOYEE_SEQ TO ${pa.proxyuser}; |
| GRANT INSERT ON ${pa.connection.user}.PROXY_EMPLOYEE_SEQ TO ${pa.proxyuser}; |
| GRANT SELECT ON ${pa.connection.user}.PROXY_EMPLOYEE_SEQ TO ${pa.proxyuser}; |
| GRANT UPDATE ON ${pa.connection.user}.PROXY_EMPLOYEE_SEQ TO ${pa.proxyuser}; |
| GRANT INDEX ON ${pa.connection.user}.PROXY_EMPLOYEE_SEQ TO ${pa.proxyuser}; |
| </sqlCommand> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>test-oracle-extension</id> |
| <properties> |
| <test-skip-oracle-extension>false</test-skip-oracle-extension> |
| </properties> |
| </profile> |
| </profiles> |
| </project> |