function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JoeK.ax278JoeK.ax278 

Compile Error on Summer 08 Sandbox

The following line of code:

>
> global class zzz_Test {public static testMethod void testDoNothing(){Test.startTest();}}
>

generates a compiler error in one of my Summer '08 sandboxes:

Error: Compile Error: Method does not exist or incorrect signature: Test.startTest() at line 1 column 70

It compiles fine in my dev org and in a different Summer '08 sandbox.

Has anyone seen this or similar problems? Am I missing some new config or setting pertinent to Test methods?

Thank you,
Joe Krutulis

(Note: I have submitted this as case 01881422)
tspraguetsprague
I am having a similar problem. I cut an pasted an example class with a test method from the cook book and this wouldn't compile with the same error also.
 
Did you manage to resolve this.
 
Tony
JoeK.ax278JoeK.ax278
Hello, Tony,

Sorry for not posting a follow-up!   I did submit the ticket, and heard from a developer that SF was working on recreating it.   After a few days I went back, un-commented my test code, and it compiled fine in our sandbox.  Everything has been ok for us for at least 10 days or so.

If you're cutting and pasting an example, I'd still recommend you create a minimal class and test method with just the offending Test.startTest() line -- just to make sure there isn't a funky typo in the example.  Occasionally, I get confused by errors from the Apex compiler when I miss a semicolon or mess up my {}'s

We have seen one other compiler issue that we've reported (can't terminate string constant with a backslash! e.g. String s = '\\'; ), so there are definitely some compiler surprises.

Hope this helps,

Think & Enjoy -- Joe Krutulis