From: Steve F. <st...@m3...> - 2004-05-06 08:45:41
|
In that case, try using the cglib extensions from either jmock or easymock. Hmmm. Alternatively, I don't imagine you'll be testing exception throwing a great deal. You could generate an empty skeleton stub just to get through the compiler, and then just override the methods you need in anonymous subclasses within the test code. public class TestThing { public void testThrowException() { final Exception exception = new Exception(); MyClass myClass = new MyClass() { public int getInt() throws Exception() { throw exception; } ... } } } It's a bit clunky, but it works. S. Laurent Duperval wrote: > If possible, I'd like to generate a skeleton of a class that could give > me the basic code I need to set up exceptions, setup test cases, etc. is > there something that will do this on a class instead of an interface? I > originally tried the MockCreator package but it generated a file that > was 300K large... *Really* not what I was looking for. |