示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @After public void tearDown()
        public virtual void TearDown()
        {
            InterruptedException exception = _pools.shutDownAll();

            if (exception != null)
            {
                throw new Exception("Test was interrupted?", exception);
            }
        }
示例#2
0
        public override void Shutdown()
        {
            _started = false;

            // First shut down the scheduler, so no new tasks are queued up in the pools.
            InterruptedException exception = ShutDownScheduler();

            // Then shut down the thread pools. This involves cancelling jobs which hasn't been cancelled already,
            // so we avoid having to wait the full maximum wait time on the executor service shut-downs.
            exception = Exceptions.chain(exception, _pools.shutDownAll());

            // Finally, we shut the work-stealing executors down.
            foreach (ExecutorService workStealingExecutor in _workStealingExecutors.Values)
            {
                exception = ShutdownPool(workStealingExecutor, exception);
            }
            _workStealingExecutors.Clear();

            if (exception != null)
            {
                throw new Exception("Unable to shut down job scheduler properly.", exception);
            }
        }