tag:blogger.com,1999:blog-7290642316743338665.post44406811136113683..comments2023-09-20T05:23:44.886-05:00Comments on behind the times: Testing Java from Groovy? 2 MisconceptionsHamlet D'Arcyhttp://www.blogger.com/profile/04008870357169725586noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7290642316743338665.post-73550383964084219892008-11-06T12:27:00.000-06:002008-11-06T12:27:00.000-06:00Hi. Thanks for posting this. I've suspected this f...Hi. Thanks for posting this. I've suspected this for a while and confirmed it a couple of months ago. Since Groovy keeps getting better day by day, i've also discovered a lightweight way of unit testing code, without having to resort to mockFor and stubFor (which are great)....and it will only work for groovy unit tests testing groovy production code: Here's the link if you haven't experimented with it already:<BR/><BR/>http://groovy.codehaus.org/ExpandoMetaClass<BR/><BR/>This simple metaclass functionality cuts down your code to one or two lines, as opposed to the potential multiple lines using the aforementioned unit testing objects for groovy.Unknownhttps://www.blogger.com/profile/07467001455916517056noreply@blogger.comtag:blogger.com,1999:blog-7290642316743338665.post-11334961863442292402008-04-07T19:56:00.000-05:002008-04-07T19:56:00.000-05:00You can also use JMockit with Groovy:http://groovy...You can also use JMockit with Groovy:<BR/>http://groovy.codehaus.org/Using+JMockit+with+Groovypaulk_aserthttps://www.blogger.com/profile/02971774501609601750noreply@blogger.comtag:blogger.com,1999:blog-7290642316743338665.post-76654093031383327432008-04-05T22:49:00.000-05:002008-04-05T22:49:00.000-05:00This doesn't help your efforts to use Groovy to te...This doesn't help your efforts to use Groovy to test Java code (which I think is a noble goal), but I recently discovered the <A HREF="https://jmockit.dev.java.net/" REL="nofollow">JMockit</A> testing framework, which allows you to easily mock out static method calls, static initializers, etc. This has proved very helpful in testing a legacy Java application which has a lot of that type of coding (it was initially written circa 1999-2000).Jeff Olsonhttps://www.blogger.com/profile/14718768155042760295noreply@blogger.com