[449] | 1 | //-------------------------------------------------------------------------------------------------
|
---|
| 2 | // Module : $RCSfile: InteractionEventListTest.java,v $
|
---|
| 3 | // Version : $Revision: 0.0 $ $Author: Patrick $ $Date: 04.12.2011 11:25:24 $
|
---|
| 4 | // Project : TaskTreePerformanceTest
|
---|
| 5 | // Creation : 2011 by Patrick
|
---|
| 6 | // Copyright : Patrick Harms, 2011
|
---|
| 7 | //-------------------------------------------------------------------------------------------------
|
---|
| 8 |
|
---|
| 9 | package de.ugoe.cs.quest.eventcore.userinteraction;
|
---|
| 10 |
|
---|
| 11 | import static org.junit.Assert.assertEquals;
|
---|
| 12 |
|
---|
| 13 | import java.util.ArrayList;
|
---|
| 14 | import java.util.List;
|
---|
| 15 |
|
---|
| 16 | import org.junit.Test;
|
---|
| 17 |
|
---|
| 18 | import de.ugoe.cs.quest.eventcore.guimodel.AbstractDefaultGUIElement;
|
---|
| 19 | import de.ugoe.cs.quest.eventcore.guimodel.GUIElement;
|
---|
| 20 | import de.ugoe.cs.quest.eventcore.userinteraction.InteractionEvent;
|
---|
| 21 | import de.ugoe.cs.quest.eventcore.userinteraction.InteractionEventList;
|
---|
| 22 | import de.ugoe.cs.quest.eventcore.userinteraction.KeyPressed;
|
---|
| 23 | import de.ugoe.cs.quest.eventcore.userinteraction.KeyReleased;
|
---|
| 24 | import de.ugoe.cs.tasktree.keyboardmaps.VirtualKey;
|
---|
| 25 |
|
---|
| 26 | //-------------------------------------------------------------------------------------------------
|
---|
| 27 | /**
|
---|
| 28 | * TODO comment
|
---|
| 29 | *
|
---|
| 30 | * @version $Revision: $ $Date: $
|
---|
| 31 | * @author 2011, last modified by $Author: $
|
---|
| 32 | */
|
---|
| 33 | //-------------------------------------------------------------------------------------------------
|
---|
| 34 |
|
---|
| 35 | public class InteractionEventListTest
|
---|
| 36 | {
|
---|
| 37 |
|
---|
| 38 | //-----------------------------------------------------------------------------------------------
|
---|
| 39 | /**
|
---|
| 40 | *
|
---|
| 41 | */
|
---|
| 42 | //-----------------------------------------------------------------------------------------------
|
---|
| 43 | @Test
|
---|
| 44 | public void testDifferentCombinationKeyCombinations()
|
---|
| 45 | {
|
---|
| 46 | List<InteractionEvent> checkList = new ArrayList<InteractionEvent>();
|
---|
| 47 | InteractionEventList eventList = new InteractionEventList();
|
---|
| 48 |
|
---|
| 49 | GUIElement guiElement = new AbstractDefaultGUIElement()
|
---|
| 50 | {
|
---|
| 51 | @Override
|
---|
| 52 | public boolean equals(GUIElement other)
|
---|
| 53 | {
|
---|
| 54 | return this == other;
|
---|
| 55 | }
|
---|
| 56 | };
|
---|
| 57 |
|
---|
| 58 | // check first of all a normal pressing and releasing of A and B
|
---|
| 59 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 60 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 61 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_B)));
|
---|
| 62 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_B)));
|
---|
| 63 |
|
---|
| 64 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 65 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 66 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_B)));
|
---|
| 67 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_B)));
|
---|
| 68 |
|
---|
| 69 | assertEquals(checkList.size(), eventList.size());
|
---|
| 70 |
|
---|
| 71 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 72 | {
|
---|
| 73 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | // check what happens if A is pressed and not released before B is pressed
|
---|
| 77 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_C)));
|
---|
| 78 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_D)));
|
---|
| 79 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_C)));
|
---|
| 80 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_D)));
|
---|
| 81 |
|
---|
| 82 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_C)));
|
---|
| 83 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_C)));
|
---|
| 84 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_D)));
|
---|
| 85 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_D)));
|
---|
| 86 |
|
---|
| 87 | assertEquals(checkList.size(), eventList.size());
|
---|
| 88 |
|
---|
| 89 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 90 | {
|
---|
| 91 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 | // now SHIFT is pressed and released after all keys are pressed
|
---|
| 95 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 96 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_E)));
|
---|
| 97 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_E)));
|
---|
| 98 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_F)));
|
---|
| 99 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_F)));
|
---|
| 100 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 101 |
|
---|
| 102 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 103 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_E)));
|
---|
| 104 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_E)));
|
---|
| 105 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_F)));
|
---|
| 106 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_F)));
|
---|
| 107 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 108 |
|
---|
| 109 | assertEquals(checkList.size(), eventList.size());
|
---|
| 110 |
|
---|
| 111 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 112 | {
|
---|
| 113 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | // now SHIFT is released before the last key is released
|
---|
| 117 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 118 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_G)));
|
---|
| 119 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_G)));
|
---|
| 120 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_H)));
|
---|
| 121 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 122 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_H)));
|
---|
| 123 |
|
---|
| 124 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 125 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_G)));
|
---|
| 126 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_G)));
|
---|
| 127 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_H)));
|
---|
| 128 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_H)));
|
---|
| 129 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 130 |
|
---|
| 131 | assertEquals(checkList.size(), eventList.size());
|
---|
| 132 |
|
---|
| 133 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 134 | {
|
---|
| 135 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 136 | }
|
---|
| 137 |
|
---|
| 138 | // now SHIFT is released before all other keys are released
|
---|
| 139 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 140 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_I)));
|
---|
| 141 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_J)));
|
---|
| 142 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_K)));
|
---|
| 143 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 144 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_J)));
|
---|
| 145 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_K)));
|
---|
| 146 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_I)));
|
---|
| 147 |
|
---|
| 148 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 149 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_I)));
|
---|
| 150 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_I)));
|
---|
| 151 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_J)));
|
---|
| 152 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_J)));
|
---|
| 153 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_K)));
|
---|
| 154 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_K)));
|
---|
| 155 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 156 |
|
---|
| 157 | assertEquals(checkList.size(), eventList.size());
|
---|
| 158 |
|
---|
| 159 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 160 | {
|
---|
| 161 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | // now SHIFT, CTRL and ALT are pressed and released after all keys are pressed
|
---|
| 165 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 166 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.CONTROL)));
|
---|
| 167 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.ALT)));
|
---|
| 168 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_L)));
|
---|
| 169 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_L)));
|
---|
| 170 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_M)));
|
---|
| 171 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_M)));
|
---|
| 172 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.ALT)));
|
---|
| 173 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.CONTROL)));
|
---|
| 174 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 175 |
|
---|
| 176 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 177 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.CONTROL)));
|
---|
| 178 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.ALT)));
|
---|
| 179 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_L)));
|
---|
| 180 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_L)));
|
---|
| 181 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_M)));
|
---|
| 182 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_M)));
|
---|
| 183 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.ALT)));
|
---|
| 184 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.CONTROL)));
|
---|
| 185 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 186 |
|
---|
| 187 | assertEquals(checkList.size(), eventList.size());
|
---|
| 188 |
|
---|
| 189 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 190 | {
|
---|
| 191 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 192 | }
|
---|
| 193 |
|
---|
| 194 | // now SHIFT, CTRL and ALT are released before the last key is released
|
---|
| 195 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 196 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.CONTROL)));
|
---|
| 197 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.ALT)));
|
---|
| 198 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_N)));
|
---|
| 199 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_N)));
|
---|
| 200 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_O)));
|
---|
| 201 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.ALT)));
|
---|
| 202 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.CONTROL)));
|
---|
| 203 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 204 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_O)));
|
---|
| 205 |
|
---|
| 206 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 207 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.CONTROL)));
|
---|
| 208 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.ALT)));
|
---|
| 209 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_N)));
|
---|
| 210 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_N)));
|
---|
| 211 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_O)));
|
---|
| 212 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_O)));
|
---|
| 213 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.ALT)));
|
---|
| 214 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.CONTROL)));
|
---|
| 215 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 216 |
|
---|
| 217 | assertEquals(checkList.size(), eventList.size());
|
---|
| 218 |
|
---|
| 219 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 220 | {
|
---|
| 221 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 222 | }
|
---|
| 223 |
|
---|
| 224 | // now SHIFT, CTRL and ALT are released in another order and before some other keys are released
|
---|
| 225 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 226 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.CONTROL)));
|
---|
| 227 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.ALT)));
|
---|
| 228 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_P)));
|
---|
| 229 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_Q)));
|
---|
| 230 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_R)));
|
---|
| 231 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_Q)));
|
---|
| 232 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 233 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.ALT)));
|
---|
| 234 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.CONTROL)));
|
---|
| 235 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_R)));
|
---|
| 236 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_P)));
|
---|
| 237 |
|
---|
| 238 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 239 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.CONTROL)));
|
---|
| 240 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.ALT)));
|
---|
| 241 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_P)));
|
---|
| 242 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_P)));
|
---|
| 243 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_Q)));
|
---|
| 244 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_Q)));
|
---|
| 245 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_R)));
|
---|
| 246 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_R)));
|
---|
| 247 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.ALT)));
|
---|
| 248 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.CONTROL)));
|
---|
| 249 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 250 |
|
---|
| 251 | assertEquals(checkList.size(), eventList.size());
|
---|
| 252 |
|
---|
| 253 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 254 | {
|
---|
| 255 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 256 | }
|
---|
| 257 | }
|
---|
| 258 |
|
---|
| 259 | //-----------------------------------------------------------------------------------------------
|
---|
| 260 | /**
|
---|
| 261 | *
|
---|
| 262 | */
|
---|
| 263 | //-----------------------------------------------------------------------------------------------
|
---|
| 264 | @Test
|
---|
| 265 | public void testSeveralSubsequentKeyPressedEvents()
|
---|
| 266 | {
|
---|
| 267 | List<InteractionEvent> checkList = new ArrayList<InteractionEvent>();
|
---|
| 268 | InteractionEventList eventList = new InteractionEventList();
|
---|
| 269 |
|
---|
| 270 | GUIElement guiElement = new AbstractDefaultGUIElement()
|
---|
| 271 | {
|
---|
| 272 | @Override
|
---|
| 273 | public boolean equals(GUIElement other)
|
---|
| 274 | {
|
---|
| 275 | return this == other;
|
---|
| 276 | }
|
---|
| 277 | };
|
---|
| 278 |
|
---|
| 279 | // check first of all a normal pressing and releasing of A and B
|
---|
| 280 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 281 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 282 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 283 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 284 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 285 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 286 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 287 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 288 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 289 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 290 |
|
---|
| 291 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 292 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 293 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 294 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 295 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 296 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 297 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 298 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 299 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 300 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 301 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 302 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 303 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 304 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 305 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 306 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 307 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 308 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 309 |
|
---|
| 310 | assertEquals(checkList.size(), eventList.size());
|
---|
| 311 |
|
---|
| 312 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 313 | {
|
---|
| 314 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 315 | }
|
---|
| 316 |
|
---|
| 317 | // check first of all a normal pressing and releasing of A and B
|
---|
| 318 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 319 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 320 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 321 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 322 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 323 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 324 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 325 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 326 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 327 | eventList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 328 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 329 | eventList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 330 |
|
---|
| 331 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 332 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 333 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 334 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 335 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 336 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 337 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 338 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 339 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 340 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 341 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 342 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 343 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 344 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 345 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 346 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 347 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.SHIFT)));
|
---|
| 348 | checkList.add(new InteractionEvent(guiElement, new KeyPressed(VirtualKey.LETTER_A)));
|
---|
| 349 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.LETTER_A)));
|
---|
| 350 | checkList.add(new InteractionEvent(guiElement, new KeyReleased(VirtualKey.SHIFT)));
|
---|
| 351 |
|
---|
| 352 | assertEquals(checkList.size(), eventList.size());
|
---|
| 353 |
|
---|
| 354 | for (int i = 0; i < checkList.size(); i++)
|
---|
| 355 | {
|
---|
| 356 | assertEquals(checkList.get(i).getInteraction(), eventList.get(i).getInteraction());
|
---|
| 357 | }
|
---|
| 358 | }
|
---|
| 359 |
|
---|
| 360 | }
|
---|