* {@link org.pentaho.platform.scheduler2.blockout.PentahoBlockoutManager#isPartiallyBlocked(org.quartz.IJobTrigger)}.
*/
@Test
public void testIsPartiallyBlocked() throws Exception {
Calendar blockOutStartDate = new GregorianCalendar( 2013, Calendar.JANUARY, 1, 0, 0, 0 );
IJobTrigger blockOutTrigger =
new SimpleJobTrigger( blockOutStartDate.getTime(), null, -1, TIME.WEEK.time * 2 / 1000 );
blockOutTrigger.setDuration( duration );
/*
* Simple Schedule Triggers
*/
Calendar trueScheduleStartDate1 = new GregorianCalendar( 2013, Calendar.JANUARY, 15, 0, 0, 0 );
IJobTrigger trueSchedule1 =
new SimpleJobTrigger( trueScheduleStartDate1.getTime(), null, -1, TIME.WEEK.time * 2 / 1000 );
Calendar trueScheduleStartDate2 = new GregorianCalendar( 2013, Calendar.JANUARY, 15, 0, 0, 0 );
IJobTrigger trueSchedule2 =
new SimpleJobTrigger( trueScheduleStartDate2.getTime(), null, -1, TIME.WEEK.time / 1000 );
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 ) );
/*