title: Junit for Quartz Scheduler
body: <p>I have created a simple Job using SchedulerFactoryBean for my application. Can anyone please let me know how do I test this Job using Junit and make sure that is working fine for the interval given and the job should be stopped after that. I have created a sample class and have tested its working fine, for stopping this I have to stop/kill the application.  </p>
  
  <p><strong>What I want to try using Junit is:</strong> The Job call's a method after a required interval, I want to test the return value of the method and other functionalities associated with this method and then the job should be stopped.</p>
  
  <pre><code> public class First {
     private HashMap myData = null;
  
     public void reload(){
       myData = calling some method;
     }
  }
  </code></pre>
  
  <p>I will create an instance of First in Junit then sleep for some interval. In between the sleep the reload will be called by the Job and that will fill the myData. Now I need to test the value in myData with Junit.</p>
  
  <p>I created this Job using the below link: <a href="http://www.mkyong.com/spring/spring-...duler-example/" rel="nofollow">http://www.mkyong.com/spring/spring-...duler-example/</a></p>
  
  <p>Thanks in Advance.<br>
  Khan </p>