Fix JedisConnection transaction discard

DATAREDIS-135
This commit is contained in:
Jennifer Hickey
2013-03-21 18:16:57 -07:00
parent 57edca0785
commit 22e1c9da9b
6 changed files with 29 additions and 7 deletions

View File

@@ -365,7 +365,7 @@ public abstract class AbstractConnectionIntegrationTests {
}
@Test
public void testMulti() throws Exception {
public void testMultiExec() throws Exception {
byte[] key = "key".getBytes();
byte[] value = "value".getBytes();
@@ -378,6 +378,18 @@ public abstract class AbstractConnectionIntegrationTests {
assertEquals(new String(value), new String((byte[])results.get(1)));
}
@Test
public void testMultiDiscard() throws Exception {
connection.set("testitnow", "willdo");
connection.multi();
connection.set("testitnow", "notok");
connection.discard();
assertEquals("willdo", connection.get("testitnow"));
// Ensure we can run a new tx after discarding previous one
testMultiExec();
}
@Test
public void testBlPopTimeout() {
assertNull(connection.bLPop(1, "lclist"));

View File

@@ -80,8 +80,14 @@ public class JRedisConnectionIntegrationTests extends AbstractConnectionIntegrat
public void testBitSet() throws Exception {
}
@Ignore
public void testMulti() throws Exception {
@Test(expected = UnsupportedOperationException.class)
public void testMultiExec() throws Exception {
super.testMultiExec();
}
@Test(expected = UnsupportedOperationException.class)
public void testMultiDiscard() throws Exception {
super.testMultiDiscard();
}
@Ignore

View File

@@ -45,7 +45,7 @@ public class LettuceConnectionIntegrationTests extends AbstractConnectionIntegra
}
@Test
public void testMulti() throws Exception {
public void testMultiExec() throws Exception {
byte[] key = "key".getBytes();
byte[] value = "value".getBytes();

View File

@@ -49,7 +49,7 @@ public class RjcConnectionIntegrationTests extends AbstractConnectionIntegration
}
@Test
public void testMulti() throws Exception {
public void testMultiExec() throws Exception {
byte[] key = "key".getBytes();
byte[] value = "value".getBytes();

View File

@@ -45,7 +45,11 @@ public class SrpConnectionIntegrationTests extends AbstractConnectionIntegration
}
@Ignore("DATAREDIS-123, exec does not return command results")
public void testMulti() throws Exception {
public void testMultiExec() throws Exception {
}
@Ignore("DATAREDIS-123, exec does not return command results")
public void testMultiDiscard() {
}
@Ignore("DATAREDIS-130, sort not working")