@Override public void afterChunkError(ChunkContext context) { try { chunkListener.afterChunkError(context); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterFailedChunk.", e); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onReadError(java.lang.Exception)} * . */ @Test public void testOnReadErrorFails() { error = true; try { multicast.onReadError(new RuntimeException("foo")); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#afterStep(StepExecution) */ @Override public ExitStatus afterStep(StepExecution stepExecution) { try { return stepListener.afterStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterStep.", e); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#onWriteError(Exception, java.util.List)} * . */ @Test public void testOnWriteErrorFails() { error = true; try { multicast.onWriteError(new RuntimeException("foo"), null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeItemReadListener#onReadError(java.lang.Exception) */ @Override public void onReadError(Exception ex) { try { itemReadListener.onReadError(ex); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in onReadError.", e); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterStep(org.springframework.batch.core.StepExecution)} * . */ @Test public void testAfterStepFails() { error = true; try { multicast.afterStep(null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see ItemWriteListener#onWriteError(Exception, List) */ @Override public void onWriteError(Exception ex, List<? extends S> items) { try { itemWriteListener.onWriteError(ex, items); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in onWriteError.", e); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterChunk(ChunkContext context)} * . */ @Test public void testAfterChunkFails() { error = true; try { multicast.afterChunk(null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution) */ @Override public void beforeStep(StepExecution stepExecution) { try { stepListener.beforeStep(stepExecution); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeStep.", e); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterRead(java.lang.Object)} * . */ @Test public void testAfterReadFails() { error = true; try { multicast.afterRead(null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeItemProcessListener#onProcessError(java.lang.Object, * java.lang.Exception) */ @Override public void onProcessError(T item, Exception ex) { try { itemProcessListener.onProcessError(item, ex); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in onProcessError.", e); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeWrite(List)} * . */ @Test public void testBeforeWriteFails() { error = true; try { multicast.beforeWrite(null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeItemProcessListener#afterProcess(java.lang.Object, * java.lang.Object) */ @Override public void afterProcess(T item, @Nullable S result) { try { itemProcessListener.afterProcess(item, result); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterProcess.", getTargetException(e)); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeChunk(ChunkContext context)} * . */ @Test public void testBeforeChunkFails() { error = true; try { multicast.beforeChunk(null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeItemProcessListener#beforeProcess(java.lang.Object) */ @Override public void beforeProcess(T item) { try { itemProcessListener.beforeProcess(item); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeProcess.", getTargetException(e)); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeRead()} * . */ @Test public void testBeforeReadFails() { error = true; try { multicast.beforeRead(); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk(ChunkContext context) */ @Override public void afterChunk(ChunkContext context) { try { chunkListener.afterChunk(context); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in afterChunk.", getTargetException(e)); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#beforeStep(org.springframework.batch.core.StepExecution)} * . */ @Test public void testBeforeStepFails() { error = true; try { multicast.beforeStep(null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }
/** * @see org.springframework.batch.core.listener.CompositeChunkListener#beforeChunk(ChunkContext context) */ @Override public void beforeChunk(ChunkContext context) { try { chunkListener.beforeChunk(context); } catch (RuntimeException e) { throw new StepListenerFailedException("Error in beforeChunk.", getTargetException(e)); } }
/** * Test method for * {@link org.springframework.batch.core.listener.MulticasterBatchListener#afterWrite(java.util.List)} * . */ @Test public void testAfterWriteFails() { error = true; try { multicast.afterWrite(null); fail("Expected StepListenerFailedException"); } catch (StepListenerFailedException e) { // expected String message = e.getCause().getMessage(); assertEquals("Wrong message: " + message, "listener error", message); } assertEquals(1, count); }