[445] | 1 | // Module : $RCSfile: TaskTreeManagerTest.java,v $
|
---|
| 2 | // Version : $Revision: 0.0 $ $Author: Patrick $ $Date: 08.11.2011 21:32:36 $
|
---|
| 3 | // Project : TaskTreePerformanceTest
|
---|
| 4 | // Creation : 2011 by Patrick
|
---|
| 5 | // Copyright : Patrick Harms, 2011
|
---|
| 6 |
|
---|
| 7 | package de.ugoe.cs.quest.tasktrees.temporalrelation;
|
---|
| 8 |
|
---|
| 9 | import org.junit.Test;
|
---|
| 10 |
|
---|
[557] | 11 | import de.ugoe.cs.quest.eventcore.IEventTarget;
|
---|
[445] | 12 | import de.ugoe.cs.quest.tasktrees.testutils.DummyGUIElement;
|
---|
| 13 | import de.ugoe.cs.quest.tasktrees.testutils.DummyInteraction;
|
---|
| 14 | import de.ugoe.cs.quest.tasktrees.testutils.TaskTreeChecker;
|
---|
| 15 |
|
---|
| 16 | /**
|
---|
| 17 | * TODO comment
|
---|
[557] | 18 | *
|
---|
[445] | 19 | * @version $Revision: $ $Date: $
|
---|
[557] | 20 | * @author 2011, last modified by $Author: $
|
---|
[445] | 21 | */
|
---|
[557] | 22 | public class DefaultGuiEventSequenceDetectionRuleTest extends AbstractTemporalRelationshipTC {
|
---|
[445] | 23 |
|
---|
[557] | 24 | /**
|
---|
| 25 | *
|
---|
| 26 | */
|
---|
| 27 | @Test
|
---|
| 28 | public void testOneInteractionOnOneElement() {
|
---|
| 29 | simulateEvent(new DummyInteraction("bla", 1), new DummyGUIElement("elem1"));
|
---|
[445] | 30 |
|
---|
[557] | 31 | new TaskTreeChecker().assertTaskTree
|
---|
| 32 | ("Sequence sequence {" +
|
---|
| 33 | " Event bla {}" +
|
---|
| 34 | "}", getTaskTree());
|
---|
| 35 | }
|
---|
[445] | 36 |
|
---|
[557] | 37 | /**
|
---|
| 38 | *
|
---|
| 39 | */
|
---|
| 40 | @Test
|
---|
| 41 | public void testManyInteractionsOnOneElement() {
|
---|
| 42 | IEventTarget eventTarget = new DummyGUIElement("elem1");
|
---|
| 43 | simulateEvent(new DummyInteraction("bla", 1), eventTarget);
|
---|
| 44 | simulateEvent(new DummyInteraction("bli", 1), eventTarget);
|
---|
| 45 | simulateEvent(new DummyInteraction("blo", 1), eventTarget);
|
---|
| 46 | simulateEvent(new DummyInteraction("blu", 1), eventTarget);
|
---|
| 47 | simulateEvent(new DummyInteraction("bla", 1), eventTarget);
|
---|
[445] | 48 |
|
---|
[557] | 49 | new TaskTreeChecker().assertTaskTree
|
---|
| 50 | ("Sequence sequence {" +
|
---|
| 51 | " Event bla {}" +
|
---|
| 52 | " Event bli {}" +
|
---|
| 53 | " Event blo {}" +
|
---|
| 54 | " Event blu {}" +
|
---|
| 55 | " Event bla {}" +
|
---|
| 56 | "}", getTaskTree());
|
---|
| 57 | }
|
---|
[445] | 58 |
|
---|
[557] | 59 | /**
|
---|
| 60 | *
|
---|
| 61 | */
|
---|
| 62 | @Test
|
---|
| 63 | public void testOneInteractionOnManyElements() {
|
---|
| 64 | IEventTarget eventTarget1 = new DummyGUIElement("elem1");
|
---|
| 65 | IEventTarget eventTarget2 = new DummyGUIElement("elem2");
|
---|
| 66 | IEventTarget eventTarget3 = new DummyGUIElement("elem3");
|
---|
| 67 | IEventTarget eventTarget4 = new DummyGUIElement("elem4");
|
---|
| 68 | IEventTarget eventTarget5 = new DummyGUIElement("elem5");
|
---|
| 69 | IEventTarget eventTarget6 = new DummyGUIElement("elem6");
|
---|
| 70 | simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
|
---|
| 71 | simulateEvent(new DummyInteraction("bli", 1), eventTarget2);
|
---|
| 72 | simulateEvent(new DummyInteraction("bla", 1), eventTarget3);
|
---|
| 73 | simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
|
---|
| 74 | simulateEvent(new DummyInteraction("blo", 1), eventTarget5);
|
---|
| 75 | simulateEvent(new DummyInteraction("bla", 1), eventTarget6);
|
---|
| 76 |
|
---|
| 77 | new TaskTreeChecker().assertTaskTree
|
---|
| 78 | ("Sequence sequence0 {" +
|
---|
| 79 | " Sequence sequence1 {" +
|
---|
| 80 | " Event bla {}" +
|
---|
| 81 | " }" +
|
---|
| 82 | " Sequence sequence2 {" +
|
---|
| 83 | " Event bli {}" +
|
---|
| 84 | " }" +
|
---|
| 85 | " Sequence sequence3 {" +
|
---|
| 86 | " Event bla {}" +
|
---|
| 87 | " }" +
|
---|
| 88 | " Sequence sequence4 {" +
|
---|
| 89 | " Event bli {}" +
|
---|
| 90 | " }" +
|
---|
| 91 | " Sequence sequence5 {" +
|
---|
| 92 | " Event blo {}" +
|
---|
| 93 | " }" +
|
---|
| 94 | " Sequence sequence6 {" +
|
---|
| 95 | " Event bla {}" +
|
---|
| 96 | " }" +
|
---|
| 97 | "}", getTaskTree());
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 | /**
|
---|
| 101 | *
|
---|
| 102 | */
|
---|
| 103 | @Test
|
---|
| 104 | public void testManyInteractionsOnManyElements() {
|
---|
| 105 | IEventTarget eventTarget1 = new DummyGUIElement("elem1");
|
---|
| 106 | IEventTarget eventTarget2 = new DummyGUIElement("elem2");
|
---|
| 107 | IEventTarget eventTarget3 = new DummyGUIElement("elem3");
|
---|
| 108 | IEventTarget eventTarget4 = new DummyGUIElement("elem4");
|
---|
| 109 | IEventTarget eventTarget5 = new DummyGUIElement("elem5");
|
---|
| 110 | IEventTarget eventTarget6 = new DummyGUIElement("elem6");
|
---|
| 111 | simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
|
---|
| 112 | simulateEvent(new DummyInteraction("bli", 1), eventTarget1);
|
---|
| 113 | simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
|
---|
| 114 | simulateEvent(new DummyInteraction("bli", 1), eventTarget2);
|
---|
| 115 | simulateEvent(new DummyInteraction("blo", 1), eventTarget2);
|
---|
| 116 | simulateEvent(new DummyInteraction("bla", 1), eventTarget3);
|
---|
| 117 | simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
|
---|
| 118 | simulateEvent(new DummyInteraction("bla", 1), eventTarget4);
|
---|
| 119 | simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
|
---|
| 120 | simulateEvent(new DummyInteraction("blo", 1), eventTarget4);
|
---|
| 121 | simulateEvent(new DummyInteraction("bla", 1), eventTarget5);
|
---|
| 122 | simulateEvent(new DummyInteraction("bli", 1), eventTarget6);
|
---|
| 123 | simulateEvent(new DummyInteraction("bla", 1), eventTarget6);
|
---|
| 124 | simulateEvent(new DummyInteraction("bli", 1), eventTarget6);
|
---|
| 125 | simulateEvent(new DummyInteraction("blo", 1), eventTarget6);
|
---|
| 126 |
|
---|
| 127 | new TaskTreeChecker().assertTaskTree
|
---|
| 128 | ("Sequence sequence0 {" +
|
---|
| 129 | " Sequence sequence1 {" +
|
---|
| 130 | " Event bla {}" +
|
---|
| 131 | " Event bli {}" +
|
---|
| 132 | " Event bla {}" +
|
---|
| 133 | " }" +
|
---|
| 134 | " Sequence sequence2 {" +
|
---|
| 135 | " Event bli {}" +
|
---|
| 136 | " Event blo {}" +
|
---|
| 137 | " }" +
|
---|
| 138 | " Sequence sequence3 {" +
|
---|
| 139 | " Event bla {}" +
|
---|
| 140 | " }" +
|
---|
| 141 | " Sequence sequence4 {" +
|
---|
| 142 | " Event bli {}" +
|
---|
| 143 | " Event bla {}" +
|
---|
| 144 | " Event bli {}" +
|
---|
| 145 | " Event blo {}" +
|
---|
| 146 | " }" +
|
---|
| 147 | " Sequence sequence5 {" +
|
---|
| 148 | " Event bla {}" +
|
---|
| 149 | " }" +
|
---|
| 150 | " Sequence sequence6 {" +
|
---|
| 151 | " Event bli {}" +
|
---|
| 152 | " Event bla {}" +
|
---|
| 153 | " Event bli {}" +
|
---|
| 154 | " Event blo {}" +
|
---|
| 155 | " }" +
|
---|
| 156 | "}", getTaskTree());
|
---|
| 157 | }
|
---|
| 158 |
|
---|
[445] | 159 | }
|
---|