QueueingResultHandlerImpl implements QueueingResultHandler<T> { @Override public void handleResult(ResultContext<? extends T> context) { delayCollect(); if (Thread.currentThread().isInterrupted()) { if (verboseLog.get()) { LOGGER.trace(LogId.TAL041003); } context.stop(); return; } this.prevRow = context.getResultObject(); }  @Override void handleResult(ResultContext<? extends T> context); @Override void delayCollect(); @Override void setDaoCollector(DaoCollector<T> daoCollector); static void setVerbose(boolean verbose);  }
@Test public void testHandleResult001() { QueueingResultHandlerImpl<HogeBean> drh = new QueueingResultHandlerImpl<>(); DummyResultContext ctxInNull = new DummyResultContext(); ctxInNull.setResultObject(null); assertNotNull(drh); try { drh.handleResult(ctxInNull); drh.handleResult(ctxInNull); drh.handleResult(ctxInNull); drh.handleResult(ctxInNull); drh.handleResult(ctxInNull); } catch (Exception e) { e.printStackTrace(); fail(); } }
@Test public void testHandleResult002() { QueueingResultHandlerImpl<HogeBean> drh = new QueueingResultHandlerImpl<>(); assertNotNull(drh); try { DummyResultContext context = new DummyResultContext(); context.setResultObject(HogeBean.buider().hoge("hoge1").build()); drh.handleResult(context); context = new DummyResultContext(); context.setResultObject(HogeBean.buider().hoge("hoge2").build()); drh.handleResult(context); DummyResultContext contextInNull = new DummyResultContext(); contextInNull.setResultObject(null); drh.handleResult(contextInNull); context = new DummyResultContext(); context.setResultObject(HogeBean.buider().hoge("hoge3").build()); drh.handleResult(context); context = new DummyResultContext(); context.setResultObject(HogeBean.buider().hoge("hoge4").build()); drh.handleResult(context); } catch (Exception e) { e.printStackTrace(); fail(); } }