Fix Lettuce and SRP blpop/brpop issues
- DATAREDIS-127 Fix Lettuce NPE on timeout - DATAREDIS-128 Fix SRP arg array conversion and NPE on timeout
This commit is contained in:
@@ -377,6 +377,30 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertEquals(new String(value), new String((byte[])results.get(1)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBlPopTimeout() {
|
||||
assertNull(connection.bLPop(1, "lclist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBlPop() {
|
||||
connection.lPush("poplist", "foo");
|
||||
connection.lPush("poplist", "bar");
|
||||
assertEquals(Arrays.asList(new String[] {"poplist", "bar"}), connection.bLPop(1, "poplist", "otherlist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBRPop() {
|
||||
connection.rPush("rpoplist", "bar");
|
||||
connection.rPush("rpoplist", "foo");
|
||||
assertEquals(Arrays.asList(new String[] {"rpoplist", "foo"}), connection.bRPop(1, "rpoplist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBRPopTimeout() {
|
||||
assertNull(connection.bRPop(1, "rclist"));
|
||||
}
|
||||
|
||||
private boolean isAsync() {
|
||||
return (getConnectionFactory() instanceof LettuceConnectionFactory) ||
|
||||
(getConnectionFactory() instanceof SrpConnectionFactory);
|
||||
|
||||
@@ -97,4 +97,24 @@ public class JRedisConnectionIntegrationTests extends AbstractConnectionIntegrat
|
||||
public void testExecuteNativeWithPipeline() throws Exception {
|
||||
super.testExecuteNativeWithPipeline();
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
public void testBlPopTimeout() {
|
||||
super.testBlPopTimeout();
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
public void testBlPop() {
|
||||
super.testBlPop();
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
public void testBRPop() {
|
||||
super.testBRPop();
|
||||
}
|
||||
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
public void testBRPopTimeout() {
|
||||
super.testBRPopTimeout();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user