Search in sources :

Example 1 with TestProcessorMetaSupplierContext

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

the class JobRestartWithSnapshotTest method test_SequencesInPartitionsGeneratorP.

// This is a "test of a test" - it checks, that SequencesInPartitionsGeneratorP generates correct output
@Test
@Ignore
public void test_SequencesInPartitionsGeneratorP() throws Exception {
    SequencesInPartitionsMetaSupplier pms = new SequencesInPartitionsMetaSupplier(3, 2);
    pms.init(new TestProcessorMetaSupplierContext().setLocalParallelism(1).setTotalParallelism(2));
    Address a1 = new Address("127.0.0.1", 0);
    Address a2 = new Address("127.0.0.2", 0);
    Function<Address, ProcessorSupplier> supplierFunction = pms.get(asList(a1, a2));
    Iterator<? extends Processor> processors1 = supplierFunction.apply(a1).get(1).iterator();
    Processor p1 = processors1.next();
    assertFalse(processors1.hasNext());
    Iterator<? extends Processor> processors2 = supplierFunction.apply(a2).get(1).iterator();
    Processor p2 = processors2.next();
    assertFalse(processors2.hasNext());
    TestSupport.verifyProcessor(p1).expectOutput(asList(entry(0, 0), entry(2, 0), entry(0, 1), entry(2, 1)));
    TestSupport.verifyProcessor(p2).expectOutput(asList(entry(1, 0), entry(1, 1)));
}
Also used : Address(com.hazelcast.nio.Address) TestProcessorMetaSupplierContext(com.hazelcast.jet.core.test.TestProcessorMetaSupplierContext) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

TestProcessorMetaSupplierContext (com.hazelcast.jet.core.test.TestProcessorMetaSupplierContext)1 Address (com.hazelcast.nio.Address)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1