Package net.rubyeye.xmemcached.command

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


public class TextStatsCommandUnitTest extends BaseTextCommandUnitTest {
  public void testEncode() {
    Command command = this.commandFactory.createStatsCommand(null,
        new CountDownLatch(1), null);
    assertNull(command.getIoBuffer());
    command.encode();
    assertEquals(TextStatsCommand.STATS, command.getIoBuffer().buf());
  }

  public void testItemEncode() {
    Command command = this.commandFactory.createStatsCommand(null,
View Full Code Here


  public void testItemEncode() {
    Command command = this.commandFactory.createStatsCommand(null,
        new CountDownLatch(1), "items");
    assertNull(command.getIoBuffer());
    command.encode();
    assertEquals(ByteBuffer.wrap("stats items\r\n".getBytes()), command
        .getIoBuffer().buf());
  }

  public void testDecode() {
View Full Code Here

public class TextDeleteCommandUnitTest extends BaseTextCommandUnitTest {
  public void testEncode() {
    Command command = this.commandFactory.createDeleteCommand("test",
        "test".getBytes(), 10,false);
    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "delete test 10\r\n");
   
     command = this.commandFactory.createDeleteCommand("test",
          "test".getBytes(), 10,true);
      assertNull(command.getIoBuffer());
View Full Code Here

    checkByteBufferEquals(command, "delete test 10\r\n");
   
     command = this.commandFactory.createDeleteCommand("test",
          "test".getBytes(), 10,true);
      assertNull(command.getIoBuffer());
      command.encode();
      checkByteBufferEquals(command, "delete test 10 noreply\r\n");
  }

  public void testDecode() {
    Command command = this.commandFactory.createDeleteCommand("test",
View Full Code Here

public class TextVersionCommandUnitTest extends BaseTextCommandUnitTest {
  public void testEncode() {
    Command versionCommand = this.commandFactory.createVersionCommand(new CountDownLatch(1),null);
    assertNull(versionCommand.getIoBuffer());
    versionCommand.encode();
    assertEquals(ServerAddressAware.VERSION, versionCommand.getIoBuffer()
        .buf());
  }

  public void testDecode() {
View Full Code Here

  public void testCASEncode() {
    Command command = this.commandFactory.createCASCommand(key, key
        .getBytes(), exp, value, cas, false, transcoder);
    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "cas test 0 0 2 999\r\n10\r\n");
    command = this.commandFactory.createCASCommand(key, key.getBytes(),
        exp, value, cas, true, transcoder);
    command.encode();
    checkByteBufferEquals(command, "cas test 0 0 2 999 noreply\r\n10\r\n");
View Full Code Here

    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "cas test 0 0 2 999\r\n10\r\n");
    command = this.commandFactory.createCASCommand(key, key.getBytes(),
        exp, value, cas, true, transcoder);
    command.encode();
    checkByteBufferEquals(command, "cas test 0 0 2 999 noreply\r\n10\r\n");
  }

  public void testSetEncode() {
    Command command = this.commandFactory.createSetCommand(key, key
View Full Code Here

  public void testSetEncode() {
    Command command = this.commandFactory.createSetCommand(key, key
        .getBytes(), exp, value, false, transcoder);
    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "set test 0 0 2\r\n10\r\n");
    command = this.commandFactory.createSetCommand(key, key.getBytes(),
        exp, value, true, transcoder);
    command.encode();
    checkByteBufferEquals(command, "set test 0 0 2 noreply\r\n10\r\n");
View Full Code Here

    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "set test 0 0 2\r\n10\r\n");
    command = this.commandFactory.createSetCommand(key, key.getBytes(),
        exp, value, true, transcoder);
    command.encode();
    checkByteBufferEquals(command, "set test 0 0 2 noreply\r\n10\r\n");
  }

  public void testAddEncode() {
    Command command = this.commandFactory.createAddCommand(key, key
View Full Code Here

  public void testAddEncode() {
    Command command = this.commandFactory.createAddCommand(key, key
        .getBytes(), exp, value, false, transcoder);
    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "add test 0 0 2\r\n10\r\n");

    command = this.commandFactory.createAddCommand(key, key.getBytes(),
        exp, value, true, transcoder);
    assertNull(command.getIoBuffer());
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.