@Test public void testReset() throws Exception { final DownloadTransfer transfer = new DownloadTransfer(new Host(new TestProtocol()), new Path("/p", EnumSet.of(Path.Type.file)), new Local("/t")); final TransferSpeedometer s = new TransferSpeedometer(transfer); transfer.addSize(8L); assertEquals(8L, s.getStatus().getSize(), 0L); assertEquals(0L, s.getStatus().getTransferred(), 0L); assertEquals(0L, s.getStatus().getSpeed(), 0L); s.reset(); assertEquals(0L, s.getStatus().getSpeed(), 0L); transfer.addTransferred(4L); Thread.sleep(1000L); assertNotEquals(0L, s.getStatus().getSpeed(), 0L); s.reset(); assertEquals(0L, s.getStatus().getSpeed(), 0L); }
public void reset() { final long timestamp = System.currentTimeMillis(); if(log.isDebugEnabled()) { log.debug(String.format("Reset with timestamp %d", timestamp)); } this.reset(timestamp, transfer.getTransferred()); }
TransferSpeedometer extends Speedometer { public void reset() { final long timestamp = System.currentTimeMillis(); if(log.isDebugEnabled()) { log.debug(String.format("Reset with timestamp %d", timestamp)); } this.reset(timestamp, transfer.getTransferred()); } }
TransferSpeedometer extends Speedometer { public void reset() { final long timestamp = System.currentTimeMillis(); if(log.isDebugEnabled()) { log.debug(String.format("Reset with timestamp %d", timestamp)); } this.reset(timestamp, transfer.getTransferred()); } TransferSpeedometer(final Transfer transfer); }
TransferSpeedometer extends Speedometer { public void reset() { final long timestamp = System.currentTimeMillis(); if(log.isDebugEnabled()) { log.debug(String.format("Reset with timestamp %d", timestamp)); } this.reset(timestamp, transfer.getTransferred()); } TransferSpeedometer(final Transfer transfer); TransferProgress getStatus(); TransferProgress getStatus(boolean plain); void reset(); }
TransferSpeedometer extends Speedometer { public void reset() { final long timestamp = System.currentTimeMillis(); if(log.isDebugEnabled()) { log.debug(String.format("Reset with timestamp %d", timestamp)); } this.reset(timestamp, transfer.getTransferred()); } TransferSpeedometer(final Transfer transfer); TransferProgress getStatus(); TransferProgress getStatus(boolean plain); void reset();  }