com.samskivert.util.tests
Class SerialExecutorTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.samskivert.util.tests.SerialExecutorTest
All Implemented Interfaces:
RunQueue, junit.framework.Test

public class SerialExecutorTest
extends junit.framework.TestCase
implements RunQueue

Tests the SerialExecutor class.


Nested Class Summary
protected  class SerialExecutorTest.Sleeper
           
 
Field Summary
protected  int _doubleints
           
protected  int _exits
           
protected  int _interrupts
           
protected  Thread _main
           
protected  Queue<Runnable> _queue
           
protected  int _results
           
protected  int _sleeps
           
protected  int _timeouts
           
 
Fields inherited from interface com.samskivert.util.RunQueue
AWT
 
Constructor Summary
SerialExecutorTest()
           
 
Method Summary
protected  void assertCount(String field, int value, int expected)
           
 boolean isDispatchThread()
           
static void main(String[] args)
           
 void postRunnable(Runnable r)
          Post the specified Runnable to be run on the RunQueue.
 void runTest()
           
static junit.framework.Test suite()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_main

protected Thread _main

_queue

protected Queue<Runnable> _queue

_sleeps

protected int _sleeps

_interrupts

protected int _interrupts

_doubleints

protected int _doubleints

_exits

protected int _exits

_results

protected int _results

_timeouts

protected int _timeouts
Constructor Detail

SerialExecutorTest

public SerialExecutorTest()
Method Detail

runTest

public void runTest()
Overrides:
runTest in class junit.framework.TestCase

assertCount

protected void assertCount(String field,
                           int value,
                           int expected)

postRunnable

public void postRunnable(Runnable r)
Description copied from interface: RunQueue
Post the specified Runnable to be run on the RunQueue.

Specified by:
postRunnable in interface RunQueue

isDispatchThread

public boolean isDispatchThread()
Specified by:
isDispatchThread in interface RunQueue
Returns:
true if the calling thread is the RunQueue dispatch thread.

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.