+ Start a Discussion
BrianHBrianH 

Test.isRunningTest() - Method does not exist or incorrect signature

We have an existing class that uses the Test.isRunningTest() method.  Today we tried making changes to that class (completely unrelated to the isRunningTestMethod) and weren't able to save it because of a "method doesn't exist or incorrect signature" error on that method.  Did something change with the Winter 12 release where we can no longer use this in code?  If so, is there something replacing this functionality?  If we should still be able to use it, any thoughts on why we are receiving this error now?


Save error: Method does not exist or incorrect signature: Test.isRunningTest()


Best Answer chosen by Admin (Salesforce Developers) 
spraetzspraetz

Did you add a class to your org named Test?

 

If you add an Apex Class with the same name as a default class in Apex, all calls to that class will look at your class instead of the standard Apex classes.

All Answers

spraetzspraetz

Did you add a class to your org named Test?

 

If you add an Apex Class with the same name as a default class in Apex, all calls to that class will look at your class instead of the standard Apex classes.

This was selected as the best answer
BrianHBrianH

I knew that question was going to come and should have preemptively noted that... No, we do not have a class called "Test".

BrianHBrianH

Nevermind, one of our developers did create a class called "test", I just didn't have it pulled down in to my Eclipse project so I didn't see it.  Thanks for the help spraetz!

spraetzspraetz

Phew. =)  I was worried there was a pretty bad bug in the wild.

 

Glad you got it resolved.

seven23seven23

I would have bet my paychaeck that I didn't have a class named "test"..... but sure enough, i had created one less than a month ago to store some random code.

 

I love a simple explanation more than I care about looking stupid! Thank you!

Akshay DeshmukhAkshay Deshmukh
Thanks spraetz ! you saved my lot of time man.


Katta RahulKatta Rahul
Thanks spraetz!!!
GautamKumarDrefGautamKumarDref
Sparetz, you saved me a ton of time today. Thanks!
Puneet NarangPuneet Narang
That was a bulls eye.
Even I was not able to compile all my apex classes, as I had used Test.IsRunningTest() to reset governer limits.
After deleting class named Test, I was able to do.

Thanks
sales force 436sales force 436
Thanks Sparetz!! :)