Package org.teiid.dqp.internal.process

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


       
        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


                Thread.sleep(SINGLE_WAIT*3);
            } catch(InterruptedException e) {               
            }
        }
       
        pool.shutdown();               
       
        WorkerPoolStatisticsMetadata stats = pool.getStats();
        assertEquals("Expected 1 thread for serial execution", 1, stats.getHighestActiveThreads()); //$NON-NLS-1$
       
        pool.awaitTermination(1000, TimeUnit.MILLISECONDS);
View Full Code Here

        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();
      pool.execute(new FakeWorkItem(1));
    }
   
    @Test public void testScheduleCancel() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
View Full Code Here

      public void release() {
       
      }
    }, 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 {
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.