You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found, that DeterministicScheduler is the nice way to test code, which uses ScheduledExecutorService.
As far as I can see it provides similar functionality like TestScheduler provides for code, which uses RxJava or DelayController for Kotlin code, which uses coroutine.
In both cases tick() does exactly the same as advanceTimeBy() is doing in earlier mentioning libs: it moves virtual time forward and runs any task, which is expected to be executed within this time frame.
As far as I can see it's general purouse functionality, which could be quite helpful for many people, who is not (or not yet) using jMock mocking functionality.
Thus it would suggest at least to mention it somewhere in the readme or on the main page of the project web site.
I see it mentioned here, but it's hard to find it.
Ideally it would be nice to provide it as a separate JAR/maven artifact so that people can easily pull it without adding whole jmock lib.
As far as I can see the only dependency of DeterministicScheduler is DeltaQueue - so it should be easy to extract it.
Perhaps there are some other "utility" classes, which you might find good to extract to such lib as well.
P.S. I have shared the info about this functionality in the corresponding Stack Overflow question.
The text was updated successfully, but these errors were encountered:
I have found, that
DeterministicScheduler
is the nice way to test code, which usesScheduledExecutorService
.As far as I can see it provides similar functionality like TestScheduler provides for code, which uses RxJava or DelayController for Kotlin code, which uses coroutine.
In both cases
tick()
does exactly the same asadvanceTimeBy()
is doing in earlier mentioning libs: it moves virtual time forward and runs any task, which is expected to be executed within this time frame.As far as I can see it's general purouse functionality, which could be quite helpful for many people, who is not (or not yet) using jMock mocking functionality.
Thus it would suggest at least to mention it somewhere in the readme or on the main page of the project web site.
I see it mentioned here, but it's hard to find it.
Ideally it would be nice to provide it as a separate JAR/maven artifact so that people can easily pull it without adding whole jmock lib.
As far as I can see the only dependency of
DeterministicScheduler
isDeltaQueue
- so it should be easy to extract it.Perhaps there are some other "utility" classes, which you might find good to extract to such lib as well.
P.S. I have shared the info about this functionality in the corresponding Stack Overflow question.
The text was updated successfully, but these errors were encountered: