@SuppressWarnings("unchecked") @Override public void afterWrite(List<? extends S> items) { try { delegate.afterWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void beforeWrite(List<? extends S> items) { try { delegate.beforeWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void onWriteError(Exception exception, List<? extends S> items) { try { delegate.onWriteError((List<Object>) items, exception); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
if (!nothingToWrite) { for (final ItemWriteListener l : itemWriteListeners) { l.beforeWrite(outputList); l.afterWrite(outputList); l.onWriteError(outputList, e);
writeListenerProxy.beforeWrite(theChunk); writeListenerProxy.afterWrite(theChunk); for (ItemWriteListener writeListenerProxy : itemWriteListeners) { try { writeListenerProxy.onWriteError(theChunk, e); } catch (Exception e1) { ExceptionConfig.wrapBatchException(e1);
@Test(expected=BatchRuntimeException.class) public void testOnWriteErrorException() throws Exception { Exception cause = new Exception("cause"); doThrow(new Exception("expected")).when(delegate).onWriteError(items, cause); adapter.onWriteError(cause, items); } }
@Test(expected=BatchRuntimeException.class) public void testAfterTestWriteException() throws Exception { doThrow(new Exception("expected")).when(delegate).afterWrite(items); adapter.afterWrite(items); }
@Test(expected=BatchRuntimeException.class) public void testBeforeTestWriteException() throws Exception { doThrow(new Exception("expected")).when(delegate).beforeWrite(items); adapter.beforeWrite(items); }
@Test public void testOnWriteError() throws Exception { Exception cause = new Exception("cause"); adapter.onWriteError(cause, items); verify(delegate).onWriteError(items, cause); }
@Test public void testAfterWrite() throws Exception { adapter.afterWrite(items); verify(delegate).afterWrite(items); }
@Test public void testBeforeWrite() throws Exception { adapter.beforeWrite(items); verify(delegate).beforeWrite(items); }
@SuppressWarnings("unchecked") @Override public void onWriteError(Exception exception, List<? extends S> items) { try { delegate.onWriteError((List<Object>) items, exception); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
@SuppressWarnings("unchecked") @Override public void afterWrite(List<? extends S> items) { try { delegate.afterWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void beforeWrite(List<? extends S> items) { try { delegate.beforeWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void onWriteError(Exception exception, List<? extends S> items) { try { delegate.onWriteError((List<Object>) items, exception); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
@SuppressWarnings("unchecked") @Override public void afterWrite(List<? extends S> items) { try { delegate.afterWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void beforeWrite(List<? extends S> items) { try { delegate.beforeWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void onWriteError(Exception exception, List<? extends S> items) { try { delegate.onWriteError((List<Object>) items, exception); } catch (Exception e) { throw new BatchRuntimeException(e); } } }
@SuppressWarnings("unchecked") @Override public void afterWrite(List<? extends S> items) { try { delegate.afterWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public void beforeWrite(List<? extends S> items) { try { delegate.beforeWrite((List<Object>) items); } catch (Exception e) { throw new BatchRuntimeException(e); } }