Search in sources :

Example 1 with DummyExecutor

use of org.apache.tika.config.DummyExecutor in project tika by apache.

the class TikaConfigTest method testTikaExecutorServiceFromConfig.

@Test
public void testTikaExecutorServiceFromConfig() throws Exception {
    URL url = TikaConfigTest.class.getResource("TIKA-1762-executors.xml");
    TikaConfig config = new TikaConfig(url);
    ThreadPoolExecutor executorService = (ThreadPoolExecutor) config.getExecutorService();
    assertTrue("Should use Dummy Executor", (executorService instanceof DummyExecutor));
    assertEquals("Should have configured Core Threads", 3, executorService.getCorePoolSize());
    assertEquals("Should have configured Max Threads", 10, executorService.getMaximumPoolSize());
}
Also used : TikaConfig(org.apache.tika.config.TikaConfig) DummyExecutor(org.apache.tika.config.DummyExecutor) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) URL(java.net.URL) Test(org.junit.Test) TikaConfigTest(org.apache.tika.config.TikaConfigTest)

Aggregations

URL (java.net.URL)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1 DummyExecutor (org.apache.tika.config.DummyExecutor)1 TikaConfig (org.apache.tika.config.TikaConfig)1 TikaConfigTest (org.apache.tika.config.TikaConfigTest)1 Test (org.junit.Test)1