We will only confine our study to the list of mocking frameworks that are compatible with Scala. There will be similar frameworks or bridge APIs to the same frameworks available for unit testing other languages.
As the name suggests, JMock was originally written for test-driven development of Java code by providing support for mock objects and stubs. Given that Scala runs on JVM and can use Java classes, it is quite easy to start using JMock when test-driving Scala code.
Moreover, it is also easier for developers who have used JMock with Java to make a transition into writing test-driven Scala code.
The following are JMock advantages:
Easier to make a transition from Java to Scala
Quite easy to set up and use
Support for annotations becomes less obtrusive
Ability to define precise interactions between objects
Most new IDEs have support/plugins for JMock and can code assist in auto-completion.
Easily plugs into ScalaTest or Specs2
Extensible
ScalaTest has a...