Examples of TimingOutFixedThreadPoolExecutorServices


Examples of org.jboss.weld.executor.TimingOutFixedThreadPoolExecutorServices

    @Test
    public void testServices() throws Exception {
        assertTrue(manager.getServices().get(Validator.class) instanceof ConcurrentValidator);
        assertTrue(manager.getServices().get(ContainerLifecycleEvents.class).isPreloaderEnabled());
        assertTrue(manager.getServices().get(ExecutorServices.class) instanceof TimingOutFixedThreadPoolExecutorServices);
        TimingOutFixedThreadPoolExecutorServices executorServices = (TimingOutFixedThreadPoolExecutorServices) manager.getServices().get(ExecutorServices.class);
        // Use full capaticy of the pool
        assertEquals(3, executorServices.getPoolSize());
        Thread.sleep(7000l);
        // All workers timed out
        assertEquals(0, executorServices.getPoolSize());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.