Package io.netty.channel.embedded

Examples of io.netty.channel.embedded.EmbeddedChannel.config()


    int refCount = slices[0].refCnt();

    decodeAndVerify(ch, slices[0]);

    Assert.assertEquals(refCount + 1, slices[0].refCnt());
    Assert.assertFalse(ch.config().isAutoRead());

    // notify of available buffer (=> bufferAvailable() callback does return a buffer
    // of the current network buffer size; the decoder needs to adjust its size to the
    // requested size
    decoder.bufferAvailable(allocBuffer(envelopes[0].getBuffer().size() * 2));
 
View Full Code Here


    // requested size
    decoder.bufferAvailable(allocBuffer(envelopes[0].getBuffer().size() * 2));
    ch.runPendingTasks();

    Assert.assertEquals(refCount - 1, slices[0].refCnt());
    Assert.assertTrue(ch.config().isAutoRead());

    decodeAndVerify(ch, envelopes[0]);

    // 2. no buffer available, incoming slice does NOT contain all data
    refCount = slices[1].refCnt();
View Full Code Here

    refCount = slices[1].refCnt();

    decodeAndVerify(ch, slices[1]);

    Assert.assertEquals(refCount + 1, slices[1].refCnt());
    Assert.assertFalse(ch.config().isAutoRead());

    decoder.bufferAvailable(allocBuffer());
    ch.runPendingTasks();

    Assert.assertEquals(refCount - 1, slices[1].refCnt());
View Full Code Here

    decoder.bufferAvailable(allocBuffer());
    ch.runPendingTasks();

    Assert.assertEquals(refCount - 1, slices[1].refCnt());
    Assert.assertTrue(ch.config().isAutoRead());

    decodeAndVerify(ch);

    // 3. buffer available
    refCount = slices[2].refCnt();
View Full Code Here

    refCount = slices[2].refCnt();

    decodeAndVerify(ch, slices[2], envelopes[1], envelopes[2]);

    Assert.assertEquals(refCount - 1, slices[2].refCnt());
    Assert.assertTrue(ch.config().isAutoRead());

    Assert.assertEquals(1, buf.refCnt());
    buf.release();
  }
View Full Code Here

    int refCount = buf.refCnt();

    decodeAndVerify(ch, buf);

    Assert.assertFalse(ch.config().isAutoRead());
    Assert.assertEquals(refCount + 1, buf.refCnt());

    try {
      decodeAndVerify(ch, buf);
      Assert.fail("Expected IllegalStateException not thrown");
View Full Code Here

      // registered BufferAvailabilityListener => call bufferAvailable(buffer)
      while (randomBufferAvailabilityRegistrationAnswer.isRegistered()) {
        randomBufferAvailabilityRegistrationAnswer.unregister();

        Assert.assertFalse(ch.config().isAutoRead());
        Assert.assertEquals(refCount + 1, slice.refCnt());

        // return a buffer of max size => decoder needs to limit buffer size
        decoder.bufferAvailable(allocBuffer(MAX_BUFFER_SIZE));
        ch.runPendingTasks();
View Full Code Here

        decoder.bufferAvailable(allocBuffer(MAX_BUFFER_SIZE));
        ch.runPendingTasks();
      }

      Assert.assertEquals(refCount - 1, slice.refCnt());
      Assert.assertTrue(ch.config().isAutoRead());
    }

    Envelope[] expected = randomBufferAvailabilityRegistrationAnswer.removeSkippedEnvelopes(envelopes);

    decodeAndVerify(ch, expected);
View Full Code Here

    int refCount = slices[0].refCnt();

    decodeAndVerify(ch, slices[0]);

    Assert.assertEquals(refCount + 1, slices[0].refCnt());
    Assert.assertFalse(ch.config().isAutoRead());

    // notify of available buffer (=> bufferAvailable() callback does return a buffer
    // of the current network buffer size; the decoder needs to adjust its size to the
    // requested size
    decoder.bufferAvailable(allocBuffer(envelopes[0].getBuffer().size() * 2));
 
View Full Code Here

    // requested size
    decoder.bufferAvailable(allocBuffer(envelopes[0].getBuffer().size() * 2));
    ch.runPendingTasks();

    Assert.assertEquals(refCount - 1, slices[0].refCnt());
    Assert.assertTrue(ch.config().isAutoRead());

    decodeAndVerify(ch, envelopes[0]);

    // 2. no buffer available, incoming slice does NOT contain all data
    refCount = slices[1].refCnt();
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.