Changeset 1042 for trunk/autoquest-core-events-test/src/test
- Timestamp:
- 01/24/13 18:20:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClickCondenserTest.java
r995 r1042 161 161 162 162 simulateEvent(new MouseButtonDown(leftBtn, 0, 0), element1); 163 simulateEvent(new MouseButtonUp(leftBtn, 1, 0), element1);163 simulateEvent(new MouseButtonUp(leftBtn, 5, 0), element1); 164 164 assertCondensedMouseClicks("drag left elem1"); 165 165 166 166 simulateEvent(new MouseButtonDown(leftBtn, 0, 0), element1); 167 simulateEvent(new MouseButtonUp(leftBtn, 1, 1), element1);167 simulateEvent(new MouseButtonUp(leftBtn, 5, 5), element1); 168 168 assertCondensedMouseClicks("drag left elem1", "drag left elem1"); 169 169 170 170 simulateEvent(new MouseButtonDown(leftBtn, 0, 0), element1); 171 simulateEvent(new MouseButtonUp(leftBtn, 0, 1), element1);171 simulateEvent(new MouseButtonUp(leftBtn, 0, 5), element1); 172 172 simulateEvent(new MouseClick(leftBtn, 0, 0), element1); 173 173 assertCondensedMouseClicks("drag left elem1", "drag left elem1", "drag left elem1", 174 174 "click left elem1"); 175 175 176 simulateEvent(new MouseButtonDown(middleBtn, 1, 0), element1);176 simulateEvent(new MouseButtonDown(middleBtn, 5, 0), element1); 177 177 simulateEvent(new MouseButtonUp(middleBtn, 0, 0), element1); 178 178 simulateEvent(new MouseClick(middleBtn, 0, 0), element1); … … 180 180 "click left elem1", "", "", "click middle elem1"); 181 181 182 simulateEvent(new MouseButtonDown(rightBtn, 0, 1), element1);182 simulateEvent(new MouseButtonDown(rightBtn, 0, 5), element1); 183 183 simulateEvent(new MouseButtonUp(rightBtn, 0, 0), element1); 184 184 simulateEvent(new MouseClick(rightBtn, 0, 0), element1); … … 191 191 * 192 192 */ 193 @Test 194 public void testDoubleClick() { 195 MouseButtonInteraction.Button leftBtn = MouseButtonInteraction.Button.LEFT; 196 MouseButtonInteraction.Button rightBtn = MouseButtonInteraction.Button.RIGHT; 197 198 IGUIElement element1 = new DummyGUIElement("elem1"); 199 200 simulateEventWithTimestamp(new MouseClick(leftBtn, 0, 0), element1); 201 simulateEventWithTimestamp(new MouseClick(leftBtn, 0, 0), element1); 202 assertCondensedMouseClicks("dblclick left elem1"); 203 204 simulateEventWithTimestamp(new MouseButtonDown(leftBtn, 5, 5), element1); 205 simulateEventWithTimestamp(new MouseButtonUp(leftBtn, 5, 5), element1); 206 simulateEventWithTimestamp(new MouseButtonDown(leftBtn, 5, 5), element1); 207 simulateEventWithTimestamp(new MouseButtonUp(leftBtn, 5, 5), element1); 208 assertCondensedMouseClicks("dblclick left elem1", "dblclick left elem1"); 209 210 simulateEventWithTimestamp(new MouseClick(leftBtn, 0, 0), element1); 211 simulateEventWithTimestamp(new MouseClick(leftBtn, 5, 5), element1); 212 assertCondensedMouseClicks("dblclick left elem1", "dblclick left elem1", 213 "click left elem1", "click left elem1"); 214 215 simulateEventWithTimestamp(new MouseButtonDown(leftBtn, 0, 0), element1); 216 simulateEventWithTimestamp(new MouseButtonUp(leftBtn, 0, 0), element1); 217 simulateEventWithTimestamp(new MouseButtonDown(leftBtn, 5, 5), element1); 218 simulateEventWithTimestamp(new MouseButtonUp(leftBtn, 5, 5), element1); 219 assertCondensedMouseClicks("dblclick left elem1", "dblclick left elem1", 220 "click left elem1", "click left elem1", 221 "click left elem1", "click left elem1"); 222 223 simulateEventWithTimestamp(new MouseClick(rightBtn, 0, 0), element1); 224 simulateEventWithTimestamp(new MouseClick(rightBtn, 5, 5), element1); 225 assertCondensedMouseClicks("dblclick left elem1", "dblclick left elem1", 226 "click left elem1", "click left elem1", 227 "click left elem1", "click left elem1", 228 "click right elem1", "click right elem1"); 229 230 simulateEventWithTimestamp(new MouseButtonDown(rightBtn, 0, 0), element1); 231 simulateEventWithTimestamp(new MouseButtonUp(rightBtn, 0, 0), element1); 232 simulateEventWithTimestamp(new MouseButtonDown(rightBtn, 5, 5), element1); 233 simulateEventWithTimestamp(new MouseButtonUp(rightBtn, 5, 5), element1); 234 assertCondensedMouseClicks("dblclick left elem1", "dblclick left elem1", 235 "click left elem1", "click left elem1", 236 "click left elem1", "click left elem1", 237 "click right elem1", "click right elem1", 238 "click right elem1", "click right elem1"); 239 240 } 241 242 /** 243 * 244 */ 193 245 private void simulateEvent(IEventType eventType, IGUIElement guiElement) { 194 246 events.add(new Event(eventType, guiElement)); 247 } 248 249 /** 250 * 251 */ 252 private void simulateEventWithTimestamp(IEventType eventType, IGUIElement guiElement) { 253 Event event = new Event(eventType, guiElement); 254 event.setTimestamp(System.currentTimeMillis()); 255 events.add(event); 195 256 } 196 257 … … 214 275 assertTrue(result.get(i).getType() instanceof MouseClick); 215 276 } 277 else if ("dblclick".equals(parts[0])) { 278 assertTrue(result.get(i).getType() instanceof MouseDoubleClick); 279 } 216 280 else if ("drag".equals(parts[0])) { 217 281 assertTrue(result.get(i).getType() instanceof MouseDragAndDrop);
Note: See TracChangeset
for help on using the changeset viewer.