DATAREDIS-269 - Add support for 'CLIENT SETNAME'.

Setting client name is possible for 'jedis', 'lettuce' and 'srp'.
Using 'jredis' throws 'UnspupportedOperationException'.

Original Pull Request: #54
This commit is contained in:
Christoph Strobl
2014-03-24 13:32:50 +01:00
committed by Thomas Darimont
parent 6a6d03eb4c
commit e280a23550
13 changed files with 131 additions and 1 deletions

View File

@@ -1884,6 +1884,14 @@ public abstract class AbstractConnectionIntegrationTests {
assertThat(time > 0, equalTo(true));
}
/**
* @see DATAREDIS-269
*/
@Test
public void clientSetNameWorksCorrectly() {
connection.setClientName("foo".getBytes());
}
protected void verifyResults(List<Object> expected) {
assertEquals(expected, getResults());
}

View File

@@ -1710,6 +1710,16 @@ public class DefaultStringRedisConnectionTests {
verify(nativeConnection, times(1)).shutdown(eq(ShutdownOption.NOSAVE));
}
/**
* @see DATAREDIS-269
*/
@Test
public void settingClientNameShouldDelegateToNativeConnection() {
connection.setClientName("foo");
verify(nativeConnection, times(1)).setClientName(eq("foo".getBytes()));
}
protected List<Object> getResults() {
return actual;
}

View File

@@ -246,4 +246,12 @@ public class JedisConnectionPipelineIntegrationTests extends AbstractConnectionP
public void testZAddMultiple() {
super.testZAddMultiple();
}
/**
* @see DATAREDIS-269
*/
@Test(expected = UnsupportedOperationException.class)
public void clientSetNameWorksCorrectly() {
super.clientSetNameWorksCorrectly();
}
}

View File

@@ -191,4 +191,13 @@ public class JedisConnectionTransactionIntegrationTests extends AbstractConnecti
public void testRestoreExistingKey() {
super.testRestoreExistingKey();
}
/**
* @see DATAREDIS-269
*/
@Test(expected = UnsupportedOperationException.class)
public void clientSetNameWorksCorrectly() {
super.clientSetNameWorksCorrectly();
}
}

View File

@@ -809,4 +809,13 @@ public class JRedisConnectionIntegrationTests extends AbstractConnectionIntegrat
public void testPsetEx() throws Exception {
super.testPsetEx();
}
/**
* @see DATAREDIS-269
*/
@Override
@Test(expected = UnsupportedOperationException.class)
public void clientSetNameWorksCorrectly() {
super.clientSetNameWorksCorrectly();
}
}