1 | package org.expeditee.gui;
|
---|
2 |
|
---|
3 |
|
---|
4 | public class FreeItemsTest extends GuiTestCase {
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * Test the picking up and putting down of objects on a frame.
|
---|
8 | *
|
---|
9 | * @throws Exception
|
---|
10 | */
|
---|
11 | public final void testAttachedToCursor() throws Exception {
|
---|
12 | Frame testFrame = showFrame("ExpediteeTest2");
|
---|
13 |
|
---|
14 | FrameMouseActions.pickup(testFrame.getTitleItem());
|
---|
15 | assertTrue(FreeItems.itemsAttachedToCursor());
|
---|
16 | assertTrue(FreeItems.textOnlyAttachedToCursor());
|
---|
17 |
|
---|
18 | FrameMouseActions.anchor(FreeItems.getInstance());
|
---|
19 | assertFalse(FreeItems.itemsAttachedToCursor());
|
---|
20 | assertFalse(FreeItems.textOnlyAttachedToCursor());
|
---|
21 |
|
---|
22 | FrameMouseActions.pickup(testFrame.getAllItems());
|
---|
23 | assertTrue(FreeItems.itemsAttachedToCursor());
|
---|
24 | assertFalse(FreeItems.textOnlyAttachedToCursor());
|
---|
25 | assertEquals(8, FreeItems.getTextItems().size());
|
---|
26 |
|
---|
27 | assertEquals(1, FreeItems.getGroupedText().get("").size());
|
---|
28 | assertEquals(2, FreeItems.getGroupedText().get("Label").size());
|
---|
29 | assertEquals(3, FreeItems.getGroupedText().get("Label2").size());
|
---|
30 | assertEquals(null, FreeItems.getGroupedText().get("non existing label"));
|
---|
31 |
|
---|
32 | FrameMouseActions.anchor(FreeItems.getInstance());
|
---|
33 | assertFalse(FreeItems.itemsAttachedToCursor());
|
---|
34 | assertFalse(FreeItems.textOnlyAttachedToCursor());
|
---|
35 | }
|
---|
36 | }
|
---|