This is an automated email from the ASF dual-hosted git repository.
struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git
The following commit(s) were added to refs/heads/master by this push:
new c42aff8 OPENJPA-2753 add a profile test-postgresql-docker
c42aff8 is described below
commit c42aff8ffffd54b3b6dc267b1afdf6929c8c321d
Author: Mark Struberg <[email protected]>
AuthorDate: Sat Nov 3 22:54:12 2018 +0100
OPENJPA-2753 add a profile test-postgresql-docker
---
openjpa-project/BUILDING.txt | 5 +++
pom.xml | 79 +++++++++++++++++++++++++++++++++++++++++---
2 files changed, 80 insertions(+), 4 deletions(-)
diff --git a/openjpa-project/BUILDING.txt b/openjpa-project/BUILDING.txt
index 1639016..b270148 100644
--- a/openjpa-project/BUILDING.txt
+++ b/openjpa-project/BUILDING.txt
@@ -194,3 +194,8 @@ Running unit tests in the Debugger
TODO: finish!
-Dopenjpa.ConnectionURL=jdbc:derby:target/database/openjpa-derby-database;create=true
-Dopenjpa.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver
+For running against a MySQL Docker installation:
+-ea -Dopenjpa.ConnectionDriverName=com.mysql.jdbc.Driver
-Dopenjpa.ConnectionURL=jdbc:mysql://localhost:3306/openjpatst
-Dopenjpa.ConnectionUserName=openjpatst -Dopenjpa.ConnectionPassword=openjpatst
+
+Running against a PostgreSQL Docker installation:
+-ea -Dopenjpa.ConnectionDriverName=org.postgresql.Driver
-Dopenjpa.ConnectionURL=jdbc:postgresql://localhost/openjpatst
-Dopenjpa.ConnectionUserName=postgres -Dopenjpa.ConnectionPassword=postgres
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7315a38..7c1bcf3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,7 +76,9 @@
<derby.version>10.14.2.0</derby.version>
<hsqldb.version>2.4.1</hsqldb.version>
<mysql.connector.version>5.1.47</mysql.connector.version>
- <postgresql.version>42.2.5</postgresql.version>
+
+ <postgresql.connector.version>42.2.5</postgresql.connector.version>
+
<!-- other common versions -->
<slf4j.version>1.7.23</slf4j.version>
<!-- Compile Java source/target class level -->
@@ -654,9 +656,9 @@
</activation>
<dependencies>
<dependency>
- <groupId>postgresql</groupId>
+ <groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
- <version>${postgresql.version}</version>
+ <version>${postgresql.connector.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -674,6 +676,75 @@
</properties>
</profile>
+ <!-- Profile for testing with PostgreSQL DB via Docker -->
+ <profile>
+ <id>test-postgresql-docker</id>
+ <activation>
+ <property>
+ <name>test-postgresql-docker</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${postgresql.connector.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+
<connection.driver.name>org.postgresql.Driver</connection.driver.name>
+
+ <!-- default settings for local docker -->
+
<docker.external.postgresql.port>5432</docker.external.postgresql.port>
+
<openjpa.postgresql.dbname>openjpatst</openjpa.postgresql.dbname>
+
<openjpa.postgresql.username>postgres</openjpa.postgresql.username>
+
<openjpa.postgresql.password>postgres</openjpa.postgresql.password>
+
<openjpa.postgresql.url>jdbc:postgresql://localhost/${openjpa.postgresql.dbname}</openjpa.postgresql.url>
+
+
<!--<connection.url>jdbc:postgresql://localhost/openjpa</connection.url>-->
+ <connection.url>${openjpa.postgresql.url}</connection.url>
+
<connection.username>${openjpa.postgresql.username}</connection.username>
+
<connection.password>${openjpa.postgresql.password}</connection.password>
+ <jdbc.DBDictionary />
+
+ <!-- DBCP overrides -->
+ <dbcp.maxIdle>5</dbcp.maxIdle>
+ <dbcp.minIdle>0</dbcp.minIdle>
+ <dbcp.maxActive>20</dbcp.maxActive>
+
+ <postgresql.server.version>11</postgresql.server.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <configuration>
+ <images>
+ <image>
+
<name>postgres:${postgresql.server.version}</name>
+ <run>
+ <env>
+ <PGDATA>/pg</PGDATA>
+
<POSTGRES_DB>${openjpa.postgresql.dbname}</POSTGRES_DB>
+
<POSTGRES_USER>${connection.username}</POSTGRES_USER>
+
<POSTGRES_PASSWORD>${connection.password}</POSTGRES_PASSWORD>
+ </env>
+ <ports>
+
<port>${docker.external.postgresql.port}:5432</port>
+ </ports>
+ </run>
+ </image>
+ </images>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+
<!-- Profile for testing with SQLServer DB using MS JDBC driver -->
<profile>
<!--
@@ -1428,7 +1499,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
- <version>${postgresql.version}</version>
+ <version>${postgresql.connector.version}</version>
<scope>provided</scope>
</dependency>
<dependency>