Changeset 1146 for trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java
- Timestamp:
- 04/04/13 16:06:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java
r1132 r1146 17 17 import org.junit.Test; 18 18 19 import de.ugoe.cs.autoquest.eventcore.IEventTarget;20 import de.ugoe.cs.autoquest.eventcore.gui.IInteraction;21 import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;22 import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEquality;23 import de.ugoe.cs.autoquest.test.DummyGUIElement;24 import de.ugoe.cs.autoquest.test.DummyInteraction;25 26 19 /** 27 20 * TODO comment … … 36 29 */ 37 30 @Test 38 public void testTaskDetection() throws Exception { 39 IEventTarget element1 = new DummyGUIElement("elem1"); 40 41 IInteraction action1 = new DummyInteraction("action1", 1); 42 IInteraction action2 = new DummyInteraction("action2", 1); 43 IInteraction action3 = new DummyInteraction("action3", 1); 44 IInteraction action4 = new DummyInteraction("action4", 1); 45 46 simulateEvent(new DummyInteraction("noise0", 1), element1); 47 simulateEvent(action1, element1); 48 simulateEvent(action2, element1); 49 simulateEvent(action3, element1); 50 simulateEvent(action4, element1); 51 simulateEvent(new DummyInteraction("noise1", 1), element1); 52 simulateEvent(new DummyInteraction("noise2", 1), element1); 53 simulateEvent(action1, element1); 54 simulateEvent(action2, element1); 55 simulateEvent(action3, element1); 56 simulateEvent(action4, element1); 57 simulateEvent(new DummyInteraction("noise3", 1), element1); 58 simulateEvent(new DummyInteraction("noise4", 1), element1); 59 simulateEvent(new DummyInteraction("noise5", 1), element1); 60 simulateEvent(new DummyInteraction("noise6", 1), element1); 61 simulateEvent(action1, element1); 62 simulateEvent(action2, element1); 63 simulateEvent(action3, element1); 64 simulateEvent(action4, element1); 65 simulateEvent(new DummyInteraction("noise7", 1), element1); 66 simulateEvent(new DummyInteraction("noise8", 1), element1); 67 68 new TaskTreeChecker().assertTaskTree 69 ("Sequence root {" + 70 " Sequence session1 {" + 71 " Event noise0 {}" + 72 " Sequence sequence2 {" + 73 " Event action1 {}" + 74 " Event action2 {}" + 75 " Event action3 {}" + 76 " Event action4 {}" + 77 " }" + 78 " Event noise1 {}" + 79 " Event noise2 {}" + 80 " Sequence sequence2 {" + 81 " Event action1 {}" + 82 " Event action2 {}" + 83 " Event action3 {}" + 84 " Event action4 {}" + 85 " }" + 86 " Event noise3 {}" + 87 " Event noise4 {}" + 88 " Event noise5 {}" + 89 " Event noise6 {}" + 90 " Sequence sequence2 {" + 91 " Event action1 {}" + 92 " Event action2 {}" + 93 " Event action3 {}" + 94 " Event action4 {}" + 95 " }" + 96 " Event noise7 {}" + 97 " Event noise8 {}" + 98 " }" + 99 "}", getTaskTree(SequenceForTaskDetectionRule.class, NodeEquality.LEXICALLY_EQUAL, true)); 31 public void test_TaskDetection_01() throws Exception { 32 String input = 33 "UserSession {" + 34 " Event noise0 {}" + 35 " Event action1 {}" + 36 " Event action2 {}" + 37 " Event action3 {}" + 38 " Event action4 {}" + 39 " Event noise1 {}" + 40 " Event noise2 {}" + 41 " Event action1 {}" + 42 " Event action2 {}" + 43 " Event action3 {}" + 44 " Event action4 {}" + 45 " Event noise3 {}" + 46 " Event noise4 {}" + 47 " Event noise5 {}" + 48 " Event noise6 {}" + 49 " Event action1 {}" + 50 " Event action2 {}" + 51 " Event action3 {}" + 52 " Event action4 {}" + 53 " Event action1 {}" + 54 " Event action2 {}" + 55 " Event action3 {}" + 56 " Event action4 {}" + 57 " Event noise7 {}" + 58 "}"; 100 59 60 String output = 61 "UserSession {" + 62 " Event noise0 {}" + 63 " Iteration iteration1 {" + 64 " Sequence sequence1 {" + 65 " Event action1 {}" + 66 " Event action2 {}" + 67 " Event action3 {}" + 68 " Event action4 {}" + 69 " }" + 70 " }" + 71 " Event noise1 {}" + 72 " Event noise2 {}" + 73 " Iteration iteration1 {" + 74 " Sequence sequence1 {" + 75 " Event action1 {}" + 76 " Event action2 {}" + 77 " Event action3 {}" + 78 " Event action4 {}" + 79 " }" + 80 " }" + 81 " Event noise3 {}" + 82 " Event noise4 {}" + 83 " Event noise5 {}" + 84 " Event noise6 {}" + 85 " Iteration iteration1 {" + 86 " Sequence sequence1 {" + 87 " Event action1 {}" + 88 " Event action2 {}" + 89 " Event action3 {}" + 90 " Event action4 {}" + 91 " }" + 92 " Sequence sequence1 {" + 93 " Event action1 {}" + 94 " Event action2 {}" + 95 " Event action3 {}" + 96 " Event action4 {}" + 97 " }" + 98 " }" + 99 " Event noise7 {}" + 100 "}"; 101 102 applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output); 103 } 104 105 /** 106 * 107 */ 108 @Test 109 public void test_TaskDetection_02() throws Exception { 110 String input = 111 "UserSession {" + 112 " Event noise0 {}" + 113 " Event action1 {}" + 114 " Event action2 {}" + 115 " Event noise1 {}" + 116 " Event noise2 {}" + 117 " Event action3 {}" + 118 " Event action1 {}" + 119 " Event action2 {}" + 120 " Event action4 {}" + 121 " Event noise3 {}" + 122 " Event noise4 {}" + 123 " Event noise5 {}" + 124 " Event noise6 {}" + 125 " Event action1 {}" + 126 " Event action2 {}" + 127 " Event action3 {}" + 128 " Event action4 {}" + 129 " Event action1 {}" + 130 " Event action2 {}" + 131 " Event action3 {}" + 132 " Event action4 {}" + 133 " Event noise7 {}" + 134 "}"; 135 136 String output = 137 "UserSession {" + 138 " Event noise0 {}" + 139 " Sequence sequence1 {" + 140 " Event action1 {}" + 141 " Event action2 {}" + 142 " }" + 143 " Event noise1 {}" + 144 " Event noise2 {}" + 145 " Event action3 {}" + 146 " Sequence sequence1 {" + 147 " Event action1 {}" + 148 " Event action2 {}" + 149 " }" + 150 " Event action4 {}" + 151 " Event noise3 {}" + 152 " Event noise4 {}" + 153 " Event noise5 {}" + 154 " Event noise6 {}" + 155 " Iteration iteration1 {" + 156 " Sequence sequence3 {" + 157 " Sequence sequence1 {" + 158 " Event action1 {}" + 159 " Event action2 {}" + 160 " }" + 161 " Event action3 {}" + 162 " Event action4 {}" + 163 " }" + 164 " Sequence sequence3 {" + 165 " Sequence sequence1 {" + 166 " Event action1 {}" + 167 " Event action2 {}" + 168 " }" + 169 " Event action3 {}" + 170 " Event action4 {}" + 171 " }" + 172 " }" + 173 " Event noise7 {}" + 174 "}"; 175 176 applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output); 101 177 } 102 178
Note: See TracChangeset
for help on using the changeset viewer.