Thursday, March 11, 2010

JMockit

Using JMockit and this technique, for the first time since I
got interested in unit testing and TDD, I feel confident of
being able to write a unit test for absolutely anything.
Most frameworks don't support mocking final classes
and methods, static methods, constructors... but
JMockit seems to do it all. Unfortunately, so far I haven't
been able to get JMockit working in Groovy. JMockit
uses anonymous inner classes. Groovy uses closures
instead. In most ways closures are better but the lack
of anonymous inner classes does seem to create a
compatibility issue with JMockit.

1 comment:

  1. Hi Larry,

    Have you spent any more time on JMockit and Groovy? I think I've come to the same conclusion as you. Alas, I cannot get the two to play nice at this point.

    ReplyDelete