-
Notifications
You must be signed in to change notification settings - Fork 171
/
pom.xml
432 lines (417 loc) · 21.8 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2020 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>3.0.0-RC2</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.ojdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>xmlparserv2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ucp</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>xdb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</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>