01: /*
02: * Created on 5 Apr 2007
03: */
04: package uk.org.ponder.test.dateutil;
05:
06: import java.util.Calendar;
07: import java.util.Date;
08: import java.util.GregorianCalendar;
09: import java.util.TimeZone;
10:
11: import uk.org.ponder.dateutil.StandardFieldDateTransit;
12: import uk.org.ponder.util.UniversalRuntimeException;
13: import junit.framework.TestCase;
14:
15: public class TestDateTransit extends TestCase {
16: public void testTZTransit() {
17: // StandardFieldDateTransit transit = new StandardFieldDateTransit();
18: // TimeZone offtz = TimeZone.getTimeZone("BST");
19: // transit.setTimeZone(offtz);
20: // transit.init();
21: // Calendar cal = new GregorianCalendar();
22: // cal.set(2007, 4, 5, 1, 0, 0);
23: // cal.set(Calendar.MILLISECOND, 0);
24: // Date caltime = cal.getTime();
25: // //caltime.setTimeZone(offtz);
26: // transit.setDate(cal.getTime());
27: // String tz8601 = transit.getISO8601TZ();
28: // assertEquals(tz8601, "2007-05-05T01:00:00.000+0100");
29: // // Test that transit correctly ignores any timezone strewn in by a
30: // // client-side knowlessman
31: // tz8601 = tz8601.substring(0, 23) + "+0200";
32: // try {
33: // transit.setISO8601TZ(tz8601);
34: // }
35: // catch (Exception e) {
36: // throw UniversalRuntimeException.accumulate(e, "Error parsing date " + tz8601);
37: // }
38: // assertEquals(transit.getDate(), cal.getTime());
39: }
40: }
|