62、saleforce的schedule

//需要实现
Schedulable接口,实现
execute方法

public
class MerchandiseSchedule implements Schedulable{ public void execute(SchedulableContext sc){ MerchandiseBatch batchUtil = new MerchandiseBatch(); Database.executeBatch(batchUtil); } }
@isTest
private class TestGoodsSchedule {
    static testMethod void myUnitTest(){
        String executeTime = '0 10 2 * * ?';
        MerchandiseSchedule scheduleMer = new MerchandiseSchedule();
        System.schedule('batch goods',executeTime,scheduleMer);
    }
}

test的结果如下图所示

 

posted @ 2017-02-16 23:47  香港胖仔  阅读(263)  评论(0编辑  收藏  举报