cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [2/5] cayenne git commit: ensure consistent connection pool size for the integration tests
Date Mon, 05 Sep 2016 15:04:36 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/574eefb9
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/574eefb9
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/574eefb9

Branch: refs/heads/master
Commit: 574eefb97b3785053b7e1c8db18e20aa00d20316
Parents: d8e5afe
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 14:37:19 2016 +0300

----------------------------------------------------------------------
 .../unit/di/server/ConnectionProperties.java        |  8 +++++---
 .../di/server/ServerCaseDataSourceInfoProvider.java | 16 ++++++++++------
 2 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/574eefb9/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 3a66b5b..b5aa6d1 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
@@ -19,15 +19,15 @@
 
 package org.apache.cayenne.unit.di.server;
 
+import org.apache.cayenne.conn.DataSourceInfo;
+import org.apache.commons.collections.ExtendedProperties;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cayenne.conn.DataSourceInfo;
-import org.apache.commons.collections.ExtendedProperties;
-
 /**
  * ConnectionProperties handles a set of DataSourceInfo objects using
  * information stored in $HOME/.cayenne/connection.properties. As of now this is
@@ -85,6 +85,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);
 
 		return dsi;
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/574eefb9/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 1e657ef..ffef0b9 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
@@ -18,11 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.unit.di.server;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.dba.derby.DerbyAdapter;
@@ -33,6 +28,11 @@ import org.apache.commons.collections.ExtendedProperties;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
 public class ServerCaseDataSourceInfoProvider implements Provider<DataSourceInfo> {
 
     private static Log logger = LogFactory.getLog(ServerCaseDataSourceInfoProvider.class);
@@ -68,6 +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);
         inMemoryDataSources.put("hsql", hsqldb);
 
         DataSourceInfo h2 = new DataSourceInfo();
@@ -76,7 +78,7 @@ 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(2);
+        h2.setMinConnections(1);
         h2.setMaxConnections(2);
         inMemoryDataSources.put("h2", h2);
 
@@ -86,6 +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);
         inMemoryDataSources.put("derby", derby);
     }
 


Mime
View raw message