new Integer( 30 ) );
Assert.assertEquals( ( (RecurrenceList) trigger.getMinuteRecurrences().get( 0 ) ).getValues().get( 1 ),
new Integer( 45 ) );
trigger = new ComplexJobTrigger();
trigger.addYearlyRecurrence( new SequentialRecurrence( 2010, 2013 ) );
trigger.addMonthlyRecurrence( new SequentialRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.MAY ) );
trigger.addDayOfMonthRecurrence( new SequentialRecurrence( 15, 20 ) );
trigger.addHourlyRecurrence( new SequentialRecurrence( 12, 15 ) );
trigger.addMinuteRecurrence( new SequentialRecurrence( 30, 45 ) );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 0,30-45 0,12-15 15-20 3-5 ? 2010-2013" );
trigger = new ComplexJobTrigger();
trigger.setYearlyRecurrence( new SequentialRecurrence( 2010, 2013 ) );
trigger.setMonthlyRecurrence( new SequentialRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.MAY ) );
trigger.setDayOfMonthRecurrence( new SequentialRecurrence( 15, 20 ) );
trigger.setHourlyRecurrence( new SequentialRecurrence( 12, 15 ) );
trigger.setMinuteRecurrence( new SequentialRecurrence( 30, 45 ) );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 30-45 12-15 15-20 3-5 ? 2010-2013" );
trigger = new ComplexJobTrigger();
trigger.addYearlyRecurrence( 2010, 2011, 2012, 2013 );
trigger.addMonthlyRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.APRIL, ComplexJobTrigger.MAY );
trigger.addDayOfMonthRecurrence( 15, 16, 17, 18, 19, 20 );
trigger.addHourlyRecurrence( 12, 13, 14, 15 );
trigger.addMinuteRecurrence( 30, 31, 32, 33, 34, 35, 36 );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 0,30-36 0,12-15 15-20 3-5 ? 2010-2013" );
trigger = new ComplexJobTrigger();
trigger.setYearlyRecurrence( 2010, 2011, 2012, 2013 );
trigger.setMonthlyRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.APRIL, ComplexJobTrigger.MAY );
trigger.setDayOfMonthRecurrence( 15, 16, 17, 18, 19, 20 );
trigger.setHourlyRecurrence( 12, 13, 14, 15 );
trigger.setMinuteRecurrence( 30, 31, 32, 33, 34, 35, 36 );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 30-36 12-15 15-20 3-5 ? 2010-2013" );
trigger = new ComplexJobTrigger();
trigger.addYearlyRecurrence( 2010, 2011, 2012, 2013 );
trigger.addMonthlyRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.APRIL, ComplexJobTrigger.MAY );
trigger.addDayOfWeekRecurrence( ComplexJobTrigger.SUNDAY, ComplexJobTrigger.MONDAY, ComplexJobTrigger.TUESDAY,
ComplexJobTrigger.WEDNESDAY, ComplexJobTrigger.THURSDAY, ComplexJobTrigger.FRIDAY, ComplexJobTrigger.SATURDAY );
trigger.addHourlyRecurrence( 12, 13, 14, 15 );
trigger.addMinuteRecurrence( 30, 31, 32, 33, 34, 35, 36 );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 0,30-36 0,12-15 ? 3-5 1-7 2010-2013" );
trigger = new ComplexJobTrigger();
trigger.setYearlyRecurrence( 2010, 2011, 2012, 2013 );
trigger.setMonthlyRecurrence( ComplexJobTrigger.MARCH, ComplexJobTrigger.APRIL, ComplexJobTrigger.MAY );
trigger.setDayOfWeekRecurrence( ComplexJobTrigger.SUNDAY, ComplexJobTrigger.MONDAY, ComplexJobTrigger.TUESDAY,
ComplexJobTrigger.WEDNESDAY, ComplexJobTrigger.THURSDAY, ComplexJobTrigger.FRIDAY, ComplexJobTrigger.SATURDAY );
trigger.setHourlyRecurrence( 12, 13, 14, 15 );
trigger.setMinuteRecurrence( 30, 31, 32, 33, 34, 35, 36 );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 30-36 12-15 ? 3-5 1-7 2010-2013" );
trigger = QuartzScheduler.createComplexTrigger( "0 30-45 12-15 ? 3-5 1-7 2010-2013" );
Assert.assertEquals( trigger.getYearlyRecurrences().size(), 1 );
Assert.assertTrue( trigger.getYearlyRecurrences().get( 0 ) instanceof SequentialRecurrence );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getYearlyRecurrences().get( 0 ) ).getFirstValue(),
new Integer( 2010 ) );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getYearlyRecurrences().get( 0 ) ).getLastValue(),
new Integer( 2013 ) );
Assert.assertEquals( trigger.getMonthlyRecurrences().size(), 1 );
Assert.assertTrue( trigger.getMonthlyRecurrences().get( 0 ) instanceof SequentialRecurrence );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getMonthlyRecurrences().get( 0 ) ).getFirstValue(),
new Integer( ComplexJobTrigger.MARCH ) );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getMonthlyRecurrences().get( 0 ) ).getLastValue(),
new Integer( ComplexJobTrigger.MAY ) );
Assert.assertEquals( trigger.getDayOfMonthRecurrences().size(), 0 );
Assert.assertEquals( trigger.getDayOfWeekRecurrences().size(), 1 );
Assert.assertTrue( trigger.getDayOfWeekRecurrences().get( 0 ) instanceof SequentialRecurrence );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getDayOfWeekRecurrences().get( 0 ) ).getFirstValue(),
new Integer( ComplexJobTrigger.SUNDAY ) );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getDayOfWeekRecurrences().get( 0 ) ).getLastValue(),
new Integer( ComplexJobTrigger.SATURDAY ) );
Assert.assertEquals( trigger.getHourlyRecurrences().size(), 1 );
Assert.assertTrue( trigger.getHourlyRecurrences().get( 0 ) instanceof SequentialRecurrence );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getHourlyRecurrences().get( 0 ) ).getFirstValue(),
new Integer( 12 ) );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getHourlyRecurrences().get( 0 ) ).getLastValue(),
new Integer( 15 ) );
Assert.assertEquals( trigger.getMinuteRecurrences().size(), 1 );
Assert.assertTrue( trigger.getMinuteRecurrences().get( 0 ) instanceof SequentialRecurrence );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getMinuteRecurrences().get( 0 ) ).getFirstValue(),
new Integer( 30 ) );
Assert.assertEquals( ( (SequentialRecurrence) trigger.getMinuteRecurrences().get( 0 ) ).getLastValue(),
new Integer( 45 ) );
trigger = new ComplexJobTrigger();
trigger.addDayOfWeekRecurrence( new QualifiedDayOfWeek( DayOfWeekQualifier.LAST, DayOfWeek.FRI ) );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 0 0 ? * 6L *" );
trigger = new ComplexJobTrigger();
trigger.addDayOfWeekRecurrence( new QualifiedDayOfWeek( DayOfWeekQualifier.LAST, DayOfWeek.FRI ) );
trigger.addDayOfWeekRecurrence( new QualifiedDayOfWeek( DayOfWeekQualifier.THIRD, DayOfWeek.SUN ) );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "0 0 0 ? * 6L,1#3 *" );
trigger = QuartzScheduler.createComplexTrigger( "* 0 0 ? * 6L,1#3 *" );
Assert.assertEquals( trigger.getDayOfWeekRecurrences().size(), 2 );
Assert.assertTrue( trigger.getDayOfWeekRecurrences().get( 0 ) instanceof QualifiedDayOfWeek );
Assert.assertEquals( ( (QualifiedDayOfWeek) trigger.getDayOfWeekRecurrences().get( 0 ) ).getQualifier(),
DayOfWeekQualifier.LAST );
Assert.assertEquals( ( (QualifiedDayOfWeek) trigger.getDayOfWeekRecurrences().get( 0 ) ).getDayOfWeek(),
DayOfWeek.FRI );
Assert.assertTrue( trigger.getDayOfWeekRecurrences().get( 1 ) instanceof QualifiedDayOfWeek );
Assert.assertEquals( ( (QualifiedDayOfWeek) trigger.getDayOfWeekRecurrences().get( 1 ) ).getQualifier(),
DayOfWeekQualifier.THIRD );
Assert.assertEquals( ( (QualifiedDayOfWeek) trigger.getDayOfWeekRecurrences().get( 1 ) ).getDayOfWeek(),
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" );
trigger = new ComplexJobTrigger();
trigger.setYearlyRecurrence( new SequentialRecurrence( 2015, 2020 ) );
trigger.setMonthlyRecurrence( new SequentialRecurrence( ComplexJobTrigger.JULY, ComplexJobTrigger.SEPTEMBER ) );
trigger.setDayOfWeekRecurrence( new SequentialRecurrence( ComplexJobTrigger.SUNDAY, ComplexJobTrigger.MONDAY ) );
trigger.setHourlyRecurrence( new SequentialRecurrence( 25, 30 ) );
trigger.setMinuteRecurrence( new SequentialRecurrence( 5, 10 ) );
trigger.setSecondRecurrence( new SequentialRecurrence( 30, 35 ) );
System.out.println( trigger.toString() );
Assert.assertEquals( trigger.toString(), "30-35 5-10 25-30 ? 7-9 1-2 2015-2020" );
trigger =
QuartzScheduler