Examples of runTask()


Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

      pool.setMaximumPoolSize(1);
      try
      {
         pool.runTask(new TestTask(HOLD_START, "test1"));
         started.wait(1);
         pool.runTask(new TestTask(BASIC, "test2"));
         Thread.sleep(1000);
         assertEquals(0, completed.tasks.size());
         started.release("test1");
         completed.wait(2);
         assertEquals(makeExpected(new Object[] {"test1", "test2"}), completed.tasks);
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

      BasicThreadPool pool = new BasicThreadPool();
      pool.setMaximumQueueSize(1);
      pool.setMaximumPoolSize(1);
      try
      {
         pool.runTask(new TestTask(HOLD_START, "test1"));
         started.wait(1);
         pool.runTask(new TestTask(BASIC, "test2"));
         assertEquals(0, rejected.tasks.size());
         pool.runTask(new TestTask(BASIC, "test3"));
         assertEquals(makeExpected(new Object[] {"test3"}), rejected.tasks);
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

      pool.setMaximumPoolSize(1);
      try
      {
         pool.runTask(new TestTask(HOLD_START, "test1"));
         started.wait(1);
         pool.runTask(new TestTask(BASIC, "test2"));
         assertEquals(0, rejected.tasks.size());
         pool.runTask(new TestTask(BASIC, "test3"));
         assertEquals(makeExpected(new Object[] {"test3"}), rejected.tasks);

         started.release("test1");
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

      {
         pool.runTask(new TestTask(HOLD_START, "test1"));
         started.wait(1);
         pool.runTask(new TestTask(BASIC, "test2"));
         assertEquals(0, rejected.tasks.size());
         pool.runTask(new TestTask(BASIC, "test3"));
         assertEquals(makeExpected(new Object[] {"test3"}), rejected.tasks);

         started.release("test1");
         completed.wait(2);
         assertEquals(makeExpected(new Object[] {"test1", "test2"}), completed.tasks);
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

      {
         /* Test that a task with a timeout that completes within its timeout
         works as expected
         */
         TestTask task = new TestTask(HOLD_START, "test1", 0, 10*1000, Task.WAIT_NONE);
         pool.runTask(task);
         started.wait(1);
         started.release("test1");
         completed.wait(1);

         /* Test a task with a timeout that does not complete within its timeout
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

         /* Test a task with a timeout that does not complete within its timeout
         is stopped
         */
         task = new TestTask(HOLD_START, "test2", 0, 10*1000, Task.WAIT_NONE);
         task.setRunSleepTime(12*1000);
         pool.runTask(task);
         started.wait(1);
         started.release("test2");
         stopped.wait(1);
         completed.wait(1);

View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

         stopped.wait(1);
         completed.wait(1);

         // Test that another valid task completes as expected
         task = new TestTask(HOLD_START, "test3", 0, 0, Task.WAIT_NONE);
         pool.runTask(task);
         started.wait(1);
         started.release("test3");
         completed.wait(1);

         /* Test a task with a timeout that does not complete within its timeout
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

         /* Test a task with a timeout that does not complete within its timeout
         is stopped
         */
         task = new TestTask(HOLD_START, "test4", 0, 10*1000, Task.WAIT_NONE);
         task.setRunSleepTime(12*1000);
         pool.runTask(task);
         started.wait(1);
         started.release("test4");
         stopped.wait(1);        
         completed.wait(1);
      }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool.runTask()

         /* Test that a task with a timeout that completes within its timeout
         works as expected
         */
         TestTask task = new TestTask(HOLD_START, "test1", 0, 10*1000, Task.WAIT_NONE);
         task.setRunSleepTime(Long.MAX_VALUE);
         pool.runTask(task);
         started.wait(1);
         started.release("test1");
         stopped.wait(1);        
         completed.wait(1);
      }
View Full Code Here

Examples of org.openbravo.erpCommon.utility.AntExecutor.runTask()

        ant.setProperty("force", "true");
        tasks.add("apply.modules");
        ant.setProperty("module", unnappliedModules);
      }

      ant.runTask(tasks);

      ant.setFinished(true);

      if (ant.hasErrorOccured()) {
        createModuleLog(false, ant.getErr());
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.