Example usage for org.springframework.data.redis.connection StringRedisConnection del

List of usage examples for org.springframework.data.redis.connection StringRedisConnection del

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection StringRedisConnection del.

Prototype

Long del(String... keys);

Source Link

Document

Delete given keys .

Usage

From source file:org.springframework.data.redis.connection.jredis.JRedisConnectionIntegrationTests.java

@Test
public void testMove() {
    connection.set("foo", "bar");
    actual.add(connection.move("foo", 1));
    verifyResults(Arrays.asList(new Object[] { true }));
    // JRedis does not support select() on existing conn, create new one
    JredisConnectionFactory factory2 = new JredisConnectionFactory();
    factory2.setDatabase(1);//from  w w  w.java2  s  . co  m
    factory2.afterPropertiesSet();
    StringRedisConnection conn2 = new DefaultStringRedisConnection(factory2.getConnection());
    try {
        assertEquals("bar", conn2.get("foo"));
    } finally {
        if (conn2.exists("foo")) {
            conn2.del("foo");
        }
        conn2.close();
    }
}