cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [4/5] cayenne git commit: ensure consistent connection pool size for the integration tests
Date Mon, 05 Sep 2016 15:04:38 GMT
ensure consistent connection pool size for the integration tests


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/64ae0fb1
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/64ae0fb1
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/64ae0fb1

Branch: refs/heads/master
Commit: 64ae0fb11432d69c7477fbda41ab1e752bf8d2b4
Parents: 66d3f0a
Author: Andrus Adamchik <andrus@objectstyle.com>
Authored: Mon Sep 5 14:37:19 2016 +0300
Committer: Andrus Adamchik <andrus@objectstyle.com>
Committed: Mon Sep 5 17:58:30 2016 +0300

----------------------------------------------------------------------
 .../cayenne/unit/di/server/ConnectionProperties.java    |  7 +++++--
 .../di/server/ServerCaseDataSourceInfoProvider.java     | 12 ++++++------
 2 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/64ae0fb1/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ConnectionProperties.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ConnectionProperties.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ConnectionProperties.java
index b5aa6d1..525fc39 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ConnectionProperties.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ConnectionProperties.java
@@ -35,6 +35,9 @@ import java.util.Map;
  */
 class ConnectionProperties {
 
+	static final int MIN_CONNECTIONS = 1;
+	static final int MAX_CONNECTIONS = 2;
+
 	private static final String ADAPTER_KEY = "adapter";
 	private static final String ADAPTER20_KEY = "cayenne.adapter";
 	private static final String USER_NAME_KEY = "jdbc.username";
@@ -85,8 +88,8 @@ class ConnectionProperties {
 		dsi.setPassword(props.getString(PASSWORD_KEY));
 		dsi.setDataSourceUrl(props.getString(URL_KEY));
 		dsi.setJdbcDriver(props.getString(DRIVER_KEY));
-		dsi.setMinConnections(1);
-		dsi.setMaxConnections(2);
+		dsi.setMinConnections(MIN_CONNECTIONS);
+		dsi.setMaxConnections(MAX_CONNECTIONS);
 
 		return dsi;
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/64ae0fb1/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
index ffef0b9..64d190f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
@@ -68,8 +68,8 @@ public class ServerCaseDataSourceInfoProvider implements Provider<DataSourceInfo
         hsqldb.setPassword("");
         hsqldb.setDataSourceUrl("jdbc:hsqldb:mem:aname");
         hsqldb.setJdbcDriver("org.hsqldb.jdbcDriver");
-        hsqldb.setMinConnections(1);
-        hsqldb.setMaxConnections(2);
+        hsqldb.setMinConnections(ConnectionProperties.MIN_CONNECTIONS);
+        hsqldb.setMaxConnections(ConnectionProperties.MAX_CONNECTIONS);
         inMemoryDataSources.put("hsql", hsqldb);
 
         DataSourceInfo h2 = new DataSourceInfo();
@@ -78,8 +78,8 @@ public class ServerCaseDataSourceInfoProvider implements Provider<DataSourceInfo
         h2.setPassword("");
         h2.setDataSourceUrl("jdbc:h2:mem:aname;MVCC=TRUE;DB_CLOSE_DELAY=-1");
         h2.setJdbcDriver("org.h2.Driver");
-        h2.setMinConnections(1);
-        h2.setMaxConnections(2);
+        h2.setMinConnections(ConnectionProperties.MIN_CONNECTIONS);
+        h2.setMaxConnections(ConnectionProperties.MAX_CONNECTIONS);
         inMemoryDataSources.put("h2", h2);
 
         DataSourceInfo derby = new DataSourceInfo();
@@ -88,8 +88,8 @@ public class ServerCaseDataSourceInfoProvider implements Provider<DataSourceInfo
         derby.setPassword("");
         derby.setDataSourceUrl("jdbc:derby:target/testdb;create=true");
         derby.setJdbcDriver("org.apache.derby.jdbc.EmbeddedDriver");
-        derby.setMinConnections(1);
-        derby.setMaxConnections(2);
+        derby.setMinConnections(ConnectionProperties.MIN_CONNECTIONS);
+        derby.setMaxConnections(ConnectionProperties.MAX_CONNECTIONS);
         inMemoryDataSources.put("derby", derby);
     }
 


Mime
View raw message