com.silverpeas.scheduler
Class SchedulerTest

java.lang.Object
  extended by com.silverpeas.scheduler.SchedulerTest

public class SchedulerTest
extends Object

The scheduling system is backed by an interface, Scheduler, and a factory on implementation of this interface, SchedulerFactory. The factory hides the concrete underlying scheduling system in use by Silverpeas and provides a a single access to it through the Scheduler interface. Silverpeas scheduling API provides its own interface to manage scheduled jobs that are eaten by a scheduler and keeps actually a backward compability with its old previous API. This test checks the current concrete scheduler is ok.


Constructor Summary
SchedulerTest()
           
 
Method Summary
 void aFailureJobExecutionShouldFireACorrespondingSchedulerEvent()
           
 void aFailureJobShouldFireACorrespondingSchedulerEvent()
           
 void aNonScheduledJobShouldBeNotFound()
           
 void aScheduledJobAtAGivenTimeInEveryDayShouldBeFound()
           
 void aScheduledJobAtASpecificDayOfWeekShouldBeFound()
           
 void aScheduledJobAtWhateverTheDayOfMonthShouldBeFound()
           
 void aScheduledJobAtWhateverTheDayOfWeekAndMonthShouldThrowAnException()
           
 void aScheduledJobAtWhateverTheDayOfWeekShouldBeFound()
           
 void aScheduledJobAtWithATwoDigitsShouldBeFound()
           
 void aScheduledJobShouldBeFound()
           
 void emptyTest()
          An empty test just to check the setting up of the fixture is ok.
protected  boolean isJobExecuted()
          Is the job executed?
protected  void jobExecuted()
          Sets the job as executed.
protected  void scheduleAJob(String jobName)
          Schedules a job under the specified name.
 void schedulingAJobWithoutEventListenerShouldRunThatJobAtTheExpectedTime()
           
 void schedulingAnAlreadyScheduledJobExecutionShouldThrowASchedulerException()
           
 void schedulingAnAlreadyScheduledJobShouldThrowASchedulerException()
           
 void schedulingEveryTimeAJobExecutionShouldSendAnExecutionEventAtTheExpectedTime()
           
 void schedulingEveryTimeAJobShouldRunThatJobAtTheExpectedTime()
           
 void schedulingWithDayOfMonthAndDayOfWeekBothSetShouldThrowAnException()
           
 void setUp()
           
static void setUpClass()
           
 void tearDown()
           
static void tearDownClass()
           
 void unscheduleANonScheduledJobShouldDoesNothing()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulerTest

public SchedulerTest()
Method Detail

setUpClass

public static void setUpClass()
                       throws Exception
Throws:
Exception

tearDownClass

public static void tearDownClass()
                          throws Exception
Throws:
Exception

setUp

public void setUp()

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

emptyTest

public void emptyTest()
An empty test just to check the setting up of the fixture is ok.


schedulingAnAlreadyScheduledJobShouldThrowASchedulerException

public void schedulingAnAlreadyScheduledJobShouldThrowASchedulerException()
                                                                   throws Exception
Throws:
Exception

schedulingAnAlreadyScheduledJobExecutionShouldThrowASchedulerException

public void schedulingAnAlreadyScheduledJobExecutionShouldThrowASchedulerException()
                                                                            throws Exception
Throws:
Exception

schedulingEveryTimeAJobExecutionShouldSendAnExecutionEventAtTheExpectedTime

public void schedulingEveryTimeAJobExecutionShouldSendAnExecutionEventAtTheExpectedTime()
                                                                                 throws Exception
Throws:
Exception

aFailureJobExecutionShouldFireACorrespondingSchedulerEvent

public void aFailureJobExecutionShouldFireACorrespondingSchedulerEvent()
                                                                throws Exception
Throws:
Exception

schedulingAJobWithoutEventListenerShouldRunThatJobAtTheExpectedTime

public void schedulingAJobWithoutEventListenerShouldRunThatJobAtTheExpectedTime()
                                                                         throws Exception
Throws:
Exception

aFailureJobShouldFireACorrespondingSchedulerEvent

public void aFailureJobShouldFireACorrespondingSchedulerEvent()
                                                       throws Exception
Throws:
Exception

schedulingEveryTimeAJobShouldRunThatJobAtTheExpectedTime

public void schedulingEveryTimeAJobShouldRunThatJobAtTheExpectedTime()
                                                              throws Exception
Throws:
Exception

schedulingWithDayOfMonthAndDayOfWeekBothSetShouldThrowAnException

public void schedulingWithDayOfMonthAndDayOfWeekBothSetShouldThrowAnException()
                                                                       throws Exception
Throws:
Exception

aScheduledJobShouldBeFound

public void aScheduledJobShouldBeFound()
                                throws Exception
Throws:
Exception

aScheduledJobAtAGivenTimeInEveryDayShouldBeFound

public void aScheduledJobAtAGivenTimeInEveryDayShouldBeFound()
                                                      throws Exception
Throws:
Exception

aScheduledJobAtWithATwoDigitsShouldBeFound

public void aScheduledJobAtWithATwoDigitsShouldBeFound()
                                                throws Exception
Throws:
Exception

aScheduledJobAtWhateverTheDayOfWeekShouldBeFound

public void aScheduledJobAtWhateverTheDayOfWeekShouldBeFound()
                                                      throws Exception
Throws:
Exception

aScheduledJobAtWhateverTheDayOfMonthShouldBeFound

public void aScheduledJobAtWhateverTheDayOfMonthShouldBeFound()
                                                       throws Exception
Throws:
Exception

aScheduledJobAtASpecificDayOfWeekShouldBeFound

public void aScheduledJobAtASpecificDayOfWeekShouldBeFound()
                                                    throws Exception
Throws:
Exception

aScheduledJobAtWhateverTheDayOfWeekAndMonthShouldThrowAnException

public void aScheduledJobAtWhateverTheDayOfWeekAndMonthShouldThrowAnException()
                                                                       throws Exception
Throws:
Exception

aNonScheduledJobShouldBeNotFound

public void aNonScheduledJobShouldBeNotFound()
                                      throws Exception
Throws:
Exception

unscheduleANonScheduledJobShouldDoesNothing

public void unscheduleANonScheduledJobShouldDoesNothing()
                                                 throws Exception
Throws:
Exception

jobExecuted

protected void jobExecuted()
Sets the job as executed.


isJobExecuted

protected boolean isJobExecuted()
Is the job executed?

Returns:

scheduleAJob

protected void scheduleAJob(String jobName)
Schedules a job under the specified name. This method is dedicated for fixture preparations. If the job scheduling throw an exception, then the fixture will fail.

Parameters:
jobName - the name of the job to schedule.


Copyright © 2016 Silverpeas. All Rights Reserved.