Hi, Ludwig, > Is there any way to go around this error (and perhaps some > similar errors I haven't come across yes) and create some > kind of RunData object that would work in my test cases?
For testing, I've written three very simple classes that implement RunData, ParameterParser, and Context, with empty bodies for most of the methods, implementing only the bits my tests need with simple HashMaps. I've found it makes many tests much easier. In your example, since my RunData's implementation has just an empty body for removeUserFromSession(), no exception would be thrown. If you needed to test user removal, of course, you would have to add behavior for that (and presumably for adding the user), but since (generally) we're testing the behavior of the systems we build, and not of the supplied components, a trivial implementation usually serves. If I had a lot of such testing to do, I might create completely empty implementations of the three interfaces, then subclass and implement the specific bits needed by a given test or test suite. Peace, --Carl --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
