Package net.rubyeye.xmemcached.command

Examples of net.rubyeye.xmemcached.command.TextCommandFactory


  protected BufferAllocator bufferAllocator;

  @Override
  public void setUp() {
    this.bufferAllocator = new SimpleBufferAllocator();
    this.commandFactory = new TextCommandFactory();
  }
View Full Code Here


        + PROP_SESSION_LOCATOR + " value: " + getCommandFactoryName());
  }

  protected CommandFactory getCommandFactory() {
    if (commandFactoryNameEquals(TextCommandFactory.class)) {
      return new TextCommandFactory();
    }

    if (commandFactoryNameEquals(BinaryCommandFactory.class)) {
      return new BinaryCommandFactory();
    }
View Full Code Here

  private CommandFactory commandFactory;

  @Override
  protected void setUp() throws Exception {
    this.optimiezer = new Optimizer(Protocol.Text);
    this.commandFactory = new TextCommandFactory();
    this.optimiezer.setBufferAllocator(new SimpleBufferAllocator());
    this.writeQueue = new LinkedTransferQueue<Command>();
    this.executingCmds = new LinkedTransferQueue<Command>();
    for (int i = 0; i < 10; i++) {
      Command cmd = this.commandFactory.createGetCommand(String
View Full Code Here

  private CommandFactory commandFactory;

  @Override
  protected void setUp() throws Exception {
    this.commandFactory = new TextCommandFactory(
        );
  }
View Full Code Here

  private Decoder decoder;

  public void testDecode() {
    decoder = new MemcachedCodecFactory().getDecoder();
    MemcachedTCPSession session = buildSession();
    Command versionCommand = new TextCommandFactory().createVersionCommand(
        new CountDownLatch(1), null);
    session.addCommand(versionCommand);
    Command decodedCommand = (Command) decoder.decode(IoBuffer
        .wrap(ByteBuffer.wrap("VERSION 1.28\r\n".getBytes())), session);
    assertSame(decodedCommand, versionCommand);
View Full Code Here

  public MemcachedTCPSession buildSession() {
    NioSessionConfig sessionConfig = new NioSessionConfig(null,
        new HandlerAdapter(), null, new ByteBufferCodecFactory(), null,
        null, null, true, 0, 0);
    return new MemcachedTCPSession(sessionConfig, 16 * 1024, null, 0,
        new TextCommandFactory());
  }
View Full Code Here

public class MemcachedEncoderUnitTest extends TestCase {
  private Encoder encoder;

  public void testEncode() {
    this.encoder = new MemcachedCodecFactory().getEncoder();
    Command command = new TextCommandFactory().createVersionCommand(
        new CountDownLatch(1), null);
    command.encode();
    IoBuffer buffer = this.encoder.encode(command, null);
    assertEquals(buffer.buf(), ServerAddressAware.VERSION);
  }
View Full Code Here

        + PROP_SESSION_LOCATOR + " value: " + getCommandFactoryName());
  }

  protected CommandFactory getCommandFactory() {
    if (commandFactoryNameEquals(TextCommandFactory.class)) {
      return new TextCommandFactory();
    }

    if (commandFactoryNameEquals(BinaryCommandFactory.class)) {
      return new BinaryCommandFactory();
    }
View Full Code Here

  private CommandFactory commandFactory;

  @Override
  protected void setUp() throws Exception {
    this.optimiezer = new Optimizer(Protocol.Text);
    this.commandFactory = new TextCommandFactory();
    this.optimiezer.setBufferAllocator(new SimpleBufferAllocator());
    this.writeQueue = new LinkedTransferQueue<Command>();
    this.executingCmds = new LinkedTransferQueue<Command>();
    for (int i = 0; i < 10; i++) {
      Command cmd = this.commandFactory.createGetCommand(
View Full Code Here

  private CommandFactory commandFactory;

  @Override
  protected void setUp() throws Exception {
    this.commandFactory = new TextCommandFactory(
        );
  }
View Full Code Here

TOP

Related Classes of net.rubyeye.xmemcached.command.TextCommandFactory

Copyright © 2018 www.massapicom. 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.