verify(ccuStats).close();
@Test public void shouldBeMockable() throws Exception { CCUStats mockCCUStats = mock(CCUStats.class); mockCCUStats.incReceivedBytes(1L); mockCCUStats.incSentBytes(1L); verify(mockCCUStats, times(1)).incReceivedBytes(1L); verify(mockCCUStats, times(1)).incSentBytes(1L); } }
/** * Signals the run thread to stop, closes underlying resources. */ @Override public void close() { this.continueProcessing.set(false); // signals we are done. // Close the socket. This will also cause the underlying streams to fail. try { if (this.socket != null) { this.socket.close(); } } catch (IOException ignore) { // ignore } if (this.cacheHelper != null) { this.cacheHelper.close(); } releaseCommBuffer(); this.stats.close(); }
public CCUStats createStatistics(DistributedSystem system, ServerLocation location) { return new CCUStats(system, location); } }