1 16 package org.quartz; 17 18 import java.util.Calendar ; 19 import java.util.TimeZone ; 20 21 import org.quartz.impl.calendar.AnnualCalendar; 22 23 24 27 public class AnnualCalendarTest extends SerializationTestSupport { 28 private static final String [] VERSIONS = new String [] {"1.5.1"}; 29 30 private static final TimeZone EST_TIME_ZONE = TimeZone.getTimeZone("America/New_York"); 31 32 36 protected Object getTargetObject() { 37 AnnualCalendar c = new AnnualCalendar(); 38 39 c.setDescription("description"); 40 41 Calendar cal = Calendar.getInstance(EST_TIME_ZONE); 42 cal.clear(); 43 cal.set(2005, Calendar.JANUARY, 20, 10, 5, 15); 44 45 c.setDayExcluded(cal, true); 46 47 return c; 48 } 49 50 54 protected String [] getVersions() { 55 return VERSIONS; 56 } 57 58 62 protected void verifyMatch(Object target, Object deserialized) { 63 AnnualCalendar targetCalendar = (AnnualCalendar)target; 64 AnnualCalendar deserializedCalendar = (AnnualCalendar)deserialized; 65 66 assertNotNull(deserializedCalendar); 67 assertEquals(targetCalendar.getDescription(), deserializedCalendar.getDescription()); 68 assertEquals(targetCalendar.getDaysExcluded(), deserializedCalendar.getDaysExcluded()); 69 assertNull(deserializedCalendar.getTimeZone()); 70 } 71 } 72 | Popular Tags |