@After public void tearDown() throws Exception { if (this.sampleCollector != null) { this.sampleCollector.close(); this.sampleCollector = null; } this.manager = null; }
@After public void tearDown() throws Exception { if (this.sampleCollector != null) { this.sampleCollector.close(); this.sampleCollector = null; } this.manager = null; }
@Test public void testGetStatMonitorHandlerAfterClose() { this.sampleCollector.close(); try { /* StatMonitorHandler handler = */ SampleCollector.getStatMonitorHandler(); fail( "getStatMonitorHandler should throw IllegalStateException when SampleCollector is closed"); } catch (IllegalStateException expected) { // passed } }
@Test public void testGetStatMonitorHandlerBeforeAndAfterClose() { StatMonitorHandler handler = SampleCollector.getStatMonitorHandler(); assertNotNull(handler); this.sampleCollector.close(); try { handler = SampleCollector.getStatMonitorHandler(); fail( "getStatMonitorHandler should throw IllegalStateException when SampleCollector is closed"); } catch (IllegalStateException expected) { // passed } }
closeSpecialStats(); if (this.sampleCollector != null) { this.sampleCollector.close();