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
enrydevenrydev 

Test class for schedulable interface

How can test this class?

global class CustomerPortalRevokeSchedulable implements Schedulable {

    global void execute(SchedulableContext c)
    {   
        CustomerPortalRevokeBatch theC = new CustomerPortalRevokeBatch();
        Database.executeBatch(theC);                 
    }
}

Thanks in advantage for any advice.

joshbirkjoshbirk

You need to call the scheduled task directly, and then use Start and Stop test to execute/simulate the logic.  More info and code samples here:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm