[41/47] geode git commit: Revert BlockingHARegionJUnitTest

2017-05-31 Thread klund
Revert BlockingHARegionJUnitTest


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

Branch: refs/heads/feature/GEODE-2632-18
Commit: dee71176c40a079ddc642fcaf528101b28f55e68
Parents: 409b59b
Author: Kirk Lund 
Authored: Wed May 24 19:13:53 2017 -0700
Committer: Kirk Lund 
Committed: Wed May 31 13:25:44 2017 -0700

--
 .../cache/ha/BlockingHARegionJUnitTest.java | 494 ++-
 1 file changed, 270 insertions(+), 224 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/dee71176/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
index 1534192..d0f5793 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
@@ -14,116 +14,76 @@
  */
 package org.apache.geode.internal.cache.ha;
 
-import static java.util.concurrent.TimeUnit.*;
 import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.internal.cache.ha.HARegionQueue.*;
 import static org.junit.Assert.*;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Properties;
 
-import org.awaitility.Awaitility;
-import org.awaitility.core.ConditionFactory;
-import org.junit.After;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Before;
 import org.junit.Ignore;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.cache.EventID;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.dunit.ThreadUtils;
-import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
+import org.apache.geode.test.dunit.Wait;
+import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.junit.categories.IntegrationTest;
-import 
org.apache.geode.test.junit.rules.serializable.SerializableErrorCollector;
 
