jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1129206 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ConcurrentGcTest.java
Date Mon, 30 May 2011 14:53:03 GMT
Author: jukka
Date: Mon May 30 14:53:03 2011
New Revision: 1129206

URL: http://svn.apache.org/viewvc?rev=1129206&view=rev
Log:
JCR-2026: DbDataStore: garbage collection deadlock

Make sure that the test database connection pool gets closed so that the test directory can
be cleared also on Windows.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ConcurrentGcTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ConcurrentGcTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ConcurrentGcTest.java?rev=1129206&r1=1129205&r2=1129206&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ConcurrentGcTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ConcurrentGcTest.java
Mon May 30 14:53:03 2011
@@ -86,19 +86,24 @@ public class ConcurrentGcTest extends Te
     }
 
     private void doTestDatabase(String driver, String url, String user, String password)
throws Exception {
-        DbDataStore store = new DbDataStore();
-        store.setConnectionFactory(new ConnectionFactory());
-
-        ids.clear();
-
-        store.setDriver(driver);
-        store.setUrl(url);
-        store.setUser(user);
-        store.setPassword(password);
-
-        store.init("target/test-db-datastore");
-        store.setMinRecordLength(0);
-        doTest(store);
+        ConnectionFactory pool = new ConnectionFactory();
+        try {
+            DbDataStore store = new DbDataStore();
+            store.setConnectionFactory(pool);
+
+            ids.clear();
+
+            store.setDriver(driver);
+            store.setUrl(url);
+            store.setUser(user);
+            store.setPassword(password);
+
+            store.init("target/test-db-datastore");
+            store.setMinRecordLength(0);
+            doTest(store);
+        } finally {
+            pool.close();
+        }
     }
 
     public void testFile() throws Exception {



Mime
View raw message