Announcement Announcement Module
Collapse
No announcement yet.
Junit with Quartz SchedulerFactoryBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Junit with Quartz SchedulerFactoryBean

    Hi,

    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.

    I created this Job using the below link: http://www.mkyong.com/spring/spring-...duler-example/

    Thanks in Advance.
    Rauf Khan

  • #2
    Hi rauf,
    What are you trying to achieve using JUnit, since SimpleTrigger and Cron trigger are already configured, just bootstrap the spring context would kick-in the quartz scheduling.

    Thanks,
    Karthik

    Comment


    • #3
      Hi Karthik,
      I have configured the quartz scheduling and its working fine.

      What I want to try using Junit is: The Job call's a method after a required interval, I want to test the value of the method and other functionalities associated with this method.

      Code:
      Public class First {
         private HashMap myData = null;
      
         public void reload(){
               myData = calling some method;
         }
      
      }
      I have created an instance of First in Junit then used sleep for some interval. In between the sleep interval the reload has be called by the Job and that has filled the myData as per log file. Now when I try to test the value of myData using Junit its giving as NULL. The instance of First is having myData as NULL value.

      Does anyone has idea how to test the value of this instance.

      Thanks in Advance
      Khan
      Last edited by Rauf Khan; Mar 17th, 2011, 01:32 AM. Reason: Added extra info

      Comment


      • #4
        Does anyone has any idea how to test the value of the member variable, whose value is assigned by the Job Scheduler.

        After creating an instance of the class and should wait for job to execute the method. Once the method is executed it should assign the values to the member variables of the instance. Right now the the member variable are having values when I check the log file but the member variable through the instance is showing NULL.

        Comment

        Working...
        X