-/**
- * Integration tests for Blocking HARegionQueue.
- *
- * 
- * #40314: Filled up queue causes all publishers to block
- *
- * 
- * #37627: In case of out of order messages, (sequence Id violation), in spite 
of HARQ not full, the
- * capacity (putPermits) of the HARQ exhausted.
- */
 @Category({IntegrationTest.class, ClientSubscriptionTest.class})
 public class BlockingHARegionJUnitTest {
 
-  public static final String REGION = "BlockingHARegionJUnitTest_Region";
-  private static final long THREAD_TIMEOUT = 2 * 60 * 1000;
-
-  private final Object numberForThreadsLock = new Object();
-  private int numberForDoPuts;
-  private int numberForDoTakes;
-
-  volatile boolean stopThreads;
+  private static InternalCache cache = null;
 
-  private InternalCache cache;
-  private HARegionQueueAttributes queueAttributes;
-  private List threads;
-  private ThreadGroup threadGroup;
-
-  @Rule
-  public SerializableErrorCollector errorCollector = new 
SerializableErrorCollector();
+  /** boolean to record an exception occurence in another thread **/
+  private static volatile boolean exceptionOccurred = false;
+  /** StringBuffer to store the exception **/
+  private static StringBuffer exceptionString = new StringBuffer();
+  /** boolen to quit the for loop **/
+  private static volatile boolean quitForLoop = false;
 
   @Before
   public void setUp() throws Exception {
-synchronized (this.numberForThreadsLock) {
-  this.numberForDoPuts = 0;
-  this.numberForDoTakes = 0;
-}
-
-this.stopThreads = false;
-this.threads = new ArrayList<>();
-this.threadGroup = new ThreadGroup(getClass().getSimpleName()) {
-  @Override
-  public void uncaughtException(Thread t, Throwable e) {
-errorCollector.addError(e);
-  }
-};
-
-this.queueAttributes = new HARegionQueueAttributes();
-
-Properties config = new Properties();
-config.setProperty(MCAST_PORT, "0");
-
-this.cache = (InternalCache) 
CacheFactory.create(DistributedSystem.connect(config));
-  }
-
-  @After
-  public void tearDown() throws Exception {
-try {
-  this.stopThreads = true;
-  for 

[38/43] geode git commit: Revert BlockingHARegionJUnitTest

2017-05-30 Thread klund
Revert BlockingHARegionJUnitTest


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/91c13dab
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/91c13dab
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/91c13dab

Branch: refs/heads/feature/GEODE-2632-17
Commit: 91c13dabf3d5591d8e08cfeddf3b13feb7058503
Parents: 4f6a7a7
Author: Kirk Lund 
Authored: Wed May 24 19:13:53 2017 -0700
Committer: Kirk Lund 
Committed: Tue May 30 10:21:11 2017 -0700

--
 .../cache/ha/BlockingHARegionJUnitTest.java | 494 ++-
 1 file changed, 270 insertions(+), 224 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/91c13dab/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
index 1534192..d0f5793 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
@@ -14,116 +14,76 @@
  */
 package org.apache.geode.internal.cache.ha;
 
-import static java.util.concurrent.TimeUnit.*;
 import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.internal.cache.ha.HARegionQueue.*;
 import static org.junit.Assert.*;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Properties;
 
-import org.awaitility.Awaitility;
-import org.awaitility.core.ConditionFactory;
-import org.junit.After;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Before;
 import org.junit.Ignore;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.cache.EventID;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.dunit.ThreadUtils;
-import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
+import org.apache.geode.test.dunit.Wait;
+import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.junit.categories.IntegrationTest;
-import 
org.apache.geode.test.junit.rules.serializable.SerializableErrorCollector;
 
-/**
- * Integration tests for Blocking HARegionQueue.
- *
- * 
- * #40314: Filled up queue causes all publishers to block
- *
- * 
- * #37627: In case of out of order messages, (sequence Id violation), in spite 
of HARQ not full, the
- * capacity (putPermits) of the HARQ exhausted.
- */
 @Category({IntegrationTest.class, ClientSubscriptionTest.class})
 public class BlockingHARegionJUnitTest {
 
-  public static final String REGION = "BlockingHARegionJUnitTest_Region";
-  private static final long THREAD_TIMEOUT = 2 * 60 * 1000;
-
-  private final Object numberForThreadsLock = new Object();
-  private int numberForDoPuts;
-  private int numberForDoTakes;
-
-  volatile boolean stopThreads;
+  private static InternalCache cache = null;
 
-  private InternalCache cache;
-  private HARegionQueueAttributes queueAttributes;
-  private List threads;
-  private ThreadGroup threadGroup;
-
-  @Rule
-  public SerializableErrorCollector errorCollector = new 
SerializableErrorCollector();
+  /** boolean to record an exception occurence in another thread **/
+  private static volatile boolean exceptionOccurred = false;
+  /** StringBuffer to store the exception **/
+  private static StringBuffer exceptionString = new StringBuffer();
+  /** boolen to quit the for loop **/
+  private static volatile boolean quitForLoop = false;
 
   @Before
   public void setUp() throws Exception {
-synchronized (this.numberForThreadsLock) {
-  this.numberForDoPuts = 0;
-  this.numberForDoTakes = 0;
-}
-
-this.stopThreads = false;
-this.threads = new ArrayList<>();
-this.threadGroup = new ThreadGroup(getClass().getSimpleName()) {
-  @Override
-  public void uncaughtException(Thread t, Throwable e) {
-errorCollector.addError(e);
-  }
-};
-
-this.queueAttributes = new HARegionQueueAttributes();
-
-Properties config = new Properties();
-config.setProperty(MCAST_PORT, "0");
-
-this.cache = (InternalCache) 
CacheFactory.create(DistributedSystem.connect(config));
-  }
-
-  @After
-  public void tearDown() throws Exception {
-try {
-  this.stopThreads = true;
-  for 

geode git commit: Revert BlockingHARegionJUnitTest

2017-05-24 Thread klund
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2632-17 5cf271d22 -> 41e2eccd1


Revert BlockingHARegionJUnitTest


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/41e2eccd
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/41e2eccd
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/41e2eccd

Branch: refs/heads/feature/GEODE-2632-17
Commit: 41e2eccd1b92f85b47eb99471b528b2021c4733c
Parents: 5cf271d
Author: Kirk Lund 
Authored: Wed May 24 19:13:53 2017 -0700
Committer: Kirk Lund 
Committed: Wed May 24 19:13:53 2017 -0700

--
 .../cache/ha/BlockingHARegionJUnitTest.java | 494 ++-
 1 file changed, 270 insertions(+), 224 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/geode/blob/41e2eccd/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
--
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
index 1534192..d0f5793 100755
--- 
a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
+++ 
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java
@@ -14,116 +14,76 @@
  */
 package org.apache.geode.internal.cache.ha;
 
-import static java.util.concurrent.TimeUnit.*;
 import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.internal.cache.ha.HARegionQueue.*;
 import static org.junit.Assert.*;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Properties;
 
-import org.awaitility.Awaitility;
-import org.awaitility.core.ConditionFactory;
-import org.junit.After;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
 import org.junit.Before;
 import org.junit.Ignore;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.cache.EventID;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.dunit.ThreadUtils;
-import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
+import org.apache.geode.test.dunit.Wait;
+import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.junit.categories.IntegrationTest;
-import 
org.apache.geode.test.junit.rules.serializable.SerializableErrorCollector;
 
-/**
- * Integration tests for Blocking HARegionQueue.
- *
- * 
- * #40314: Filled up queue causes all publishers to block
- *
- * 
- * #37627: In case of out of order messages, (sequence Id violation), in spite 
of HARQ not full, the
- * capacity (putPermits) of the HARQ exhausted.
- */
 @Category({IntegrationTest.class, ClientSubscriptionTest.class})
 public class BlockingHARegionJUnitTest {
 
-  public static final String REGION = "BlockingHARegionJUnitTest_Region";
-  private static final long THREAD_TIMEOUT = 2 * 60 * 1000;
-
-  private final Object numberForThreadsLock = new Object();
-  private int numberForDoPuts;
-  private int numberForDoTakes;
-
-  volatile boolean stopThreads;
+  private static InternalCache cache = null;
 
-  private InternalCache cache;
-  private HARegionQueueAttributes queueAttributes;
-  private List threads;
-  private ThreadGroup threadGroup;
-
-  @Rule
-  public SerializableErrorCollector errorCollector = new 
SerializableErrorCollector();
+  /** boolean to record an exception occurence in another thread **/
+  private static volatile boolean exceptionOccurred = false;
+  /** StringBuffer to store the exception **/
+  private static StringBuffer exceptionString = new StringBuffer();
+  /** boolen to quit the for loop **/
+  private static volatile boolean quitForLoop = false;
 
   @Before
   public void setUp() throws Exception {
-synchronized (this.numberForThreadsLock) {
-  this.numberForDoPuts = 0;
-  this.numberForDoTakes = 0;
-}
-
-this.stopThreads = false;
-this.threads = new ArrayList<>();
-this.threadGroup = new ThreadGroup(getClass().getSimpleName()) {
-  @Override
-  public void uncaughtException(Thread t, Throwable e) {
-errorCollector.addError(e);
-  }
-};
-
-this.queueAttributes = new HARegionQueueAttributes();
-
-Properties config = new Properties();
-config.setProperty(MCAST_PORT, "0");
-
-this.cache = (InternalCache) 
CacheFactory.create(DistributedSystem.connect(config));
-  }
-
-  @After
-