Re: Is it possible to have write NonBlocking Junit tests
Malte Finsterwalder <[email protected]> Fri, 11 Apr 2014 23:20:03 +0200
| Newsgroups | gmane.comp.java.junit.user |
|---|---|
| Message-ID | <CALS12-M1KX_G-F36fMAdJsGgwSoxg=JAvESxtYgaWCwhfTHJQA@mail.gmail.com> |
According to general logic: You can't access and verify a result, that was not yet produced. :-) So you will always have to wait, until the result you want to verify, was produced. If you have sequential unit tests, you "automatically block" your unit test, while you call a method/methods that produce the result you want to verify. When the method you call in your test produces the result asynchronously, you'll somehow have to block and wait until the result was produced. So the only leverage you have is to wait as little as possible. BTW: Should you find a way to verify a result that was not yet produced, please let us know, since that could speed up all our tests quite a bit... ;-) Greetings, Malte