cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1072886 - /cayenne/main/tags/3.1M2/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/CayenneResources.java
Date Mon, 21 Feb 2011 08:55:55 GMT
Author: aadamchik
Date: Mon Feb 21 08:55:55 2011
New Revision: 1072886

URL: http://svn.apache.org/viewvc?rev=1072886&view=rev
Log:
CAY-1542 DI container is not shutting down Cayenne-managed connection pool

making sure PoolManager can be reused in the test lifecycle

(cherry picked from commit 7e6228c0a6e0ddda1a8b92c52e24e9cb083b20ea)

Modified:
    cayenne/main/tags/3.1M2/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/CayenneResources.java

Modified: cayenne/main/tags/3.1M2/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/CayenneResources.java
URL: http://svn.apache.org/viewvc/cayenne/main/tags/3.1M2/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/CayenneResources.java?rev=1072886&r1=1072885&r2=1072886&view=diff
==============================================================================
--- cayenne/main/tags/3.1M2/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/CayenneResources.java
(original)
+++ cayenne/main/tags/3.1M2/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/CayenneResources.java
Mon Feb 21 08:55:55 2011
@@ -20,6 +20,7 @@
 package org.apache.cayenne.unit;
 
 import java.io.InputStream;
+import java.sql.SQLException;
 import java.util.Map;
 
 import javax.sql.DataSource;
@@ -107,8 +108,6 @@ public class CayenneResources implements
         return resources;
     }
 
-
-
     public CayenneResources(Map adapterMap) {
         this.adapterMap = adapterMap;
     }
@@ -237,7 +236,15 @@ public class CayenneResources implements
                     1,
                     1,
                     connectionInfo.getUserName(),
-                    connectionInfo.getPassword());
+                    connectionInfo.getPassword()) {
+
+                @Override
+                public void shutdown() throws SQLException {
+                    // noop - make sure we are not shutdown by the test scope, but at the
+                    // same time PoolManager methods are exposed (so we can't wrap
+                    // PoolManager)
+                }
+            };
         }
         catch (Exception ex) {
             logger.error("Can not create shared data source.", ex);



Mime
View raw message