cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1546153 - in /cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server: ServerCaseDataSourceFactory.java ServerCaseDataSourceInfoProvider.java
Date Wed, 27 Nov 2013 18:29:01 GMT
Author: aadamchik
Date: Wed Nov 27 18:29:01 2013
New Revision: 1546153

URL: http://svn.apache.org/r1546153
Log:
fixing H2 unit test failures

the fix would ensure we keep at least 2 open connections during the tests, so that
when an (intentional) exception happens in DB operation, closing the connection
doesn't kill the in-memory db

Modified:
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceFactory.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceFactory.java?rev=1546153&r1=1546152&r2=1546153&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceFactory.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceFactory.java
Wed Nov 27 18:29:01 2013
@@ -77,10 +77,10 @@ public class ServerCaseDataSourceFactory
                     dataSourceInfo.getDataSourceUrl());
             return new PoolManager(
                     poolDS,
-                    1,
-                    1,
+                    dataSourceInfo.getMinConnections(),
+                    dataSourceInfo.getMaxConnections(),
                     dataSourceInfo.getUserName(),
-                    dataSourceInfo.getPassword()) {
+                    dataSourceInfo.getPassword(), PoolManager.MAX_QUEUE_WAIT_DEFAULT) {
 
                 @Override
                 public void shutdown() throws SQLException {

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java?rev=1546153&r1=1546152&r2=1546153&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataSourceInfoProvider.java
Wed Nov 27 18:29:01 2013
@@ -76,6 +76,8 @@ public class ServerCaseDataSourceInfoPro
         h2.setPassword("");
         h2.setDataSourceUrl("jdbc:h2:mem:aname;MVCC=TRUE");
         h2.setJdbcDriver("org.h2.Driver");
+        h2.setMinConnections(2);
+        h2.setMaxConnections(2);
         inMemoryDataSources.put("h2", h2);
 
         DataSourceInfo derby = new DataSourceInfo();



Mime
View raw message