@After
 public void after() throws Exception {
   if (taskSchedulerHelper != null) {
     taskSchedulerHelper.stop();
     taskSchedulerHelper = null;
   }
 }
 protected Scheduler createScheduler(String name, int threadPoolSize) throws SchedulerException {
   try {
     this.taskSchedulerHelper = new TaskSchedulerHelper(database.getInstance());
     this.taskSchedulerHelper.init(threadPoolSize, new SimpleJobFactory());
     this.taskSchedulerHelper.start();
     return ((QuartzSchedulerSPI) taskSchedulerHelper.getScheduler()).getScheduler();
   } catch (Exception e) {
     throw Throwables.propagate(e);
   }
 }