CollectorUtility { public static void closeQuietly(Collector<?> collector) { try { if (collector != null) { collector.close(); } } catch (IOException e) { } } protected  CollectorUtility(); static void closeQuietly(Collector<?> collector); static void closeQuietly(FileLineIterator<T> iterator); static void closeQuietly(FileLineWriter<T> writer);  }
@Test public void testCloseQuietly001() { CollectorStub<HogeBean> collector = new CollectorStub<HogeBean>(); CollectorUtility.closeQuietly(collector); assertTrue(collector.isCloseCalled()); }
@Test public void testCloseQuietly002() { CollectorStub<HogeBean> collector = new CollectorStub<HogeBean>(); collector.setCloseException(true); CollectorUtility.closeQuietly(collector); assertTrue(collector.isCloseCalled()); }
@Test public void testCloseQuietlyFileLineIteratorOfT001() { FileLineIteratorStub<Hoge> iterator = new FileLineIteratorStub<Hoge>(); CollectorUtility.closeQuietly(iterator); assertTrue(iterator.isCloseFileCalled()); }
@Test public void testCloseQuietlyFileLineIteratorOfT002() { FileLineIteratorStub<Hoge> iterator = new FileLineIteratorStub<Hoge>(); iterator.setCloseException(true); CollectorUtility.closeQuietly(iterator); assertTrue(iterator.isCloseFileCalled()); }
@Test public void testCloseQuietlyFileLineWriterOfT001() { FileLineWriterStub<Hoge> writer = new FileLineWriterStub<Hoge>(); CollectorUtility.closeQuietly(writer); assertTrue(writer.isCloseFileCalled()); }
@Test public void testCloseQuietlyFileLineWriterOfT002() { FileLineWriterStub<Hoge> writer = new FileLineWriterStub<Hoge>(); writer.setCloseException(true); CollectorUtility.closeQuietly(writer); assertTrue(writer.isCloseFileCalled()); }