- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
02-05-2013 04:30 AM
Test.start() takes you into a new context. When you setup a load of test data, execute SOQL calls against that data to extract ids etc, you will consume some of the limits for DML, SOQL etc. By executing Test.startTest() you effectively reset all those limits so that your test code starts from scratch. This allows you to be sure that any governor limits problems are entirely down to your code.
Test.stopTest() takes you back to the original context, but more importantly causes all asynchronous processing scheduled by your test to execute. So if you have @future calls to test and you don't execute this method then they won't run.
Certified Salesforce Technical Architect, Developer, Advanced Developer, Administrator, Advanced Administrator, Consultant, Sales Cloud Consultant,Service Cloud Consultant
Force.com MVP | The Bob Buzzard Blog | Linked In | Twitter
I don't respond to private messages/emails asking for help.
Take the Bob Buzzard Sobject Fields quiz.