1 | //------------------------------------------------------------------------------------------------- |
---|
2 | // Module : $RCSfile: DefaultIterationDetectionRuleTest.java,v $ |
---|
3 | // Version : $Revision: 0.0 $ $Author: patrick $ $Date: 28.04.2012 $ |
---|
4 | // Project : TaskTreeTemporalRelationship |
---|
5 | // Creation : 2012 by patrick |
---|
6 | // Copyright : Patrick Harms, 2012 |
---|
7 | //------------------------------------------------------------------------------------------------- |
---|
8 | package de.ugoe.cs.quest.tasktrees.temporalrelation; |
---|
9 | |
---|
10 | import org.junit.Test; |
---|
11 | |
---|
12 | import de.ugoe.cs.quest.eventcore.guimodel.GUIElement; |
---|
13 | import de.ugoe.cs.quest.eventcore.guimodel.TrackBar; |
---|
14 | import de.ugoe.cs.quest.eventcore.userinteraction.ValueSelection; |
---|
15 | import de.ugoe.cs.quest.tasktrees.testutils.DummyGUIElement; |
---|
16 | import de.ugoe.cs.quest.tasktrees.testutils.DummyInteraction; |
---|
17 | import de.ugoe.cs.quest.tasktrees.testutils.TaskTreeChecker; |
---|
18 | |
---|
19 | //------------------------------------------------------------------------------------------------- |
---|
20 | /** |
---|
21 | * TODO comment |
---|
22 | * |
---|
23 | * @version $Revision: $ $Date: 28.04.2012$ |
---|
24 | * @author 2012, last modified by $Author: patrick$ |
---|
25 | */ |
---|
26 | //------------------------------------------------------------------------------------------------- |
---|
27 | public class TrackBarSelectionDetectionRuleTest extends AbstractTemporalRelationshipTC |
---|
28 | { |
---|
29 | |
---|
30 | //----------------------------------------------------------------------------------------------- |
---|
31 | /** |
---|
32 | * |
---|
33 | */ |
---|
34 | //----------------------------------------------------------------------------------------------- |
---|
35 | @Test |
---|
36 | public void testSimpleDetection() throws Exception |
---|
37 | { |
---|
38 | GUIElement element1 = new DummyTrackBar(); |
---|
39 | simulateInteraction(element1, new ValueSelection<Integer>(1)); |
---|
40 | new TaskTreeChecker().assertTaskTree |
---|
41 | ("Sequence sequence1 {" + |
---|
42 | " Iteration interation1 {" + |
---|
43 | " Selection selection1 {" + |
---|
44 | " Interaction ValueSelection {}" + |
---|
45 | " }" + |
---|
46 | " }" + |
---|
47 | "}", getTaskTree()); |
---|
48 | |
---|
49 | simulateInteraction(element1, new ValueSelection<Integer>(2)); |
---|
50 | new TaskTreeChecker().assertTaskTree |
---|
51 | ("Sequence sequence1 {" + |
---|
52 | " Iteration interation1 {" + |
---|
53 | " Selection selection1 {" + |
---|
54 | " Interaction ValueSelection {}" + |
---|
55 | " Interaction ValueSelection {}" + |
---|
56 | " }" + |
---|
57 | " }" + |
---|
58 | "}", getTaskTree()); |
---|
59 | |
---|
60 | simulateInteraction(element1, new ValueSelection<Integer>(3)); |
---|
61 | new TaskTreeChecker().assertTaskTree |
---|
62 | ("Sequence sequence1 {" + |
---|
63 | " Iteration interation1 {" + |
---|
64 | " Selection selection1 {" + |
---|
65 | " Interaction ValueSelection {}" + |
---|
66 | " Interaction ValueSelection {}" + |
---|
67 | " Interaction ValueSelection {}" + |
---|
68 | " }" + |
---|
69 | " }" + |
---|
70 | "}", getTaskTree()); |
---|
71 | |
---|
72 | simulateInteraction(element1, new ValueSelection<Integer>(2)); |
---|
73 | new TaskTreeChecker().assertTaskTree |
---|
74 | ("Sequence sequence1 {" + |
---|
75 | " Iteration interation1 {" + |
---|
76 | " Selection selection1 {" + |
---|
77 | " Interaction ValueSelection {}" + |
---|
78 | " Interaction ValueSelection {}" + |
---|
79 | " Interaction ValueSelection {}" + |
---|
80 | " }" + |
---|
81 | " }" + |
---|
82 | "}", getTaskTree()); |
---|
83 | |
---|
84 | simulateInteraction(element1, new ValueSelection<Integer>(3)); |
---|
85 | new TaskTreeChecker().assertTaskTree |
---|
86 | ("Sequence sequence1 {" + |
---|
87 | " Iteration interation1 {" + |
---|
88 | " Selection selection1 {" + |
---|
89 | " Interaction ValueSelection {}" + |
---|
90 | " Interaction ValueSelection {}" + |
---|
91 | " Interaction ValueSelection {}" + |
---|
92 | " }" + |
---|
93 | " }" + |
---|
94 | "}", getTaskTree()); |
---|
95 | |
---|
96 | } |
---|
97 | |
---|
98 | //----------------------------------------------------------------------------------------------- |
---|
99 | /** |
---|
100 | * |
---|
101 | */ |
---|
102 | //----------------------------------------------------------------------------------------------- |
---|
103 | @Test |
---|
104 | public void testComplexDetection() throws Exception |
---|
105 | { |
---|
106 | GUIElement element1 = new DummyTrackBar(); |
---|
107 | simulateInteraction(element1, new ValueSelection<Integer>(1)); |
---|
108 | simulateInteraction(element1, new ValueSelection<Integer>(2)); |
---|
109 | simulateInteraction(element1, new ValueSelection<Integer>(3)); |
---|
110 | simulateInteraction(element1, new ValueSelection<Integer>(1)); |
---|
111 | simulateInteraction(element1, new DummyInteraction("bla", 1)); |
---|
112 | simulateInteraction(element1, new DummyInteraction("bla", 2)); |
---|
113 | simulateInteraction(element1, new ValueSelection<Integer>(2)); |
---|
114 | simulateInteraction(element1, new ValueSelection<Integer>(1)); |
---|
115 | simulateInteraction(element1, new DummyInteraction("bla", 3)); |
---|
116 | simulateInteraction(element1, new ValueSelection<Integer>(3)); |
---|
117 | simulateInteraction(element1, new ValueSelection<Integer>(2)); |
---|
118 | simulateInteraction(element1, new ValueSelection<Integer>(3)); |
---|
119 | simulateInteraction(element1, new DummyInteraction("bla", 1)); |
---|
120 | simulateInteraction(element1, new DummyInteraction("bla", 2)); |
---|
121 | simulateInteraction(element1, new ValueSelection<Integer>(1)); |
---|
122 | simulateInteraction(element1, new ValueSelection<Integer>(1)); |
---|
123 | |
---|
124 | new TaskTreeChecker().assertTaskTree |
---|
125 | ("Sequence sequence1 {" + |
---|
126 | " Iteration interation1 {" + |
---|
127 | " Selection selection1 {" + |
---|
128 | " Interaction ValueSelection {}" + |
---|
129 | " Interaction ValueSelection {}" + |
---|
130 | " Interaction ValueSelection {}" + |
---|
131 | " }" + |
---|
132 | " }" + |
---|
133 | " Interaction bla {}" + |
---|
134 | " Interaction bla {}" + |
---|
135 | " Iteration interation2 {" + |
---|
136 | " Selection selection2 {" + |
---|
137 | " Interaction ValueSelection {}" + |
---|
138 | " Interaction ValueSelection {}" + |
---|
139 | " }" + |
---|
140 | " }" + |
---|
141 | " Interaction bla {}" + |
---|
142 | " Iteration interation3 {" + |
---|
143 | " Selection selection3 {" + |
---|
144 | " Interaction ValueSelection {}" + |
---|
145 | " Interaction ValueSelection {}" + |
---|
146 | " }" + |
---|
147 | " }" + |
---|
148 | " Interaction bla {}" + |
---|
149 | " Interaction bla {}" + |
---|
150 | " Iteration interation4 {" + |
---|
151 | " Selection selection4 {" + |
---|
152 | " Interaction ValueSelection {}" + |
---|
153 | " }" + |
---|
154 | " }" + |
---|
155 | "}", getTaskTree()); |
---|
156 | } |
---|
157 | |
---|
158 | //----------------------------------------------------------------------------------------------- |
---|
159 | /** |
---|
160 | * TODO comment |
---|
161 | * |
---|
162 | * @version $Revision: $ $Date: 28.04.2012$ |
---|
163 | * @author 2012, last modified by $Author: patrick$ |
---|
164 | */ |
---|
165 | //----------------------------------------------------------------------------------------------- |
---|
166 | public class DummyTrackBar extends DummyGUIElement implements TrackBar |
---|
167 | { |
---|
168 | |
---|
169 | //--------------------------------------------------------------------------------------------- |
---|
170 | /** |
---|
171 | * |
---|
172 | */ |
---|
173 | //--------------------------------------------------------------------------------------------- |
---|
174 | public DummyTrackBar() |
---|
175 | { |
---|
176 | super("DummyTrackBar"); |
---|
177 | } |
---|
178 | } |
---|
179 | |
---|
180 | } |
---|