Package net.rubyeye.xmemcached.command

Examples of net.rubyeye.xmemcached.command.Command.encode()


public class TextIncrDecrCommandUnitTest extends BaseTextCommandUnitTest {
  public void testEncodeIncr() {
    Command command = this.commandFactory.createIncrDecrCommand("test",
        "test".getBytes(), 10, 0,0, CommandType.INCR, false);
    assertNull(command.getIoBuffer());
    command.encode();

    checkByteBufferEquals(command, "incr test 10\r\n");
   
    command = this.commandFactory.createIncrDecrCommand("test",
        "test".getBytes(), 10, 0,0, CommandType.INCR, true);
View Full Code Here


    checkByteBufferEquals(command, "incr test 10\r\n");
   
    command = this.commandFactory.createIncrDecrCommand("test",
        "test".getBytes(), 10, 0,0, CommandType.INCR, true);
    assertNull(command.getIoBuffer());
    command.encode();

    checkByteBufferEquals(command, "incr test 10 noreply\r\n");
  }

  public void testEncodeDecr() {
View Full Code Here

  public void testEncodeDecr() {
    Command command = this.commandFactory.createIncrDecrCommand("test",
        "test".getBytes(), 10, 0,0, CommandType.DECR, false);
    assertNull(command.getIoBuffer());
    command.encode();

    checkByteBufferEquals(command, "decr test 10\r\n");
   
    command = this.commandFactory.createIncrDecrCommand("test",
        "test".getBytes(), 10, 0,0, CommandType.DECR, true);
View Full Code Here

    checkByteBufferEquals(command, "decr test 10\r\n");
   
    command = this.commandFactory.createIncrDecrCommand("test",
        "test".getBytes(), 10, 0,0, CommandType.DECR, true);
    assertNull(command.getIoBuffer());
    command.encode();

    checkByteBufferEquals(command, "decr test 10 noreply\r\n");
  }

  public void testDecode() {
View Full Code Here

public class TextVerbositylCommandUnitTest extends BaseTextCommandUnitTest {
  public void testEncode() {
    Command command = this.commandFactory.createVerbosityCommand(
        new CountDownLatch(1), 1, false);
    assertNull(command.getIoBuffer());
    command.encode();
    assertEquals("verbosity 1\r\n", new String(command.getIoBuffer()
        .buf().array()));

    command = this.commandFactory.createVerbosityCommand(
        new CountDownLatch(1), 1, true);
View Full Code Here

    assertEquals("verbosity 1\r\n", new String(command.getIoBuffer()
        .buf().array()));

    command = this.commandFactory.createVerbosityCommand(
        new CountDownLatch(1), 1, true);
    command.encode();
    assertEquals("verbosity 1 noreply\r\n", new String(command
        .getIoBuffer().buf().array()));

  }
View Full Code Here

public class TextFlushAllCommandUnitTest extends BaseTextCommandUnitTest {
  public void testEncode() {
    Command command = this.commandFactory.createFlushAllCommand(
        new CountDownLatch(1), 0, false);
    assertNull(command.getIoBuffer());
    command.encode();
    assertEquals(TextFlushAllCommand.FLUSH_ALL, command.getIoBuffer()
        .buf());

    command = this.commandFactory.createFlushAllCommand(new CountDownLatch(
        1), 0, true);
View Full Code Here

        .buf());

    command = this.commandFactory.createFlushAllCommand(new CountDownLatch(
        1), 0, true);
    assertNull(command.getIoBuffer());
    command.encode();
    assertEquals("flush_all noreply\r\n", new String(command.getIoBuffer()
        .buf().array()));

  }
 
View Full Code Here

 
  public void testEncodeWithDelay(){
    Command command = this.commandFactory.createFlushAllCommand(
        new CountDownLatch(1), 10, false);
    assertNull(command.getIoBuffer());
    command.encode();
    assertEquals("flush_all 10\r\n", new String(command.getIoBuffer()
        .buf().array()));

    command = this.commandFactory.createFlushAllCommand(new CountDownLatch(
        1), 10, true);
View Full Code Here

        .buf().array()));

    command = this.commandFactory.createFlushAllCommand(new CountDownLatch(
        1), 10, true);
    assertNull(command.getIoBuffer());
    command.encode();
    assertEquals("flush_all 10 noreply\r\n", new String(command.getIoBuffer()
        .buf().array()));
  }

  public void testDecode() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.