Wednesday, April 19, 2006 07:08 AM
I had used the PrivilegeAccessor's invoke() from junit testcase inorder to accesss a private method named myMethod which is in class MyClass.
Object privilegeObject=PrivilegedAccessor.invokeMethod(myclass,"myMethod" ,args );
myclass is the instance of MyClass
args is an object array which takes the arguments for myMethod()
But junit is throwing
java.lang.NoSuchMethodException: Invalid method : myMethod