Search in sources :

Example 1 with ManagedScheduledExecutorServiceImpl

use of org.apache.openejb.threads.impl.ManagedScheduledExecutorServiceImpl in project tomee by apache.

the class ManagedScheduledExecutorServiceImplFactoryTest method createServiceTest.

@Test
public void createServiceTest() {
    final ManagedScheduledExecutorServiceImplFactory factory = new ManagedScheduledExecutorServiceImplFactory();
    factory.setThreadFactory(MyThreadFactory.class.getName());
    final ManagedScheduledExecutorServiceImpl executorService = factory.create();
    final ScheduledThreadPoolExecutor poolExecutor = (ScheduledThreadPoolExecutor) executorService.getDelegate();
    Assert.assertEquals(poolExecutor.getThreadFactory().getClass(), ManagedThreadFactoryImpl.class);
}
Also used : ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor) ManagedScheduledExecutorServiceImpl(org.apache.openejb.threads.impl.ManagedScheduledExecutorServiceImpl) ManagedScheduledExecutorServiceImplFactory(org.apache.openejb.resource.thread.ManagedScheduledExecutorServiceImplFactory) Test(org.junit.Test)

Aggregations

ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)1 ManagedScheduledExecutorServiceImplFactory (org.apache.openejb.resource.thread.ManagedScheduledExecutorServiceImplFactory)1 ManagedScheduledExecutorServiceImpl (org.apache.openejb.threads.impl.ManagedScheduledExecutorServiceImpl)1 Test (org.junit.Test)1