Package org.teiid.dqp.internal.process

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


    }
   
    @Test public void testSchedule() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
        final ArrayList<String> result = new ArrayList<String>();
      pool.schedule(new Work() {
     
      @Override
      public void run() {
          result.add("hello"); //$NON-NLS-1$
      }
View Full Code Here


      assertEquals(1, result.size());
    }
   
    @Test(expected=ExecutionException.class) public void testScheduleException() throws Exception {
      ThreadReuseExecutor pool = new ThreadReuseExecutor("test", 5); //$NON-NLS-1$
      ScheduledFuture<?> future = pool.schedule(new Runnable() {
        @Override
        public void run() {
          throw new RuntimeException();
        }
      }, 0, TimeUnit.MILLISECONDS);
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.