Ignore:
Timestamp:
10/26/12 10:15:00 (12 years ago)
Author:
pharms
Message:
  • added support for mouse click coordinates
Location:
trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui/KeyInteractionCorrectorTest.java

    r927 r946  
    389389        // Check if mouse events stay where they are 
    390390        input.add(new Event(new KeyPressed(VirtualKey.LETTER_A), guiElement)); 
    391         input.add(new Event(new MouseButtonDown(Button.LEFT), guiElement)); 
    392         input.add(new Event(new MouseButtonUp(Button.LEFT), guiElement)); 
    393         input.add(new Event(new MouseClick(Button.LEFT), guiElement)); 
    394         input.add(new Event(new KeyReleased(VirtualKey.LETTER_A), guiElement)); 
    395  
    396         expected.add(new Event(new KeyTyped(VirtualKey.LETTER_A), guiElement)); 
    397         expected.add(new Event(new MouseButtonDown(Button.LEFT), guiElement)); 
    398         expected.add(new Event(new MouseButtonUp(Button.LEFT), guiElement)); 
    399         expected.add(new Event(new MouseClick(Button.LEFT), guiElement)); 
     391        input.add(new Event(new MouseButtonDown(Button.LEFT, 0, 0), guiElement)); 
     392        input.add(new Event(new MouseButtonUp(Button.LEFT, 0, 0), guiElement)); 
     393        input.add(new Event(new MouseClick(Button.LEFT, 0, 0), guiElement)); 
     394        input.add(new Event(new KeyReleased(VirtualKey.LETTER_A), guiElement)); 
     395 
     396        expected.add(new Event(new KeyTyped(VirtualKey.LETTER_A), guiElement)); 
     397        expected.add(new Event(new MouseButtonDown(Button.LEFT, 0, 0), guiElement)); 
     398        expected.add(new Event(new MouseButtonUp(Button.LEFT, 0, 0), guiElement)); 
     399        expected.add(new Event(new MouseClick(Button.LEFT, 0, 0), guiElement)); 
    400400 
    401401        List<Event> output = sorter.sortKeyInteractions(input); 
  • trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui/MouseClickCondenserTest.java

    r927 r946  
    5555        IGUIElement element2 = new DummyGUIElement("elem2"); 
    5656 
    57         simulateEvent(new MouseButtonDown(leftBtn), element1); 
    58         simulateEvent(new MouseButtonUp(leftBtn), element1); 
    59         simulateEvent(new MouseClick(leftBtn), element1); 
     57        simulateEvent(new MouseButtonDown(leftBtn, 0, 0), element1); 
     58        simulateEvent(new MouseButtonUp(leftBtn, 0, 0), element1); 
     59        simulateEvent(new MouseClick(leftBtn, 0, 0), element1); 
    6060        assertCondensedMouseClicks("elem1"); 
    6161 
    6262        simulateEvent(new DummyInteraction("bla", 1), element1); 
    6363        simulateEvent(new DummyInteraction("bli", 1), element1); 
    64         simulateEvent(new MouseButtonDown(middleBtn), element1); 
    65         simulateEvent(new MouseButtonUp(middleBtn), element1); 
    66         simulateEvent(new MouseClick(middleBtn), element1); 
     64        simulateEvent(new MouseButtonDown(middleBtn, 0, 0), element1); 
     65        simulateEvent(new MouseButtonUp(middleBtn, 0, 0), element1); 
     66        simulateEvent(new MouseClick(middleBtn, 0, 0), element1); 
    6767        simulateEvent(new DummyInteraction("blo", 1), element1); 
    6868        simulateEvent(new DummyInteraction("blu", 1), element1); 
     
    7171        simulateEvent(new DummyInteraction("bla", 1), element2); 
    7272        simulateEvent(new DummyInteraction("bli", 1), element2); 
    73         simulateEvent(new MouseButtonDown(rightBtn), element2); 
    74         simulateEvent(new MouseButtonUp(rightBtn), element2); 
    75         simulateEvent(new MouseClick(rightBtn), element2); 
     73        simulateEvent(new MouseButtonDown(rightBtn, 0, 0), element2); 
     74        simulateEvent(new MouseButtonUp(rightBtn, 0, 0), element2); 
     75        simulateEvent(new MouseClick(rightBtn, 0, 0), element2); 
    7676        simulateEvent(new DummyInteraction("blo", 1), element2); 
    7777        simulateEvent(new DummyInteraction("blu", 1), element2); 
    7878        assertCondensedMouseClicks("elem1", "", "", "elem1", "", "", "", "", "elem2", "", ""); 
    7979 
    80         simulateEvent(new MouseButtonDown(leftBtn), element1); 
    81         simulateEvent(new MouseButtonUp(leftBtn), element1); 
    82         simulateEvent(new MouseClick(leftBtn), element2); 
     80        simulateEvent(new MouseButtonDown(leftBtn, 0, 0), element1); 
     81        simulateEvent(new MouseButtonUp(leftBtn, 0, 0), element1); 
     82        simulateEvent(new MouseClick(leftBtn, 0, 0), element2); 
    8383        assertCondensedMouseClicks("elem1", "", "", "elem1", "", "", "", "", "elem2", "", "", 
    8484                                   "", "", "elem2"); 
    8585 
    86         simulateEvent(new MouseButtonDown(middleBtn), element1); 
    87         simulateEvent(new MouseButtonUp(middleBtn), element1); 
    88         simulateEvent(new MouseClick(rightBtn), element1); 
     86        simulateEvent(new MouseButtonDown(middleBtn, 0, 0), element1); 
     87        simulateEvent(new MouseButtonUp(middleBtn, 0, 0), element1); 
     88        simulateEvent(new MouseClick(rightBtn, 0, 0), element1); 
    8989        simulateEvent(new DummyInteraction("bla", 1), element2); 
    9090        assertCondensedMouseClicks("elem1", "", "", "elem1", "", "", "", "", "elem2", "", "", 
  • trunk/autoquest-core-events-test/src/test/java/de/ugoe/cs/autoquest/eventcore/gui/TextInputDetectorTest.java

    r927 r946  
    164164        IGUIElement element3 = new DummyGUIElement("elem3"); 
    165165         
    166         simulateEvent(new MouseClick(MouseClick.Button.LEFT), element2); 
     166        simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element2); 
    167167        simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 
    168168        simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 
     
    173173        assertTextInput("", "abc"); 
    174174 
    175         simulateEvent(new MouseClick(MouseClick.Button.LEFT), element2); 
    176         simulateEvent(new MouseClick(MouseClick.Button.LEFT), element3); 
    177         simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 
    178         simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 
    179         simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 
    180         simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 
    181         simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 
    182         simulateEvent(new KeyReleased(VirtualKey.LETTER_C), element1); 
    183         simulateEvent(new MouseClick(MouseClick.Button.LEFT), element3); 
     175        simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element2); 
     176        simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 
     177        simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 
     178        simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 
     179        simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 
     180        simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 
     181        simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 
     182        simulateEvent(new KeyReleased(VirtualKey.LETTER_C), element1); 
     183        simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 
    184184        assertTextInput("", "abc", "", "", "abc", ""); 
    185185 
    186         simulateEvent(new MouseClick(MouseClick.Button.LEFT), element2); 
    187         simulateEvent(new MouseClick(MouseClick.Button.LEFT), element3); 
    188         simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 
    189         simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 
    190         simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 
    191         simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 
    192         simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 
    193         simulateEvent(new MouseClick(MouseClick.Button.LEFT), element3); 
     186        simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element2); 
     187        simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 
     188        simulateEvent(new KeyPressed(VirtualKey.LETTER_A), element1); 
     189        simulateEvent(new KeyReleased(VirtualKey.LETTER_A), element1); 
     190        simulateEvent(new KeyPressed(VirtualKey.LETTER_B), element1); 
     191        simulateEvent(new KeyReleased(VirtualKey.LETTER_B), element1); 
     192        simulateEvent(new KeyPressed(VirtualKey.LETTER_C), element1); 
     193        simulateEvent(new MouseClick(MouseClick.Button.LEFT, 0, 0), element3); 
    194194        simulateEvent(new KeyReleased(VirtualKey.LETTER_C), element1); 
    195195         
Note: See TracChangeset for help on using the changeset viewer.