package redis.clients.jedis.tests.commands;

import org.junit.Test;

import redis.clients.util.SafeEncoder;

public class ObjectCommandsTest extends JedisCommandTestBase {

    private String key = "mylist";
    private byte[] binaryKey = SafeEncoder.encode(key);

    @Test
    public void objectRefcount() {
	jedis.lpush(key, "hello world");
	Long refcount = jedis.objectRefcount(key);
	assertEquals(new Long(1), refcount);

	// Binary
	refcount = jedis.objectRefcount(binaryKey);
	assertEquals(new Long(1), refcount);

    }

    @Test
    public void objectEncoding() {
	jedis.lpush(key, "hello world");
	String encoding = jedis.objectEncoding(key);
	assertEquals("ziplist", encoding);

	// Binary
	encoding = SafeEncoder.encode(jedis.objectEncoding(binaryKey));
	assertEquals("ziplist", encoding);
    }

    @Test
    public void objectIdletime() throws InterruptedException {
	jedis.lpush(key, "hello world");

	// Wait a little bit more than 10 seconds so the idle time is 10
	// seconds.
	Thread.sleep(10001);
	Long time = jedis.objectIdletime(key);
	assertEquals(new Long(10), time);

	// Binary
	time = jedis.objectIdletime(binaryKey);
	assertEquals(new Long(10), time);
    }
}
@@ -915,109 +915,8 @@
 );%0A%0A
-%09// Wait a little bit more than 10 seconds so the idle time is 10%0A%09// seconds.%0A%09Thread.sleep(10001);%0A
 %09Lon
@@ -966,33 +966,32 @@
 Equals(new Long(
-1
 0), time);%0A%0A%09// 
@@ -1030,32 +1030,32 @@
 ime(binaryKey);%0A
+
 %09assertEquals(ne
@@ -1061,17 +1061,16 @@
 ew Long(
-1
 0), time

make object command tests fast