Examples of BufferState


Examples of io.fabric8.dosgi.io.ProtocolCodec.BufferState

  @Test
  public void testWrite() throws Exception {
    final Buffer value = Buffer.ascii("TESTDATA");

    final BufferState state = codec.write(value);

    assertEquals(BufferState.WAS_EMPTY, state);
    assertEquals(false, codec.full());
    assertEquals(false, codec.empty());
    assertEquals(0l, codec.getWriteCounter());
View Full Code Here

Examples of io.fabric8.dosgi.io.ProtocolCodec.BufferState

  public void testWrite$Twice() throws Exception {
    final Buffer value1 = Buffer.ascii("TESTDATA");
    final Buffer value2 = Buffer.ascii("TESTDATA");
    codec.write(value1);

    final BufferState state = codec.write(value2);

    assertEquals(BufferState.NOT_EMPTY, state);
    assertEquals(false, codec.full());
    assertEquals(false, codec.empty());
    assertEquals(0l, codec.getWriteCounter());
View Full Code Here

Examples of io.fabric8.dosgi.io.ProtocolCodec.BufferState

    codec.write(value);
    final int bytesThatWillBeWritten = value.length();
    expect(writableByteChannel.write((ByteBuffer) anyObject())).andAnswer(createWriteAnswer(bytesThatWillBeWritten));
    replay(writableByteChannel);

    final BufferState state = codec.flush();

    assertEquals(BufferState.EMPTY, state);
    assertEquals(false, codec.full());
    assertEquals(true, codec.empty());
    assertEquals(bytesThatWillBeWritten, codec.getWriteCounter());
View Full Code Here

Examples of io.fabric8.dosgi.io.ProtocolCodec.BufferState

    codec.write(value);
    final int bytesThatWillBeWritten = value.length() / 2;
    expect(writableByteChannel.write((ByteBuffer) anyObject())).andAnswer(createWriteAnswer(bytesThatWillBeWritten));
    replay(writableByteChannel);

    final BufferState state = codec.flush();

    assertEquals(BufferState.NOT_EMPTY, state);
    assertEquals(false, codec.full());
    assertEquals(false, codec.empty());
    assertEquals(bytesThatWillBeWritten, codec.getWriteCounter());
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.