DayOfWeek.SUN );
trigger = new ComplexJobTrigger();
trigger.addYearlyRecurrence( 2010, 2013 );
trigger.addYearlyRecurrence( new SequentialRecurrence( 2015, 2020 ) );
trigger.addYearlyRecurrence( new IncrementalRecurrence( 2025, 5 ) );
trigger.addMonthlyRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.MAY );
trigger.addMonthlyRecurrence( new SequentialRecurrence( ComplexJobTrigger.JULY, ComplexJobTrigger.SEPTEMBER ) );
trigger.addMonthlyRecurrence( new IncrementalRecurrence( ComplexJobTrigger.JANUARY, 3 ) );
trigger.addDayOfMonthRecurrence( 3, 10 );
trigger.addDayOfMonthRecurrence( new SequentialRecurrence( 15, 20 ) );
trigger.addDayOfMonthRecurrence( new IncrementalRecurrence( 21, 3 ) );
trigger.addHourlyRecurrence( 12, 15 );
trigger.addHourlyRecurrence( new SequentialRecurrence( 25, 30 ) );
trigger.addHourlyRecurrence( new IncrementalRecurrence( 10, 5 ) );
trigger.addMinuteRecurrence( 30, 45 );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(),
"0 0,30,45 0,12,15,25-30,10/5 3,10,15-20,21/3 3,5,7-9,1/3 ? 2010,2013,2015-2020,2025/5" );
trigger = new ComplexJobTrigger();
trigger.setYearlyRecurrence( 2010, 2013 );
trigger.addYearlyRecurrence( new SequentialRecurrence( 2015, 2020 ) );
trigger.addYearlyRecurrence( new IncrementalRecurrence( 2025, 5 ) );
trigger.setMonthlyRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.MAY );
trigger.addMonthlyRecurrence( new SequentialRecurrence( ComplexJobTrigger.JULY, ComplexJobTrigger.SEPTEMBER ) );
trigger.addMonthlyRecurrence( new IncrementalRecurrence( ComplexJobTrigger.JANUARY, 3 ) );
trigger.setDayOfWeekRecurrence( ComplexJobTrigger.THURSDAY, ComplexJobTrigger.FRIDAY );
trigger.addDayOfWeekRecurrence( new SequentialRecurrence( ComplexJobTrigger.SUNDAY, ComplexJobTrigger.MONDAY ) );
trigger.setHourlyRecurrence( 12, 15 );
trigger.addHourlyRecurrence( new SequentialRecurrence( 25, 30 ) );
trigger.addHourlyRecurrence( new IncrementalRecurrence( 10, 5 ) );
trigger.setMinuteRecurrence( 30, 45 );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(),
"0 30,45 12,15,25-30,10/5 ? 3,5,7-9,1/3 5,6,1-2 2010,2013,2015-2020,2025/5" );