1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.framework;
17
18 import java.util.HashSet;
19 import java.util.Set;
20
21 import org.kuali.rice.krms.api.engine.ExecutionEnvironment;
22 import org.kuali.rice.krms.framework.engine.Action;
23
24
25
26
27
28
29 public class ActionMock implements Action {
30
31 private static final Set<String> actionsFired = new HashSet<String>();
32
33 public static void resetActionsFired() {
34 actionsFired.clear();
35 }
36
37 public static boolean actionFired(String name) {
38 return actionsFired.contains(name);
39 }
40
41 public ActionMock(String name) {
42 this.name = name;
43 }
44
45 private final String name;
46
47 @Override
48 public void execute(ExecutionEnvironment environment) {
49 actionsFired.add(name);
50 }
51
52
53
54
55 @Override
56 public void executeSimulation(ExecutionEnvironment environment) {
57 throw new UnsupportedOperationException();
58 }
59
60 public boolean actionFired() {
61 return actionFired(name);
62 }
63
64 }