mirror of https://github.com/apache/openjpa.git
OPENJPA-1245:
Move lockmode tests to a separate module. This allows different derby lock settings to be set on persistence-jdbc which should speed up test execution. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@804335 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c8fa380048
commit
88dcd580d8
|
@ -39,7 +39,7 @@
|
||||||
<dbcp.minIdle>2</dbcp.minIdle>
|
<dbcp.minIdle>2</dbcp.minIdle>
|
||||||
<dbcp.maxWait>10000</dbcp.maxWait>
|
<dbcp.maxWait>10000</dbcp.maxWait>
|
||||||
<dbcp.args>MaxActive=${dbcp.maxActive},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
|
<dbcp.args>MaxActive=${dbcp.maxActive},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
|
||||||
<derby.locks.waitTimeout>60</derby.locks.waitTimeout>
|
<derby.locks.waitTimeout>8</derby.locks.waitTimeout>
|
||||||
<derby.locks.deadlockTimeout>5</derby.locks.deadlockTimeout>
|
<derby.locks.deadlockTimeout>5</derby.locks.deadlockTimeout>
|
||||||
<tests.openjpa.allowfailure>ignore</tests.openjpa.allowfailure>
|
<tests.openjpa.allowfailure>ignore</tests.openjpa.allowfailure>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
|
@ -66,9 +66,6 @@ import org.apache.openjpa.persistence.kernel.TestProxies2;
|
||||||
import org.apache.openjpa.persistence.kernel.TestSavepoints;
|
import org.apache.openjpa.persistence.kernel.TestSavepoints;
|
||||||
import org.apache.openjpa.persistence.kernel.TestStateManagerImplData;
|
import org.apache.openjpa.persistence.kernel.TestStateManagerImplData;
|
||||||
import org.apache.openjpa.persistence.kernel.TestStoreBlob;
|
import org.apache.openjpa.persistence.kernel.TestStoreBlob;
|
||||||
import org.apache.openjpa.persistence.lockmgr.TestMixedLockManagerLockBasic;
|
|
||||||
import org.apache.openjpa.persistence.lockmgr.
|
|
||||||
TestMixedLockManagerLockPermutation;
|
|
||||||
import org.apache.openjpa.persistence.meta.TestMetamodel;
|
import org.apache.openjpa.persistence.meta.TestMetamodel;
|
||||||
import org.apache.openjpa.persistence.query.TestComplexQueries;
|
import org.apache.openjpa.persistence.query.TestComplexQueries;
|
||||||
import org.apache.openjpa.persistence.query.TestNamedQueries;
|
import org.apache.openjpa.persistence.query.TestNamedQueries;
|
||||||
|
@ -171,8 +168,6 @@ public class DynamicEnhancementSuite extends TestCase {
|
||||||
suite.addTestSuite(TestQueryResultSize.class);
|
suite.addTestSuite(TestQueryResultSize.class);
|
||||||
suite.addTestSuite(TestQueryResultSize.class);
|
suite.addTestSuite(TestQueryResultSize.class);
|
||||||
suite.addTestSuite(TestDetachNoCascade.class);
|
suite.addTestSuite(TestDetachNoCascade.class);
|
||||||
suite.addTestSuite(TestMixedLockManagerLockBasic.class);
|
|
||||||
suite.addTestSuite(TestMixedLockManagerLockPermutation.class);
|
|
||||||
// end Subclassing failing tests
|
// end Subclassing failing tests
|
||||||
|
|
||||||
// org.apache.openjpa.persistence.enhance
|
// org.apache.openjpa.persistence.enhance
|
||||||
|
|
|
@ -0,0 +1,623 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the
|
||||||
|
NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF
|
||||||
|
licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file
|
||||||
|
except in compliance with the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||||
|
either express or implied. See the License for the specific language governing permissions and limitations under
|
||||||
|
the License.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
Maven release plugin requires the project tag to be on a single line.
|
||||||
|
-->
|
||||||
|
<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>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa-persistence-locking</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>OpenJPA Persistence Locking</name>
|
||||||
|
<description>OpenJPA Persistence Locking tests</description>
|
||||||
|
<url>http://openjpa.apache.org</url>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa-parent</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<properties>
|
||||||
|
<dbcp.maxActive>10</dbcp.maxActive>
|
||||||
|
<dbcp.maxIdle>5</dbcp.maxIdle>
|
||||||
|
<dbcp.minIdle>2</dbcp.minIdle>
|
||||||
|
<dbcp.maxWait>10000</dbcp.maxWait>
|
||||||
|
<dbcp.args>MaxActive=${dbcp.maxActive},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
|
||||||
|
<derby.locks.waitTimeout>60</derby.locks.waitTimeout>
|
||||||
|
<derby.locks.deadlockTimeout>5</derby.locks.deadlockTimeout>
|
||||||
|
<tests.openjpa.allowfailure>ignore</tests.openjpa.allowfailure>
|
||||||
|
</properties>
|
||||||
|
<profiles>
|
||||||
|
|
||||||
|
<!-- Profile for testing with test-dynamic-enhancer -->
|
||||||
|
<profile>
|
||||||
|
<id>test-dynamic-enhancer</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>false</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<build.enhance>false</build.enhance>
|
||||||
|
<surefire.jvm.args>-Dopenjpa.RuntimeUnenhancedClasses=unsupported ${test.jvm.arguments}</surefire.jvm.args>
|
||||||
|
</properties>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<argLine>${surefire.jvm.args}</argLine>
|
||||||
|
<includes>
|
||||||
|
<include>org/apache/openjpa/persistence/enhance/DynamicEnhancementSuite.java</include>
|
||||||
|
</includes>
|
||||||
|
<systemProperties>
|
||||||
|
<property>
|
||||||
|
<name>openjpa.Log</name>
|
||||||
|
<value>DefaultLevel=${openjpa.loglevel}</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>openjpa.ConnectionDriverName</name>
|
||||||
|
<value>org.apache.commons.dbcp.BasicDataSource</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>derby.stream.error.file</name>
|
||||||
|
<value>target/derby.log</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>openjpa.ConnectionProperties</name>
|
||||||
|
<value>DriverClassName=${connection.driver.name},Url=${connection.url},Username=${connection.username},Password=${connection.password},${dbcp.args}</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>tests.openjpa.allowfailure</name>
|
||||||
|
<value>${tests.openjpa.allowfailure}</value>
|
||||||
|
</property>
|
||||||
|
</systemProperties>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<!-- Profile for testing with Apache Derby -->
|
||||||
|
<profile>
|
||||||
|
<id>test-derby</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
<property>
|
||||||
|
<name>test-derby</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.derby</groupId>
|
||||||
|
<artifactId>derby</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<connection.driver.name>org.apache.derby.jdbc.EmbeddedDriver</connection.driver.name>
|
||||||
|
<connection.url>jdbc:derby:target/database/openjpa-derby-database;create=true</connection.url>
|
||||||
|
<connection.username />
|
||||||
|
<connection.password />
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Profile for testing with HSQL DB -->
|
||||||
|
<profile>
|
||||||
|
<id>test-hsqldb</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>test-hsqldb</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>hsqldb</groupId>
|
||||||
|
<artifactId>hsqldb</artifactId>
|
||||||
|
<version>${hsqldb.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<hsqldb.version>1.8.0.7</hsqldb.version>
|
||||||
|
<connection.driver.name>org.hsqldb.jdbcDriver</connection.driver.name>
|
||||||
|
<connection.url>jdbc:hsqldb:target/database/openjpa-hsqldb-database;create=true</connection.url>
|
||||||
|
<connection.username>sa</connection.username>
|
||||||
|
<connection.password />
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Profile for testing with MySQL DB -->
|
||||||
|
<profile>
|
||||||
|
<id>test-mysql</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>test-mysql</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>${mysql.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<mysql.version>5.1.6</mysql.version>
|
||||||
|
<connection.driver.name>com.mysql.jdbc.Driver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.mysql.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.mysql.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.mysql.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Profile for testing with PostgreSQL DB -->
|
||||||
|
<profile>
|
||||||
|
<id>test-postgresql</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>test-postgresql</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<version>${postgresql.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<postgresql.version>8.3-603.jdbc3</postgresql.version>
|
||||||
|
<connection.driver.name>org.postgresql.Driver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.postgresql.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.postgresql.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.postgresql.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Profile for testing with SQLServer DB using MS JDBC driver -->
|
||||||
|
<profile>
|
||||||
|
<!--
|
||||||
|
Example MS SQL profile. You can use this profile if you: 1) have the MS SQL artifacts installed in a
|
||||||
|
local repo and supply the URL: -Dmssql.maven.repo=http://my.local.repo 2) have a copy of the MS SQL JDBC
|
||||||
|
driver from: http://msdn.microsoft.com/en-us/data/aa937724.aspx and run the following commands : mvn
|
||||||
|
install:install-file -Dfile=${path to sqljdbc.jar} \ -DgroupId=com.microsoft.sqlserver \
|
||||||
|
-DartifactId=sqljdbc \ -Dversion=2.0 \ -Dpackaging=jar You must also set the following properties:
|
||||||
|
-Dopenjpa.mssql.url=jdbc:sqlserver://<HOST>:<PORT>;\ DataBaseName=<DBNAME>
|
||||||
|
-Dopenjpa.mssql.username=<mssql_uid> -Dopenjpa.mssql.password=<mssql_pwd> Optionally, you can override
|
||||||
|
the default groupId and version by also supplying the following properties:
|
||||||
|
-Dmssql.groupid=com.microsoft.sqlserver -Dmssql.version=2.0 If you are using Java SE 6 or later, you
|
||||||
|
will need to use: -Dmssql.artifactid=sqljdbc4
|
||||||
|
-->
|
||||||
|
<id>test-mssql</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${mssql.groupid}</groupId>
|
||||||
|
<artifactId>${mssql.artifactid}</artifactId>
|
||||||
|
<version>${mssql.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<mssql.maven.repo>http://not.real.repository</mssql.maven.repo>
|
||||||
|
<mssql.groupid>com.microsoft.sqlserver</mssql.groupid>
|
||||||
|
<mssql.artifactid>sqljdbc</mssql.artifactid>
|
||||||
|
<mssql.version>2.0</mssql.version>
|
||||||
|
<connection.driver.name>com.microsoft.sqlserver.jdbc.SQLServerDriver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.mssql.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.mssql.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.mssql.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>mssql.repository</id>
|
||||||
|
<name>MSSQL Repository</name>
|
||||||
|
<url>${mssql.maven.repo}</url>
|
||||||
|
<layout>default</layout>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<checksumPolicy>ignore</checksumPolicy>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Profile for testing with SQLServer DB using the jTDS driver -->
|
||||||
|
<profile>
|
||||||
|
<id>test-sqlserver</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sourceforge.jtds</groupId>
|
||||||
|
<artifactId>jtds</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<connection.driver.name>net.sourceforge.jtds.jdbc.Driver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.sqlserver.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.sqlserver.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.sqlserver.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Profile for testing with Sybase DB using the jTDS driver -->
|
||||||
|
<profile>
|
||||||
|
<id>test-sybase</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>test-sybase</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sourceforge.jtds</groupId>
|
||||||
|
<artifactId>jtds</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<connection.driver.name>net.sourceforge.jtds.jdbc.Driver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.sybase.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.sybase.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.sybase.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- Profile for testing with a custom DB using a system jar -->
|
||||||
|
<!--
|
||||||
|
For example, to test with Oracle, you might run: mvn test -Dtest=TestPersistence -Ptest-custom \
|
||||||
|
-Dopenjpa.custom.driverjar=$(pwd)/drivers/jdbc-oracle-10_2_0_1_0.jar \
|
||||||
|
-Dopenjpa.custom.driverclass=oracle.jdbc.driver.OracleDriver \
|
||||||
|
-Dopenjpa.custom.url=jdbc:oracle:thin:@HOST:PORT:DBNAME \ -Dopenjpa.custom.username=USERNAME \
|
||||||
|
-Dopenjpa.custom.password=PASSWORD
|
||||||
|
-->
|
||||||
|
<profile>
|
||||||
|
<id>test-custom</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>test-custom</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>openjpa.customdriver</groupId>
|
||||||
|
<artifactId>openjpa.customdriver</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${openjpa.custom.driverjar}</systemPath>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<connection.driver.name>${openjpa.custom.driverclass}</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.custom.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.custom.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.custom.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Profile for testing with a custom DB using two system jars. Some databases (DB2) use more than one jar for
|
||||||
|
their JDBC provider. Functionally this is identical to the previous profile, with a second system dependency
|
||||||
|
added.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
For example, to test with DB2, you might run: mvn test -Dtest=TestPersistence -Ptest-custom2 \
|
||||||
|
-Dopenjpa.custom.driverjar1=$(pwd)/drivers/db2jcc.jar \
|
||||||
|
-Dopenjpa.custom.driverjar2=$(pwd)/drviers/db2jcc_license_cu.jar \
|
||||||
|
-Dopenjpa.custom.driverclass=com.ibm.db2.jcc.DB2Driver \ -Dopenjpa.custom.url=jdbc:db2://HOST:PORT/DBNAME \
|
||||||
|
-Dopenjpa.custom.username=USERNAME \ -Dopenjpa.custom.password=PASSWORD
|
||||||
|
-->
|
||||||
|
<profile>
|
||||||
|
<id>test-custom2</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>test-custom2</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>openjpa.customdriver1</groupId>
|
||||||
|
<artifactId>openjpa.customdriver1</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${openjpa.custom.driverjar1}</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>openjpa.customdriver2</groupId>
|
||||||
|
<artifactId>openjpa.customdriver2</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${openjpa.custom.driverjar2}</systemPath>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<connection.driver.name>${openjpa.custom.driverclass}</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.custom.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.custom.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.custom.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The test-custom2 profile does not work very well when used with a continuous build system. As a convenience
|
||||||
|
I've added profiles for some of the proprietary databases to make testing easier.
|
||||||
|
-->
|
||||||
|
<profile>
|
||||||
|
<!--
|
||||||
|
Example db2 profile. You can use this profile if you: 1) have the DB2 artifacts installed in a local
|
||||||
|
repo and supply the URL: -Ddb2.maven.repo=http://my.local.repo 2) have a copy of the DB2 JCC driver and
|
||||||
|
run the following commands : mvn install:install-file -Dfile=${path to db2jcc.jar} \
|
||||||
|
-DgroupId=com.ibm.db2 \ -DartifactId=jcc-driver \ -Dversion=9.5 \ -Dpackaging=jar mvn
|
||||||
|
install:install-file -Dfile=${path to db2jcc_license.jar} \ -DgroupId=com.ibm.db2 \
|
||||||
|
-DartifactId=jcc-license \ -Dversion=9.5 \ -Dpackaging=jar You must also set the following properties:
|
||||||
|
-Dopenjpa.db2.url=jdbc:db2://<HOST>:<PORT>/<DBNAME> -Dopenjpa.db2.username=<db2_uid>
|
||||||
|
-Dopenjpa.db2.password=<db2_pwd> Optionally, you can override the default DB2 groupId, artifactIds and
|
||||||
|
version by also supplying the following properties: -Ddb2.groupid=com.ibm.db2
|
||||||
|
-Dids.driver.artifactid=jcc-driver -Dids.license.artifactid=jcc-license -Ddb2.version=9.5
|
||||||
|
-->
|
||||||
|
<id>test-db2-jcc</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${db2.groupid}</groupId>
|
||||||
|
<artifactId>${db2.driver.artifactid}</artifactId>
|
||||||
|
<version>${db2.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${db2.groupid}</groupId>
|
||||||
|
<artifactId>${db2.license.artifactid}</artifactId>
|
||||||
|
<version>${db2.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<db2.maven.repo>http://not.a.real.repository</db2.maven.repo>
|
||||||
|
<db2.groupid>com.ibm.db2</db2.groupid>
|
||||||
|
<db2.driver.artifactid>jcc-driver</db2.driver.artifactid>
|
||||||
|
<db2.license.artifactid>jcc-license</db2.license.artifactid>
|
||||||
|
<db2.version>9.5</db2.version>
|
||||||
|
<connection.driver.name>com.ibm.db2.jcc.DB2Driver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.db2.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.db2.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.db2.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>db2.repository</id>
|
||||||
|
<name>DB2 Repository</name>
|
||||||
|
<url>${db2.maven.repo}</url>
|
||||||
|
<layout>default</layout>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<checksumPolicy>ignore</checksumPolicy>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<!--
|
||||||
|
Example Informix JCC profile. You can use this profile if you: 1a) have the DB2 JCC artifacts installed
|
||||||
|
in a local repo and supply the URL: -Dids.maven.repo=http://my.local.repo 1b) or have a copy of the DB2
|
||||||
|
JCC driver and run the commands listed above in the test-db2-jcc profile. 2) have the DRDA service
|
||||||
|
enabled on the IDS server, which is usually port 9089 You must also set the following properties:
|
||||||
|
-Dopenjpa.ids.url=jdbc:ids://<HOST>:<PORT>/<DBNAME> -Dopenjpa.ids.username=<ids_uid>
|
||||||
|
-Dopenjpa.ids.password=<ids_pwd> Optionally, you can override the default DB2 JCC groupId, artifactIds
|
||||||
|
and version by also supplying the following properties: -Dids.groupid=com.ibm.db2
|
||||||
|
-Dids.driver.artifactid=jcc-driver -Dids.license.artifactid=jcc-license -Dids.version=9.5
|
||||||
|
-->
|
||||||
|
<id>test-ids-jcc</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${ids.groupid}</groupId>
|
||||||
|
<artifactId>${ids.driver.artifactid}</artifactId>
|
||||||
|
<version>${ids.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${ids.groupid}</groupId>
|
||||||
|
<artifactId>${ids.license.artifactid}</artifactId>
|
||||||
|
<version>${ids.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<ids.maven.repo>http://not.a.real.repository</ids.maven.repo>
|
||||||
|
<ids.groupid>com.ibm.db2</ids.groupid>
|
||||||
|
<ids.driver.artifactid>jcc-driver</ids.driver.artifactid>
|
||||||
|
<ids.license.artifactid>jcc-license</ids.license.artifactid>
|
||||||
|
<ids.version>9.5</ids.version>
|
||||||
|
<connection.driver.name>com.ibm.db2.jcc.DB2Driver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.ids.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.ids.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.ids.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>ids.repository</id>
|
||||||
|
<name>Informix Repository</name>
|
||||||
|
<url>${ids.maven.repo}</url>
|
||||||
|
<layout>default</layout>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<checksumPolicy>ignore</checksumPolicy>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<!--
|
||||||
|
Example oracle profile. You can use this profile if you: 1) have the Oracle artifacts installed in a
|
||||||
|
local repo and supply the URL: -Doracle.maven.repo=http://my.local.repo 2) have a copy of the Oracle
|
||||||
|
driver and run the following command: mvn install:install-file -Dfile=${path to ojdbc.jar} \
|
||||||
|
-DgroupId=com.oracle \ -DartifactId=jdbc-driver \ -Dversion=10g \ -Dpackaging=jar You must also set the
|
||||||
|
following properties: -Dopenjpa.oracle.url -Dopenjpa.oracle.username -Dopenjpa.oracle.password
|
||||||
|
|
||||||
|
Optionally, you can override the default Oracle groupId and version by also supplying the following
|
||||||
|
properties: -Doracle.groupid=com.oracle -Doracle.version=10g
|
||||||
|
-->
|
||||||
|
<id>test-oracle</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${oracle.groupid}</groupId>
|
||||||
|
<artifactId>${oracle.artifactid}</artifactId>
|
||||||
|
<version>${oracle.version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<oracle.maven.repo>http://not.a.real.repository</oracle.maven.repo>
|
||||||
|
<oracle.groupid>com.oracle</oracle.groupid>
|
||||||
|
<oracle.artifactid>jdbc-driver</oracle.artifactid>
|
||||||
|
<oracle.version>10g</oracle.version>
|
||||||
|
<connection.driver.name>oracle.jdbc.driver.OracleDriver</connection.driver.name>
|
||||||
|
<connection.url>${openjpa.oracle.url}</connection.url>
|
||||||
|
<connection.username>${openjpa.oracle.username}</connection.username>
|
||||||
|
<connection.password>${openjpa.oracle.password}</connection.password>
|
||||||
|
</properties>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>oracle.repository</id>
|
||||||
|
<name>Oracle Repository</name>
|
||||||
|
<url>${oracle.maven.repo}</url>
|
||||||
|
<layout>default</layout>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<checksumPolicy>ignore</checksumPolicy>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa</artifactId>
|
||||||
|
<version>${pom.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.openjpa</groupId>
|
||||||
|
<artifactId>openjpa-persistence-jdbc</artifactId>
|
||||||
|
<version>${pom.version}</version>
|
||||||
|
<classifier>tests</classifier>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-dbcp</groupId>
|
||||||
|
<artifactId>commons-dbcp</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.derby</groupId>
|
||||||
|
<artifactId>derby</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta-regexp</groupId>
|
||||||
|
<artifactId>jakarta-regexp</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>test-compile</phase>
|
||||||
|
<configuration>
|
||||||
|
<tasks>
|
||||||
|
<ant antfile="src/test/ant/enhancer.xml" target="enhance" inheritRefs="true">
|
||||||
|
<property name="maven.test.skip" value="${maven.test.skip}" />
|
||||||
|
<property name="test" value="${test}" />
|
||||||
|
<property name="outdir" value="${project.build.outputDirectory}" />
|
||||||
|
<property name="project.build.testOutputDirectory" value="${project.build.testOutputDirectory}" />
|
||||||
|
<property name="openjpa.loglevel" value="${openjpa.loglevel}" />
|
||||||
|
<property name="build.enhance" value="${build.enhance}" />
|
||||||
|
</ant>
|
||||||
|
</tasks>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<argLine>${surefire.jvm.args}</argLine>
|
||||||
|
<excludes>
|
||||||
|
<!--
|
||||||
|
exclude classes that end with 'Test'; these are not test cases per OpenJPA standards
|
||||||
|
-->
|
||||||
|
<exclude>org/apache/openjpa/**/*Test.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
<systemProperties>
|
||||||
|
<property>
|
||||||
|
<name>openjpa.Log</name>
|
||||||
|
<value>DefaultLevel=${openjpa.loglevel}</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>openjpa.DynamicEnhancementAgent</name>
|
||||||
|
<value>false</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>openjpa.ConnectionDriverName</name>
|
||||||
|
<value>org.apache.commons.dbcp.BasicDataSource</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>derby.stream.error.file</name>
|
||||||
|
<value>target/derby.log</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>derby.locks.deadlockTimeout</name>
|
||||||
|
<value>${derby.locks.deadlockTimeout}</value>
|
||||||
|
</property>
|
||||||
|
<!-- following causes lockmgr test failures -->
|
||||||
|
<property>
|
||||||
|
<name>derby.locks.waitTimeout</name>
|
||||||
|
<value>${derby.locks.waitTimeout}</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>openjpa.ConnectionProperties</name>
|
||||||
|
<value>DriverClassName=${connection.driver.name},Url=${connection.url},Username=${connection.username},Password=${connection.password},${dbcp.args}</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>tests.openjpa.allowfailure</name>
|
||||||
|
<value>${tests.openjpa.allowfailure}</value>
|
||||||
|
</property>
|
||||||
|
</systemProperties>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,76 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
distributed with this work for additional information
|
||||||
|
regarding copyright ownership. The ASF licenses this file
|
||||||
|
to you under the Apache License, Version 2.0 (the
|
||||||
|
"License"); you may not use this file except in compliance
|
||||||
|
with the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing,
|
||||||
|
software distributed under the License is distributed on an
|
||||||
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, either express or implied. See the License for the
|
||||||
|
specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
-->
|
||||||
|
<project name="enhance" basedir=".">
|
||||||
|
<!--
|
||||||
|
This build file executes the PCEnhancer on the test entities. It's in a
|
||||||
|
separate file instead of nested in pom.xml to make some conditional
|
||||||
|
processing easier.
|
||||||
|
|
||||||
|
Test classes will not be compiled if maven is invoked with
|
||||||
|
-Dmaven.test.skip=true.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<condition property="maven.test.skip.istrue">
|
||||||
|
<istrue value="${maven.test.skip}" />
|
||||||
|
</condition>
|
||||||
|
|
||||||
|
<condition property="skip.enhance">
|
||||||
|
<or>
|
||||||
|
<equals arg1="${test}" arg2="false" />
|
||||||
|
<equals arg1="${build.enhance}" arg2="false" />
|
||||||
|
<istrue value="${maven.test.skip}" />
|
||||||
|
<istrue value="${skipTests}" />
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
|
||||||
|
<!-- =================================
|
||||||
|
target: enhance
|
||||||
|
================================= -->
|
||||||
|
<target name="enhance" description="--> run the enhancer unless test=false" unless="skip.enhance">
|
||||||
|
<antcall target="enhance.all.entities" inheritall="true" inheritrefs="true" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- =================================
|
||||||
|
target: enhance.all.entities
|
||||||
|
================================= -->
|
||||||
|
<target name="enhance.all.entities" description="--> enhance the test entities" unless="skip.enhance">
|
||||||
|
<echo> running enhancer</echo>
|
||||||
|
<!--
|
||||||
|
Inherited references won't be present until the task is called.
|
||||||
|
Therefore the path definition needs to stay inside the task.
|
||||||
|
-->
|
||||||
|
<path id="cp">
|
||||||
|
<path refid="maven.test.classpath" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
|
||||||
|
<classpath refid="cp" />
|
||||||
|
</taskdef>
|
||||||
|
|
||||||
|
<fileset id="enhance.path.ref" dir="${project.build.testOutputDirectory}">
|
||||||
|
<include name="**/*.class" />
|
||||||
|
</fileset>
|
||||||
|
<openjpac>
|
||||||
|
<classpath refid="cp" />
|
||||||
|
<fileset refid="enhance.path.ref" />
|
||||||
|
<config log="DefaultLevel=${openjpa.loglevel}" />
|
||||||
|
</openjpac>
|
||||||
|
</target>
|
||||||
|
</project>
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
distributed with this work for additional information
|
||||||
|
regarding copyright ownership. The ASF licenses this file
|
||||||
|
to you under the Apache License, Version 2.0 (the
|
||||||
|
"License"); you may not use this file except in compliance
|
||||||
|
with the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing,
|
||||||
|
software distributed under the License is distributed on an
|
||||||
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, either express or implied. See the License for the
|
||||||
|
specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
-->
|
||||||
|
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
version="1.0">
|
||||||
|
<persistence-unit name="test">
|
||||||
|
<properties>
|
||||||
|
<!--
|
||||||
|
These properties are instead passed via System properties
|
||||||
|
|
||||||
|
<property name="openjpa.ConnectionDriverName"
|
||||||
|
value="org.apache.commons.dbcp.BasicDataSource"/>
|
||||||
|
<property name="openjpa.ConnectionProperties"
|
||||||
|
value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/>
|
||||||
|
-->
|
||||||
|
<property name="openjpa.jdbc.SynchronizeMappings"
|
||||||
|
value="buildSchema(ForeignKeys=true)"/>
|
||||||
|
</properties>
|
||||||
|
</persistence-unit>
|
||||||
|
</persistence>
|
1
pom.xml
1
pom.xml
|
@ -99,6 +99,7 @@
|
||||||
<module>openjpa-jdbc</module>
|
<module>openjpa-jdbc</module>
|
||||||
<module>openjpa-persistence</module>
|
<module>openjpa-persistence</module>
|
||||||
<module>openjpa-persistence-jdbc</module>
|
<module>openjpa-persistence-jdbc</module>
|
||||||
|
<module>openjpa-persistence-locking</module>
|
||||||
<module>openjpa-xmlstore</module>
|
<module>openjpa-xmlstore</module>
|
||||||
<module>openjpa-slice</module>
|
<module>openjpa-slice</module>
|
||||||
<module>openjpa</module>
|
<module>openjpa</module>
|
||||||
|
|
Loading…
Reference in New Issue