You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/07/08 18:21:12 UTC

[04/21] incubator-geode git commit: GEODE-1566: rename GeodeRedisServer and repackage redis code into org.apache.geode

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
deleted file mode 100644
index c10e521..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.redis;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.util.Random;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import redis.clients.jedis.Jedis;
-
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.ConfigurationProperties;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.internal.SocketCreator;
-import com.gemstone.gemfire.test.dunit.AsyncInvocation;
-import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
-import com.gemstone.gemfire.test.dunit.Host;
-import com.gemstone.gemfire.test.dunit.IgnoredException;
-import com.gemstone.gemfire.test.dunit.LogWriterUtils;
-import com.gemstone.gemfire.test.dunit.SerializableCallable;
-import com.gemstone.gemfire.test.dunit.VM;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-
-@Category(DistributedTest.class)
-public class RedisDistDUnitTest extends JUnit4DistributedTestCase {
-
-  public static final String TEST_KEY = "key";
-  public static int pushes = 200;
-  int redisPort = 6379;
-  private Host host;
-  private VM server1;
-  private VM server2;
-  private VM client1;
-  private VM client2;
-
-  private int server1Port;
-  private int server2Port;
-  
-  private String localHost;
-  
-  private static final int JEDIS_TIMEOUT = 20 * 1000;
-
-  private abstract class ClientTestBase extends SerializableCallable {
-
-    int port;
-
-    protected ClientTestBase (int port) {
-      this.port = port;
-    }
-  }
-
-  @Override
-  public final void postSetUp() throws Exception {
-    disconnectAllFromDS();
-
-    localHost = SocketCreator.getLocalHost().getHostName();
-
-    host = Host.getHost(0);
-    server1 = host.getVM(0);
-    server2 = host.getVM(1);
-    client1 = host.getVM(2);
-    client2 = host.getVM(3);  
-    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    final int locatorPort = DistributedTestUtils.getDUnitLocatorPort();
-    final SerializableCallable<Object> startRedisAdapter = new SerializableCallable<Object>() {
-
-      @Override
-      public Object call() throws Exception {
-        int port = ports[VM.getCurrentVMNum()];
-        CacheFactory cF = new CacheFactory();
-        String locator = SocketCreator.getLocalHost().getHostName() + "[" + locatorPort + "]";
-        cF.set(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
-        cF.set(ConfigurationProperties.REDIS_BIND_ADDRESS, localHost);
-        cF.set(ConfigurationProperties.REDIS_PORT, "" + port);
-        cF.set(MCAST_PORT, "0");
-        cF.set(LOCATORS, locator);
-        cF.create();
-        return Integer.valueOf(port);
-      }
-    };
-    AsyncInvocation i = server1.invokeAsync(startRedisAdapter);
-    server2Port = (Integer) server2.invoke(startRedisAdapter);
-    server1Port = (Integer) i.getResult();
-  }
-
-  @Override
-  public final void preTearDown() throws Exception {
-    disconnectAllFromDS();
-  }
-
-  @Category(FlakyTest.class) // GEODE-1092: random ports, failure stack involves TCPTransport ConnectionHandler (are we eating BindExceptions somewhere?), uses Random, async actions
-  @Test
-  public void testConcListOps() throws Exception {
-    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) {
-        super(port);
-      }
-
-      @Override
-      public Object call() throws Exception {
-        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
-        Random r = new Random();
-        for (int i = 0; i < pushes; i++) {
-          if (r.nextBoolean()) {
-            jedis.lpush(TEST_KEY, randString());
-          } else {
-            jedis.rpush(TEST_KEY, randString());
-          }
-        }
-        return null;
-      }
-    };
-
-    AsyncInvocation i = client1.invokeAsync(new ConcListOps(server1Port));
-    client2.invoke(new ConcListOps(server2Port));
-    i.getResult();
-    long expected = 2 * pushes;
-    long result1 = jedis1.llen(TEST_KEY);
-    long result2 = jedis2.llen(TEST_KEY);
-    assertEquals(expected, result1);
-    assertEquals(result1, result2);
-  }
-
-  @Category(FlakyTest.class) // GEODE-717: random ports, BindException in failure stack, async actions
-  @Test
-  public void testConcCreateDestroy() throws Exception {
-    IgnoredException.addIgnoredException("RegionDestroyedException");
-    IgnoredException.addIgnoredException("IndexInvalidException");
-    final int ops = 40;
-    final String hKey = TEST_KEY+"hash";
-    final String lKey = TEST_KEY+"list";
-    final String zKey = TEST_KEY+"zset";
-    final String sKey = TEST_KEY+"set";
-
-    class ConcCreateDestroy extends ClientTestBase{
-      protected ConcCreateDestroy(int port) {
-        super(port);
-      }
-
-      @Override
-      public Object call() throws Exception {
-        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
-        Random r = new Random();
-        for (int i = 0; i < ops; i++) {
-          int n = r.nextInt(4);
-          if (n == 0) {
-            if (r.nextBoolean()) {
-              jedis.hset(hKey, randString(), randString());
-            } else {
-              jedis.del(hKey);
-            }
-          } else if (n == 1) {
-            if (r.nextBoolean()) {
-              jedis.lpush(lKey, randString());
-            } else {
-              jedis.del(lKey);
-            }
-          } else if (n == 2) {
-            if (r.nextBoolean()) {
-              jedis.zadd(zKey, r.nextDouble(), randString());
-            } else {
-              jedis.del(zKey);
-            }
-          } else {
-            if (r.nextBoolean()) {
-              jedis.sadd(sKey, randString());
-            } else {
-              jedis.del(sKey);
-            }
-          }
-        }
-        return null;
-      }
-    }
-
-    // Expect to run with no exception
-    AsyncInvocation i = client1.invokeAsync(new ConcCreateDestroy(server1Port));
-    client2.invoke(new ConcCreateDestroy(server2Port));
-    i.getResult();
-  }
-
-  /**
-   * Just make sure there are no unexpected server crashes
-   */
-  @Test
-  public void testConcOps() throws Exception {
-
-    final int ops = 100;
-    final String hKey = TEST_KEY+"hash";
-    final String lKey = TEST_KEY+"list";
-    final String zKey = TEST_KEY+"zset";
-    final String sKey = TEST_KEY+"set";
-
-    class ConcOps extends ClientTestBase {
-
-      protected ConcOps(int port) {
-        super(port);
-      }
-
-      @Override
-      public Object call() throws Exception {
-        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
-        Random r = new Random();
-        for (int i = 0; i < ops; i++) {
-          int n = r.nextInt(4);
-          if (n == 0) {
-            jedis.hset(hKey, randString(), randString());
-            jedis.hgetAll(hKey);
-            jedis.hvals(hKey);
-          } else if (n == 1) {
-            jedis.lpush(lKey, randString());
-            jedis.rpush(lKey, randString());
-            jedis.ltrim(lKey, 0, 100);
-            jedis.lrange(lKey, 0, -1);
-          } else if (n == 2) {
-            jedis.zadd(zKey, r.nextDouble(), randString());
-            jedis.zrangeByLex(zKey, "(a", "[z");
-            jedis.zrangeByScoreWithScores(zKey, 0, 1, 0, 100);
-            jedis.zremrangeByScore(zKey, r.nextDouble(), r.nextDouble());
-          } else {
-            jedis.sadd(sKey, randString());
-            jedis.smembers(sKey);
-            jedis.sdiff(sKey, "afd");
-            jedis.sunionstore("dst", sKey, "afds");
-          }
-        }
-        return null;
-      }
-    }
-
-    // Expect to run with no exception
-    AsyncInvocation i = client1.invokeAsync(new ConcOps(server1Port));
-    client2.invoke(new ConcOps(server2Port));
-    i.getResult();
-  }
-
-  private String randString() {
-    return Long.toHexString(Double.doubleToLongBits(Math.random()));
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/com/gemstone/gemfire/redis/SetsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/redis/SetsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/redis/SetsJUnitTest.java
deleted file mode 100755
index 7872e41..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/redis/SetsJUnitTest.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.redis;
-
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.GemFireCache;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import redis.clients.jedis.Jedis;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Random;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-@Category(IntegrationTest.class)
-public class SetsJUnitTest {
-
-  private static Jedis jedis;
-  private static GemFireRedisServer server;
-  private static GemFireCache cache;
-  private static Random rand;
-  private static int port = 6379;
-
-  @BeforeClass
-  public static void setUp() throws IOException {
-    rand = new Random();
-    CacheFactory cf = new CacheFactory();
-    //cf.set("log-file", "redis.log");
-    cf.set(LOG_LEVEL, "error");
-    cf.set(MCAST_PORT, "0");
-    cf.set(LOCATORS, "");
-    cache = cf.create();
-    port = AvailablePortHelper.getRandomAvailableTCPPort();
-    server = new GemFireRedisServer("localhost", port);
-
-    server.start();
-    jedis = new Jedis("localhost", port, 10000000);
-  }
-
-  @Test
-  public void testSAddScard() {
-    int elements = 10;
-    Set<String> strings = new HashSet<String>();
-    String key = randString();
-    for (int i = 0; i < elements; i++) {
-      String elem = randString();
-      strings.add(elem);
-    }
-    String[] stringArray = strings.toArray(new String[strings.size()]);
-    Long response = jedis.sadd(key, stringArray);
-    assertEquals(response, new Long(strings.size()));
-
-    assertEquals(jedis.scard(key), new Long(strings.size()));
-  }
-
-  @Test
-  public void testSMembersIsMember() {
-    int elements = 10;
-    Set<String> strings = new HashSet<String>();
-    String key = randString();
-    for (int i = 0; i < elements; i++) {
-      String elem = randString();
-      strings.add(elem);
-    }
-    String[] stringArray = strings.toArray(new String[strings.size()]);
-    jedis.sadd(key, stringArray);
-
-    Set<String> returnedSet = jedis.smembers(key);
-
-    assertEquals(returnedSet, new HashSet<String>(strings));
-
-    for (String entry: strings) {
-      boolean exists = jedis.sismember(key, entry);
-      assertTrue(exists);
-    }
-  }
-
-  @Test
-  public void testSMove() {
-    String source = randString();
-    String dest = randString();
-    String test = randString();
-    int elements = 10;
-    Set<String> strings = new HashSet<String>();
-    for (int i = 0; i < elements; i++) {
-      String elem = randString();
-      strings.add(elem);
-    }
-    String[] stringArray = strings.toArray(new String[strings.size()]);
-    jedis.sadd(source, stringArray);
-
-    long i = 1;
-    for (String entry: strings) {
-      assertTrue(jedis.smove(source, dest, entry) == 1);
-      assertTrue(jedis.sismember(dest, entry));
-      assertTrue(jedis.scard(source) == strings.size() - i);
-      assertTrue(jedis.scard(dest) == i);
-      i++;
-    }
-
-    assertTrue(jedis.smove(test, dest, randString()) == 0);
-  }
-
-  @Test
-  public void testSDiffAndStore() {
-    int numSets = 3;
-    int elements = 10;
-    String[] keys = new String[numSets];
-    ArrayList<Set<String>> sets = new ArrayList<Set<String>>();
-    for (int j = 0; j < numSets; j++) {
-      keys[j] = randString();
-      Set<String> newSet = new HashSet<String>();
-      for (int i = 0; i < elements; i++)
-        newSet.add(randString());
-      sets.add(newSet);
-    }
-    
-    for (int i = 0; i < numSets; i++) {
-      Set<String> s = sets.get(i);
-      String[] stringArray = s.toArray(new String[s.size()]);
-      jedis.sadd(keys[i], stringArray);
-    }
-    
-    Set<String> result = sets.get(0);
-    for (int i = 1; i < numSets; i++)
-      result.removeAll(sets.get(i));
-    
-    assertEquals(result, jedis.sdiff(keys));
-    
-    String destination = randString();
-    
-    jedis.sdiffstore(destination, keys);
-    
-    Set<String> destResult = jedis.smembers(destination);
-    
-    assertEquals(result, destResult);
-    
-  }
-  
-  @Test
-  public void testSUnionAndStore() {
-    int numSets = 3;
-    int elements = 10;
-    String[] keys = new String[numSets];
-    ArrayList<Set<String>> sets = new ArrayList<Set<String>>();
-    for (int j = 0; j < numSets; j++) {
-      keys[j] = randString();
-      Set<String> newSet = new HashSet<String>();
-      for (int i = 0; i < elements; i++)
-        newSet.add(randString());
-      sets.add(newSet);
-    }
-    
-    for (int i = 0; i < numSets; i++) {
-      Set<String> s = sets.get(i);
-      String[] stringArray = s.toArray(new String[s.size()]);
-      jedis.sadd(keys[i], stringArray);
-    }
-    
-    Set<String> result = sets.get(0);
-    for (int i = 1; i < numSets; i++)
-      result.addAll(sets.get(i));
-    
-    assertEquals(result, jedis.sunion(keys));
-    
-    String destination = randString();
-    
-    jedis.sunionstore(destination, keys);
-    
-    Set<String> destResult = jedis.smembers(destination);
-    
-    assertEquals(result, destResult);
-    
-  }
-  
-  @Test
-  public void testSInterAndStore() {
-    int numSets = 3;
-    int elements = 10;
-    String[] keys = new String[numSets];
-    ArrayList<Set<String>> sets = new ArrayList<Set<String>>();
-    for (int j = 0; j < numSets; j++) {
-      keys[j] = randString();
-      Set<String> newSet = new HashSet<String>();
-      for (int i = 0; i < elements; i++)
-        newSet.add(randString());
-      sets.add(newSet);
-    }
-    
-    for (int i = 0; i < numSets; i++) {
-      Set<String> s = sets.get(i);
-      String[] stringArray = s.toArray(new String[s.size()]);
-      jedis.sadd(keys[i], stringArray);
-    }
-    
-    Set<String> result = sets.get(0);
-    for (int i = 1; i < numSets; i++)
-      result.retainAll(sets.get(i));
-    
-    assertEquals(result, jedis.sinter(keys));
-    
-    String destination = randString();
-    
-    jedis.sinterstore(destination, keys);
-    
-    Set<String> destResult = jedis.smembers(destination);
-    
-    assertEquals(result, destResult);
-    
-  }
-
-  private String randString() {
-    int length = rand.nextInt(8) + 5;
-    StringBuilder rString = new StringBuilder();
-    for (int i = 0; i < length; i++)
-      rString.append((char) (rand.nextInt(57) + 65));
-    return rString.toString();
-    //return Long.toHexString(Double.doubleToLongBits(Math.random()));
-  }
-
-  @After
-  public void flushAll() {
-    jedis.flushAll();
-  }
-
-  @AfterClass
-  public static void tearDown() {
-    jedis.close();
-    cache.close();
-    server.shutdown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java
deleted file mode 100755
index aeba535..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/redis/SortedSetsJUnitTest.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.redis;
-
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.GemFireCache;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import redis.clients.jedis.Jedis;
-import redis.clients.jedis.Tuple;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.Map.Entry;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-@Category(IntegrationTest.class)
-public class SortedSetsJUnitTest {
-  private static Jedis jedis;
-  private static GemFireRedisServer server;
-  private static GemFireCache cache;
-  private static Random rand;
-  private static int port = 6379;
-
-  @BeforeClass
-  public static void setUp() throws IOException {
-    rand = new Random();
-    CacheFactory cf = new CacheFactory();
-    //cf.set("log-file", "redis.log");
-    cf.set(LOG_LEVEL, "error");
-    cf.set(MCAST_PORT, "0");
-    cf.set(LOCATORS, "");
-    cache = cf.create();
-    port = AvailablePortHelper.getRandomAvailableTCPPort();
-    server = new GemFireRedisServer("localhost", port);
-
-    server.start();
-    jedis = new Jedis("localhost", port, 10000000);
-  }
-
-  @Test
-  public void testZAddZRange() {
-    int numMembers = 10;
-    String key = randString();
-    Map<String, Double> scoreMembers = new HashMap<String, Double>();
-
-    for (int i = 0; i < numMembers; i++)
-      scoreMembers.put(randString(), rand.nextDouble());
-
-    jedis.zadd(key, scoreMembers);
-    int k = 0;
-    for (String entry: scoreMembers.keySet())
-      assertNotNull(jedis.zscore(key, entry));
-
-    Set<Tuple> results = jedis.zrangeWithScores(key, 0, -1);
-    Map<String, Double> resultMap = new HashMap<String, Double>();
-    for (Tuple t: results) {
-      resultMap.put(t.getElement(), t.getScore());
-    }
-
-    assertEquals(scoreMembers, resultMap);
-
-    for (int i = 0; i < 10; i++) {
-      int start;
-      int stop;
-      do {
-        start = rand.nextInt(numMembers);
-        stop = rand.nextInt(numMembers);
-      } while (start > stop);
-      results = jedis.zrangeWithScores(key, start, stop);
-      List<Entry<String, Double>> resultList = new ArrayList<Entry<String, Double>>();
-      for (Tuple t: results)
-        resultList.add(new AbstractMap.SimpleEntry<String, Double>(t.getElement(), t.getScore()));
-      List<Entry<String, Double>> list = new ArrayList<Entry<String, Double>>(scoreMembers.entrySet());
-      Collections.sort(list, new EntryCmp());
-      list = list.subList(start, stop + 1);
-      assertEquals(list, resultList);
-    }
-  }
-
-  @Test
-  public void testZRevRange() {
-    int numMembers = 10;
-    String key = randString();
-
-    Map<String, Double> scoreMembers = new HashMap<String, Double>();
-
-    for (int i = 0; i < numMembers; i++)
-      scoreMembers.put(randString(), rand.nextDouble());
-
-    jedis.zadd(key, scoreMembers);
-
-    Set<Tuple> results;
-
-    for (int i = 0; i < 10; i++) {
-      int start;
-      int stop;
-      do {
-        start = rand.nextInt(numMembers);
-        stop = rand.nextInt(numMembers);
-      } while (start > stop);
-      results = jedis.zrevrangeWithScores(key, start, stop);
-      List<Entry<String, Double>> resultList = new ArrayList<Entry<String, Double>>();
-      for (Tuple t: results)
-        resultList.add(new AbstractMap.SimpleEntry<String, Double>(t.getElement(), t.getScore()));
-      List<Entry<String, Double>> list = new ArrayList<Entry<String, Double>>(scoreMembers.entrySet());
-      Collections.sort(list, new EntryRevCmp());
-      list = list.subList(start, stop + 1);
-      assertEquals(list, resultList);
-    }
-  }
-
-  @Test
-  public void testZCount() {
-    int num = 10;
-    int runs = 2;
-    for (int i = 0; i < runs; i++) {
-      Double min;
-      Double max;
-      do {
-        min = rand.nextDouble();
-        max = rand.nextDouble();
-      } while (min > max);
-
-
-      int count = 0;
-
-      String key = randString();
-      Map<String, Double> scoreMembers = new HashMap<String, Double>();
-
-      for (int j = 0; j < num; j++) {
-        Double nextDouble = rand.nextDouble();
-        if (nextDouble >= min && nextDouble <= max)
-          count++;
-        scoreMembers.put(randString(), nextDouble);
-      }
-
-      jedis.zadd(key, scoreMembers);
-      Long countResult = jedis.zcount(key, min, max);
-      assertTrue(count == countResult);
-    }
-
-  }
-
-  @Test
-  public void testZIncrBy() {
-    String key = randString();
-    String member = randString();
-    Double score = 0.0;
-    for (int i = 0; i < 20; i++) {
-      Double incr = rand.nextDouble();
-      Double result = jedis.zincrby(key, incr, member);
-      score += incr;
-      assertEquals(score, result, 1.0/100000000.0);
-    }
-
-
-    jedis.zincrby(key, Double.MAX_VALUE, member);
-    Double infResult = jedis.zincrby(key, Double.MAX_VALUE, member);
-
-
-    assertEquals(infResult, Double.valueOf(Double.POSITIVE_INFINITY));
-  }
-
-  public void testZRangeByScore() {
-    Double min;
-    Double max;
-    for (int j = 0; j < 2; j++) {
-      do {
-        min = rand.nextDouble();
-        max = rand.nextDouble();
-      } while (min > max);
-      int numMembers = 500;
-      String key = randString();
-      Map<String, Double> scoreMembers = new HashMap<String, Double>();
-      List<Entry<String, Double>> expected = new ArrayList<Entry<String, Double>>();
-      for (int i = 0; i < numMembers; i++) {
-        String s = randString();
-        Double d = rand.nextDouble();
-        scoreMembers.put(s, d);
-        if (d > min && d < max)
-          expected.add(new AbstractMap.SimpleEntry<String, Double>(s, d));
-      }
-      jedis.zadd(key, scoreMembers);
-      Set<Tuple> results = jedis.zrangeByScoreWithScores(key, min, max);
-      List<Entry<String, Double>> resultList = new ArrayList<Entry<String, Double>>();
-      for (Tuple t: results)
-        resultList.add(new AbstractMap.SimpleEntry<String, Double>(t.getElement(), t.getScore()));
-      Collections.sort(expected, new EntryCmp());
-
-      assertEquals(expected, resultList);
-      jedis.del(key);
-    }
-  }
-
-  public void testZRevRangeByScore() {
-    Double min;
-    Double max;
-    for (int j = 0; j < 2; j++) {
-      do {
-        min = rand.nextDouble();
-        max = rand.nextDouble();
-      } while (min > max);
-      int numMembers = 500;
-      String key = randString();
-      Map<String, Double> scoreMembers = new HashMap<String, Double>();
-      List<Entry<String, Double>> expected = new ArrayList<Entry<String, Double>>();
-      for (int i = 0; i < numMembers; i++) {
-        String s = randString();
-        Double d = rand.nextDouble();
-        scoreMembers.put(s, d);
-        if (d > min && d < max)
-          expected.add(new AbstractMap.SimpleEntry<String, Double>(s, d));
-      }
-      jedis.zadd(key, scoreMembers);
-      Set<Tuple> results = jedis.zrevrangeByScoreWithScores(key, max, min);
-      List<Entry<String, Double>> resultList = new ArrayList<Entry<String, Double>>();
-      for (Tuple t: results)
-        resultList.add(new AbstractMap.SimpleEntry<String, Double>(t.getElement(), t.getScore()));
-      Collections.sort(expected, new EntryRevCmp());
-
-      assertEquals(expected, resultList);
-      jedis.del(key);
-    }
-  }
-
-  @Test
-  public void testZRemZScore() {
-    Double min;
-    Double max;
-    for (int j = 0; j < 2; j++) {
-      do {
-        min = rand.nextDouble();
-        max = rand.nextDouble();
-      } while (min > max);
-      int numMembers = 5000;
-      String key = randString();
-      Map<String, Double> scoreMembers = new HashMap<String, Double>();
-      List<Entry<String, Double>> expected = new ArrayList<Entry<String, Double>>();
-      for (int i = 0; i < numMembers; i++) {
-        String s = randString();
-        Double d = rand.nextDouble();
-        scoreMembers.put(s, d);
-        if (d > min && d < max)
-          expected.add(new AbstractMap.SimpleEntry<String, Double>(s, d));
-      }
-      jedis.zadd(key, scoreMembers);
-      Collections.sort(expected, new EntryCmp());
-      for (int i = expected.size(); i > 0; i--) {
-        Entry<String, Double> remEntry = expected.remove(i-1);
-        String rem = remEntry.getKey();
-        Double val = remEntry.getValue();
-        assertEquals(val, jedis.zscore(key, rem));
-
-        assertTrue(jedis.zrem(key, rem) == 1);
-      }
-      String s = randString();
-      if (!expected.contains(s))
-        assertTrue(jedis.zrem(key, s) == 0);
-      jedis.del(key);
-    }
-  }
-
-  @Test
-  public void testZRank() {
-    for (int j = 0; j < 2; j++) {
-      int numMembers = 10;
-      String key = randString();
-      Map<String, Double> scoreMembers = new HashMap<String, Double>();
-      List<Entry<String, Double>> expected = new ArrayList<Entry<String, Double>>();
-      for (int i = 0; i < numMembers; i++) {
-        String s = randString();
-        Double d = rand.nextDouble();
-        scoreMembers.put(s, d);
-        expected.add(new AbstractMap.SimpleEntry<String, Double>(s, d));
-      }
-      Collections.sort(expected, new EntryCmp());
-      jedis.zadd(key, scoreMembers);
-      for (int i = 0; i < expected.size(); i++) {
-        Entry<String, Double> en = expected.get(i);
-        String field = en.getKey();
-        Long rank = jedis.zrank(key, field);
-        assertEquals(new Long(i), rank);
-      }
-      String field = randString();
-      if (!expected.contains(field))
-        assertNull(jedis.zrank(key, field));
-      jedis.del(key);
-    }
-  }
-
-  @Test
-  public void testZRevRank() {
-    for (int j = 0; j < 2; j++) {
-      int numMembers = 10;
-      String key = randString();
-      Map<String, Double> scoreMembers = new HashMap<String, Double>();
-      List<Entry<String, Double>> expected = new ArrayList<Entry<String, Double>>();
-      for (int i = 0; i < numMembers; i++) {
-        String s = randString();
-        Double d = rand.nextDouble();
-        scoreMembers.put(s, d);
-        expected.add(new AbstractMap.SimpleEntry<String, Double>(s, d));
-      }
-      Collections.sort(expected, new EntryRevCmp());
-      jedis.zadd(key, scoreMembers);
-      for (int i = 0; i < expected.size(); i++) {
-        Entry<String, Double> en = expected.get(i);
-        String field = en.getKey();
-        Long rank = jedis.zrevrank(key, field);
-        assertEquals(new Long(i), rank);
-      }
-      String field = randString();
-      if (!expected.contains(field))
-        assertNull(jedis.zrank(key, field));
-      jedis.del(key);
-    }
-  }
-
-  private class EntryCmp implements Comparator<Entry<String, Double>> {
-
-    @Override
-    public int compare(Entry<String, Double> o1, Entry<String, Double> o2) {
-      Double diff = o1.getValue() - o2.getValue();
-      if (diff == 0) 
-        return o2.getKey().compareTo(o1.getKey());
-      else
-        return diff > 0 ? 1 : -1;
-    }
-
-  }
-
-  private class EntryRevCmp implements Comparator<Entry<String, Double>> {
-
-    @Override
-    public int compare(Entry<String, Double> o1, Entry<String, Double> o2) {
-      Double diff = o2.getValue() - o1.getValue();
-      if (diff == 0) 
-        return o1.getKey().compareTo(o2.getKey());
-      else
-        return diff > 0 ? 1 : -1;
-    }
-
-  }
-
-  @Test
-  public void testZRemRangeByScore() {
-    Double min;
-    Double max;
-    for (int j = 0; j < 3; j++) {
-      do {
-        min = rand.nextDouble();
-        max = rand.nextDouble();
-      } while (min > max);
-      int numMembers = 10;
-      String key = randString();
-      Map<String, Double> scoreMembers = new HashMap<String, Double>();
-      List<Entry<String, Double>> fullList = new ArrayList<Entry<String, Double>>();
-      List<Entry<String, Double>> toRemoveList = new ArrayList<Entry<String, Double>>();
-      for (int i = 0; i < numMembers; i++) {
-        String s = randString();
-        Double d = rand.nextDouble();
-        scoreMembers.put(s, d);
-        fullList.add(new AbstractMap.SimpleEntry<String, Double>(s, d));
-        if (d > min && d < max)
-          toRemoveList.add(new AbstractMap.SimpleEntry<String, Double>(s, d));
-      }
-      jedis.zadd(key, scoreMembers);
-      Long numRemoved = jedis.zremrangeByScore(key, min, max);
-      List<Entry<String, Double>> expectedList = new ArrayList<Entry<String, Double>>(fullList);
-      expectedList.removeAll(toRemoveList);
-      Collections.sort(expectedList, new EntryCmp());
-      Set<Tuple> result = jedis.zrangeWithScores(key, 0, -1);
-      List<Entry<String, Double>> resultList = new ArrayList<Entry<String, Double>>();
-      for (Tuple t: result)
-        resultList.add(new AbstractMap.SimpleEntry<String, Double>(t.getElement(), t.getScore()));
-      assertEquals(expectedList, resultList);
-      jedis.del(key);
-    }
-  }
-
-  private String randString() {
-    return Long.toHexString(Double.doubleToLongBits(Math.random()));
-  }
-
-  @After
-  public void flushAll() {
-    jedis.flushAll();
-  }
-
-  @AfterClass
-  public static void tearDown() {
-    jedis.close();
-    cache.close();
-    server.shutdown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/com/gemstone/gemfire/redis/StringsJunitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/redis/StringsJunitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/redis/StringsJunitTest.java
deleted file mode 100755
index 1c31356..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/redis/StringsJunitTest.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.redis;
-
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.GemFireCache;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import redis.clients.jedis.Jedis;
-
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-@Category(IntegrationTest.class)
-public class StringsJunitTest {
-
-  private static Jedis jedis;
-  private static GemFireRedisServer server;
-  private static GemFireCache cache;
-  private static Random rand;
-  private static int port = 6379;
-
-  @BeforeClass
-  public static void setUp() throws IOException {
-    rand = new Random();
-    CacheFactory cf = new CacheFactory();
-    //cf.set("log-file", "redis.log");
-    cf.set(LOG_LEVEL, "error");
-    cf.set(MCAST_PORT, "0");
-    cf.set(LOCATORS, "");
-    cache = cf.create();
-    port = AvailablePortHelper.getRandomAvailableTCPPort();
-    server = new GemFireRedisServer("localhost", port);
-
-    server.start();
-    jedis = new Jedis("localhost", port, 10000000);
-  }
-
-  @Test
-  public void testAppendAndStrlen() {
-    String key = randString();
-    int len = key.length();
-    String full = key;
-    jedis.set(key, key);
-    for (int i = 0; i < 15; i++) {
-      String rand = randString();
-      jedis.append(key, rand);
-      len += rand.length();
-      full += rand;
-    }
-    String ret = jedis.get(key);
-    assertTrue(ret.length() == len);
-    assertTrue(full.equals(ret));
-    assertTrue(full.length() == jedis.strlen(key));
-  }
-
-  @Test
-  public void testDecr() {
-    String key1 = randString();
-    String key2 = randString();
-    String key3 = randString();
-    int num1 = 100;
-    int num2 = -100;
-    jedis.set(key1, ""+num1);
-    //jedis.set(key3, "-100");
-    jedis.set(key2, ""+num2);
-
-    jedis.decr(key1);
-    jedis.decr(key3);
-    jedis.decr(key2);
-    assertTrue(jedis.get(key1).equals("" + (num1 - 1)));
-    assertTrue(jedis.get(key2).equals("" + (num2 - 1)));
-    assertTrue(jedis.get(key3).equals("" + (-1)));
-  }
-
-  @Test
-  public void testIncr() {
-    String key1 = randString();
-    String key2 = randString();
-    String key3 = randString();
-    int num1 = 100;
-    int num2 = -100;
-    jedis.set(key1, ""+num1);
-    //jedis.set(key3, "-100");
-    jedis.set(key2, ""+num2);
-
-    jedis.incr(key1);
-    jedis.incr(key3);
-    jedis.incr(key2);
-
-    assertTrue(jedis.get(key1).equals("" + (num1 + 1)));
-    assertTrue(jedis.get(key2).equals("" + (num2 + 1)));
-    assertTrue(jedis.get(key3).equals("" + (+1)));
-  }
-
-  @Test
-  public void testDecrBy() {
-    String key1 = randString();
-    String key2 = randString();
-    String key3 = randString();
-    int decr1 = rand.nextInt(100);
-    int decr2 = rand.nextInt(100);
-    Long decr3 = Long.MAX_VALUE/2;
-    int num1 = 100;
-    int num2 = -100;
-    jedis.set(key1, ""+num1);
-    jedis.set(key2, ""+num2);
-    jedis.set(key3, ""+Long.MIN_VALUE);
-
-    jedis.decrBy(key1, decr1);
-    jedis.decrBy(key2, decr2);
-
-    assertTrue(jedis.get(key1).equals("" + (num1 - decr1*1)));
-    assertTrue(jedis.get(key2).equals("" + (num2 - decr2*1)));
-
-    Exception ex= null;
-    try {
-      jedis.decrBy(key3, decr3);
-    } catch(Exception e) {
-      ex = e;
-    }
-    assertNotNull(ex);
-
-  }  
-
-  @Test
-  public void testIncrBy() {
-    String key1 = randString();
-    String key2 = randString();
-    String key3 = randString();
-    int incr1 = rand.nextInt(100);
-    int incr2 = rand.nextInt(100);
-    Long incr3 = Long.MAX_VALUE/2;
-    int num1 = 100;
-    int num2 = -100;
-    jedis.set(key1, ""+num1);
-    jedis.set(key2, ""+num2);
-    jedis.set(key3, ""+Long.MAX_VALUE);
-
-    jedis.incrBy(key1, incr1);
-    jedis.incrBy(key2, incr2);
-    assertTrue(jedis.get(key1).equals("" + (num1 + incr1*1)));
-    assertTrue(jedis.get(key2).equals("" + (num2 + incr2*1)));
-
-    Exception ex= null;
-    try {
-      jedis.incrBy(key3, incr3);
-    } catch(Exception e) {
-      ex = e;
-    }
-    assertNotNull(ex);
-  }
-
-  @Test
-  public void testGetRange() {
-    String sent = randString();
-    String contents = randString();
-    jedis.set(sent, contents);
-    for (int i = 0; i < sent.length(); i++) {
-      String range = jedis.getrange(sent, i, -1);
-      assertTrue(contents.substring(i).equals(range));
-    }
-    assertNull(jedis.getrange(sent, 2,0));
-  }
-
-  @Test
-  public void testGetSet() {
-    String key = randString();
-    String contents = randString();
-    jedis.set(key, contents);
-    String newContents = randString();
-    String oldContents = jedis.getSet(key, newContents);
-    assertTrue(oldContents.equals(contents));
-    contents = newContents;
-  }
-
-  @Test
-  public void testMSetAndGet() {
-    int r = 5;
-    String[] keyvals = new String[(r*2)];
-    String[] keys = new String[r];
-    String[] vals = new String[r];
-    for(int i = 0; i < r; i++) {
-      String key = randString();
-      String val = randString();
-      keyvals[2*i] = key;
-      keyvals[2*i+1] = val;
-      keys[i] = key;
-      vals[i] = val;
-    }
-
-    jedis.mset(keyvals);
-
-    List<String> ret = jedis.mget(keys);
-    Object[] retArray =  ret.toArray();
-
-    assertTrue(Arrays.equals(vals, retArray));
-  }
-
-  @Test
-  public void testMSetNX() {
-    Set<String> strings = new HashSet<String>();
-    for(int i = 0; i < 2 * 5; i++)
-      strings.add(randString());
-    String[] array = strings.toArray(new String[0]);
-    long response = jedis.msetnx(array);
-
-    assertTrue(response == 1);
-
-    long response2 = jedis.msetnx(array[0], randString());
-
-    assertTrue(response2 == 0);
-    assertEquals(array[1], jedis.get(array[0]));
-  }
-
-  @Test
-  public void testSetNX() {
-    String key1 = randString();
-    String key2;
-    do {
-      key2 = randString();
-    } while (key2.equals(key1));
-
-    long response1 = jedis.setnx(key1, key1);
-    long response2 = jedis.setnx(key2, key2);
-    long response3 = jedis.setnx(key1, key2);
-
-    assertTrue(response1 == 1);
-    assertTrue(response2 == 1);
-    assertTrue(response3 == 0);
-  }
-
-  @Test
-  public void testPAndSetex() {
-    Random r = new Random();
-    int setex = r.nextInt(5);
-    if (setex == 0)
-      setex = 1;
-    String key = randString();
-    jedis.setex(key, setex, randString());
-    try {
-      Thread.sleep((setex  + 5) * 1000);
-    } catch (InterruptedException e) {
-      return;
-    }
-    String result = jedis.get(key);
-    //System.out.println(result);
-    assertNull(result);
-
-    int psetex = r.nextInt(5000);
-    if (psetex == 0)
-      psetex = 1;
-    key = randString();
-    jedis.psetex(key, psetex, randString());
-    long start = System.currentTimeMillis();
-    try {
-      Thread.sleep(psetex + 5000);
-    } catch (InterruptedException e) {
-      return;
-    }
-    long stop = System.currentTimeMillis();
-    result = jedis.get(key);
-    assertTrue(stop - start >= psetex);
-    assertNull(result);
-  }
-
-  private String randString() {
-    return Long.toHexString(Double.doubleToLongBits(Math.random()));
-  }
-
-  @After
-  public void flushAll() {
-    jedis.flushAll();
-  }
-
-  @AfterClass
-  public static void tearDown() {
-    jedis.close();
-    cache.close();
-    server.shutdown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/org/apache/geode/redis/AuthJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/redis/AuthJUnitTest.java b/geode-core/src/test/java/org/apache/geode/redis/AuthJUnitTest.java
new file mode 100644
index 0000000..0a4c0b8
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/redis/AuthJUnitTest.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.distributed.ConfigurationProperties;
+import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+import org.apache.geode.redis.GeodeRedisServer;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.exceptions.JedisDataException;
+
+import java.io.IOException;
+import java.util.Random;
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.junit.Assert.*;
+
+@Category(IntegrationTest.class)
+public class AuthJUnitTest {
+
+  private static final String PASSWORD = "pwd";
+  Jedis jedis;
+  GeodeRedisServer server;
+  GemFireCache cache;
+  Random rand;
+  int port;
+
+  int runs = 150;
+
+  @Before
+  public void setUp() throws IOException {
+    rand = new Random();
+    port = AvailablePortHelper.getRandomAvailableTCPPort();
+    this.jedis = new Jedis("localhost", port, 100000);
+  }
+
+  @After
+  public void tearDown() throws InterruptedException {
+    server.shutdown();
+    cache.close();
+  }
+  private void setupCacheWithPassword() {
+    CacheFactory cf = new CacheFactory();
+    cf.set(LOG_LEVEL, "error");
+    cf.set(MCAST_PORT, "0");
+    cf.set(LOCATORS, "");
+    cf.set(ConfigurationProperties.REDIS_PASSWORD, PASSWORD);
+    cache = cf.create();
+    server = new GeodeRedisServer("localhost", port);
+    server.start();
+  }
+
+  @Test
+  public void testAuthConfig() {
+    setupCacheWithPassword();
+    InternalDistributedSystem iD = (InternalDistributedSystem) cache.getDistributedSystem();
+    assert(iD.getConfig().getRedisPassword().equals(PASSWORD));
+  }
+
+  @Test
+  public void testAuthRejectAccept() {
+    setupCacheWithPassword();
+    Exception ex = null;
+    try {                        
+      jedis.auth("wrongpwd");
+    } catch (JedisDataException e) {
+      ex = e;
+    }
+    assertNotNull(ex);
+
+    String res = jedis.auth(PASSWORD);
+    assertEquals(res, "OK");
+  }
+
+  @Test
+  public void testAuthNoPwd() {
+    CacheFactory cf = new CacheFactory();
+    cf.set(LOG_LEVEL, "error");
+    cf.set(MCAST_PORT, "0");
+    cf.set(LOCATORS, "");
+    cache = cf.create();
+    server = new GeodeRedisServer("localhost", port);
+    server.start();
+
+    Exception ex = null;
+    try {                        
+      jedis.auth(PASSWORD);
+    } catch (JedisDataException e) {
+      ex = e;
+    }
+    assertNotNull(ex);
+  }
+
+  @Test
+  public void testAuthAcceptRequests() {
+    setupCacheWithPassword();
+    Exception ex = null;
+    try {                        
+      jedis.set("foo", "bar");
+    } catch (JedisDataException e) {
+      ex = e;
+    }
+    assertNotNull(ex);
+
+    String res = jedis.auth(PASSWORD);
+    assertEquals(res, "OK");
+
+    jedis.set("foo", "bar"); // No exception
+  }
+
+  @Test
+  public void testSeparateClientRequests() {
+    setupCacheWithPassword();
+    Jedis authorizedJedis = null;
+    Jedis nonAuthorizedJedis = null;
+    try {
+      authorizedJedis =  new Jedis("localhost", port, 100000);
+      nonAuthorizedJedis = new Jedis("localhost", port, 100000);
+      String res = authorizedJedis.auth(PASSWORD);
+      assertEquals(res, "OK");
+      authorizedJedis.set("foo", "bar"); // No exception for authorized client
+
+      authorizedJedis.auth(PASSWORD);
+      Exception ex = null;
+      try {                        
+        nonAuthorizedJedis.set("foo", "bar");
+      } catch (JedisDataException e) {
+        ex = e;
+      }
+      assertNotNull(ex);
+    } finally {
+      if (authorizedJedis != null)
+        authorizedJedis.close();
+      if (nonAuthorizedJedis != null)
+        nonAuthorizedJedis.close();
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/org/apache/geode/redis/ConcurrentStartTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/redis/ConcurrentStartTest.java b/geode-core/src/test/java/org/apache/geode/redis/ConcurrentStartTest.java
new file mode 100644
index 0000000..e5d9e1c
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/redis/ConcurrentStartTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+import org.apache.geode.redis.GeodeRedisServer;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.contrib.java.lang.system.RestoreSystemProperties;
+import org.junit.experimental.categories.Category;
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.LOCATORS;
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.junit.Assert.assertFalse;
+
+@Category(IntegrationTest.class)
+public class ConcurrentStartTest {
+
+  private Cache cache;
+  private int numServers = 10;
+  
+  @Rule
+  public RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
+  
+  @Before
+  public void setUp() {
+    System.setProperty(DistributedSystem.PROPERTIES_FILE_PROPERTY, getClass().getSimpleName() + ".properties");
+  }
+
+  @After
+  public void tearDown() {
+    if (this.cache != null) {
+      this.cache.close();
+      this.cache = null;
+    }
+  }
+  
+  @Test
+  public void testCachelessStart() throws InterruptedException {
+    runNServers(numServers);
+    GemFireCacheImpl.getInstance().close();
+  }
+  
+  @Test
+  public void testCachefulStart() throws InterruptedException {
+    CacheFactory cf = new CacheFactory();
+    cf.set(MCAST_PORT, "0");
+    cf.set(LOCATORS, "");
+    this.cache = cf.create();
+    
+    runNServers(numServers);
+  }
+  
+  private void runNServers(int n) throws InterruptedException {
+    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(numServers);
+    final Thread[] threads = new Thread[n];
+    for (int i = 0; i < n; i++) {
+      final int j = i;
+      Runnable r = new Runnable() {
+
+        @Override
+        public void run() {
+          GeodeRedisServer s = new GeodeRedisServer(ports[j]);
+          s.start();
+          s.shutdown();
+        }
+      };
+      
+      Thread t = new Thread(r);
+      t.setDaemon(true);
+      t.start();
+      threads[i] = t;
+    }
+    for (Thread t : threads)
+      t.join();
+    this.cache = GemFireCacheImpl.getInstance();
+    assertFalse(this.cache.isClosed());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/org/apache/geode/redis/HashesJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/redis/HashesJUnitTest.java b/geode-core/src/test/java/org/apache/geode/redis/HashesJUnitTest.java
new file mode 100755
index 0000000..f219d81
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/redis/HashesJUnitTest.java
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+import org.apache.geode.redis.GeodeRedisServer;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import redis.clients.jedis.Jedis;
+
+import java.io.IOException;
+import java.util.*;
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.junit.Assert.*;
+
+@Category(IntegrationTest.class)
+public class HashesJUnitTest {
+  private static Jedis jedis;
+  private static GeodeRedisServer server;
+  private static GemFireCache cache;
+  private static Random rand;
+  private static int port = 6379;
+
+  @BeforeClass
+  public static void setUp() throws IOException {
+    rand = new Random();
+    CacheFactory cf = new CacheFactory();
+    //cf.set("log-file", "redis.log");
+    cf.set(LOG_LEVEL, "error");
+    cf.set(MCAST_PORT, "0");
+    cf.set(LOCATORS, "");
+    cache = cf.create();
+    port = AvailablePortHelper.getRandomAvailableTCPPort();
+    server = new GeodeRedisServer("localhost", port);
+
+    server.start();
+    jedis = new Jedis("localhost", port, 10000000);
+  }
+
+  @Test
+  public void testHMSetHSetHLen() {
+    int num = 10;
+    String key = randString();
+    Map<String, String> hash = new HashMap<String, String>();
+    for (int i = 0; i < num; i++) {
+      hash.put(randString(), randString());
+    }
+    String response = jedis.hmset(key, hash);
+    assertTrue(response.equals("OK"));
+    assertEquals(new Long(hash.size()), jedis.hlen(key));
+
+    key = randString();
+    hash = new HashMap<String, String>();
+    for (int i = 0; i < num; i++) {
+      hash.put(randString(), randString());
+    }
+    Set<String> keys = hash.keySet();
+    Long count = 1L;
+    for (String field: keys) {
+      Long res = jedis.hset(key, field, hash.get(field));
+      assertTrue(res == 1L);
+      assertEquals(count++, jedis.hlen(key));
+    }
+  }
+
+  @Test
+  public void testHMGetHDelHGetAllHVals() {
+    String key = randString();
+    Map<String, String> hash = new HashMap<String, String>();
+    for (int i = 0; i < 10; i++) {
+      String m = randString();
+      String f = randString();
+      hash.put(m, f);
+    }
+    jedis.hmset(key, hash);
+    Set<String> keys = hash.keySet();
+    String[] keyArray = keys.toArray(new String[keys.size()]);
+    List<String> retList = jedis.hmget(key, keyArray);
+
+    for (int i = 0; i < keys.size(); i++) {
+      assertEquals(retList.get(i), hash.get(keyArray[i]));
+    }
+
+    Map<String, String> retMap = jedis.hgetAll(key);
+
+    assertEquals(retMap, hash);
+
+    List<String> retVals = jedis.hvals(key);
+    Set<String> retSet = new HashSet<String>(retVals);
+
+    assertTrue(retSet.containsAll(hash.values()));
+
+    jedis.hdel(key, keyArray);
+    assertTrue(jedis.hlen(key) == 0);
+  }
+
+  @Test
+  public void testHkeys() {
+    String key = randString();
+    Map<String, String> hash = new HashMap<String, String>();
+    for (int i = 0; i < 10; i++) {
+      hash.put(randString(), randString());
+    }
+    String response = jedis.hmset(key, hash);
+
+    Set<String> keys = hash.keySet();
+    Set<String> retSet = jedis.hkeys(key);
+
+    assertTrue(retSet.containsAll(keys));
+  }
+
+  @Test
+  public void testHIncrBy() {
+    String key = randString();
+    String field = randString();
+
+    Long incr = (long) rand.nextInt(50);
+    if (incr == 0)
+      incr++;
+
+    long response1 = jedis.hincrBy(key, field, incr);
+    assertTrue(response1 == incr);
+
+    long response2 = jedis.hincrBy(randString(), randString(), incr);
+    assertTrue(response2 == incr);
+
+    long response3 = jedis.hincrBy(key, field, incr);
+    assertTrue(response3 == 2*incr);
+
+
+    String field1 = randString();
+    Exception ex = null;
+    try {
+      jedis.hincrBy(key, field1, Long.MAX_VALUE);
+      jedis.hincrBy(key, field1, incr);
+    } catch (Exception e) {
+      ex = e;
+    }
+
+    assertNotNull(ex);
+  }
+
+  private String randString() {
+    int length = rand.nextInt(8) + 5;
+    StringBuilder rString = new StringBuilder();
+    for (int i = 0; i < length; i++)
+      rString.append((char) (rand.nextInt(57) + 65));
+    return rString.toString();
+    //return Long.toHexString(Double.doubleToLongBits(Math.random()));
+  }
+
+  @After
+  public void flushAll() {
+    jedis.flushAll();
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    jedis.close();
+    cache.close();
+    server.shutdown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/org/apache/geode/redis/ListsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/redis/ListsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/redis/ListsJUnitTest.java
new file mode 100755
index 0000000..82654e2
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/redis/ListsJUnitTest.java
@@ -0,0 +1,253 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+import org.apache.geode.redis.GeodeRedisServer;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import redis.clients.jedis.Jedis;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.junit.Assert.*;
+
+@Category(IntegrationTest.class)
+public class ListsJUnitTest {
+
+  private static Jedis jedis;
+  private static GeodeRedisServer server;
+  private static GemFireCache cache;
+  private static Random rand;
+  private static int port = 6379;
+
+  @BeforeClass
+  public static void setUp() throws IOException {
+    rand = new Random();
+    CacheFactory cf = new CacheFactory();
+    //cf.set("log-file", "redis.log");
+    cf.set(LOG_LEVEL, "error");
+    cf.set(MCAST_PORT, "0");
+    cf.set(LOCATORS, "");
+    cache = cf.create();
+    port = AvailablePortHelper.getRandomAvailableTCPPort();
+    server = new GeodeRedisServer("localhost", port);
+
+    server.start();
+    jedis = new Jedis("localhost", port, 10000000);
+  }
+
+  @Test
+  public void testLindex() {
+    int elements = 50;
+    ArrayList<String> strings = new ArrayList<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.rpush(key, stringArray);
+    
+
+    for (int i = 0; i < elements; i++) {
+      String gemString = jedis.lindex(key, i);
+      String s = strings.get(i);
+      assertEquals(gemString, s);
+    }
+  }
+
+  @Test
+  public void testLPopRPush() {
+    int elements = 50;
+    ArrayList<String> strings = new ArrayList<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.rpush(key, stringArray);
+
+    for (int i = 0; i < elements; i++) {
+      String gemString = jedis.lpop(key);
+      String s = strings.get(i);
+      assertEquals(s, gemString);
+    }
+  }
+
+  @Test
+  public void testRPopLPush() {
+    int elements = 500;
+    ArrayList<String> strings = new ArrayList<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.lpush(key, stringArray);
+
+    for (int i = 0; i < elements; i++) {
+      String gemString = jedis.rpop(key);
+      String s = strings.get(i);
+      assertEquals(gemString, s);
+    }
+
+  }
+
+  @Test
+  public void testLRange() {
+    int elements = 10;
+    ArrayList<String> strings = new ArrayList<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.rpush(key, stringArray);
+
+    for (int i = 0; i < elements; i++) {
+      List<String> range = jedis.lrange(key, 0, i);
+      assertEquals(range, strings.subList(0, i+1));
+    }
+
+    for (int i = 0; i < elements; i++) {
+      List<String> range = jedis.lrange(key, i, -1);
+      assertEquals(range, strings.subList(i, strings.size()));
+    }
+  }
+
+  @Test
+  public void testLTrim() {
+    int elements = 5;
+    ArrayList<String> strings = new ArrayList<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.rpush(key, stringArray);
+    // Take off last element one at a time
+    for (int i = elements - 1; i >= 0; i--) {
+      jedis.ltrim(key, 0, i);
+      List<String> range = jedis.lrange(key, 0, -1);
+      assertEquals(range, strings.subList(0, i+1));
+    }
+    jedis.rpop(key);
+    jedis.rpush(key, stringArray);
+    // Take off first element one at a time
+    for (int i = 1; i < elements; i++) {
+      jedis.ltrim(key, 1, -1);
+      List<String> range = jedis.lrange(key, 0, -1);
+      List<String> expected = strings.subList(i, strings.size());
+      assertEquals(range, expected);
+    }
+  }
+
+  @Test
+  public void testLRPushX() {
+    String key = randString();
+    String otherKey = "Other key";
+    jedis.lpush(key, randString());
+    assertTrue(jedis.lpushx(key, randString()) > 0);
+    assertTrue(jedis.rpushx(key, randString()) > 0);
+
+    assertTrue(jedis.lpushx(otherKey, randString()) == 0);
+    assertTrue(jedis.rpushx(otherKey, randString()) == 0);
+
+    jedis.del(key);
+
+    assertTrue(jedis.lpushx(key, randString()) == 0);
+    assertTrue(jedis.rpushx(key, randString()) == 0);
+  }
+
+  @Test
+  public void testLRem() {
+    int elements = 5;
+    ArrayList<String> strings = new ArrayList<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.rpush(key, stringArray);
+
+    for (int i = 0; i < elements; i++) {
+      String remove = strings.remove(0);
+      jedis.lrem(key, 0, remove);
+      List<String> range = jedis.lrange(key, 0, -1);
+      assertEquals(strings, range);
+    }
+  }
+
+  @Test
+  public void testLSet() {
+    int elements = 10;
+    ArrayList<String> strings = new ArrayList<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.rpush(key, stringArray);
+
+    for (int i = 0; i < elements; i++) {
+      String s = randString();
+      strings.set(i, s);
+      jedis.lset(key, i, s);
+      List<String> range = jedis.lrange(key, 0, -1);
+      assertEquals(range, strings);
+    }
+  }
+
+  private String randString() {
+    int length = rand.nextInt(8) + 5;
+    StringBuilder rString = new StringBuilder();
+    for (int i = 0; i < length; i++)
+      rString.append((char) (rand.nextInt(57) + 65));
+    //return rString.toString();
+    return Long.toHexString(Double.doubleToLongBits(Math.random()));
+  }
+
+  @After
+  public void flushAll() {
+    jedis.flushAll();
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    jedis.close();
+    cache.close();
+    server.shutdown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/org/apache/geode/redis/RedisDistDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/redis/RedisDistDUnitTest.java b/geode-core/src/test/java/org/apache/geode/redis/RedisDistDUnitTest.java
new file mode 100644
index 0000000..eb87797
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/redis/RedisDistDUnitTest.java
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis;
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.Random;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import redis.clients.jedis.Jedis;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.ConfigurationProperties;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.internal.SocketCreator;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import com.gemstone.gemfire.test.junit.categories.FlakyTest;
+
+@Category(DistributedTest.class)
+public class RedisDistDUnitTest extends JUnit4DistributedTestCase {
+
+  public static final String TEST_KEY = "key";
+  public static int pushes = 200;
+  int redisPort = 6379;
+  private Host host;
+  private VM server1;
+  private VM server2;
+  private VM client1;
+  private VM client2;
+
+  private int server1Port;
+  private int server2Port;
+  
+  private String localHost;
+  
+  private static final int JEDIS_TIMEOUT = 20 * 1000;
+
+  private abstract class ClientTestBase extends SerializableCallable {
+
+    int port;
+
+    protected ClientTestBase (int port) {
+      this.port = port;
+    }
+  }
+
+  @Override
+  public final void postSetUp() throws Exception {
+    disconnectAllFromDS();
+
+    localHost = SocketCreator.getLocalHost().getHostName();
+
+    host = Host.getHost(0);
+    server1 = host.getVM(0);
+    server2 = host.getVM(1);
+    client1 = host.getVM(2);
+    client2 = host.getVM(3);  
+    final int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+    final int locatorPort = DistributedTestUtils.getDUnitLocatorPort();
+    final SerializableCallable<Object> startRedisAdapter = new SerializableCallable<Object>() {
+
+      @Override
+      public Object call() throws Exception {
+        int port = ports[VM.getCurrentVMNum()];
+        CacheFactory cF = new CacheFactory();
+        String locator = SocketCreator.getLocalHost().getHostName() + "[" + locatorPort + "]";
+        cF.set(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
+        cF.set(ConfigurationProperties.REDIS_BIND_ADDRESS, localHost);
+        cF.set(ConfigurationProperties.REDIS_PORT, "" + port);
+        cF.set(MCAST_PORT, "0");
+        cF.set(LOCATORS, locator);
+        cF.create();
+        return Integer.valueOf(port);
+      }
+    };
+    AsyncInvocation i = server1.invokeAsync(startRedisAdapter);
+    server2Port = (Integer) server2.invoke(startRedisAdapter);
+    server1Port = (Integer) i.getResult();
+  }
+
+  @Override
+  public final void preTearDown() throws Exception {
+    disconnectAllFromDS();
+  }
+
+  @Category(FlakyTest.class) // GEODE-1092: random ports, failure stack involves TCPTransport ConnectionHandler (are we eating BindExceptions somewhere?), uses Random, async actions
+  @Test
+  public void testConcListOps() throws Exception {
+    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) {
+        super(port);
+      }
+
+      @Override
+      public Object call() throws Exception {
+        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
+        Random r = new Random();
+        for (int i = 0; i < pushes; i++) {
+          if (r.nextBoolean()) {
+            jedis.lpush(TEST_KEY, randString());
+          } else {
+            jedis.rpush(TEST_KEY, randString());
+          }
+        }
+        return null;
+      }
+    };
+
+    AsyncInvocation i = client1.invokeAsync(new ConcListOps(server1Port));
+    client2.invoke(new ConcListOps(server2Port));
+    i.getResult();
+    long expected = 2 * pushes;
+    long result1 = jedis1.llen(TEST_KEY);
+    long result2 = jedis2.llen(TEST_KEY);
+    assertEquals(expected, result1);
+    assertEquals(result1, result2);
+  }
+
+  @Category(FlakyTest.class) // GEODE-717: random ports, BindException in failure stack, async actions
+  @Test
+  public void testConcCreateDestroy() throws Exception {
+    IgnoredException.addIgnoredException("RegionDestroyedException");
+    IgnoredException.addIgnoredException("IndexInvalidException");
+    final int ops = 40;
+    final String hKey = TEST_KEY+"hash";
+    final String lKey = TEST_KEY+"list";
+    final String zKey = TEST_KEY+"zset";
+    final String sKey = TEST_KEY+"set";
+
+    class ConcCreateDestroy extends ClientTestBase{
+      protected ConcCreateDestroy(int port) {
+        super(port);
+      }
+
+      @Override
+      public Object call() throws Exception {
+        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
+        Random r = new Random();
+        for (int i = 0; i < ops; i++) {
+          int n = r.nextInt(4);
+          if (n == 0) {
+            if (r.nextBoolean()) {
+              jedis.hset(hKey, randString(), randString());
+            } else {
+              jedis.del(hKey);
+            }
+          } else if (n == 1) {
+            if (r.nextBoolean()) {
+              jedis.lpush(lKey, randString());
+            } else {
+              jedis.del(lKey);
+            }
+          } else if (n == 2) {
+            if (r.nextBoolean()) {
+              jedis.zadd(zKey, r.nextDouble(), randString());
+            } else {
+              jedis.del(zKey);
+            }
+          } else {
+            if (r.nextBoolean()) {
+              jedis.sadd(sKey, randString());
+            } else {
+              jedis.del(sKey);
+            }
+          }
+        }
+        return null;
+      }
+    }
+
+    // Expect to run with no exception
+    AsyncInvocation i = client1.invokeAsync(new ConcCreateDestroy(server1Port));
+    client2.invoke(new ConcCreateDestroy(server2Port));
+    i.getResult();
+  }
+
+  /**
+   * Just make sure there are no unexpected server crashes
+   */
+  @Test
+  public void testConcOps() throws Exception {
+
+    final int ops = 100;
+    final String hKey = TEST_KEY+"hash";
+    final String lKey = TEST_KEY+"list";
+    final String zKey = TEST_KEY+"zset";
+    final String sKey = TEST_KEY+"set";
+
+    class ConcOps extends ClientTestBase {
+
+      protected ConcOps(int port) {
+        super(port);
+      }
+
+      @Override
+      public Object call() throws Exception {
+        Jedis jedis = new Jedis(localHost, port, JEDIS_TIMEOUT);
+        Random r = new Random();
+        for (int i = 0; i < ops; i++) {
+          int n = r.nextInt(4);
+          if (n == 0) {
+            jedis.hset(hKey, randString(), randString());
+            jedis.hgetAll(hKey);
+            jedis.hvals(hKey);
+          } else if (n == 1) {
+            jedis.lpush(lKey, randString());
+            jedis.rpush(lKey, randString());
+            jedis.ltrim(lKey, 0, 100);
+            jedis.lrange(lKey, 0, -1);
+          } else if (n == 2) {
+            jedis.zadd(zKey, r.nextDouble(), randString());
+            jedis.zrangeByLex(zKey, "(a", "[z");
+            jedis.zrangeByScoreWithScores(zKey, 0, 1, 0, 100);
+            jedis.zremrangeByScore(zKey, r.nextDouble(), r.nextDouble());
+          } else {
+            jedis.sadd(sKey, randString());
+            jedis.smembers(sKey);
+            jedis.sdiff(sKey, "afd");
+            jedis.sunionstore("dst", sKey, "afds");
+          }
+        }
+        return null;
+      }
+    }
+
+    // Expect to run with no exception
+    AsyncInvocation i = client1.invokeAsync(new ConcOps(server1Port));
+    client2.invoke(new ConcOps(server2Port));
+    i.getResult();
+  }
+
+  private String randString() {
+    return Long.toHexString(Double.doubleToLongBits(Math.random()));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/test/java/org/apache/geode/redis/SetsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/redis/SetsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/redis/SetsJUnitTest.java
new file mode 100755
index 0000000..53f2261
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/redis/SetsJUnitTest.java
@@ -0,0 +1,259 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+import org.apache.geode.redis.GeodeRedisServer;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import redis.clients.jedis.Jedis;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Random;
+import java.util.Set;
+
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+@Category(IntegrationTest.class)
+public class SetsJUnitTest {
+
+  private static Jedis jedis;
+  private static GeodeRedisServer server;
+  private static GemFireCache cache;
+  private static Random rand;
+  private static int port = 6379;
+
+  @BeforeClass
+  public static void setUp() throws IOException {
+    rand = new Random();
+    CacheFactory cf = new CacheFactory();
+    //cf.set("log-file", "redis.log");
+    cf.set(LOG_LEVEL, "error");
+    cf.set(MCAST_PORT, "0");
+    cf.set(LOCATORS, "");
+    cache = cf.create();
+    port = AvailablePortHelper.getRandomAvailableTCPPort();
+    server = new GeodeRedisServer("localhost", port);
+
+    server.start();
+    jedis = new Jedis("localhost", port, 10000000);
+  }
+
+  @Test
+  public void testSAddScard() {
+    int elements = 10;
+    Set<String> strings = new HashSet<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    Long response = jedis.sadd(key, stringArray);
+    assertEquals(response, new Long(strings.size()));
+
+    assertEquals(jedis.scard(key), new Long(strings.size()));
+  }
+
+  @Test
+  public void testSMembersIsMember() {
+    int elements = 10;
+    Set<String> strings = new HashSet<String>();
+    String key = randString();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.sadd(key, stringArray);
+
+    Set<String> returnedSet = jedis.smembers(key);
+
+    assertEquals(returnedSet, new HashSet<String>(strings));
+
+    for (String entry: strings) {
+      boolean exists = jedis.sismember(key, entry);
+      assertTrue(exists);
+    }
+  }
+
+  @Test
+  public void testSMove() {
+    String source = randString();
+    String dest = randString();
+    String test = randString();
+    int elements = 10;
+    Set<String> strings = new HashSet<String>();
+    for (int i = 0; i < elements; i++) {
+      String elem = randString();
+      strings.add(elem);
+    }
+    String[] stringArray = strings.toArray(new String[strings.size()]);
+    jedis.sadd(source, stringArray);
+
+    long i = 1;
+    for (String entry: strings) {
+      assertTrue(jedis.smove(source, dest, entry) == 1);
+      assertTrue(jedis.sismember(dest, entry));
+      assertTrue(jedis.scard(source) == strings.size() - i);
+      assertTrue(jedis.scard(dest) == i);
+      i++;
+    }
+
+    assertTrue(jedis.smove(test, dest, randString()) == 0);
+  }
+
+  @Test
+  public void testSDiffAndStore() {
+    int numSets = 3;
+    int elements = 10;
+    String[] keys = new String[numSets];
+    ArrayList<Set<String>> sets = new ArrayList<Set<String>>();
+    for (int j = 0; j < numSets; j++) {
+      keys[j] = randString();
+      Set<String> newSet = new HashSet<String>();
+      for (int i = 0; i < elements; i++)
+        newSet.add(randString());
+      sets.add(newSet);
+    }
+    
+    for (int i = 0; i < numSets; i++) {
+      Set<String> s = sets.get(i);
+      String[] stringArray = s.toArray(new String[s.size()]);
+      jedis.sadd(keys[i], stringArray);
+    }
+    
+    Set<String> result = sets.get(0);
+    for (int i = 1; i < numSets; i++)
+      result.removeAll(sets.get(i));
+    
+    assertEquals(result, jedis.sdiff(keys));
+    
+    String destination = randString();
+    
+    jedis.sdiffstore(destination, keys);
+    
+    Set<String> destResult = jedis.smembers(destination);
+    
+    assertEquals(result, destResult);
+    
+  }
+  
+  @Test
+  public void testSUnionAndStore() {
+    int numSets = 3;
+    int elements = 10;
+    String[] keys = new String[numSets];
+    ArrayList<Set<String>> sets = new ArrayList<Set<String>>();
+    for (int j = 0; j < numSets; j++) {
+      keys[j] = randString();
+      Set<String> newSet = new HashSet<String>();
+      for (int i = 0; i < elements; i++)
+        newSet.add(randString());
+      sets.add(newSet);
+    }
+    
+    for (int i = 0; i < numSets; i++) {
+      Set<String> s = sets.get(i);
+      String[] stringArray = s.toArray(new String[s.size()]);
+      jedis.sadd(keys[i], stringArray);
+    }
+    
+    Set<String> result = sets.get(0);
+    for (int i = 1; i < numSets; i++)
+      result.addAll(sets.get(i));
+    
+    assertEquals(result, jedis.sunion(keys));
+    
+    String destination = randString();
+    
+    jedis.sunionstore(destination, keys);
+    
+    Set<String> destResult = jedis.smembers(destination);
+    
+    assertEquals(result, destResult);
+    
+  }
+  
+  @Test
+  public void testSInterAndStore() {
+    int numSets = 3;
+    int elements = 10;
+    String[] keys = new String[numSets];
+    ArrayList<Set<String>> sets = new ArrayList<Set<String>>();
+    for (int j = 0; j < numSets; j++) {
+      keys[j] = randString();
+      Set<String> newSet = new HashSet<String>();
+      for (int i = 0; i < elements; i++)
+        newSet.add(randString());
+      sets.add(newSet);
+    }
+    
+    for (int i = 0; i < numSets; i++) {
+      Set<String> s = sets.get(i);
+      String[] stringArray = s.toArray(new String[s.size()]);
+      jedis.sadd(keys[i], stringArray);
+    }
+    
+    Set<String> result = sets.get(0);
+    for (int i = 1; i < numSets; i++)
+      result.retainAll(sets.get(i));
+    
+    assertEquals(result, jedis.sinter(keys));
+    
+    String destination = randString();
+    
+    jedis.sinterstore(destination, keys);
+    
+    Set<String> destResult = jedis.smembers(destination);
+    
+    assertEquals(result, destResult);
+    
+  }
+
+  private String randString() {
+    int length = rand.nextInt(8) + 5;
+    StringBuilder rString = new StringBuilder();
+    for (int i = 0; i < length; i++)
+      rString.append((char) (rand.nextInt(57) + 65));
+    return rString.toString();
+    //return Long.toHexString(Double.doubleToLongBits(Math.random()));
+  }
+
+  @After
+  public void flushAll() {
+    jedis.flushAll();
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    jedis.close();
+    cache.close();
+    server.shutdown();
+  }
+}