You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2015/09/05 00:40:06 UTC

[1/2] incubator-geode git commit: GEODE-77 fixed expected exception in a test

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-77 7956d0652 -> 10035269c


GEODE-77 fixed expected exception in a test


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

Branch: refs/heads/feature/GEODE-77
Commit: d87cf44ab04b046e70f554e22f8110c94aa7000c
Parents: 7956d06
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Fri Sep 4 15:38:46 2015 -0700
Committer: Bruce Schuchardt <bs...@pivotal.io>
Committed: Fri Sep 4 15:38:46 2015 -0700

----------------------------------------------------------------------
 .../cache/client/internal/AutoConnectionSourceDUnitTest.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d87cf44a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
index d600472..6d0c6fc 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java
@@ -17,6 +17,7 @@ import junit.framework.Assert;
 
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.NoAvailableLocatorsException;
 import com.gemstone.gemfire.cache.client.NoAvailableServersException;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.server.CacheServer;
@@ -384,8 +385,8 @@ public class AutoConnectionSourceDUnitTest extends LocatorTestBase {
         System.err.println("Attempt: " + (i++));
         putInVM(vm, regionName, key, value);
         break;
-      } catch (NoAvailableServersException | dunit.RMIException e) {
-        if( !(e instanceof NoAvailableServersException)
+      } catch (NoAvailableLocatorsException | dunit.RMIException e) {
+        if( !(e instanceof NoAvailableLocatorsException)
             && !(e.getCause() instanceof NoAvailableServersException)) {
           throw e;
         }


[2/2] incubator-geode git commit: GEODE-77 modified the test to use the dunit locator

Posted by bs...@apache.org.
GEODE-77 modified the test to use the dunit locator


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

Branch: refs/heads/feature/GEODE-77
Commit: 10035269cf6d3f9245b0b1d6edb93085c606b0c3
Parents: d87cf44
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Fri Sep 4 15:39:41 2015 -0700
Committer: Bruce Schuchardt <bs...@pivotal.io>
Committed: Fri Sep 4 15:39:41 2015 -0700

----------------------------------------------------------------------
 .../gemfire/redis/RedisDistDUnitTest.java       | 30 ++++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/10035269/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
index d3aa334..184de96 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
@@ -5,16 +5,16 @@ import java.util.Random;
 import redis.clients.jedis.Jedis;
 
 import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.SocketCreator;
 
 import dunit.AsyncInvocation;
+import dunit.DistributedTestCase;
 import dunit.Host;
 import dunit.SerializableCallable;
 import dunit.VM;
 
-public class RedisDistDUnitTest extends CacheTestCase {
+public class RedisDistDUnitTest extends DistributedTestCase {
 
   public static final String TEST_KEY = "key";
   public static int pushes = 200;
@@ -28,6 +28,8 @@ public class RedisDistDUnitTest extends CacheTestCase {
   private int server1Port;
   private int server2Port;
   
+  private String localHost = SocketCreator.getLocalHost().getHostName();
+  
   private static final int JEDIS_TIMEOUT = 20 * 1000;
 
   private abstract class ClientTestBase extends SerializableCallable {
@@ -52,24 +54,22 @@ public class RedisDistDUnitTest extends CacheTestCase {
     server2 = host.getVM(1);
     client1 = host.getVM(2);
     client2 = host.getVM(3);  
-    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(3);
+    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+    final int locatorPort = getDUnitLocatorPort();
     final SerializableCallable<Object> startRedisAdapter = new SerializableCallable<Object>() {
 
       private static final long serialVersionUID = 1978017907725504294L;
 
       @Override
       public Object call() throws Exception {
-        int port = ports[VM.getCurrentVMNum()+1];
+        int port = ports[VM.getCurrentVMNum()];
         CacheFactory cF = new CacheFactory();
-        String locator = SocketCreator.getLocalHost().getHostName() + "[" + ports[2] + "]";
-        cF.set("log-level", "info");
-        cF.set("redis-bind-address", "localhost");
+        String locator = SocketCreator.getLocalHost().getHostName() + "[" + locatorPort + "]";
+        cF.set("log-level", getDUnitLogLevel());
+        cF.set("redis-bind-address", localHost);
         cF.set("redis-port", ""+port);
         cF.set("mcast-port", "0");
         cF.set("locators", locator);
-        if (VM.getCurrentVMNum() == 0) {
-          cF.set("start-locator", locator);
-        }
         cF.create();
         return Integer.valueOf(port);
       }
@@ -90,8 +90,8 @@ public class RedisDistDUnitTest extends CacheTestCase {
   }
 
   public void testConcListOps() throws Throwable {
-    final Jedis jedis1 = new Jedis("localhost", server1Port, JEDIS_TIMEOUT);
-    final Jedis jedis2 = new Jedis("localhost", server2Port, JEDIS_TIMEOUT);
+    final Jedis jedis1 = new Jedis(localHost, server1Port, JEDIS_TIMEOUT);
+    final Jedis jedis2 = new Jedis(localHost, server2Port, JEDIS_TIMEOUT);
     final int pushes = 20;
     class ConcListOps extends ClientTestBase {
       protected ConcListOps(int port) {
@@ -100,7 +100,7 @@ public class RedisDistDUnitTest extends CacheTestCase {
 
       @Override
       public Object call() throws Exception {
-        Jedis jedis = new Jedis("localhost", port, JEDIS_TIMEOUT);
+        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
         Random r = new Random();
         for (int i = 0; i < pushes; i++) {
           if (r.nextBoolean()) {
@@ -139,7 +139,7 @@ public class RedisDistDUnitTest extends CacheTestCase {
 
       @Override
       public Object call() throws Exception {
-        Jedis jedis = new Jedis("localhost", port, JEDIS_TIMEOUT);
+        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
         Random r = new Random();
         for (int i = 0; i < ops; i++) {
           int n = r.nextInt(4);
@@ -199,7 +199,7 @@ public class RedisDistDUnitTest extends CacheTestCase {
 
       @Override
       public Object call() throws Exception {
-        Jedis jedis = new Jedis("localhost", port, JEDIS_TIMEOUT);
+        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
         Random r = new Random();
         for (int i = 0; i < ops; i++) {
           int n = r.nextInt(4);