use of com.hazelcast.jet.core.TestProcessors.MockPMS in project hazelcast by hazelcast.
the class ExecutionLifecycleTest method when_psGetThrows_then_jobFails.
@Test
public void when_psGetThrows_then_jobFails() {
// Given
DAG dag = new DAG().vertex(new Vertex("faulty", new MockPMS(() -> new MockPS(MockP::new, MEMBER_COUNT).setGetError(MOCK_ERROR))));
// When
Job job = runJobExpectFailure(dag, false);
// Then
assertPsClosedWithError();
assertPmsClosedWithError();
assertJobFailed(job, MOCK_ERROR);
}
use of com.hazelcast.jet.core.TestProcessors.MockPMS in project hazelcast by hazelcast.
the class ExecutionLifecycleTest method when_psInitThrows_then_jobFails.
@Test
public void when_psInitThrows_then_jobFails() {
// Given
DAG dag = new DAG().vertex(new Vertex("test", new MockPMS(() -> new MockPS(MockP::new, MEMBER_COUNT).setInitError(MOCK_ERROR))));
// When
Job job = runJobExpectFailure(dag, false);
// Then
assertPsClosedWithError();
assertPmsClosedWithError();
assertJobFailed(job, MOCK_ERROR);
}
use of com.hazelcast.jet.core.TestProcessors.MockPMS in project hazelcast by hazelcast.
the class ExecutionLifecycleTest method when_pmsInitThrows_then_jobFails.
@Test
public void when_pmsInitThrows_then_jobFails() {
// Given
DAG dag = new DAG().vertex(new Vertex("test", new MockPMS(() -> new MockPS(MockP::new, MEMBER_COUNT)).setInitError(MOCK_ERROR)));
// When
Job job = runJobExpectFailure(dag, false);
// Then
assertPmsClosedWithError();
assertJobFailed(job, MOCK_ERROR);
}
use of com.hazelcast.jet.core.TestProcessors.MockPMS in project hazelcast by hazelcast.
the class ExecutionLifecycleTest method when_psCloseThrows_then_jobSucceeds.
@Test
public void when_psCloseThrows_then_jobSucceeds() {
// Given
DAG dag = new DAG().vertex(new Vertex("faulty", new MockPMS(() -> new MockPS(MockP::new, MEMBER_COUNT).setCloseError(MOCK_ERROR))));
// When
Job job = newJob(dag);
job.join();
// Then
assertPClosedWithoutError();
assertPsClosedWithoutError();
assertPmsClosedWithoutError();
assertJobSucceeded(job);
}
use of com.hazelcast.jet.core.TestProcessors.MockPMS in project hazelcast by hazelcast.
the class ExecutionLifecycleTest method when_processorProcessThrows_then_failJob.
@Test
public void when_processorProcessThrows_then_failJob() {
// Given
DAG dag = new DAG();
Vertex source = dag.newVertex("source", ListSource.supplier(singletonList(1)));
Vertex process = dag.newVertex("faulty", new MockPMS(() -> new MockPS(() -> new MockP().setProcessError(MOCK_ERROR), MEMBER_COUNT)));
dag.edge(between(source, process));
// When
Job job = runJobExpectFailure(dag, false);
// Then
assertPClosedWithError();
assertPsClosedWithError();
assertPmsClosedWithError();
assertJobFailed(job, MOCK_ERROR);
}
Aggregations