public virtual void TestStop()
        {
            NonAggregatingLogHandler aggregatingLogHandler = new NonAggregatingLogHandler(null
                                                                                          , null, null, new NMNullStateStoreService());

            // It should not throw NullPointerException
            aggregatingLogHandler.Stop();
            TestNonAggregatingLogHandler.NonAggregatingLogHandlerWithMockExecutor logHandler =
                new TestNonAggregatingLogHandler.NonAggregatingLogHandlerWithMockExecutor(this,
                                                                                          null, null, null);
            logHandler.Init(new Configuration());
            logHandler.Stop();
            Org.Mockito.Mockito.Verify(logHandler.mockSched).Shutdown();
            Org.Mockito.Mockito.Verify(logHandler.mockSched).AwaitTermination(Matchers.Eq(10l
                                                                                          ), Matchers.Eq(TimeUnit.Seconds));
            Org.Mockito.Mockito.Verify(logHandler.mockSched).ShutdownNow();
            logHandler.Close();
            aggregatingLogHandler.Close();
        }
        public virtual void TestHandlingApplicationFinishedEvent()
        {
            DeletionService          delService            = new DeletionService(null);
            NonAggregatingLogHandler aggregatingLogHandler = new NonAggregatingLogHandler(new
                                                                                          InlineDispatcher(), delService, dirsHandler, new NMNullStateStoreService());

            dirsHandler.Init(conf);
            dirsHandler.Start();
            delService.Init(conf);
            delService.Start();
            aggregatingLogHandler.Init(conf);
            aggregatingLogHandler.Start();
            // It should NOT throw RejectedExecutionException
            aggregatingLogHandler.Handle(new LogHandlerAppFinishedEvent(appId));
            aggregatingLogHandler.Stop();
            // It should NOT throw RejectedExecutionException after stopping
            // handler service.
            aggregatingLogHandler.Handle(new LogHandlerAppFinishedEvent(appId));
            aggregatingLogHandler.Close();
        }