I'd like to do some JUnittesting with my FrontMan beans. So I need a minimal CommandContext to subclass for testing.
It does not have to be a full blown HTTP servlet request and respnse object, but it would be nice to have an
AbstractCommandContextForTesting
to start with.
CommandContext was designed as an interface exactly so that mock instances could be used for testing. EFH was the person who suggested this, so maybe he has one?
I did use that interface for mocking while developing two FrontMan-driven projects. Both times I used EasyMock, which creates the mocks for you -- you just hand it an interface, and tell it what usage pattern you expect to see. EasyMock is pretty darn... easy.
I hacked up some, it was easy. The CommandContext is trivial, but all of my code calls it get HttpRequest, HttpResponse, HttpSession, etc.
Its not hard, but there are a lot of parts.
Probably not realistic for Bear to provide them, as they have to be tweaked for the calls your class really uses.
After hacking with it, the beauty of Bear's design shows