Changed name to ControlParameters which is more appropiate

This commit is contained in:
Jonathan Leibiusky
2010-08-08 15:57:19 -03:00
parent 8d8c5131f1
commit c290540968

View File

@@ -0,0 +1,58 @@
package redis.clients.jedis.tests.commands;
import org.junit.Test;
import redis.clients.jedis.JedisException;
import redis.clients.jedis.JedisMonitor;
public class ControlCommandsTest extends JedisCommandTestBase {
@Test
public void save() {
String status = jedis.save();
assertEquals("OK", status);
}
@Test
public void bgsave() {
String status = jedis.bgsave();
assertEquals("Background saving started", status);
}
@Test
public void bgrewriteaof() {
String status = jedis.bgrewriteaof();
assertEquals("Background append only file rewriting started", status);
}
@Test
public void lastsave() throws InterruptedException {
int before = jedis.lastsave();
String st = "";
while (!st.equals("OK")) {
try {
Thread.sleep(1000);
st = jedis.save();
} catch (JedisException e) {
}
}
int after = jedis.lastsave();
assertTrue((after - before) > 0);
}
@Test
public void info() {
String info = jedis.info();
assertNotNull(info);
}
@Test
public void monitor() {
jedis.monitor(new JedisMonitor() {
public void onCommand(String command) {
assertTrue(command.contains("OK"));
client.disconnect();
}
});
}
}