test_class.file: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/reader/BufferReaderTest.java
test_class.identifier: BufferReaderTest
test_case.body: @Test
  	public void testGetNextBufferOrEvent() throws IOException, InterruptedException {
  
  		final TestSingleInputGate inputGate = new TestSingleInputGate(1)
  				.readBuffer().readBuffer().readEvent()
  				.readBuffer().readBuffer().readEvent()
  				.readBuffer().readEndOfPartitionEvent();
  
  		final BufferReader reader = new BufferReader(inputGate.getInputGate());
  
  		// Task event listener to be notified...
  		final EventListener<TaskEvent> listener = mock(EventListener.class);
  		reader.registerTaskEventListener(listener, TestTaskEvent.class);
  
  		int numReadBuffers = 0;
  		while ((reader.getNextBuffer()) != null) {
  			numReadBuffers++;
  		}
  
  		assertEquals(5, numReadBuffers);
  		verify(listener, times(2)).onEvent(any(TaskEvent.class));
  	}
test_case.class_method_signature: BufferReaderTest.testGetNextBufferOrEvent()
test_case.full_signature: @Test public void testGetNextBufferOrEvent()
test_case.identifier: testGetNextBufferOrEvent
test_case.invocations: readEndOfPartitionEvent readBuffer readEvent readBuffer readBuffer readEvent readBuffer readBuffer getInputGate mock registerTaskEventListener getNextBuffer assertEquals onEvent verify times any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetNextBufferOrEvent()
focal_class.file: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/reader/BufferReader.java
focal_class.identifier: BufferReader
focal_class.class_method_signature: BufferReader.BufferReader(InputGate gate)
focal_class.full_signature: public  BufferReader(InputGate gate)
focal_class.identifier: BufferReader
focal_class.modifiers: public
focal_class.parameters: (InputGate gate)
focal_class.signature:  BufferReader(InputGate gate)
focal_class.class_method_signature: BufferReader.getNextBuffer()
focal_class.full_signature: public Buffer getNextBuffer()
focal_class.identifier: getNextBuffer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Buffer
focal_class.signature: Buffer getNextBuffer()
focal_class.class_method_signature: BufferReader.setReporter(AccumulatorRegistry.Reporter reporter)
focal_class.full_signature: @Override public void setReporter(AccumulatorRegistry.Reporter reporter)
focal_class.identifier: setReporter
focal_class.modifiers: @Override public
focal_class.parameters: (AccumulatorRegistry.Reporter reporter)
focal_class.return: void
focal_class.signature: void setReporter(AccumulatorRegistry.Reporter reporter)
focal_class.superclass: extends AbstractReader
focal_method.body: public Buffer getNextBuffer() throws IOException, InterruptedException {
  		while (true) {
  			final BufferOrEvent bufferOrEvent = inputGate.getNextBufferOrEvent();
  
  			if (bufferOrEvent.isBuffer()) {
  				return bufferOrEvent.getBuffer();
  			}
  			else {
  				if (handleEvent(bufferOrEvent.getEvent())) {
  					return null;
  				}
  			}
  		}
  	}
focal_method.class_method_signature: BufferReader.getNextBuffer()
focal_method.full_signature: public Buffer getNextBuffer()
focal_method.identifier: getNextBuffer
focal_method.invocations: getNextBufferOrEvent isBuffer getBuffer handleEvent getEvent
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Buffer
focal_method.signature: Buffer getNextBuffer()