Search in sources :

Example 21 with TestInbox

use of com.hazelcast.jet.core.test.TestInbox in project hazelcast-jet by hazelcast.

the class PeekingWrapperTest method assertPeekInput.

private void assertPeekInput() {
    peekP.init(mock(Outbox.class), context);
    TestInbox inbox = new TestInbox();
    inbox.add(0);
    peekP.process(0, inbox);
    verify(logger).info("Input from ordinal 0: " + format(0));
    inbox.add(0);
    peekP.process(1, inbox);
    verify(logger).info("Input from ordinal 1: " + format(0));
    inbox.add(1);
    peekP.process(0, inbox);
    if (shouldLogFn == null) {
        verify(logger).info("Input from ordinal 0: " + format(1));
    } else {
        verifyZeroInteractions(logger);
    }
    Watermark wm = new Watermark(1);
    peekP.tryProcessWatermark(wm);
    verify(logger).info("Input: " + wm);
}
Also used : TestInbox(com.hazelcast.jet.core.test.TestInbox) TestOutbox(com.hazelcast.jet.core.test.TestOutbox)

Example 22 with TestInbox

use of com.hazelcast.jet.core.test.TestInbox in project hazelcast-jet by hazelcast.

the class StreamKafkaPTest method saveSnapshot.

private TestInbox saveSnapshot(StreamKafkaP streamKafkaP, TestOutbox outbox) {
    TestInbox snapshot = new TestInbox();
    assertTrue(streamKafkaP.saveToSnapshot());
    outbox.drainSnapshotQueueAndReset(snapshot.queue(), false);
    return snapshot;
}
Also used : TestInbox(com.hazelcast.jet.core.test.TestInbox)

Aggregations

TestInbox (com.hazelcast.jet.core.test.TestInbox)22 TestOutbox (com.hazelcast.jet.core.test.TestOutbox)16 TestProcessorContext (com.hazelcast.jet.core.test.TestProcessorContext)16 Test (org.junit.Test)13 Processor (com.hazelcast.jet.core.Processor)11 QuickTest (com.hazelcast.test.annotation.QuickTest)8 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)7 Watermark (com.hazelcast.jet.core.Watermark)6 SimpleTestInClusterSupport (com.hazelcast.jet.SimpleTestInClusterSupport)4 Outbox (com.hazelcast.jet.core.Outbox)4 Before (org.junit.Before)4 FunctionEx (com.hazelcast.function.FunctionEx)3 Traverser (com.hazelcast.jet.Traverser)3 ProcessorMetaSupplier (com.hazelcast.jet.core.ProcessorMetaSupplier)3 ILogger (com.hazelcast.logging.ILogger)3 ArrayList (java.util.ArrayList)3 Arrays.asList (java.util.Arrays.asList)3 Collection (java.util.Collection)3 Collections.singletonList (java.util.Collections.singletonList)3 Entry (java.util.Map.Entry)3