/** * clear all pending messages */ @Override public synchronized void clear() { memoryList.clear(); if (!isDiskListEmpty()) { try { getDiskList().destroy(); } catch (IOException e) { throw new RuntimeException(e); } } last = null; }
@Test public void testDestroyNonEmpty() throws Exception { final int COUNT = 1000; Map<String, ByteSequence> map = new LinkedHashMap<String, ByteSequence>(); for (int i = 0; i < COUNT; i++) { String test = new String("test" + i); ByteSequence bs = new ByteSequence(test.getBytes()); map.put(test, bs); plist.addLast(test, bs); } plist.destroy(); assertEquals(0,plist.size()); }
@Test public void testDestroy() throws Exception { doTestRemove(1); plist.destroy(); assertEquals(0,plist.size()); }
/** * clear all pending messages */ @Override public synchronized void clear() { memoryList.clear(); if (!isDiskListEmpty()) { try { getDiskList().destroy(); } catch (IOException e) { throw new RuntimeException(e); } } last = null; }
/** * clear all pending messages */ @Override public synchronized void clear() { memoryList.clear(); if (!isDiskListEmpty()) { try { getDiskList().destroy(); } catch (IOException e) { throw new RuntimeException(e); } } last = null; }
/** * clear all pending messages */ @Override public synchronized void clear() { memoryList.clear(); if (!isDiskListEmpty()) { try { getDiskList().destroy(); } catch (IOException e) { throw new RuntimeException(e); } } last = null; }