Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

RE: [groovy-user] Mocking Classes using Closures?

Alexander Veit

2008-08-23

Replies: Find Java Web Hosting

Author LoginPost Reply
> simonz wrote:
> [..]
> Just wondering if there is a nice solution that I am missing here!

If Bar is not final, you could define

class MockBar extends Bar {
public void bar() {
  // ...
}
}

in your test script and inject it into the Foo object that's to be tested.

--
Alex


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.