Utilities for testing. See morimekta.net/utils for procedures on releases.
This module contains a number of utilities and helpers to help with testing. It consists of a number of mostly independent parts.
FakeClock: A fake java.time.Clock that keeps constant time and is ticked manually.
FakeScheduledExecutor: A scheduled executor that uses a fake clock and 'ticking' of that to trigger scheduled tasks. Using a real executor in the background.
ImmediateExecutor: A fake executor that executes tasks when they are submitted. This means they run while waiting for
submitto return, so all tasks are completed immediately.
ImmediateScheduledExecutor: A fake scheduled executor that uses a fake clock and 'ticking' of that to trigger scheduled tasks in the same thread as triggers the tick. Submitted tasks are always handled in the
Console: An interface to interact with a console during testing.
ConsoleManager: Base class for managing a fake console during testing that will capture whats written to standard OUT and ERR and replace standard IN.
EnglishWords: A super-light text and word generator.
ConsoleWatcher: A junit4
@Ruleto set up and reset the console.
DataProviderUtil: Utility for generating matrices of arguments to from a data provider using
ConsoleExtension: A junit5 extension to set up and reset the console, and give access to
ParamsProviderUtil: Utility for generating matrices of arguments to from a params provider.
Major Version Changes
5.x: FakeScheduledExecutor renamed ImmediateScheduledExecutor and new FakeScheduledExecutor created using a real background executor, but using the fake clock to trigger the scheduled tasks.