Package net.rubyeye.xmemcached.command

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


    ByteBuffer buffer = constructResponse(OpCode.TOUCH.fieldValue(),
        (short) 0, (byte) 0, (byte) 0, (short) 0, 0, 0, 1L, null, null,
        null);

    assertTrue(command.decode(null, buffer));
    assertTrue((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());

    buffer = constructResponse(OpCode.TOUCH.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null);
View Full Code Here


    buffer = constructResponse(OpCode.TOUCH.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null);
    command = this.commandFactory.createTouchCommand(key, keyBytes, null,
        10, false);
    assertTrue(command.decode(null, buffer));
    assertFalse((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());
  }

}
View Full Code Here

    ByteBuffer buffer = constructResponse(OpCode.APPEND.fieldValue(),
        (short) 0, (byte) 0, (byte) 0, (short) 0, 0, 0, 1L, null, null,
        null);

    assertTrue(command.decode(null, buffer));
    assertTrue((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());

    buffer = constructResponse(OpCode.APPEND.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null);
View Full Code Here

    buffer = constructResponse(OpCode.APPEND.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null);
    command = this.commandFactory.createAppendCommand(this.key, this.keyBytes, this.value,
        this.noreply, this.transcoder);
    assertTrue(command.decode(null, buffer));
    assertFalse((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());
  }

  public void testPrependEncodeAndDecode() {
View Full Code Here

    ByteBuffer buffer = constructResponse(OpCode.PREPEND.fieldValue(),
        (short) 0, (byte) 0, (byte) 0, (short) 0, 0, 0, 1L, null, null,
        null);

    assertTrue(command.decode(null, buffer));
    assertTrue((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());

    buffer = constructResponse(OpCode.PREPEND.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null);
View Full Code Here

    buffer = constructResponse(OpCode.PREPEND.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 1L, null, null, null);
    command = this.commandFactory.createPrependCommand(this.key, this.keyBytes,
        this.value, this.noreply, this.transcoder);
    assertTrue(command.decode(null, buffer));
    assertFalse((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());
  }
}
View Full Code Here

    ByteBuffer buffer = constructResponse(OpCode.SET.fieldValue(),
        (short) 0, (byte) 0, (byte) 0, (short) 0, 0, 0, 10L, null,
        null, null);

    assertTrue(command.decode(null, buffer));
    assertTrue((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());

    buffer = constructResponse(OpCode.SET.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 0L, null, null, null);
View Full Code Here

    buffer = constructResponse(OpCode.SET.fieldValue(), (short) 0,
        (byte) 0, (byte) 0, (short) 0x0005, 0, 0, 0L, null, null, null);
    command = this.commandFactory.createCASCommand(this.key, this.keyBytes, 0, this.value,
        9L, this.noreply, this.transcoder);
    assertTrue(command.decode(null, buffer));
    assertFalse((Boolean) command.getResult());
    assertEquals(0, buffer.remaining());
  }
}
View Full Code Here

  public void testIssue128() {
    // store command
    Command command = this.commandFactory.createSetCommand(key, key
        .getBytes(), exp, value, false, transcoder);
    command.decode(null, ByteBuffer
        .wrap("SERVER_ERROR out of memory storing object\r\n"
            .getBytes()));
    Exception e = command.getException();
    assertNotNull(e);
    assertEquals("out of memory storing object", e.getMessage());
View Full Code Here

    assertEquals("out of memory storing object", e.getMessage());

    // cas command
    command = this.commandFactory.createCASCommand(key, key.getBytes(),
        exp, value, cas, false, transcoder);
    command.decode(null, ByteBuffer
        .wrap("SERVER_ERROR out of memory storing object\r\n"
            .getBytes()));
    e = command.getException();
    assertNotNull(e);
    assertEquals("out of memory storing object", e.getMessage());
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.