Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide DeterministicScheduler in a separate maven artifact #196

Open
AlexTrotsenko opened this issue Jun 26, 2020 · 0 comments
Open

Provide DeterministicScheduler in a separate maven artifact #196

AlexTrotsenko opened this issue Jun 26, 2020 · 0 comments

Comments

@AlexTrotsenko
Copy link

AlexTrotsenko commented Jun 26, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant