01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */package com.tc.util;
04:
05: import java.util.ArrayList;
06: import java.util.Date;
07: import java.util.List;
08: import java.util.TimerTask;
09:
10: public class TestTimer implements TCTimer {
11:
12: public List scheduleCalls = new ArrayList();
13: public List cancelCalls = new ArrayList();
14:
15: public void cancel() {
16: cancelCalls.add(new Object());
17: }
18:
19: public void schedule(TimerTask task, long delay) {
20: scheduleCalls.add(new ScheduleCallContext(task,
21: new Long(delay), null, null));
22: }
23:
24: public void schedule(TimerTask task, Date time) {
25: return;
26:
27: }
28:
29: public void schedule(TimerTask task, long delay, long period) {
30: return;
31:
32: }
33:
34: public void schedule(TimerTask task, Date firstTime, long period) {
35: return;
36:
37: }
38:
39: public void scheduleAtFixedRate(TimerTask task, long delay,
40: long period) {
41: return;
42:
43: }
44:
45: public void scheduleAtFixedRate(TimerTask task, Date firstTime,
46: long period) {
47: return;
48:
49: }
50:
51: public static final class ScheduleCallContext {
52: public final TimerTask task;
53: public final Long delay;
54: public final Date time;
55: public final Long period;
56:
57: private ScheduleCallContext(TimerTask task, Long delay,
58: Date time, Long period) {
59: this.task = task;
60: this.delay = delay;
61: this.time = time;
62: this.period = period;
63: }
64: }
65:
66: }
|