geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject incubator-geode git commit: Fix dunit failures
Date Tue, 15 Mar 2016 18:08:21 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1050 20a35d37e -> e72b7718e


Fix dunit failures


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

Branch: refs/heads/feature/GEODE-1050
Commit: e72b7718e0151137dd49f6cf30ad2b076f5237df
Parents: 20a35d3
Author: Kirk Lund <klund@apache.org>
Authored: Tue Mar 15 11:08:01 2016 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Tue Mar 15 11:08:01 2016 -0700

----------------------------------------------------------------------
 .../gemfire/disttx/CacheMapDistTXDUnitTest.java | 16 +++++++++++++---
 .../sockets/DurableClientBug39997DUnitTest.java |  2 +-
 .../cache/wan/AsyncEventQueueTestBase.java      | 20 +++++++++++---------
 .../internal/tests/JUnit4BasicDUnitTest.java    |  3 +++
 .../cq/dunit/CqDataUsingPoolDUnitTest.java      |  7 ++++++-
 .../gemfire/internal/cache/wan/WANTestBase.java |  4 +---
 6 files changed, 35 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
index fd39f4c..f0ea16d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/disttx/CacheMapDistTXDUnitTest.java
@@ -33,21 +33,31 @@ public class CacheMapDistTXDUnitTest extends CacheMapTxnDUnitTest {
   }
 
   @Override
-  public final void postSetUpCacheMapTxnDUnitTest() throws Exception {
+  public final void preSetUp() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
 
     vm0.invoke(() -> CacheMapDistTXDUnitTest.setDistributedTX());
     vm1.invoke(() -> CacheMapDistTXDUnitTest.setDistributedTX());
+  }
 
-    // super call used to be here
+  @Override
+  public final void postSetUpCacheMapTxnDUnitTest() throws Exception {
+    Host host = Host.getHost(0);
+    VM vm0 = host.getVM(0);
+    VM vm1 = host.getVM(1);
 
-    // make sure that "distributed-transactions" is true 
+    // make sure that "distributed-transactions" is true
     vm0.invoke(() -> CacheMapDistTXDUnitTest.checkIsDistributedTX());
     vm1.invoke(() -> CacheMapDistTXDUnitTest.checkIsDistributedTX());
   }
 
+  @Override
+  public final void postTearDown() throws Exception {
+    props.clear();
+  }
+
   public static void setDistributedTX() {
     props.setProperty(DistributionConfig.DISTRIBUTED_TRANSACTIONS_NAME, "true");
 //    props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
index d9d1172..ad47b8c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientBug39997DUnitTest.java
@@ -124,7 +124,7 @@ public class DurableClientBug39997DUnitTest extends CacheTestCase {
   public Properties getClientProperties() {
     Properties props = new Properties();
     props.setProperty("mcast-port", "0");
-    props.setProperty("locators", "7");
+    props.setProperty("locators", "");
     props.setProperty("durable-client-id", "my_id");
     return props;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
index 2bc51ec..a5b6125 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
@@ -127,7 +127,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   }
 
   @Override
-  public final void postSetUp() throws Exception {
+  public final void preSetUp() throws Exception {
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
@@ -137,12 +137,14 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
     vm5 = host.getVM(5);
     vm6 = host.getVM(6);
     vm7 = host.getVM(7);
+  }
+
+  @Override
+  public final void postSetUp() throws Exception {
     // this is done to vary the number of dispatchers for sender
     // during every test method run
     shuffleNumDispatcherThreads();
-    Invoke.invokeInEveryVM(AsyncEventQueueTestBase.class,
-        "setNumDispatcherThreadsForTheRun",
-        new Object[] { dispatcherThreads.get(0) });
+    Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0)));
   }
 
   public static void shuffleNumDispatcherThreads() {
@@ -159,7 +161,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
     }
     AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
     int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-    Properties props = new Properties();
+    Properties props = test.getDistributedSystemProperties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     //props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "" + dsId);
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port
@@ -173,7 +175,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
   public static Integer createFirstRemoteLocator(int dsId, int remoteLocPort) {
     AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
     int port = AvailablePortHelper.getRandomAvailablePortForDUnitSite();
-    Properties props = new Properties();
+    Properties props = test.getDistributedSystemProperties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.DISTRIBUTED_SYSTEM_ID_NAME, "" + dsId);
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + port
@@ -692,7 +694,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
 
   protected static void createCache(Integer locPort) {
     AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
-    Properties props = new Properties();
+    Properties props = test.getDistributedSystemProperties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
         + "]");
@@ -702,7 +704,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
 
   public static void createCacheWithoutLocator(Integer mCastPort) {
     AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
-    Properties props = new Properties();
+    Properties props = test.getDistributedSystemProperties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "" + mCastPort);
     InternalDistributedSystem ds = test.getSystem(props);
     cache = CacheFactory.create(ds);
@@ -941,7 +943,7 @@ public class AsyncEventQueueTestBase extends DistributedTestCase {
 
   public static int createReceiver(int locPort) {
     AsyncEventQueueTestBase test = new AsyncEventQueueTestBase(getTestMethodName());
-    Properties props = new Properties();
+    Properties props = test.getDistributedSystemProperties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     props.setProperty(DistributionConfig.LOCATORS_NAME, "localhost[" + locPort
         + "]");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
index daf6f46..4860530 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/internal/tests/JUnit4BasicDUnitTest.java
@@ -27,15 +27,18 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /**
  * This class tests the basic functionality of the distributed unit
  * test framework.
  */
+@Category(DistributedTest.class)
 public class JUnit4BasicDUnitTest extends JUnit4DistributedTestCase {
 
   private static Properties bindings;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
index 2efc646..5d77d62 100644
--- a/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/com/gemstone/gemfire/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
@@ -859,7 +859,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
   }
 
   public void testCqStatInitializationTimingIssue() {
-    
+    disconnectAllFromDS();
+
     //The async close can cause this exception on the server
     IgnoredException.addIgnoredException("java.net.SocketException: Broken pipe");
     final String regionName = "testCqStatInitializationTimingIssue";
@@ -1115,6 +1116,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
   }
   
   public void testGetDurableCqsFromServer() {
+    disconnectAllFromDS();
+
     final String regionName = "testGetAllDurableCqsFromServer";
     final String cq1Name = "testCq1";
     final Host host = Host.getHost(0);
@@ -1175,6 +1178,8 @@ public class CqDataUsingPoolDUnitTest extends CacheTestCase {
   }
   
   public void testGetDurableCqsFromServerCycleClients() {
+    disconnectAllFromDS();
+
     final String regionName = "testGetAllDurableCqsFromServerCycleClients";
     final Host host = Host.getHost(0);
     VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e72b7718/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
index 576facb..1a94c26 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
@@ -190,9 +190,7 @@ public class WANTestBase extends DistributedTestCase{
     //this is done to vary the number of dispatchers for sender
     //during every test method run
     shuffleNumDispatcherThreads();
-//    Invoke.invokeInEveryVM(WANTestBase.class,"setNumDispatcherThreadsForTheRun",
-//            new Object[]{dispatcherThreads.get(0)});
-    Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0)));
// TODO: does this work? if so delete previous line
+    Invoke.invokeInEveryVM(() -> setNumDispatcherThreadsForTheRun(dispatcherThreads.get(0)));
     IgnoredException.addIgnoredException("Connection refused");
     IgnoredException.addIgnoredException("Software caused connection abort");
     IgnoredException.addIgnoredException("Connection reset");


Mime
View raw message