Search in sources :

Example 6 with PageResultListener

use of io.crate.operation.PageResultListener in project crate by crate.

the class PageDownstreamContextTest method testListenersCalledWhenOtherUpstreamIsFailing.

@Test
public void testListenersCalledWhenOtherUpstreamIsFailing() throws Exception {
    TestingBatchConsumer consumer = new TestingBatchConsumer();
    PageDownstreamContext ctx = getPageDownstreamContext(consumer, PassThroughPagingIterator.oneShot(), 2);
    PageResultListener listener = mock(PageResultListener.class);
    ctx.setBucket(0, Bucket.EMPTY, true, listener);
    ctx.failure(1, new Exception("dummy"));
    verify(listener, times(1)).needMore(false);
}
Also used : PageResultListener(io.crate.operation.PageResultListener) TestingBatchConsumer(io.crate.testing.TestingBatchConsumer) Test(org.junit.Test) CrateUnitTest(io.crate.test.integration.CrateUnitTest)

Aggregations

PageResultListener (io.crate.operation.PageResultListener)6 CrateUnitTest (io.crate.test.integration.CrateUnitTest)4 TestingBatchConsumer (io.crate.testing.TestingBatchConsumer)4 Test (org.junit.Test)4 ArrayBucket (io.crate.data.ArrayBucket)2 Bucket (io.crate.data.Bucket)2 CollectionBucket (io.crate.data.CollectionBucket)2