Skip to content

thurn/asynctest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsyncTest is a simple helper for writing asynchronous JUnit test cases. To use it, simply extend AsyncTestCase for your JUnit 4 test case. At the start of your test (or at least, at the start of the asynchronous portion of it), call beginAsyncTestBlock(). At the end, call endAsyncTestBlock(). Then, in your test, call finished() when some asynchronous operation has completed. You can also pass a number to beginAsyncTestBlock() to indicate the number of calls to finished() you are expecting.

By default, AsyncTest waits 10 seconds for calls to finished(), but this can be changed via a constructor parameter. It also adds a global UncaughtExceptionHandler to propagate uncaught exceptions thrown by your test code back to the main thread. This functionality can be changed via a constructor parameter as well.

About

A simple base class for writing asynchronous JUnit 4 tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors