How to get the caller method name
17:40 31 Oct 2010

To fix a test case I need to identify whether the method is called from a particular caller method. I can't afford to add a boolean parameter because it would break the interfaces defined. How to go about this?

This is what I want to achieve. Here I can't change the parameters of operation() as it is an interface implementation.

operation()
{
   if not called from performancetest() method
       do expensive bookkeeping operation
   ...       

}
java unit-testing