You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by sk...@apache.org on 2016/12/03 08:31:50 UTC

cayenne git commit: More thread leaks removed

Repository: cayenne
Updated Branches:
  refs/heads/master 865ee2bf5 -> 263ac1c9e


More thread leaks removed


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

Branch: refs/heads/master
Commit: 263ac1c9e4203ee646a801ab59ffbb078b1aa06b
Parents: 865ee2b
Author: Nikita Timofeev <st...@gmail.com>
Authored: Fri Dec 2 18:17:33 2016 +0300
Committer: Nikita Timofeev <st...@gmail.com>
Committed: Fri Dec 2 18:17:33 2016 +0300

----------------------------------------------------------------------
 .../apache/cayenne/access/DataRowStoreIT.java    | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/263ac1c9/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
index f45babf..8252348 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/DataRowStoreIT.java
@@ -44,10 +44,21 @@ public class DataRowStoreIT extends ServerCase {
 
     private DefaultEventManager eventManager;
 
+    private DataRowStore cache;
+
     @After
     public void cleanEventManager() {
         if(eventManager != null) {
             eventManager.shutdown();
+            eventManager = null;
+        }
+    }
+
+    @After
+    public void cleanDataStore() {
+        if(cache != null) {
+            cache.shutdown();
+            cache = null;
         }
     }
 
@@ -58,7 +69,7 @@ public class DataRowStoreIT extends ServerCase {
 
     @Test
     public void testDefaultConstructor() {
-        DataRowStore cache = new DataRowStore(
+        cache = new DataRowStore(
                 "cacheXYZ",
                 Collections.EMPTY_MAP,
                 eventManager);
@@ -76,7 +87,7 @@ public class DataRowStoreIT extends ServerCase {
         props.put(DataRowStore.REMOTE_NOTIFICATION_PROPERTY, String
                 .valueOf(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT));
 
-        DataRowStore cache = new DataRowStore(
+        cache = new DataRowStore(
                 "cacheXYZ",
                 props,
                 eventManager);
@@ -87,7 +98,7 @@ public class DataRowStoreIT extends ServerCase {
 
     @Test
     public void testNotifyingRemoteListeners() {
-        DataRowStore cache = new DataRowStore(
+        cache = new DataRowStore(
                 "cacheXYZ",
                 Collections.EMPTY_MAP,
                 eventManager);
@@ -108,7 +119,7 @@ public class DataRowStoreIT extends ServerCase {
         Map<Object, Object> props = new HashMap<Object, Object>();
         props.put(DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY, String.valueOf(2));
 
-        DataRowStore cache = new DataRowStore(
+        cache = new DataRowStore(
                 "cacheXYZ",
                 props,
                 eventManager);