tips:java:testprivatemethods
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | tips:java:testprivatemethods [2009/06/08 12:17] (current) – created erik | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Testing Private Methods ====== | ||
| + | It can be done using the Refletion API: | ||
| + | |||
| + | <code java> | ||
| + | Method myMethod = MyClass.class.getDeclaredMethod(" | ||
| + | myMethod.setAccessible(true); | ||
| + | |||
| + | myMethod.invoke(...); | ||
| + | </ | ||
| + | |||
| + | For more information, | ||
tips/java/testprivatemethods.txt · Last modified: by erik
