From e59e4a0d2a9758e34589babf3533c890dac3f6cb Mon Sep 17 00:00:00 2001 From: Marcos Nils Date: Tue, 11 Feb 2014 02:51:58 -0300 Subject: [PATCH] Fix test to make jedis work with latest git master version of redis --- Makefile | 6 ++--- .../tests/commands/ClusterCommandsTest.java | 26 ++++++++----------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index a5328e2..ddc298a 100644 --- a/Makefile +++ b/Makefile @@ -180,9 +180,9 @@ stop: kill `cat /tmp/sentinel1.pid` kill `cat /tmp/sentinel2.pid` kill `cat /tmp/sentinel3.pid` - kill `cat /tmp/redis_cluster_node1.pid` || true - kill `cat /tmp/redis_cluster_node2.pid` || true - kill `cat /tmp/redis_cluster_node3.pid` || true + #kill `cat /tmp/redis_cluster_node1.pid` || true + #kill `cat /tmp/redis_cluster_node2.pid` || true + #kill `cat /tmp/redis_cluster_node3.pid` || true rm -f /tmp/redis_cluster_node1.conf rm -f /tmp/redis_cluster_node2.conf rm -f /tmp/redis_cluster_node3.conf diff --git a/src/test/java/redis/clients/jedis/tests/commands/ClusterCommandsTest.java b/src/test/java/redis/clients/jedis/tests/commands/ClusterCommandsTest.java index d2bc584..59b288d 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/ClusterCommandsTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/ClusterCommandsTest.java @@ -9,7 +9,6 @@ import org.junit.Test; import redis.clients.jedis.HostAndPort; import redis.clients.jedis.Jedis; -import redis.clients.jedis.exceptions.JedisDataException; import redis.clients.jedis.tests.HostAndPortUtil; import redis.clients.jedis.tests.JedisTestBase; @@ -47,13 +46,9 @@ public class ClusterCommandsTest extends JedisTestBase { node1.clusterDelSlots(1, 2, 3, 4, 5, 500); node1.clusterSetSlotNode(5000, node1Id); node1.clusterDelSlots(5000, 10000); - node1.clusterDelSlots(6000); node2.clusterDelSlots(6000, 1, 2, 3, 4, 5, 500, 5000); - try { - node2.clusterDelSlots(10000); - } catch (JedisDataException jde) { - // Do nothing, slot may or may not be assigned depending on gossip - } + node1.clusterAddSlots(6000); + node1.clusterDelSlots(6000); } private static void waitForEqualClusterSize() throws InterruptedException { @@ -74,6 +69,15 @@ public class ClusterCommandsTest extends JedisTestBase { } return 0; } + + @Test + public void clusterSetSlotImporting() { + node2.clusterAddSlots(6000); + String[] nodes = node1.clusterNodes().split("\n"); + String nodeId = nodes[0].split(" ")[0]; + String status = node1.clusterSetSlotImporting(6000, nodeId); + assertEquals("OK", status); + } @Test public void clusterNodes() { @@ -130,12 +134,4 @@ public class ClusterCommandsTest extends JedisTestBase { assertEquals("OK", status); } - @Test - public void clusterSetSlotImporting() { - node2.clusterAddSlots(6000); - String[] nodes = node1.clusterNodes().split("\n"); - String nodeId = nodes[0].split(" ")[0]; - String status = node1.clusterSetSlotImporting(6000, nodeId); - assertEquals("OK", status); - } } \ No newline at end of file