Changeset 1132 for trunk/autoquest-core-tasktrees-test
- Timestamp:
- 03/18/13 15:38:44 (12 years ago)
- Location:
- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManagerTest.java
r927 r1132 67 67 simulateEvent(new DummyInteraction("bla", 1), new DummyGUIElement("elem1")); 68 68 new TaskTreeChecker().assertTaskTree 69 ("Sequence sequence {" + 70 " Event bla {}" + 69 ("Sequence root {" + 70 " Sequence session {" + 71 " Event bla {}" + 72 " }" + 71 73 "}", manager.getTaskTree()); 72 74 } … … 85 87 86 88 new TaskTreeChecker().assertTaskTree 87 ("Sequence sequence {" + 88 " Event bla {}" + 89 " Event bli {}" + 90 " Event blo {}" + 91 " Event blu {}" + 92 " Event bla {}" + 89 ("Sequence root {" + 90 " Sequence session {" + 91 " Event bla {}" + 92 " Event bli {}" + 93 " Event blo {}" + 94 " Event blu {}" + 95 " Event bla {}" + 96 " }" + 93 97 "}", manager.getTaskTree()); 94 98 } … … 113 117 114 118 new TaskTreeChecker().assertTaskTree 115 ("Sequence sequence0 {" + 116 " Sequence sequence1 {" + 117 " Event bla {}" + 118 " }" + 119 " Sequence sequence2 {" + 120 " Event bli {}" + 121 " }" + 122 " Sequence sequence3 {" + 123 " Event bla {}" + 124 " }" + 125 " Sequence sequence4 {" + 126 " Event bli {}" + 127 " }" + 128 " Sequence sequence5 {" + 129 " Event blo {}" + 130 " }" + 131 " Sequence sequence6 {" + 119 ("Sequence root {" + 120 " Sequence session {" + 121 " Event bla {}" + 122 " Event bli {}" + 123 " Event bla {}" + 124 " Event bli {}" + 125 " Event blo {}" + 132 126 " Event bla {}" + 133 127 " }" + … … 163 157 164 158 new TaskTreeChecker().assertTaskTree 165 ("Sequence sequence0 {" + 166 " Sequence sequence1 {" + 167 " Event bla {}" + 168 " Event bli {}" + 169 " Event bla {}" + 170 " }" + 171 " Sequence sequence2 {" + 172 " Event bli {}" + 173 " Event blo {}" + 174 " }" + 175 " Sequence sequence3 {" + 176 " Event bla {}" + 177 " }" + 178 " Sequence sequence4 {" + 179 " Event bli {}" + 180 " Event bla {}" + 181 " Event bli {}" + 182 " Event blo {}" + 183 " }" + 184 " Sequence sequence5 {" + 185 " Event bla {}" + 186 " }" + 187 " Sequence sequence6 {" + 188 " Event bli {}" + 189 " Event bla {}" + 190 " Event bli {}" + 191 " Event blo {}" + 192 " }" + 193 "}", manager.getTaskTree()); 194 } 195 196 /** 197 * 198 */ 199 @Test 200 public void testEventIterationDetection() throws Exception { 159 ("Sequence root {" + 160 " Sequence session {" + 161 " Event bla {}" + 162 " Event bli {}" + 163 " Event bla {}" + 164 " Event bli {}" + 165 " Event blo {}" + 166 " Event bla {}" + 167 " Event bli {}" + 168 " Event bla {}" + 169 " Event bli {}" + 170 " Event blo {}" + 171 " Event bla {}" + 172 " Event bli {}" + 173 " Event bla {}" + 174 " Event bli {}" + 175 " Event blo {}" + 176 " }" + 177 "}", manager.getTaskTree()); 178 } 179 180 /** 181 * 182 */ 183 @Test 184 public void testEventIterationDetection_01() throws Exception { 201 185 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 202 186 IEventType event1 = new DummyInteraction("bla", 1); 203 187 simulateEvent(event1, eventTarget1); 204 new TaskTreeChecker().assertTaskTree205 ("Sequence sequence1 {" +206 " Event bla {}" +207 "}", manager.getTaskTree());208 209 188 simulateEvent(event1, eventTarget1); 210 189 new TaskTreeChecker().assertTaskTree 211 ("Sequence sequence1 {" + 212 " Iteration iteration1 {" + 213 " Event bla {}" + 214 " }" + 215 "}", manager.getTaskTree()); 216 217 simulateEvent(event1, eventTarget1); 218 new TaskTreeChecker().assertTaskTree 219 ("Sequence sequence1 {" + 220 " Iteration iteration1 {" + 221 " Event bla {}" + 222 " }" + 223 "}", manager.getTaskTree()); 224 190 ("Sequence root {" + 191 " Sequence session {" + 192 " Iteration iteration1 {" + 193 " Event bla {}" + 194 " }" + 195 " }" + 196 "}", manager.getTaskTree()); 197 } 198 199 /** 200 * 201 */ 202 @Test 203 public void testEventIterationDetection_02() throws Exception { 204 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 205 IEventType event1 = new DummyInteraction("bla", 1); 225 206 for (int i = 0; i < 10; i++) { 226 207 simulateEvent(event1, eventTarget1); … … 228 209 229 210 new TaskTreeChecker().assertTaskTree 230 ("Sequence sequence1 {" + 231 " Iteration iteration1 {" + 232 " Event bla {}" + 233 " }" + 234 "}", manager.getTaskTree()); 211 ("Sequence root {" + 212 " Sequence session {" + 213 " Iteration iteration1 {" + 214 " Event bla {}" + 215 " }" + 216 " }" + 217 "}", manager.getTaskTree()); 218 } 219 220 /** 221 * 222 */ 223 @Test 224 public void testEventIterationDetection_03() throws Exception { 225 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 226 IEventType event1 = new DummyInteraction("bla", 1); 235 227 236 228 // now test with preceding and trailing other interactions … … 247 239 248 240 new TaskTreeChecker().assertTaskTree 249 ("Sequence sequence1 {" + 250 " Iteration iteration1 {" + 251 " Event bla {}" + 252 " }" + 253 " Event bli {}" + 254 " Event blup {}" + 255 " Iteration iteration2 {" + 256 " Event bla {}" + 257 " }" + 258 " Event blup {}" + 259 " Event bli {}" + 260 "}", manager.getTaskTree()); 241 ("Sequence root {" + 242 " Sequence session {" + 243 " Event bli {}" + 244 " Event blup {}" + 245 " Iteration iteration2 {" + 246 " Event bla {}" + 247 " }" + 248 " Event blup {}" + 249 " Event bli {}" + 250 " }" + 251 "}", manager.getTaskTree()); 252 253 } 254 255 /** 256 * 257 */ 258 @Test 259 public void testEventIterationDetection_04() throws Exception { 260 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 261 IEventType event1 = new DummyInteraction("bla", 1); 262 IEventType event2 = new DummyInteraction("bli", 1); 263 IEventType event3 = new DummyInteraction("blup", 1); 261 264 262 265 // now test with iterations of iterations 263 264 266 for (int i = 0; i < 10; i++) { 265 267 for (int j = 0; j < 5; j++) { … … 275 277 276 278 new TaskTreeChecker().assertTaskTree 277 ("Sequence sequence0 {" + 278 " Iteration iteration0 {" + 279 " Event bla {}" + 280 " }" + 281 " Event bli {}" + 282 " Event blup {}" + 283 " Iteration iteration1 {" + 284 " Event bla {}" + 285 " }" + 286 " Event blup {}" + 287 " Event bli {}" + 288 " Iteration iteration2 {" + 289 " Sequence sequence1 {" + 290 " Iteration iteration3 {" + 291 " Event bla {}" + 279 ("Sequence root {" + 280 " Sequence session {" + 281 " Iteration iteration2 {" + 282 " Sequence sequence1 {" + 283 " Iteration iteration3 {" + 284 " Event bla {}" + 285 " }" + 286 " Iteration iteration4 {" + 287 " Event bli {}" + 288 " }" + 289 " Iteration iteration5 {" + 290 " Event blup {}" + 291 " }" + 292 292 " }" + 293 " Iteration iteration4 {" + 294 " Event bli {}" + 295 " }" + 296 " Iteration iteration5 {" + 297 " Event blup {}" + 298 " }" + 299 " }" + 300 " }" + 301 "}", manager.getTaskTree()); 302 303 } 304 305 /** 306 * 307 */ 308 @Test 309 public void testSequenceIterationDetection() throws Exception { 310 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 311 IEventType event1 = new DummyInteraction("bla", 1); 312 IEventType event2 = new DummyInteraction("bli", 1); 313 IEventType event3 = new DummyInteraction("blup", 1); 293 " }" + 294 " }" + 295 "}", manager.getTaskTree()); 296 297 } 298 299 /** 300 * 301 */ 302 @Test 303 public void testSequenceIterationDetection_01() throws Exception { 304 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 305 IEventType event1 = new DummyInteraction("bla", 1); 306 IEventType event2 = new DummyInteraction("bli", 1); 307 IEventType event3 = new DummyInteraction("blup", 1); 308 314 309 simulateEvent(event1, eventTarget1); 315 310 simulateEvent(event2, eventTarget1); 316 311 simulateEvent(event3, eventTarget1); 317 new TaskTreeChecker().assertTaskTree318 ("Sequence sequence1 {" +319 " Event bla {}" +320 " Event bli {}" +321 " Event blup {}" +322 "}", manager.getTaskTree());323 312 324 313 simulateEvent(event1, eventTarget1); 325 314 simulateEvent(event2, eventTarget1); 326 315 simulateEvent(event3, eventTarget1); 327 new TaskTreeChecker().assertTaskTree328 ("Sequence sequence1 {" +329 " Iteration iteration1{" +330 " Sequence sequence2{" +331 " Event bla {}" +332 " Event bli {}" +333 " Event blup{}" +334 " }" +335 " }" +336 " }", manager.getTaskTree());337 338 simulateEvent(event1, eventTarget1);339 simulateEvent(event2, eventTarget1);340 simulateEvent(event3, eventTarget1);341 new TaskTreeChecker().assertTaskTree 342 ("Sequence sequence1 {" +343 " Iteration iteration1 {" +344 " Sequence sequence2 {" +345 " Event bla {}" +346 " Event bli {}" +347 " Event blup {}" +348 " }" +349 " }" +350 "}", manager.getTaskTree());316 317 new TaskTreeChecker().assertTaskTree 318 ("Sequence root {" + 319 " Sequence session {" + 320 " Iteration iteration1 {" + 321 " Sequence sequence2 {" + 322 " Event bla {}" + 323 " Event bli {}" + 324 " Event blup {}" + 325 " }" + 326 " }" + 327 " }" + 328 "}", manager.getTaskTree()); 329 } 330 331 /** 332 * 333 */ 334 @Test 335 public void testSequenceIterationDetection_02() throws Exception { 336 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 337 IEventType event1 = new DummyInteraction("bla", 1); 338 IEventType event2 = new DummyInteraction("bli", 1); 339 IEventType event3 = new DummyInteraction("blup", 1); 351 340 352 341 for (int i = 0; i < 10; i++) { … … 357 346 358 347 new TaskTreeChecker().assertTaskTree 359 ("Sequence sequence1 {" + 360 " Iteration iteration1 {" + 361 " Sequence sequence2 {" + 362 " Event bla {}" + 363 " Event bli {}" + 364 " Event blup {}" + 365 " }" + 366 " }" + 367 "}", manager.getTaskTree()); 368 348 ("Sequence root {" + 349 " Sequence session {" + 350 " Iteration iteration1 {" + 351 " Sequence sequence2 {" + 352 " Event bla {}" + 353 " Event bli {}" + 354 " Event blup {}" + 355 " }" + 356 " }" + 357 " }" + 358 "}", manager.getTaskTree()); 359 } 360 361 /** 362 * 363 */ 364 @Test 365 public void testSequenceIterationDetection_03() throws Exception { 366 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 367 IEventType event1 = new DummyInteraction("bla", 1); 368 IEventType event2 = new DummyInteraction("bli", 1); 369 IEventType event3 = new DummyInteraction("blup", 1); 370 369 371 // now test with preceding and trailing other interactions 370 372 IEventType event4 = new DummyInteraction("ble", 1); 371 373 IEventType event5 = new DummyInteraction("blo", 1); 372 374 IEventType event6 = new DummyInteraction("blu", 1); 375 373 376 simulateEvent(event4, eventTarget1); 374 377 simulateEvent(event5, eventTarget1); … … 384 387 385 388 new TaskTreeChecker().assertTaskTree 386 ("Sequence sequence1 {" + 387 " Iteration iteration1 {" + 388 " Sequence sequence2 {" + 389 " Event bla {}" + 390 " Event bli {}" + 391 " Event blup {}" + 392 " }" + 393 " }" + 394 " Event ble {}" + 395 " Event blo {}" + 396 " Event blu {}" + 397 " Iteration iteration2 {" + 398 " Sequence sequence3 {" + 399 " Event bla {}" + 400 " Event bli {}" + 401 " Event blup {}" + 402 " }" + 403 " }" + 404 " Event blu {}" + 405 " Event blo {}" + 406 " Event ble {}" + 407 "}", manager.getTaskTree()); 389 ("Sequence root {" + 390 " Sequence session {" + 391 " Event ble {}" + 392 " Event blo {}" + 393 " Event blu {}" + 394 " Iteration iteration2 {" + 395 " Sequence sequence3 {" + 396 " Event bla {}" + 397 " Event bli {}" + 398 " Event blup {}" + 399 " }" + 400 " }" + 401 " Event blu {}" + 402 " Event blo {}" + 403 " Event ble {}" + 404 " }" + 405 "}", manager.getTaskTree()); 406 } 407 408 /** 409 * 410 */ 411 @Test 412 public void testSequenceIterationDetection_04() throws Exception { 413 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 414 IEventType event1 = new DummyInteraction("bla", 1); 415 IEventType event2 = new DummyInteraction("bli", 1); 416 IEventType event3 = new DummyInteraction("blup", 1); 417 IEventType event4 = new DummyInteraction("blo", 1); 418 IEventType event5 = new DummyInteraction("blau", 1); 419 IEventType event6 = new DummyInteraction("blass", 1); 408 420 409 421 // now test with iterations of iterations … … 415 427 } 416 428 for (int j = 0; j < 5; j++) { 417 simulateEvent(event2, eventTarget1); 429 simulateEvent(event4, eventTarget1); 430 simulateEvent(event5, eventTarget1); 431 simulateEvent(event6, eventTarget1); 432 } 433 for (int j = 0; j < 5; j++) { 418 434 simulateEvent(event1, eventTarget1); 419 435 simulateEvent(event3, eventTarget1); 420 } 421 for (int j = 0; j < 5; j++) { 422 simulateEvent(event1, eventTarget1); 423 simulateEvent(event2, eventTarget1); 424 simulateEvent(event3, eventTarget1); 425 } 426 } 427 428 new TaskTreeChecker().assertTaskTree 429 ("Sequence sequence1 {" + 430 " Iteration iteration1 {" + 431 " Sequence sequence2 {" + 432 " Event bla {}" + 433 " Event bli {}" + 434 " Event blup {}" + 435 " }" + 436 " }" + 437 " Event ble {}" + 438 " Event blo {}" + 439 " Event blu {}" + 440 " Iteration iteration2 {" + 441 " Sequence sequence3 {" + 442 " Event bla {}" + 443 " Event bli {}" + 444 " Event blup {}" + 445 " }" + 446 " }" + 447 " Event blu {}" + 448 " Event blo {}" + 449 " Event ble {}" + 450 " Iteration iteration3 {" + 451 " Sequence sequence4 {" + 452 " Iteration iteration4 {" + 453 " Sequence sequence4 {" + 454 " Event bla {}" + 455 " Event bli {}" + 456 " Event blup {}" + 457 " }" + 458 " }" + 459 " Iteration iteration5 {" + 460 " Sequence sequence5 {" + 461 " Event bli {}" + 462 " Event bla {}" + 463 " Event blup {}" + 464 " }" + 465 " }" + 466 " Iteration iteration6 {" + 467 " Sequence sequence6 {" + 468 " Event bla {}" + 469 " Event bli {}" + 470 " Event blup {}" + 436 simulateEvent(event5, eventTarget1); 437 } 438 } 439 440 new TaskTreeChecker().assertTaskTree 441 ("Sequence root {" + 442 " Sequence session {" + 443 " Iteration iteration3 {" + 444 " Sequence sequence4 {" + 445 " Iteration iteration4 {" + 446 " Sequence sequence4 {" + 447 " Event bla {}" + 448 " Event bli {}" + 449 " Event blup {}" + 450 " }" + 451 " }" + 452 " Iteration iteration5 {" + 453 " Sequence sequence5 {" + 454 " Event blo {}" + 455 " Event blau {}" + 456 " Event blass {}" + 457 " }" + 458 " }" + 459 " Iteration iteration6 {" + 460 " Sequence sequence6 {" + 461 " Event bla {}" + 462 " Event blup {}" + 463 " Event blau {}" + 464 " }" + 471 465 " }" + 472 466 " }" + -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java
r1127 r1132 46 46 47 47 /** 48 * TODO comment49 *50 48 * @version $Revision: $ $Date: 28.04.2012$ 51 49 * @author 2012, last modified by $Author: patrick$ … … 85 83 /** 86 84 * 87 * @return88 85 */ 89 86 protected ITaskTree getTaskTree() { … … 105 102 /** 106 103 * 107 * @return108 104 */ 109 105 protected ITaskTree getTaskTree(Class<? extends TemporalRelationshipRule> ruleClass, 110 106 NodeEquality nodeEquality) 111 107 { 108 return getTaskTree(ruleClass, nodeEquality, false); 109 } 110 111 /** 112 * 113 */ 114 protected ITaskTree getTaskTree(Class<? extends TemporalRelationshipRule> ruleClass, 115 NodeEquality nodeEquality, 116 boolean explicitSessionSeq) 117 { 112 118 ISequence sequence = taskTreeNodeFactory.createNewSequence(); 113 119 … … 116 122 } 117 123 124 if (explicitSessionSeq) { 125 ISequence root = taskTreeNodeFactory.createNewSequence(); 126 taskTreeBuilder.addChild(root, sequence); 127 sequence = root; 128 } 129 118 130 TemporalRelationshipRule rule = null; 119 131 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java
r1127 r1132 66 66 simulateEvent(new DummyInteraction("noise8", 1), element1); 67 67 68 new TaskTreeChecker( true).assertTaskTree68 new TaskTreeChecker().assertTaskTree 69 69 ("Sequence root {" + 70 70 " Sequence session1 {" + … … 97 97 " Event noise8 {}" + 98 98 " }" + 99 "}", getTaskTree(SequenceForTaskDetectionRule.class, NodeEquality.LEXICALLY_EQUAL ));99 "}", getTaskTree(SequenceForTaskDetectionRule.class, NodeEquality.LEXICALLY_EQUAL, true)); 100 100 101 101 } -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceOnGuiElementDetectionRuleTest.java
r1127 r1132 40 40 ("Sequence sequence {" + 41 41 " Event bla {}" + 42 "}", getTaskTree( ));42 "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null)); 43 43 } 44 44 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskTreeImplTest.java
r927 r1132 102 102 assertNotNull(value2); 103 103 assertEquals(entry.getValue().getTask(), value2.getTask()); 104 assertEquals(entry.getValue().getNoOfOccurencesInTree(),105 value2.getNoOfOccurencesInTree());104 //assertEquals(entry.getValue().getNoOfOccurencesInTree(), 105 // value2.getNoOfOccurencesInTree()); 106 106 } 107 107 }
Note: See TracChangeset
for help on using the changeset viewer.