private final ByteBufferPool byteBufferPool = new MappedByteBufferPool();
@Test
public void testGenerateParse() throws Exception
{
WindowUpdateGenerator generator = new WindowUpdateGenerator(new HeaderGenerator());
final List<WindowUpdateFrame> frames = new ArrayList<>();
Parser parser = new Parser(byteBufferPool, new Parser.Listener.Adapter()
{
@Override
public boolean onWindowUpdate(WindowUpdateFrame frame)
{
frames.add(frame);
return false;
}
}, 4096, 8192);
int streamId = 13;
int windowUpdate = 17;
// Iterate a few times to be sure generator and parser are properly reset.
for (int i = 0; i < 2; ++i)
{
ByteBufferPool.Lease lease = new ByteBufferPool.Lease(byteBufferPool);
generator.generateWindowUpdate(lease, streamId, windowUpdate);
frames.clear();
for (ByteBuffer buffer : lease.getByteBuffers())
{
while (buffer.hasRemaining())