org.jboss.test.util.test.concurrent
Class ThreadPoolRunnableUnitTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jboss.test.util.test.concurrent.ThreadPoolRunnableUnitTestCase
All Implemented Interfaces:
junit.framework.Test

public class ThreadPoolRunnableUnitTestCase
extends junit.framework.TestCase

Tests of thread pool with Runnables added to the pool

Version:
$Revision: 2787 $
Author:
Adrian.Brock, Scott.Stark@jboss.org
See Also:
ThreadPool

Nested Class Summary
 class ThreadPoolRunnableUnitTestCase.TestRunnable
          Test runnable
 
Constructor Summary
ThreadPoolRunnableUnitTestCase(String name)
          Create a new ThreadPoolRunnableUnitTestCase
 
Method Summary
 void clearFinished()
          Clear finished
 void clearStarted()
          Clear started
 HashSet makeExpected(Object[] expected)
          Make the expected result
 void notifyFinished(String data)
           
 void notifyStarted(String data)
           
 void releaseStarted(String data)
          Release in waiting for start
 void saveRunnableThreadName(String data, String name)
          Save the thread name
 void testBasic()
           
 void testMaximumPool()
           
 void testMaximumQueue()
           
 void testMultipleBasic()
           
 void testMultiplePooling()
           
 void testRunnableTimeout()
           
 void testRunnableTimeoutWithSpinLoop()
           
 void testRunnableTimeoutWithSpinLoop2()
           
 void testSimplePooling()
           
 void waitFinished(int target)
           
 void waitForReleaseStarted(String data)
           
 void waitStarted(int target)
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadPoolRunnableUnitTestCase

public ThreadPoolRunnableUnitTestCase(String name)
Create a new ThreadPoolRunnableUnitTestCase

Parameters:
name - the test to run
Method Detail

testBasic

public void testBasic()
               throws Exception
Throws:
Exception

testMultipleBasic

public void testMultipleBasic()
                       throws Exception
Throws:
Exception

testSimplePooling

public void testSimplePooling()
                       throws Exception
Throws:
Exception

testMultiplePooling

public void testMultiplePooling()
                         throws Exception
Throws:
Exception

testMaximumPool

public void testMaximumPool()
                     throws Exception
Throws:
Exception

testMaximumQueue

public void testMaximumQueue()
                      throws Exception
Throws:
Exception

testRunnableTimeout

public void testRunnableTimeout()
                         throws Exception
Throws:
Exception

testRunnableTimeoutWithSpinLoop

public void testRunnableTimeoutWithSpinLoop()
                                     throws Exception
Throws:
Exception

testRunnableTimeoutWithSpinLoop2

public void testRunnableTimeoutWithSpinLoop2()
                                      throws Exception
Throws:
Exception

saveRunnableThreadName

public void saveRunnableThreadName(String data,
                                   String name)
Save the thread name

Parameters:
data - the test data
name - the thread name

waitStarted

public void waitStarted(int target)
                 throws InterruptedException
Throws:
InterruptedException

releaseStarted

public void releaseStarted(String data)
Release in waiting for start

Parameters:
data - the thread to start

waitForReleaseStarted

public void waitForReleaseStarted(String data)

notifyStarted

public void notifyStarted(String data)

clearStarted

public void clearStarted()
Clear started


waitFinished

public void waitFinished(int target)
                  throws InterruptedException
Throws:
InterruptedException

notifyFinished

public void notifyFinished(String data)

clearFinished

public void clearFinished()
Clear finished


makeExpected

public HashSet makeExpected(Object[] expected)
Make the expected result

Parameters:
expected - the results as an object array
Returns:
the expected result


Copyright © 2009 JBoss Inc.. All Rights Reserved.