What I usually do is that I add the dummy class as a static member class to the test class. Or if the same dummy class can be used in many places, then it will be a top level class in the test sources.
Here is one example: http://dimdwarf.svn.sourceforge.net/viewvc/dimdwarf/trunk/dimdwarf-core/src/test/java/net/orfjackal/dimdwarf/entities/SpecifyingEntitiesWithAnAnnotationSpec.java?view=markup The tests above use DummyObject.class and AnnotatedEntity.class. DummyObject is a simple object I use in many test cases - it's in the same package as that test case. AnnotatedEntity is needed only in this test case, so I have it as a public static member class inside that test case (it would best to keep them private static, but sometimes reflection requires them to be public). Here is another example which uses reflection very extensively: http://www.orfjackal.net/temp/weenyconsole-r148-src.zip If you look at the net.orfjackal.weenyconsole.CommandExecuterSpec class in the test sources, that I have member classes called TargetMock which I then pass on to the code, and expect the code to invoke some methods on them using reflection. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-guice?hl=en -~----------~----~----~----~------~----~------~--~---
