the corner office : tech blog

a tech blog, by Colin Pretorius

« Mono | Main | Maven plugins. Joy. »

JMockit

I recently discovered JMockit. Not too foreign if you're used to JMock, but with one difference: instead of proxies it uses some creamy java.lang.instrument goodness to do its mocking, meaning you can mock static methods, native methods, final classes and methods, and you can mock only parts of a class if you want.

Let that sink in for a bit... instead of whatever weird-ass things you had to do before to test time-dependent code, you can now mock System.currentTimeMillis(). Way cool.

{2009.11.24 - 17:58}

meta

-home-
about
main blog

archives

rssfeed posts

© Colin Pretorius