@Test public void testMoveToTrash_NotUsingTrash() throws Exception { systemConfig.set(Property.GC_TRASH_IGNORE.getKey(), "true"); Path path = createMock(Path.class); assertFalse(gc.moveToTrash(path)); }
boolean moveToTrash(Path path) throws IOException { final VolumeManager fs = getContext().getVolumeManager(); if (!isUsingTrash()) { return false; } try { return fs.moveToTrash(path); } catch (FileNotFoundException ex) { return false; } }
SimpleGarbageCollector extends AbstractServer implements Iface { boolean moveToTrash(Path path) throws IOException { final VolumeManager fs = getContext().getVolumeManager(); if (!isUsingTrash()) { return false; } try { return fs.moveToTrash(path); } catch (FileNotFoundException ex) { return false; } } }
SimpleGarbageCollector extends AbstractServer implements Iface { boolean moveToTrash(Path path) throws IOException { final VolumeManager fs = getContext().getVolumeManager(); if (!isUsingTrash()) { return false; } try { return fs.moveToTrash(path); } catch (FileNotFoundException ex) { return false; } } SimpleGarbageCollector(ServerOpts opts, String[] args); }
SimpleGarbageCollector extends AbstractServer implements Iface { boolean moveToTrash(Path path) throws IOException { final VolumeManager fs = getContext().getVolumeManager(); if (!isUsingTrash()) { return false; } try { return fs.moveToTrash(path); } catch (FileNotFoundException ex) { return false; } } SimpleGarbageCollector(ServerOpts opts, String[] args); static void main(String[] args); @Override @SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit") void run(); @Override GCStatus getStatus(TInfo info, TCredentials credentials); GcCycleMetrics getGcCycleMetrics(); }
SimpleGarbageCollector extends AbstractServer implements Iface { boolean moveToTrash(Path path) throws IOException { final VolumeManager fs = getContext().getVolumeManager(); if (!isUsingTrash()) { return false; } try { return fs.moveToTrash(path); } catch (FileNotFoundException ex) { return false; } } SimpleGarbageCollector(ServerOpts opts, String[] args); static void main(String[] args); @Override @SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit") void run(); @Override GCStatus getStatus(TInfo info, TCredentials credentials); GcCycleMetrics getGcCycleMetrics();  }