cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [2/3] cayenne git commit: Delete all usages of EventManager
Date Sat, 17 Dec 2016 12:19:30 GMT
Delete all usages of EventManager


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

Branch: refs/heads/master
Commit: 82944a4f9a45e6eb5e782c0430b6e9d9c4452646
Parents: 862818d
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Fri Dec 16 10:28:15 2016 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Fri Dec 16 10:28:15 2016 +0300

----------------------------------------------------------------------
 .../apache/cayenne/access/DataRowStoreIT.java   | 34 ++++++--------------
 1 file changed, 9 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/82944a4f/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 96016e3..54ce5a1 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
@@ -21,13 +21,11 @@ package org.apache.cayenne.access;
 
 import org.apache.cayenne.DataRow;
 import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 
 import java.util.Collections;
@@ -39,22 +37,17 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
+/**
+ * We pass null as EventManager parameter, as having it not null will start
+ * really heavy EventBridge (JavaGroupsBridge implementation) inside DataRowStore
+ * and this behaviour is not anyhow tested here nor it affects existing tests.
+ */
 @UseServerRuntime(CayenneProjects.TESTMAP_PROJECT)
 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();
@@ -62,20 +55,12 @@ public class DataRowStoreIT extends ServerCase {
         }
     }
 
-    @Before
-    public void createEventManager() {
-        // we don't actually need any event manager here, as having it will start
-        // really heavy Event Bridge (jgroups bridge) inside DataRowStore and this behaviour
-        // is not anyhow tested here nor it affects existing tests.
-        eventManager = null;//new DefaultEventManager();
-    }
-
     @Test
     public void testDefaultConstructor() {
         cache = new DataRowStore(
                 "cacheXYZ",
                 Collections.EMPTY_MAP,
-                eventManager);
+                null);
         assertEquals("cacheXYZ", cache.getName());
         assertNotNull(cache.getSnapshotEventSubject());
         assertTrue(cache.getSnapshotEventSubject().getSubjectName().contains("cacheXYZ"));
@@ -89,11 +74,10 @@ public class DataRowStoreIT extends ServerCase {
         Map<Object, Object> props = new HashMap<Object, Object>();
         props.put(DataRowStore.REMOTE_NOTIFICATION_PROPERTY, String
                 .valueOf(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT));
-
         cache = new DataRowStore(
                 "cacheXYZ",
                 props,
-                eventManager);
+                null);
         assertEquals("cacheXYZ", cache.getName());
         assertEquals(!DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
                 .isNotifyingRemoteListeners());
@@ -104,7 +88,7 @@ public class DataRowStoreIT extends ServerCase {
         cache = new DataRowStore(
                 "cacheXYZ",
                 Collections.EMPTY_MAP,
-                eventManager);
+                null);
 
         assertEquals(DataRowStore.REMOTE_NOTIFICATION_DEFAULT, cache
                 .isNotifyingRemoteListeners());
@@ -125,7 +109,7 @@ public class DataRowStoreIT extends ServerCase {
         cache = new DataRowStore(
                 "cacheXYZ",
                 props,
-                eventManager);
+                null);
         assertEquals(2, cache.maximumSize());
         assertEquals(0, cache.size());
 


Mime
View raw message