public void testMustNotBeAbleToShutdownGlobalPool() { ExecutorService service = AppExecutorUtil.getAppExecutorService(); try { service.shutdown(); fail(); } catch (Exception ignored) { } try { service.shutdownNow(); fail(); } catch (Exception ignored) { } try { ((ThreadPoolExecutor) service).setThreadFactory(Thread::new); fail(); } catch (Exception ignored) { } try { ((ThreadPoolExecutor) service).setCorePoolSize(0); fail(); } catch (Exception ignored) { } }
public void setThreadFactory(ThreadFactory factory) { pool.setThreadFactory(factory); }