StatMonitorHandler getStatMonitorHandler() { return SampleCollector.getStatMonitorHandler(); }
@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 } }
@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 testGetStatMonitorHandler() { StatMonitorHandler handler = SampleCollector.getStatMonitorHandler(); assertNotNull(handler); assertTrue(handler.getMonitorsSnapshot().isEmpty()); assertNull(handler.getStatMonitorNotifier()); }