Package net.rubyeye.xmemcached.command

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


    checkByteBufferEquals(command, "replace test 0 0 2\r\n10\r\n");

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

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


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

    command = this.commandFactory.createAppendCommand(key, key.getBytes(),
        value, true, transcoder);
    assertNull(command.getIoBuffer());
View Full Code Here

    checkByteBufferEquals(command, "append test 0 0 2\r\n10\r\n");

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

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

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

    command = this.commandFactory.createPrependCommand(key, key.getBytes(),
        value, true, transcoder);
    assertNull(command.getIoBuffer());
View Full Code Here

    checkByteBufferEquals(command, "prepend test 0 0 2\r\n10\r\n");

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

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

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

public class TextGetOneCommandUnitTest extends BaseTextCommandUnitTest {
  public void testGetOneEncode() {
    Command command = this.commandFactory.createGetCommand("test", "test"
        .getBytes(), CommandType.GET_ONE, null);
    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "get test\r\n");
  }

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

  public void testGetsOneEncode() {
    Command command = this.commandFactory.createGetCommand("test", "test"
        .getBytes(), CommandType.GETS_ONE, null);
    assertNull(command.getIoBuffer());
    command.encode();
    checkByteBufferEquals(command, "gets test\r\n");
  }

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

  public void testAddEncodeAndDecode() {

    Command command = this.commandFactory.createAddCommand(this.key, this.keyBytes,
        0, this.value, this.noreply, this.transcoder);

    command.encode();
    ByteBuffer encodeBuffer = command.getIoBuffer().buf();
    assertNotNull(encodeBuffer);
    assertEquals(42, encodeBuffer.capacity());

    byte opCode = encodeBuffer.get(1);
View Full Code Here

  public void testReplaceEncodeAndDecode() {

    Command command = this.commandFactory.createReplaceCommand(this.key,
        this.keyBytes, 0, this.value, this.noreply, this.transcoder);

    command.encode();
    ByteBuffer encodeBuffer = command.getIoBuffer().buf();
    assertNotNull(encodeBuffer);
    assertEquals(42, encodeBuffer.capacity());

    byte opCode = encodeBuffer.get(1);
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.