1 4 package com.tc.util; 5 6 import java.util.ArrayList ; 7 import java.util.Date ; 8 import java.util.List ; 9 import java.util.TimerTask ; 10 11 public class TestTimer implements TCTimer { 12 13 public List scheduleCalls = new ArrayList (); 14 public List cancelCalls = new ArrayList (); 15 16 public void cancel() { 17 cancelCalls.add(new Object ()); 18 } 19 20 public void schedule(TimerTask task, long delay) { 21 scheduleCalls.add(new ScheduleCallContext(task, 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, long period) { 40 return; 41 42 } 43 44 public void scheduleAtFixedRate(TimerTask task, Date firstTime, long period) { 45 return; 46 47 } 48 49 public static final class ScheduleCallContext { 50 public final TimerTask task; 51 public final Long delay; 52 public final Date time; 53 public final Long period; 54 55 private ScheduleCallContext(TimerTask task, Long delay, Date time, Long period) { 56 this.task = task; 57 this.delay = delay; 58 this.time = time; 59 this.period = period; 60 } 61 } 62 63 } 64 | Popular Tags |