@Override public synchronized void add(Id id, Record record) throws IOException, InterruptedException { if (record.context.getPhase() == ExecutionPhase.FINALIZE && profile(record).equals("testing1")) { throw new IOException(); } super.add(id, record); }
@Override public synchronized void add(Id id, Record record) throws IOException, InterruptedException { if (record.context.getPhase() == ExecutionPhase.CLEANUP && record.handler.getHandlerId().equals("hadoop")) { throw new IOException(); } super.add(id, record); }
@Override public synchronized void add(Id id, Record record) throws IOException, InterruptedException { switch (record.context.getPhase()) { case SETUP: assertThat(flowId, is(nullValue())); flowId = record.context.getFlowId(); break; case CLEANUP: assertThat(flowId, is(record.context.getFlowId())); flowId = null; break; default: Thread.sleep(100); assertThat(flowId, is(record.context.getFlowId())); break; } super.add(id, record); }