Calendar falseScheduleStartDate1 = new GregorianCalendar( 2013, Calendar.JANUARY, 1, 3, 0, 0 );
IJobTrigger falseSchedule1 =
new SimpleJobTrigger( falseScheduleStartDate1.getTime(), null, -1, TIME.WEEK.time / 1000 );
Job blockOutJob = addBlockOutJob( blockOutTrigger );
assertTrue( this.blockOutManager.isPartiallyBlocked( trueSchedule1 ) );
assertTrue( this.blockOutManager.isPartiallyBlocked( trueSchedule2 ) );
assertFalse( this.blockOutManager.isPartiallyBlocked( falseSchedule1 ) );
/*
* Complex Schedule Triggers
*/
IJobTrigger trueComplexScheduleTrigger = new ComplexJobTrigger();
trueComplexScheduleTrigger.setStartTime( trueScheduleStartDate1.getTime() );
trueComplexScheduleTrigger.setCronString( "0 0 1 ? * 2-3 *" ); //$NON-NLS-1$
IJobTrigger falseComplexScheduleTrigger = new ComplexJobTrigger();
falseComplexScheduleTrigger.setStartTime( trueScheduleStartDate1.getTime() );
falseComplexScheduleTrigger.setCronString( "0 0 1 ? * 2 *" ); //$NON-NLS-1$
assertTrue( this.blockOutManager.isPartiallyBlocked( trueComplexScheduleTrigger ) );
assertFalse( this.blockOutManager.isPartiallyBlocked( falseComplexScheduleTrigger ) );
/*
* Complex Block Out IJobTrigger
*/
deleteJob( blockOutJob.getJobId() );
blockOutTrigger = new ComplexJobTrigger();
blockOutTrigger.setStartTime( blockOutStartDate.getTime() );
blockOutTrigger.setCronString( "0 0 0 ? * 3 *" ); //$NON-NLS-1$
blockOutTrigger.setDuration( duration );
addBlockOutJob( blockOutTrigger );