1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.core.net.mock;
15
16 import java.util.Collections;
17 import java.util.List;
18 import java.util.concurrent.*;
19
20
21
22
23
24
25
26
27 public class MockScheduledExecutorService extends AbstractExecutorService {
28
29
30 private Runnable lastCommand;
31
32 public Runnable getLastCommand() {
33 return lastCommand;
34 }
35
36 public void shutdown() {
37 }
38
39 public List<Runnable> shutdownNow() {
40 return Collections.emptyList();
41 }
42
43 public boolean isShutdown() {
44 return true;
45 }
46
47 public boolean isTerminated() {
48 return true;
49 }
50
51 public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
52 return true;
53 }
54
55 public void execute(Runnable command) {
56 command.run();
57 lastCommand = command;
58 }
59
60 }