XpdWiki
Set your name in
UserPreferences Edit this page Referenced by
JSPWiki v2.0.52
![]() ![]() |
We always put our TestCase classes in a different package. This means that you can run into access problems if you want to test methods which should really be private. In the past we've made those methods protected, then extended the class we want to test in our test package, allowing us to access those protected methods. But this is ugly and causes confusion. I've never understood why putting your test classes in the same package as production code is considered 'bad'. I've always placed them in the same package, and never had a problem. And as private methods ultimately have to be called by a non-private method, they are testable 'by proxy'. Am I missing something? --DarrenHobbs Java 1.2 gives you a neat solution. If you grant your test code the java.lang.reflect.ReflectPermission? then you can call private methods. 1. Edit the java.policy file run the policytool from the JDK if you like. I'm trying to get this working in VisualAge but, VisualAge seems to generate the java.policy file when it starts. test --OliBye
See also: http://roller.anthonyeden.com/page/tirsen/20030422 ![]()
|