Skip to content

Instantly share code, notes, and snippets.

@ittaiz
Created December 19, 2015 20:58
Show Gist options
  • Save ittaiz/8cb0df991d2c773f4583 to your computer and use it in GitHub Desktop.
Save ittaiz/8cb0df991d2c773f4583 to your computer and use it in GitHub Desktop.
ShutdownAllowingDeterministicScheduler suggestion to jmock
private class ShutdownAllowingDeterministicScheduler extends DeterministicScheduler {
override def isShutdown: Boolean = shutdownRequested
override def isTerminated: Boolean = shutdownRequested
override def shutdown(): Unit = shutdownRequested = true
override def shutdownNow: util.List[Runnable] = new util.ArrayList[Runnable]
var shutdownRequested: Boolean = false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment