Search in sources :

Example 31 with MockPMS

use of com.hazelcast.jet.core.TestProcessors.MockPMS in project hazelcast-jet by hazelcast.

the class ExecutionLifecycleTest method when_processorCloseThrows_then_jobSucceeds.

@Test
public void when_processorCloseThrows_then_jobSucceeds() {
    // Given
    DAG dag = new DAG();
    RuntimeException e = new RuntimeException("mock error");
    dag.newVertex("faulty", new MockPMS(() -> new MockPS(() -> new MockP().setCloseError(e), NODE_COUNT)));
    // When
    Job job = instance.newJob(dag);
    job.join();
    // Then
    assertPClosedWithoutError();
    assertPsClosedWithoutError();
    assertPmsClosedWithoutError();
    assertJobSucceeded(job);
}
Also used : MockPMS(com.hazelcast.jet.core.TestProcessors.MockPMS) MockPS(com.hazelcast.jet.core.TestProcessors.MockPS) MockP(com.hazelcast.jet.core.TestProcessors.MockP) Job(com.hazelcast.jet.Job) Test(org.junit.Test)

Aggregations

MockPMS (com.hazelcast.jet.core.TestProcessors.MockPMS)31 MockPS (com.hazelcast.jet.core.TestProcessors.MockPS)31 Job (com.hazelcast.jet.Job)30 Test (org.junit.Test)30 MockP (com.hazelcast.jet.core.TestProcessors.MockP)26 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)17 QuickTest (com.hazelcast.test.annotation.QuickTest)17 NoOutputSourceP (com.hazelcast.jet.core.TestProcessors.NoOutputSourceP)2 CancellationException (java.util.concurrent.CancellationException)2 Config (com.hazelcast.config.Config)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 DAG (com.hazelcast.jet.core.DAG)1 Vertex (com.hazelcast.jet.core.Vertex)1 Before (org.junit.Before)1