|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase frysk.junit.TestCase frysk.event.EventLoopTestBed
abstract class EventLoopTestBed
Framework for testing different event loops.
Nested Class Summary | |
---|---|
private class |
EventLoopTestBed.EventRequest
Wrapper class to Request that re-dispatches to the specified event. |
private class |
EventLoopTestBed.EventThread
This thread asynchronously adds an event to the event loop. |
private class |
EventLoopTestBed.Immediate
Test that multiple requests from the event-loop thread get proccessed immediatly. |
private class |
EventLoopTestBed.RunnableEvent
|
private class |
EventLoopTestBed.RunnableExecuteEvent
|
private class |
EventLoopTestBed.RunnableRequestEvent
|
private class |
EventLoopTestBed.SignalThread
This thread asynchronously adds a signal handler, and code to trigger the signal, to the event loop. |
private class |
EventLoopTestBed.SleepThread
This thread asynchronously, and after 100 milliseconds, adds a final stop request. |
private class |
EventLoopTestBed.Throw
|
private class |
EventLoopTestBed.TimerThread
This thread asynchronously adds a timer to the event loop. |
Field Summary | |
---|---|
private EventLoop |
eventLoop
|
private ProcessIdentifier |
eventTid
|
Constructor Summary | |
---|---|
EventLoopTestBed()
|
Method Summary | |
---|---|
protected abstract EventLoop |
newEventLoop()
Return the event loop to be tested. |
void |
setUp()
Re-create the event loop ready for the next test. |
void |
tearDown()
Reap any stray signals. |
void |
testAsync()
Check that asynchronous events wake up the event loop. |
void |
testCountDownTimersAndSignals()
Test countdown timers alternating with signals. |
void |
testExecuteImmediate()
|
void |
testExecuteRunnable()
|
void |
testExecuteThrow()
|
void |
testManyExecutes()
|
void |
testManyRequests()
|
void |
testPeriodicTimer()
Test the periodic timer. |
void |
testRequestImmediate()
|
void |
testRequestRunnable()
|
void |
testRequestThrow()
|
void |
testScheduleBeforeRun()
Test that events scheduled before run are processed. |
void |
testSignalHandler()
Test adding and removing a signal handler. |
void |
testTimerRemoval()
Test the removal of a timer. |
private void |
verifyImmediate(EventLoopTestBed.Immediate immediate)
|
private void |
verifyMany(EventLoopTestBed.RunnableEvent request)
Test that many simultaneous requests, from different threads, are eventually all handled. |
private void |
verifyRunnableEvent(EventLoopTestBed.RunnableEvent request)
Test that a simple request is handled by the event-loop thread. |
private void |
verifyThrow(EventLoopTestBed.Throw request)
Test that a throw from within the event-loop thread is propogated back to the requesting thread. |
Methods inherited from class frysk.junit.TestCase |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, getTimeoutMilliseconds, getTimeoutSeconds, missing32or64, unresolved, unresolvedOffUtrace, unresolvedOn32On64, unresolvedOnIA32, unresolvedOnPPC, unresolvedOnUtrace, unresolvedOnx8664, unsupported |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, 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 |
---|
private EventLoop eventLoop
private ProcessIdentifier eventTid
Constructor Detail |
---|
EventLoopTestBed()
Method Detail |
---|
protected abstract EventLoop newEventLoop()
public void setUp()
setUp
in class TestCase
public void tearDown()
tearDown
in class TestCase
public void testCountDownTimersAndSignals()
public void testPeriodicTimer()
public void testTimerRemoval()
public void testScheduleBeforeRun()
public void testSignalHandler()
public void testAsync()
private void verifyRunnableEvent(EventLoopTestBed.RunnableEvent request)
public void testExecuteRunnable()
public void testRequestRunnable()
private void verifyMany(EventLoopTestBed.RunnableEvent request)
public void testManyExecutes()
public void testManyRequests()
private void verifyThrow(EventLoopTestBed.Throw request)
public void testExecuteThrow()
public void testRequestThrow()
private void verifyImmediate(EventLoopTestBed.Immediate immediate)
public void testExecuteImmediate()
public void testRequestImmediate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |