Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: FEST-Assert 1.4
-
Fix Version/s: FEST-Assert 2.0
-
Component/s: Assert
-
Labels:None
-
Number of attachments :
Description
There is a very handy for testing interactions in multiple thread feature in Mockito [1][2] which allows to verify with timeout. In the case an interaction did not occur already Mockito waits specified amount of time and just then reports failure (in case interaction occurs within that period verification immediately stops blocking and reports success).
There are cases when it would be very useful to have an ability to specify a timeout with "normal" assertions with fest-assert (e.g. asserting counter for message received from a queue). I don't know API internals, but maybe it would be possible to easily implement something looking like:
assertThat(foo).isEqualTo(bar).withTimeout(200);
(possibly at the generic matcher level)
In my opinion it is a great feature for version 2.0
.
[1] - http://docs.mockito.googlecode.com/hg/org/mockito/Mockito.html#22
[2] - http://grepcode.com/file/repo1.maven.org/maven2/org.mockito/mockito-core/1.9.0/org/mockito/internal/verification/VerificationWithTimeoutImpl.java - internal implementation (doesn't look complicated)