Package org.teiid.dqp.internal.process

Examples of org.teiid.dqp.internal.process.ThreadReuseExecutor.awaitTermination()


        for(int i=0; i<WORK_ITEMS; i++) {
            pool.execute(new FakeWorkItem(SINGLE_WAIT));
        }
       
        pool.shutdown();       
        pool.awaitTermination(1000, TimeUnit.MILLISECONDS);
        assertTrue(pool.isTerminated());
        WorkerPoolStatisticsMetadata stats = pool.getStats();
        assertEquals(10, stats.getTotalCompleted());
        assertEquals("Expected threads to be maxed out", MAX_THREADS, stats.getHighestActiveThreads()); //$NON-NLS-1$
    }
View Full Code Here


        pool.shutdown();               
       
        WorkerPoolStatisticsMetadata stats = pool.getStats();
        assertEquals("Expected 1 thread for serial execution", 1, stats.getHighestActiveThreads()); //$NON-NLS-1$
       
        pool.awaitTermination(1000, TimeUnit.MILLISECONDS);
    }
   
    @Test(expected=RejectedExecutionException.class) public void testShutdown() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
        pool.shutdown();
View Full Code Here

       
      }
    }, 5, TimeUnit.MILLISECONDS);
      Thread.sleep(100);
      pool.shutdown();
      pool.awaitTermination(1000, TimeUnit.MILLISECONDS);
      assertEquals(1, result.size());
    }
   
    @Test(expected=ExecutionException.class) public void testScheduleException() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
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.