예제 #1
0
 @After
 public void cleanup() throws IOException {
   if (reuseQueue) {
     queue.clear();
   } else {
     queue.dispose();
   }
 }
예제 #2
0
  @Test
  public void testMultipleCycles() throws IOException {
    for (int i = 0; i < 10; i++) {
      // also test reading increasingly short lists back in
      test(maxObjectsInMemory * 2 * (10 - i));
      queue.clear();

      // garbage collection can trigger finalizers,
      // which in turn close file descriptors
      System.gc();
    }
  }