Package org.jboss.util.threadpool

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


   {
      log.debug("testBasic");
      BasicThreadPool pool = new BasicThreadPool();
      try
      {
         pool.run(new TestRunnable(BASIC, "test"));
         waitFinished(1);
         HashSet expected = makeExpected(new Object[] {"test"});
         assertEquals(expected, finishedRunnables);
      }
      finally
View Full Code Here


   {
      log.debug("testMultipleBasic");
      BasicThreadPool pool = new BasicThreadPool();
      try
      {
         pool.run(new TestRunnable(BASIC, "test1"));
         pool.run(new TestRunnable(BASIC, "test2"));
         pool.run(new TestRunnable(BASIC, "test3"));
         waitFinished(3);
         HashSet expected = makeExpected(new Object[] {"test1", "test2", "test3"});
         assertEquals(expected, finishedRunnables);
View Full Code Here

      log.debug("testMultipleBasic");
      BasicThreadPool pool = new BasicThreadPool();
      try
      {
         pool.run(new TestRunnable(BASIC, "test1"));
         pool.run(new TestRunnable(BASIC, "test2"));
         pool.run(new TestRunnable(BASIC, "test3"));
         waitFinished(3);
         HashSet expected = makeExpected(new Object[] {"test1", "test2", "test3"});
         assertEquals(expected, finishedRunnables);
      }
View Full Code Here

      BasicThreadPool pool = new BasicThreadPool();
      try
      {
         pool.run(new TestRunnable(BASIC, "test1"));
         pool.run(new TestRunnable(BASIC, "test2"));
         pool.run(new TestRunnable(BASIC, "test3"));
         waitFinished(3);
         HashSet expected = makeExpected(new Object[] {"test1", "test2", "test3"});
         assertEquals(expected, finishedRunnables);
      }
      finally
View Full Code Here

      log.debug("testSimplePooling");
      BasicThreadPool pool = new BasicThreadPool();
      pool.setMaximumPoolSize(1);
      try
      {
         pool.run(new TestRunnable(BASIC, "test1"));
         waitFinished(1);
         pool.run(new TestRunnable(BASIC, "test2"));
         waitFinished(2);
         assertEquals(threadNames.get("test1"), threadNames.get("test2"));
      }
View Full Code Here

      pool.setMaximumPoolSize(1);
      try
      {
         pool.run(new TestRunnable(BASIC, "test1"));
         waitFinished(1);
         pool.run(new TestRunnable(BASIC, "test2"));
         waitFinished(2);
         assertEquals(threadNames.get("test1"), threadNames.get("test2"));
      }
      finally
      {
View Full Code Here

   {
      log.debug("testMultiplePooling");
      BasicThreadPool pool = new BasicThreadPool();
      try
      {
         pool.run(new TestRunnable(HOLD_START, "test1"));
         waitStarted(1);
         pool.run(new TestRunnable(BASIC, "test2"));
         waitFinished(1);
         releaseStarted("test1");
         waitFinished(2);
View Full Code Here

      BasicThreadPool pool = new BasicThreadPool();
      try
      {
         pool.run(new TestRunnable(HOLD_START, "test1"));
         waitStarted(1);
         pool.run(new TestRunnable(BASIC, "test2"));
         waitFinished(1);
         releaseStarted("test1");
         waitFinished(2);
         assertTrue("Shouldn't run on the same thread", threadNames.get("test1").equals(threadNames.get("test2")) == false);
      }
View Full Code Here

      log.debug("testMaximumPool");
      BasicThreadPool pool = new BasicThreadPool();
      pool.setMaximumPoolSize(1);
      try
      {
         pool.run(new TestRunnable(HOLD_START, "test1"));
         waitStarted(1);
         pool.run(new TestRunnable(BASIC, "test2"));
         Thread.sleep(1000);
         assertEquals(0, finishedRunnables.size());
         releaseStarted("test1");
View Full Code Here

      pool.setMaximumPoolSize(1);
      try
      {
         pool.run(new TestRunnable(HOLD_START, "test1"));
         waitStarted(1);
         pool.run(new TestRunnable(BASIC, "test2"));
         Thread.sleep(1000);
         assertEquals(0, finishedRunnables.size());
         releaseStarted("test1");
         waitFinished(2);
         assertEquals(makeExpected(new Object[] {"test1", "test2"}), finishedRunnables);
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.