title: Scheduled Batchable process in salesforce
body: <p>I am trying my hands on implementing a batch process. I need some help/guidance on how to test this. All I am doing here is to display the opportunity name in the debug logs. But when I run the class scheduledBatchable which also has the test class in it in Apex test execution. The debug statements on the Opp_BatchProcess are not getting displayed. What is that I am doing wrong?</p>
  
  <p>Here is the code i have</p>
  
  <pre><code>global class Opp_BatchProcess implements Database.Batchable &lt; sObject &gt;
  {
      globalDatabase.QueryLocator start(Database.BatchableContextBC)
      {
          system.debug('Insidestart');
          returnDatabase.getQueryLocator('select name,id from opportunity');
      }
  
      global void execute(Database.BatchableContext BC, List &lt;sObject&gt; batch)
      {
          for (Sobject s : batch)
          {
              opportunity o = (opportunity)s;
              system.debug('Opp name is' + o.name);
          }
      }
  
      global void finish(Database.BatchableContext BC) {}
  }
  </code></pre>
  
  <p>I also have a schedulable class</p>
  
  <pre><code>global class scheduledBatchable implements Schedulable
  {
      global void execute(SchedulableContext sc)
      {
          Opp_BatchProcess b = new Opp_BatchProcess();
          ID myBatchJobID = database.executebatch(b);
      }
  
      public static testMethod void testscheduleMerge()
      {
          Test.startTest();
          scheduledBatchable s8 = new scheduledBatchable();
          string sch = '0 0 * * 1-12 ? *';
          system.schedule('Process Trans 1', sch, s8);
          Test.stopTest();
      }
  }
  </code></pre>