Changeset 1294 for trunk/autoquest-core-tasktrees-test/src/test
- Timestamp:
- 08/14/13 17:04:42 (11 years ago)
- Location:
- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManagerTest.java
r1285 r1294 68 68 public void testOneEventOnOneElement() { 69 69 simulateEvent(new DummyInteraction("bla", 1), new DummyGUIElement("elem1")); 70 new TaskTreeChecker().assert TaskInstanceList70 new TaskTreeChecker().assertUserSession 71 71 ("UserSession session {" + 72 72 " Event bla {}" + … … 86 86 simulateEvent(new DummyInteraction("ble", 1), eventTarget); 87 87 88 new TaskTreeChecker().assert TaskInstanceList88 new TaskTreeChecker().assertUserSession 89 89 ("UserSession session {" + 90 90 " Event bla {}" + … … 114 114 simulateEvent(new DummyInteraction("blum", 1), eventTarget6); 115 115 116 new TaskTreeChecker(true).assert TaskInstanceList116 new TaskTreeChecker(true).assertUserSession 117 117 ("UserSession session {" + 118 118 " Event bla {}" + … … 152 152 simulateEvent(new DummyInteraction("blop", 1), eventTarget6); 153 153 154 new TaskTreeChecker().assert TaskInstanceList154 new TaskTreeChecker().assertUserSession 155 155 ("UserSession session {" + 156 156 " Event bla {}" + … … 181 181 simulateEvent(event1, eventTarget1); 182 182 simulateEvent(event1, eventTarget1); 183 new TaskTreeChecker().assert TaskInstanceList183 new TaskTreeChecker().assertUserSession 184 184 ("UserSession session {" + 185 185 " Iteration iteration1 {" + … … 201 201 } 202 202 203 new TaskTreeChecker().assert TaskInstanceList203 new TaskTreeChecker().assertUserSession 204 204 ("UserSession session {" + 205 205 " Iteration iteration1 {" + … … 240 240 simulateEvent(event5, eventTarget1); 241 241 242 new TaskTreeChecker().assert TaskInstanceList242 new TaskTreeChecker().assertUserSession 243 243 ("UserSession session {" + 244 244 " Event bli {}" + … … 285 285 } 286 286 287 new TaskTreeChecker(true).assert TaskInstanceList287 new TaskTreeChecker(true).assertUserSession 288 288 ("UserSession session {" + 289 289 " Iteration iteration2 {" + … … 426 426 simulateEvent(event3, eventTarget1); 427 427 428 new TaskTreeChecker().assert TaskInstanceList428 new TaskTreeChecker().assertUserSession 429 429 ("UserSession session {" + 430 430 " Iteration iteration1 {" + … … 459 459 } 460 460 461 new TaskTreeChecker().assert TaskInstanceList461 new TaskTreeChecker().assertUserSession 462 462 ("UserSession session {" + 463 463 " Iteration iteration1 {" + … … 540 540 simulateEvent(event6, eventTarget1); 541 541 542 new TaskTreeChecker().assert TaskInstanceList542 new TaskTreeChecker().assertUserSession 543 543 ("UserSession session {" + 544 544 " Event ble {}" + … … 610 610 } 611 611 612 new TaskTreeChecker().assert TaskInstanceList612 new TaskTreeChecker().assertUserSession 613 613 ("UserSession session {" + 614 614 " Iteration iteration3 {" + -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/EventTaskComparisonRuleTest.java
r1146 r1294 25 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 26 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;28 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;29 27 import de.ugoe.cs.autoquest.test.DummyGUIElement; 30 28 … … 32 30 * @author Patrick Harms 33 31 */ 34 public class EventTaskComparisonRuleTest {32 public class EventTaskComparisonRuleTest extends AbstractComparisonRuleTest { 35 33 36 34 /** … … 39 37 @Test 40 38 public void test_isApplicable_01() { 41 ITaskFactory taskFactory = new TaskFactory(); 42 43 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 44 45 IEventType eventType1 = new StringEventType("eventType1"); 46 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 47 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 39 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 40 41 IEventType eventType1 = new StringEventType("eventType1"); 42 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 43 ITask task1 = createNewEventTask(eventType1, eventTarget1); 48 44 49 45 assertTrue(rule.isApplicable(task1, task1)); … … 55 51 @Test 56 52 public void test_isApplicable_02() { 57 ITaskFactory taskFactory = new TaskFactory(); 58 59 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 60 61 IEventType eventType1 = new StringEventType("eventType1"); 62 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 63 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 53 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 54 55 IEventType eventType1 = new StringEventType("eventType1"); 56 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 57 ITask task1 = createNewEventTask(eventType1, eventTarget1); 64 58 65 59 IEventType eventType2 = new StringEventType("eventType2"); 66 60 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 67 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);61 ITask task2 = createNewEventTask(eventType2, eventTarget2); 68 62 69 63 assertTrue(rule.isApplicable(task1, task2)); … … 76 70 @Test 77 71 public void test_isApplicable_03() { 78 ITaskFactory taskFactory = new TaskFactory(); 79 80 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 81 82 IEventType eventType1 = new StringEventType("eventType1"); 83 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 84 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 72 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 73 74 IEventType eventType1 = new StringEventType("eventType1"); 75 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 76 ITask task1 = createNewEventTask(eventType1, eventTarget1); 85 77 86 ITask selection = taskFactory.createNewSelection();78 ITask selection = createNewSelection(); 87 79 88 80 assertFalse(rule.isApplicable(task1, selection)); … … 95 87 @Test 96 88 public void test_isApplicable_04() { 97 ITaskFactory taskFactory = new TaskFactory(); 98 99 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 100 101 IEventType eventType1 = new StringEventType("eventType1"); 102 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 103 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 104 105 ITask sequence = taskFactory.createNewSequence(); 89 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 90 91 IEventType eventType1 = new StringEventType("eventType1"); 92 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 93 ITask task1 = createNewEventTask(eventType1, eventTarget1); 94 95 ITask sequence = createNewSequence(); 106 96 107 97 assertFalse(rule.isApplicable(task1, sequence)); … … 114 104 @Test 115 105 public void test_isApplicable_05() { 116 ITaskFactory taskFactory = new TaskFactory(); 117 118 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 119 120 IEventType eventType1 = new StringEventType("eventType1"); 121 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 122 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 123 124 ITask iteration = taskFactory.createNewIteration(); 106 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 107 108 IEventType eventType1 = new StringEventType("eventType1"); 109 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 110 ITask task1 = createNewEventTask(eventType1, eventTarget1); 111 112 ITask iteration = createNewIteration(); 125 113 126 114 assertFalse(rule.isApplicable(task1, iteration)); … … 133 121 @Test 134 122 public void test_isApplicable_06() { 135 ITaskFactory taskFactory = new TaskFactory(); 136 137 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 138 139 IEventType eventType1 = new StringEventType("eventType1"); 140 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 141 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 142 143 ITask optional = taskFactory.createNewOptional(); 123 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 124 125 IEventType eventType1 = new StringEventType("eventType1"); 126 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 127 ITask task1 = createNewEventTask(eventType1, eventTarget1); 128 129 ITask optional = createNewOptional(); 144 130 145 131 assertFalse(rule.isApplicable(task1, optional)); … … 151 137 */ 152 138 @Test 139 public void test_isApplicable_07() { 140 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 141 142 IEventType eventType1 = new StringEventType("eventType1"); 143 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 144 ITask task1 = createNewEventTask(eventType1, eventTarget1); 145 146 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 147 task1.getInstances().iterator().next())); 148 } 149 150 /** 151 * 152 */ 153 @Test 154 public void test_isApplicable_08() { 155 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 156 157 IEventType eventType1 = new StringEventType("eventType1"); 158 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 159 ITask task1 = createNewEventTask(eventType1, eventTarget1); 160 161 IEventType eventType2 = new StringEventType("eventType2"); 162 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 163 ITask task2 = createNewEventTask(eventType2, eventTarget2); 164 165 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 166 task2.getInstances().iterator().next())); 167 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 168 task1.getInstances().iterator().next())); 169 } 170 171 /** 172 * 173 */ 174 @Test 175 public void test_isApplicable_09() { 176 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 177 178 IEventType eventType1 = new StringEventType("eventType1"); 179 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 180 ITask task1 = createNewEventTask(eventType1, eventTarget1); 181 182 ITask selection = createNewSelection(); 183 184 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 185 selection.getInstances().iterator().next())); 186 assertFalse(rule.isApplicable(selection.getInstances().iterator().next(), 187 task1.getInstances().iterator().next())); 188 } 189 190 /** 191 * 192 */ 193 @Test 194 public void test_isApplicable_10() { 195 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 196 197 IEventType eventType1 = new StringEventType("eventType1"); 198 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 199 ITask task1 = createNewEventTask(eventType1, eventTarget1); 200 201 ITask sequence = createNewSequence(); 202 203 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 204 sequence.getInstances().iterator().next())); 205 assertFalse(rule.isApplicable(sequence.getInstances().iterator().next(), 206 task1.getInstances().iterator().next())); 207 } 208 209 /** 210 * 211 */ 212 @Test 213 public void test_isApplicable_11() { 214 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 215 216 IEventType eventType1 = new StringEventType("eventType1"); 217 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 218 ITask task1 = createNewEventTask(eventType1, eventTarget1); 219 220 ITask iteration = createNewIteration(); 221 222 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 223 iteration.getInstances().iterator().next())); 224 assertFalse(rule.isApplicable(iteration.getInstances().iterator().next(), 225 task1.getInstances().iterator().next())); 226 } 227 228 /** 229 * 230 */ 231 @Test 232 public void test_isApplicable_12() { 233 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 234 235 IEventType eventType1 = new StringEventType("eventType1"); 236 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 237 ITask task1 = createNewEventTask(eventType1, eventTarget1); 238 239 ITask optional = createNewOptional(); 240 241 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 242 optional.getInstances().iterator().next())); 243 assertFalse(rule.isApplicable(optional.getInstances().iterator().next(), 244 task1.getInstances().iterator().next())); 245 } 246 247 /** 248 * 249 */ 250 @Test 153 251 public void test_compare_01() { 154 ITaskFactory taskFactory = new TaskFactory(); 155 156 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 157 158 IEventType eventType1 = new StringEventType("eventType1"); 159 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 160 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 252 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 253 254 IEventType eventType1 = new StringEventType("eventType1"); 255 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 256 ITask task1 = createNewEventTask(eventType1, eventTarget1); 161 257 162 258 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, task1)); … … 171 267 @Test 172 268 public void test_compare_02() { 173 ITaskFactory taskFactory = new TaskFactory(); 174 175 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 176 177 IEventType eventType1 = new StringEventType("eventType1"); 178 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 179 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 180 181 ITask task2 = taskFactory.createNewEventTask(eventType1, eventTarget1); 269 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 270 271 IEventType eventType1 = new StringEventType("eventType1"); 272 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 273 ITask task1 = createNewEventTask(eventType1, eventTarget1); 274 275 ITask task2 = createNewEventTask(eventType1, eventTarget1); 182 276 183 277 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, task2)); … … 197 291 @Test 198 292 public void test_compare_03() { 199 ITaskFactory taskFactory = new TaskFactory(); 200 201 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 202 203 IEventType eventType1 = new StringEventType("eventType1"); 204 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 205 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 293 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 294 295 IEventType eventType1 = new StringEventType("eventType1"); 296 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 297 ITask task1 = createNewEventTask(eventType1, eventTarget1); 206 298 207 299 IEventType eventType2 = new StringEventType("eventType2"); 208 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);300 ITask task2 = createNewEventTask(eventType2, eventTarget1); 209 301 210 302 assertEquals(TaskEquality.UNEQUAL, rule.compare(task1, task2)); … … 224 316 @Test 225 317 public void test_compare_04() { 226 ITaskFactory taskFactory = new TaskFactory(); 227 228 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 229 230 IEventType eventType1 = new StringEventType("eventType1"); 231 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 232 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 318 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 319 320 IEventType eventType1 = new StringEventType("eventType1"); 321 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 322 ITask task1 = createNewEventTask(eventType1, eventTarget1); 233 323 234 324 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 235 ITask task2 = taskFactory.createNewEventTask(eventType1, eventTarget2);325 ITask task2 = createNewEventTask(eventType1, eventTarget2); 236 326 237 327 assertEquals(TaskEquality.UNEQUAL, rule.compare(task1, task2)); … … 252 342 @Test 253 343 public void test_compare_05() { 254 ITaskFactory taskFactory = new TaskFactory(); 255 256 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 257 258 IEventType eventType1 = new StringEventType("eventType1"); 259 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 260 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 344 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 345 346 IEventType eventType1 = new StringEventType("eventType1"); 347 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 348 ITask task1 = createNewEventTask(eventType1, eventTarget1); 261 349 262 350 IEventType eventType2 = new StringEventType("eventType2"); 263 351 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 264 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);352 ITask task2 = createNewEventTask(eventType2, eventTarget2); 265 353 266 354 assertEquals(TaskEquality.UNEQUAL, rule.compare(task1, task2)); … … 275 363 } 276 364 365 366 /** 367 * 368 */ 369 @Test 370 public void test_compare_06() { 371 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 372 373 IEventType eventType1 = new StringEventType("eventType1"); 374 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 375 ITask task1 = createNewEventTask(eventType1, eventTarget1); 376 377 assertEquals(TaskEquality.LEXICALLY_EQUAL, 378 rule.compare(task1.getInstances().iterator().next(), 379 task1.getInstances().iterator().next())); 380 assertTrue(rule.areLexicallyEqual(task1.getInstances().iterator().next(), 381 task1.getInstances().iterator().next())); 382 assertTrue(rule.areSyntacticallyEqual(task1.getInstances().iterator().next(), 383 task1.getInstances().iterator().next())); 384 assertTrue(rule.areSemanticallyEqual(task1.getInstances().iterator().next(), 385 task1.getInstances().iterator().next())); 386 } 387 388 /** 389 * 390 */ 391 @Test 392 public void test_compare_07() { 393 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 394 395 IEventType eventType1 = new StringEventType("eventType1"); 396 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 397 ITask task1 = createNewEventTask(eventType1, eventTarget1); 398 399 ITask task2 = createNewEventTask(eventType1, eventTarget1); 400 401 assertEquals(TaskEquality.LEXICALLY_EQUAL, 402 rule.compare(task1.getInstances().iterator().next(), 403 task2.getInstances().iterator().next())); 404 assertTrue(rule.areLexicallyEqual(task1.getInstances().iterator().next(), 405 task2.getInstances().iterator().next())); 406 assertTrue(rule.areSyntacticallyEqual(task1.getInstances().iterator().next(), 407 task2.getInstances().iterator().next())); 408 assertTrue(rule.areSemanticallyEqual(task1.getInstances().iterator().next(), 409 task2.getInstances().iterator().next())); 410 411 assertEquals(TaskEquality.LEXICALLY_EQUAL, 412 rule.compare(task2.getInstances().iterator().next(), 413 task1.getInstances().iterator().next())); 414 assertTrue(rule.areLexicallyEqual(task2.getInstances().iterator().next(), 415 task1.getInstances().iterator().next())); 416 assertTrue(rule.areSyntacticallyEqual(task2.getInstances().iterator().next(), 417 task1.getInstances().iterator().next())); 418 assertTrue(rule.areSemanticallyEqual(task2.getInstances().iterator().next(), 419 task1.getInstances().iterator().next())); 420 } 421 422 /** 423 * 424 */ 425 @Test 426 public void test_compare_08() { 427 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 428 429 IEventType eventType1 = new StringEventType("eventType1"); 430 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 431 ITask task1 = createNewEventTask(eventType1, eventTarget1); 432 433 IEventType eventType2 = new StringEventType("eventType2"); 434 ITask task2 = createNewEventTask(eventType2, eventTarget1); 435 436 assertEquals(TaskEquality.UNEQUAL, 437 rule.compare(task1.getInstances().iterator().next(), 438 task2.getInstances().iterator().next())); 439 assertFalse(rule.areLexicallyEqual(task1.getInstances().iterator().next(), 440 task2.getInstances().iterator().next())); 441 assertFalse(rule.areSyntacticallyEqual(task1.getInstances().iterator().next(), 442 task2.getInstances().iterator().next())); 443 assertFalse(rule.areSemanticallyEqual(task1.getInstances().iterator().next(), 444 task2.getInstances().iterator().next())); 445 446 assertEquals(TaskEquality.UNEQUAL, 447 rule.compare(task2.getInstances().iterator().next(), 448 task1.getInstances().iterator().next())); 449 assertFalse(rule.areLexicallyEqual(task2.getInstances().iterator().next(), 450 task1.getInstances().iterator().next())); 451 assertFalse(rule.areSyntacticallyEqual(task2.getInstances().iterator().next(), 452 task1.getInstances().iterator().next())); 453 assertFalse(rule.areSemanticallyEqual(task2.getInstances().iterator().next(), 454 task1.getInstances().iterator().next())); 455 } 456 457 /** 458 * 459 */ 460 @Test 461 public void test_compare_09() { 462 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 463 464 IEventType eventType1 = new StringEventType("eventType1"); 465 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 466 ITask task1 = createNewEventTask(eventType1, eventTarget1); 467 468 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 469 ITask task2 = createNewEventTask(eventType1, eventTarget2); 470 471 assertEquals(TaskEquality.UNEQUAL, 472 rule.compare(task1.getInstances().iterator().next(), 473 task2.getInstances().iterator().next())); 474 assertFalse(rule.areLexicallyEqual(task1.getInstances().iterator().next(), 475 task2.getInstances().iterator().next())); 476 assertFalse(rule.areSyntacticallyEqual(task1.getInstances().iterator().next(), 477 task2.getInstances().iterator().next())); 478 assertFalse(rule.areSemanticallyEqual(task1.getInstances().iterator().next(), 479 task2.getInstances().iterator().next())); 480 481 assertEquals(TaskEquality.UNEQUAL, 482 rule.compare(task2.getInstances().iterator().next(), 483 task1.getInstances().iterator().next())); 484 assertFalse(rule.areLexicallyEqual(task2.getInstances().iterator().next(), 485 task1.getInstances().iterator().next())); 486 assertFalse(rule.areSyntacticallyEqual(task2.getInstances().iterator().next(), 487 task1.getInstances().iterator().next())); 488 assertFalse(rule.areSemanticallyEqual(task2.getInstances().iterator().next(), 489 task1.getInstances().iterator().next())); 490 } 491 492 493 /** 494 * 495 */ 496 @Test 497 public void test_compare_10() { 498 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 499 500 IEventType eventType1 = new StringEventType("eventType1"); 501 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 502 ITask task1 = createNewEventTask(eventType1, eventTarget1); 503 504 IEventType eventType2 = new StringEventType("eventType2"); 505 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 506 ITask task2 = createNewEventTask(eventType2, eventTarget2); 507 508 assertEquals(TaskEquality.UNEQUAL, 509 rule.compare(task1.getInstances().iterator().next(), 510 task2.getInstances().iterator().next())); 511 assertFalse(rule.areLexicallyEqual(task1.getInstances().iterator().next(), 512 task2.getInstances().iterator().next())); 513 assertFalse(rule.areSyntacticallyEqual(task1.getInstances().iterator().next(), 514 task2.getInstances().iterator().next())); 515 assertFalse(rule.areSemanticallyEqual(task1.getInstances().iterator().next(), 516 task2.getInstances().iterator().next())); 517 518 assertEquals(TaskEquality.UNEQUAL, 519 rule.compare(task2.getInstances().iterator().next(), 520 task1.getInstances().iterator().next())); 521 assertFalse(rule.areLexicallyEqual(task2.getInstances().iterator().next(), 522 task1.getInstances().iterator().next())); 523 assertFalse(rule.areSyntacticallyEqual(task2.getInstances().iterator().next(), 524 task1.getInstances().iterator().next())); 525 assertFalse(rule.areSemanticallyEqual(task2.getInstances().iterator().next(), 526 task1.getInstances().iterator().next())); 527 } 528 277 529 } -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/GUIEventTaskComparisonRuleTest.java
r1146 r1294 42 42 import de.ugoe.cs.autoquest.keyboardmaps.VirtualKey; 43 43 import de.ugoe.cs.autoquest.tasktrees.taskequality.EventTaskComparisonRule; 44 import de.ugoe.cs.autoquest.tasktrees.taskequality.GUIEventTaskComparisonRule;45 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;46 44 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 47 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;48 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;49 45 import de.ugoe.cs.autoquest.test.DummyGUIElement; 50 46 … … 52 48 * @author Patrick Harms 53 49 */ 54 public class GUIEventTaskComparisonRuleTest {50 public class GUIEventTaskComparisonRuleTest extends AbstractComparisonRuleTest { 55 51 56 52 /** … … 59 55 @Test 60 56 public void test_isApplicable_01() { 61 ITaskFactory taskFactory = new TaskFactory(); 62 63 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 64 65 IEventType eventType1 = new StringEventType("eventType1"); 66 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 67 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 57 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 58 59 IEventType eventType1 = new StringEventType("eventType1"); 60 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 61 ITask task1 = createNewEventTask(eventType1, eventTarget1); 68 62 69 63 assertTrue(rule.isApplicable(task1, task1)); … … 75 69 @Test 76 70 public void test_isApplicable_02() { 77 ITaskFactory taskFactory = new TaskFactory(); 78 79 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 80 81 IEventType eventType1 = new StringEventType("eventType1"); 82 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 83 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 71 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 72 73 IEventType eventType1 = new StringEventType("eventType1"); 74 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 75 ITask task1 = createNewEventTask(eventType1, eventTarget1); 84 76 85 77 IEventType eventType2 = new StringEventType("eventType2"); 86 78 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 87 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);79 ITask task2 = createNewEventTask(eventType2, eventTarget2); 88 80 89 81 assertTrue(rule.isApplicable(task1, task2)); … … 96 88 @Test 97 89 public void test_isApplicable_03() { 98 ITaskFactory taskFactory = new TaskFactory();99 100 90 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 101 91 102 92 IEventType eventType1 = new KeyboardFocusChange(); 103 93 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 104 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);94 ITask task1 = createNewEventTask(eventType1, eventTarget1); 105 95 106 96 IEventType eventType2 = new KeyboardFocusChange(); 107 97 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 108 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);98 ITask task2 = createNewEventTask(eventType2, eventTarget2); 109 99 110 100 assertTrue(rule.isApplicable(task1, task2)); … … 117 107 @Test 118 108 public void test_isApplicable_04() { 119 ITaskFactory taskFactory = new TaskFactory();120 121 109 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 122 110 123 111 IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 124 112 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 125 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);113 ITask task1 = createNewEventTask(eventType1, eventTarget1); 126 114 127 115 IEventType eventType2 = new KeyReleased(VirtualKey.LETTER_B); 128 116 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 129 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);117 ITask task2 = createNewEventTask(eventType2, eventTarget2); 130 118 131 119 assertTrue(rule.isApplicable(task1, task2)); … … 138 126 @Test 139 127 public void test_isApplicable_05() { 140 ITaskFactory taskFactory = new TaskFactory();141 142 128 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 143 129 144 130 IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_C); 145 131 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 146 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);132 ITask task1 = createNewEventTask(eventType1, eventTarget1); 147 133 148 134 IEventType eventType2 = new KeyTyped(VirtualKey.LETTER_D); 149 135 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 150 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);136 ITask task2 = createNewEventTask(eventType2, eventTarget2); 151 137 152 138 assertTrue(rule.isApplicable(task1, task2)); … … 159 145 @Test 160 146 public void test_isApplicable_06() { 161 ITaskFactory taskFactory = new TaskFactory();162 163 147 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 164 148 165 149 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 5, 6); 166 150 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 167 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);151 ITask task1 = createNewEventTask(eventType1, eventTarget1); 168 152 169 153 IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.MIDDLE, 3, 1); 170 154 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 171 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);155 ITask task2 = createNewEventTask(eventType2, eventTarget2); 172 156 173 157 assertTrue(rule.isApplicable(task1, task2)); … … 180 164 @Test 181 165 public void test_isApplicable_07() { 182 ITaskFactory taskFactory = new TaskFactory();183 184 166 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 185 167 186 168 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.RIGHT, 4, 7); 187 169 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 188 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);170 ITask task1 = createNewEventTask(eventType1, eventTarget1); 189 171 190 172 IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.X, 9, 12); 191 173 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 192 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);174 ITask task2 = createNewEventTask(eventType2, eventTarget2); 193 175 194 176 assertTrue(rule.isApplicable(task1, task2)); … … 201 183 @Test 202 184 public void test_isApplicable_08() { 203 ITaskFactory taskFactory = new TaskFactory();204 205 185 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 206 186 207 187 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 208 188 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 209 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);189 ITask task1 = createNewEventTask(eventType1, eventTarget1); 210 190 211 191 IEventType eventType2 = new MouseDragAndDrop(5, 6, 7, 8); 212 192 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 213 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);193 ITask task2 = createNewEventTask(eventType2, eventTarget2); 214 194 215 195 assertTrue(rule.isApplicable(task1, task2)); … … 222 202 @Test 223 203 public void test_isApplicable_09() { 224 ITaskFactory taskFactory = new TaskFactory();225 226 204 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 227 205 228 206 IEventType eventType1 = new Scroll(1, 2); 229 207 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 230 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);208 ITask task1 = createNewEventTask(eventType1, eventTarget1); 231 209 232 210 IEventType eventType2 = new Scroll(3, 4); 233 211 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 234 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);212 ITask task2 = createNewEventTask(eventType2, eventTarget2); 235 213 236 214 assertTrue(rule.isApplicable(task1, task2)); … … 243 221 @Test 244 222 public void test_isApplicable_10() { 245 ITaskFactory taskFactory = new TaskFactory();246 247 223 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 248 224 … … 250 226 IEventType eventType1 = new TextInput("text1", inputEvents); 251 227 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 252 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);228 ITask task1 = createNewEventTask(eventType1, eventTarget1); 253 229 254 230 IEventType eventType2 = new TextInput("text2", inputEvents); 255 231 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 256 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);232 ITask task2 = createNewEventTask(eventType2, eventTarget2); 257 233 258 234 assertTrue(rule.isApplicable(task1, task2)); … … 265 241 @Test 266 242 public void test_isApplicable_11() { 267 ITaskFactory taskFactory = new TaskFactory();268 269 243 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 270 244 271 245 IEventType eventType1 = new TextSelection(); 272 246 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 273 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);247 ITask task1 = createNewEventTask(eventType1, eventTarget1); 274 248 275 249 IEventType eventType2 = new ValueSelection<String>("value"); 276 250 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 277 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);251 ITask task2 = createNewEventTask(eventType2, eventTarget2); 278 252 279 253 assertTrue(rule.isApplicable(task1, task2)); … … 286 260 @Test 287 261 public void test_isApplicable_12() { 288 ITaskFactory taskFactory = new TaskFactory(); 289 290 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 291 292 IEventType eventType1 = new StringEventType("eventType1"); 293 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 294 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 295 296 ITask selection = taskFactory.createNewSelection(); 262 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 263 264 IEventType eventType1 = new StringEventType("eventType1"); 265 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 266 ITask task1 = createNewEventTask(eventType1, eventTarget1); 267 268 ITask selection = createNewSelection(); 297 269 298 270 assertFalse(rule.isApplicable(task1, selection)); … … 305 277 @Test 306 278 public void test_isApplicable_13() { 307 ITaskFactory taskFactory = new TaskFactory(); 308 309 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 310 311 IEventType eventType1 = new StringEventType("eventType1"); 312 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 313 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 314 315 ITask sequence = taskFactory.createNewSequence(); 279 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 280 281 IEventType eventType1 = new StringEventType("eventType1"); 282 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 283 ITask task1 = createNewEventTask(eventType1, eventTarget1); 284 285 ITask sequence = createNewSequence(); 316 286 317 287 assertFalse(rule.isApplicable(task1, sequence)); … … 324 294 @Test 325 295 public void test_isApplicable_14() { 326 ITaskFactory taskFactory = new TaskFactory(); 327 328 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 329 330 IEventType eventType1 = new StringEventType("eventType1"); 331 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 332 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 333 334 ITask iteration = taskFactory.createNewIteration(); 296 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 297 298 IEventType eventType1 = new StringEventType("eventType1"); 299 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 300 ITask task1 = createNewEventTask(eventType1, eventTarget1); 301 302 ITask iteration = createNewIteration(); 335 303 336 304 assertFalse(rule.isApplicable(task1, iteration)); … … 343 311 @Test 344 312 public void test_isApplicable_15() { 345 ITaskFactory taskFactory = new TaskFactory(); 346 347 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 348 349 IEventType eventType1 = new StringEventType("eventType1"); 350 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 351 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 352 353 ITask optional = taskFactory.createNewOptional(); 313 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 314 315 IEventType eventType1 = new StringEventType("eventType1"); 316 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 317 ITask task1 = createNewEventTask(eventType1, eventTarget1); 318 319 ITask optional = createNewOptional(); 354 320 355 321 assertFalse(rule.isApplicable(task1, optional)); … … 357 323 } 358 324 325 326 /** 327 * 328 */ 329 @Test 330 public void test_isApplicable_16() { 331 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 332 333 IEventType eventType1 = new StringEventType("eventType1"); 334 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 335 ITask task1 = createNewEventTask(eventType1, eventTarget1); 336 337 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 338 task1.getInstances().iterator().next())); 339 } 340 341 /** 342 * 343 */ 344 @Test 345 public void test_isApplicable_17() { 346 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 347 348 IEventType eventType1 = new StringEventType("eventType1"); 349 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 350 ITask task1 = createNewEventTask(eventType1, eventTarget1); 351 352 IEventType eventType2 = new StringEventType("eventType2"); 353 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 354 ITask task2 = createNewEventTask(eventType2, eventTarget2); 355 356 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 357 task2.getInstances().iterator().next())); 358 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 359 task1.getInstances().iterator().next())); 360 } 361 362 /** 363 * 364 */ 365 @Test 366 public void test_isApplicable_18() { 367 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 368 369 IEventType eventType1 = new KeyboardFocusChange(); 370 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 371 ITask task1 = createNewEventTask(eventType1, eventTarget1); 372 373 IEventType eventType2 = new KeyboardFocusChange(); 374 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 375 ITask task2 = createNewEventTask(eventType2, eventTarget2); 376 377 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 378 task2.getInstances().iterator().next())); 379 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 380 task1.getInstances().iterator().next())); 381 } 382 383 /** 384 * 385 */ 386 @Test 387 public void test_isApplicable_19() { 388 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 389 390 IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 391 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 392 ITask task1 = createNewEventTask(eventType1, eventTarget1); 393 394 IEventType eventType2 = new KeyReleased(VirtualKey.LETTER_B); 395 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 396 ITask task2 = createNewEventTask(eventType2, eventTarget2); 397 398 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 399 task2.getInstances().iterator().next())); 400 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 401 task1.getInstances().iterator().next())); 402 } 403 404 /** 405 * 406 */ 407 @Test 408 public void test_isApplicable_20() { 409 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 410 411 IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_C); 412 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 413 ITask task1 = createNewEventTask(eventType1, eventTarget1); 414 415 IEventType eventType2 = new KeyTyped(VirtualKey.LETTER_D); 416 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 417 ITask task2 = createNewEventTask(eventType2, eventTarget2); 418 419 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 420 task2.getInstances().iterator().next())); 421 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 422 task1.getInstances().iterator().next())); 423 } 424 425 /** 426 * 427 */ 428 @Test 429 public void test_isApplicable_21() { 430 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 431 432 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 5, 6); 433 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 434 ITask task1 = createNewEventTask(eventType1, eventTarget1); 435 436 IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.MIDDLE, 3, 1); 437 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 438 ITask task2 = createNewEventTask(eventType2, eventTarget2); 439 440 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 441 task2.getInstances().iterator().next())); 442 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 443 task1.getInstances().iterator().next())); 444 } 445 446 /** 447 * 448 */ 449 @Test 450 public void test_isApplicable_22() { 451 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 452 453 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.RIGHT, 4, 7); 454 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 455 ITask task1 = createNewEventTask(eventType1, eventTarget1); 456 457 IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.X, 9, 12); 458 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 459 ITask task2 = createNewEventTask(eventType2, eventTarget2); 460 461 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 462 task2.getInstances().iterator().next())); 463 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 464 task1.getInstances().iterator().next())); 465 } 466 467 /** 468 * 469 */ 470 @Test 471 public void test_isApplicable_23() { 472 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 473 474 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 475 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 476 ITask task1 = createNewEventTask(eventType1, eventTarget1); 477 478 IEventType eventType2 = new MouseDragAndDrop(5, 6, 7, 8); 479 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 480 ITask task2 = createNewEventTask(eventType2, eventTarget2); 481 482 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 483 task2.getInstances().iterator().next())); 484 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 485 task1.getInstances().iterator().next())); 486 } 487 488 /** 489 * 490 */ 491 @Test 492 public void test_isApplicable_24() { 493 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 494 495 IEventType eventType1 = new Scroll(1, 2); 496 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 497 ITask task1 = createNewEventTask(eventType1, eventTarget1); 498 499 IEventType eventType2 = new Scroll(3, 4); 500 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 501 ITask task2 = createNewEventTask(eventType2, eventTarget2); 502 503 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 504 task2.getInstances().iterator().next())); 505 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 506 task1.getInstances().iterator().next())); 507 } 508 509 /** 510 * 511 */ 512 @Test 513 public void test_isApplicable_25() { 514 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 515 516 List<Event> inputEvents = new ArrayList<Event>(); 517 IEventType eventType1 = new TextInput("text1", inputEvents); 518 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 519 ITask task1 = createNewEventTask(eventType1, eventTarget1); 520 521 IEventType eventType2 = new TextInput("text2", inputEvents); 522 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 523 ITask task2 = createNewEventTask(eventType2, eventTarget2); 524 525 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), task2.getInstances().iterator().next())); 526 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), task1.getInstances().iterator().next())); 527 } 528 529 /** 530 * 531 */ 532 @Test 533 public void test_isApplicable_26() { 534 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 535 536 IEventType eventType1 = new TextSelection(); 537 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 538 ITask task1 = createNewEventTask(eventType1, eventTarget1); 539 540 IEventType eventType2 = new ValueSelection<String>("value"); 541 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 542 ITask task2 = createNewEventTask(eventType2, eventTarget2); 543 544 assertTrue(rule.isApplicable(task1.getInstances().iterator().next(), 545 task2.getInstances().iterator().next())); 546 assertTrue(rule.isApplicable(task2.getInstances().iterator().next(), 547 task1.getInstances().iterator().next())); 548 } 549 550 /** 551 * 552 */ 553 @Test 554 public void test_isApplicable_27() { 555 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 556 557 IEventType eventType1 = new StringEventType("eventType1"); 558 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 559 ITask task1 = createNewEventTask(eventType1, eventTarget1); 560 561 ITask selection = createNewSelection(); 562 563 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 564 selection.getInstances().iterator().next())); 565 assertFalse(rule.isApplicable(selection.getInstances().iterator().next(), 566 task1.getInstances().iterator().next())); 567 } 568 569 /** 570 * 571 */ 572 @Test 573 public void test_isApplicable_28() { 574 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 575 576 IEventType eventType1 = new StringEventType("eventType1"); 577 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 578 ITask task1 = createNewEventTask(eventType1, eventTarget1); 579 580 ITask sequence = createNewSequence(); 581 582 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 583 sequence.getInstances().iterator().next())); 584 assertFalse(rule.isApplicable(sequence.getInstances().iterator().next(), 585 task1.getInstances().iterator().next())); 586 } 587 588 /** 589 * 590 */ 591 @Test 592 public void test_isApplicable_29() { 593 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 594 595 IEventType eventType1 = new StringEventType("eventType1"); 596 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 597 ITask task1 = createNewEventTask(eventType1, eventTarget1); 598 599 ITask iteration = createNewIteration(); 600 601 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 602 iteration.getInstances().iterator().next())); 603 assertFalse(rule.isApplicable(iteration.getInstances().iterator().next(), 604 task1.getInstances().iterator().next())); 605 } 606 607 /** 608 * 609 */ 610 @Test 611 public void test_isApplicable_30() { 612 EventTaskComparisonRule rule = new EventTaskComparisonRule(); 613 614 IEventType eventType1 = new StringEventType("eventType1"); 615 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 616 ITask task1 = createNewEventTask(eventType1, eventTarget1); 617 618 ITask optional = createNewOptional(); 619 620 assertFalse(rule.isApplicable(task1.getInstances().iterator().next(), 621 optional.getInstances().iterator().next())); 622 assertFalse(rule.isApplicable(optional.getInstances().iterator().next(), 623 task1.getInstances().iterator().next())); 624 } 625 359 626 /** 360 627 * … … 362 629 @Test 363 630 public void test_compare_KeyboardFocusChange_01() { 364 ITaskFactory taskFactory = new TaskFactory();365 366 631 IEventType eventType1 = new KeyboardFocusChange(); 367 632 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 368 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);369 370 assertLexicallyEqual( task1, task1);633 ITask task1 = createNewEventTask(eventType1, eventTarget1); 634 635 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 371 636 } 372 637 … … 376 641 @Test 377 642 public void test_compare_KeyboardFocusChange_02() { 378 ITaskFactory taskFactory = new TaskFactory();379 380 643 IEventType eventType1 = new KeyboardFocusChange(); 381 644 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 382 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);645 ITask task1 = createNewEventTask(eventType1, eventTarget1); 383 646 384 647 IEventType eventType2 = new KeyboardFocusChange(); 385 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);386 387 assertLexicallyEqual( task1, task2);648 ITask task2 = createNewEventTask(eventType2, eventTarget1); 649 650 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 388 651 } 389 652 … … 393 656 @Test 394 657 public void test_compare_KeyboardFocusChange_03() { 395 ITaskFactory taskFactory = new TaskFactory();396 397 658 IEventType eventType1 = new KeyboardFocusChange(); 398 659 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 399 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);660 ITask task1 = createNewEventTask(eventType1, eventTarget1); 400 661 401 662 IEventType eventType2 = new KeyboardFocusChange(); 402 663 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 403 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);404 405 assertUnequal( task1, task2);664 ITask task2 = createNewEventTask(eventType2, eventTarget2); 665 666 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 406 667 } 407 668 … … 411 672 @Test 412 673 public void test_compare_KeyPressed_01() { 413 ITaskFactory taskFactory = new TaskFactory();414 415 674 IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 416 675 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 417 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);418 419 assertLexicallyEqual( task1, task1);676 ITask task1 = createNewEventTask(eventType1, eventTarget1); 677 678 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 420 679 } 421 680 … … 425 684 @Test 426 685 public void test_compare_KeyPressed_02() { 427 ITaskFactory taskFactory = new TaskFactory();428 429 686 IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 430 687 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 431 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);688 ITask task1 = createNewEventTask(eventType1, eventTarget1); 432 689 433 690 IEventType eventType2 = new KeyPressed(VirtualKey.LETTER_A); 434 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);435 436 assertLexicallyEqual( task1, task2);691 ITask task2 = createNewEventTask(eventType2, eventTarget1); 692 693 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 437 694 } 438 695 … … 442 699 @Test 443 700 public void test_compare_KeyPressed_03() { 444 ITaskFactory taskFactory = new TaskFactory();445 446 701 IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 447 702 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 448 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);703 ITask task1 = createNewEventTask(eventType1, eventTarget1); 449 704 450 705 IEventType eventType2 = new KeyPressed(VirtualKey.LETTER_B); 451 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);452 453 assertSemanticallyEqual( task1, task2);706 ITask task2 = createNewEventTask(eventType2, eventTarget1); 707 708 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 454 709 } 455 710 … … 459 714 @Test 460 715 public void test_compare_KeyPressed_04() { 461 ITaskFactory taskFactory = new TaskFactory();462 463 716 IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 464 717 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 465 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);718 ITask task1 = createNewEventTask(eventType1, eventTarget1); 466 719 467 720 IEventType eventType2 = new KeyPressed(VirtualKey.LETTER_A); 468 721 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 469 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);470 471 assertUnequal( task1, task2);722 ITask task2 = createNewEventTask(eventType2, eventTarget2); 723 724 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 472 725 } 473 726 … … 477 730 @Test 478 731 public void test_compare_KeyReleased_01() { 479 ITaskFactory taskFactory = new TaskFactory();480 481 732 IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 482 733 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 483 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);484 485 assertLexicallyEqual( task1, task1);734 ITask task1 = createNewEventTask(eventType1, eventTarget1); 735 736 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 486 737 } 487 738 … … 491 742 @Test 492 743 public void test_compare_KeyReleased_02() { 493 ITaskFactory taskFactory = new TaskFactory();494 495 744 IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 496 745 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 497 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);746 ITask task1 = createNewEventTask(eventType1, eventTarget1); 498 747 499 748 IEventType eventType2 = new KeyReleased(VirtualKey.LETTER_A); 500 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);501 502 assertLexicallyEqual( task1, task2);749 ITask task2 = createNewEventTask(eventType2, eventTarget1); 750 751 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 503 752 } 504 753 … … 508 757 @Test 509 758 public void test_compare_KeyReleased_03() { 510 ITaskFactory taskFactory = new TaskFactory();511 512 759 IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 513 760 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 514 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);761 ITask task1 = createNewEventTask(eventType1, eventTarget1); 515 762 516 763 IEventType eventType2 = new KeyReleased(VirtualKey.LETTER_B); 517 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);518 519 assertSemanticallyEqual( task1, task2);764 ITask task2 = createNewEventTask(eventType2, eventTarget1); 765 766 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 520 767 } 521 768 … … 525 772 @Test 526 773 public void test_compare_KeyReleased_04() { 527 ITaskFactory taskFactory = new TaskFactory();528 529 774 IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 530 775 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 531 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);776 ITask task1 = createNewEventTask(eventType1, eventTarget1); 532 777 533 778 IEventType eventType2 = new KeyReleased(VirtualKey.LETTER_A); 534 779 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 535 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);536 537 assertUnequal( task1, task2);780 ITask task2 = createNewEventTask(eventType2, eventTarget2); 781 782 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 538 783 } 539 784 … … 543 788 @Test 544 789 public void test_compare_KeyTyped_01() { 545 ITaskFactory taskFactory = new TaskFactory();546 547 790 IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 548 791 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 549 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);550 551 assertLexicallyEqual( task1, task1);792 ITask task1 = createNewEventTask(eventType1, eventTarget1); 793 794 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 552 795 } 553 796 … … 557 800 @Test 558 801 public void test_compare_KeyTyped_02() { 559 ITaskFactory taskFactory = new TaskFactory();560 561 802 IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 562 803 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 563 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);804 ITask task1 = createNewEventTask(eventType1, eventTarget1); 564 805 565 806 IEventType eventType2 = new KeyTyped(VirtualKey.LETTER_A); 566 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);567 568 assertLexicallyEqual( task1, task2);807 ITask task2 = createNewEventTask(eventType2, eventTarget1); 808 809 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 569 810 } 570 811 … … 574 815 @Test 575 816 public void test_compare_KeyTyped_03() { 576 ITaskFactory taskFactory = new TaskFactory();577 578 817 IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 579 818 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 580 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);819 ITask task1 = createNewEventTask(eventType1, eventTarget1); 581 820 582 821 IEventType eventType2 = new KeyTyped(VirtualKey.LETTER_B); 583 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);584 585 assertSemanticallyEqual( task1, task2);822 ITask task2 = createNewEventTask(eventType2, eventTarget1); 823 824 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 586 825 } 587 826 … … 591 830 @Test 592 831 public void test_compare_KeyTyped_04() { 593 ITaskFactory taskFactory = new TaskFactory();594 595 832 IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 596 833 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 597 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);834 ITask task1 = createNewEventTask(eventType1, eventTarget1); 598 835 599 836 IEventType eventType2 = new KeyTyped(VirtualKey.LETTER_A); 600 837 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 601 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);602 603 assertUnequal( task1, task2);838 ITask task2 = createNewEventTask(eventType2, eventTarget2); 839 840 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 604 841 } 605 842 … … 609 846 @Test 610 847 public void test_compare_MouseButtonDown_01() { 611 ITaskFactory taskFactory = new TaskFactory();612 613 848 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 614 849 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 615 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);616 617 assertLexicallyEqual( task1, task1);850 ITask task1 = createNewEventTask(eventType1, eventTarget1); 851 852 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 618 853 } 619 854 … … 623 858 @Test 624 859 public void test_compare_MouseButtonDown_02() { 625 ITaskFactory taskFactory = new TaskFactory();626 627 860 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 628 861 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 629 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);862 ITask task1 = createNewEventTask(eventType1, eventTarget1); 630 863 631 864 IEventType eventType2 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 632 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);633 634 assertLexicallyEqual( task1, task2);865 ITask task2 = createNewEventTask(eventType2, eventTarget1); 866 867 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 635 868 } 636 869 … … 640 873 @Test 641 874 public void test_compare_MouseButtonDown_03() { 642 ITaskFactory taskFactory = new TaskFactory();643 644 875 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 645 876 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 646 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);877 ITask task1 = createNewEventTask(eventType1, eventTarget1); 647 878 648 879 IEventType eventType2 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 3); 649 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);650 651 assertSemanticallyEqual( task1, task2);880 ITask task2 = createNewEventTask(eventType2, eventTarget1); 881 882 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 652 883 } 653 884 … … 657 888 @Test 658 889 public void test_compare_MouseButtonDown_04() { 659 ITaskFactory taskFactory = new TaskFactory();660 661 890 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 662 891 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 663 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);892 ITask task1 = createNewEventTask(eventType1, eventTarget1); 664 893 665 894 IEventType eventType2 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 3, 2); 666 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);667 668 assertSemanticallyEqual( task1, task2);895 ITask task2 = createNewEventTask(eventType2, eventTarget1); 896 897 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 669 898 } 670 899 … … 674 903 @Test 675 904 public void test_compare_MouseButtonDown_05() { 676 ITaskFactory taskFactory = new TaskFactory();677 678 905 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 679 906 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 680 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);907 ITask task1 = createNewEventTask(eventType1, eventTarget1); 681 908 682 909 IEventType eventType2 = new MouseButtonDown(MouseButtonInteraction.Button.RIGHT, 1, 2); 683 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);684 685 assertUnequal( task1, task2);910 ITask task2 = createNewEventTask(eventType2, eventTarget1); 911 912 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 686 913 } 687 914 … … 691 918 @Test 692 919 public void test_compare_MouseButtonDown_06() { 693 ITaskFactory taskFactory = new TaskFactory();694 695 920 IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 696 921 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 697 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);922 ITask task1 = createNewEventTask(eventType1, eventTarget1); 698 923 699 924 IEventType eventType2 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 700 925 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 701 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);702 703 assertUnequal( task1, task2);926 ITask task2 = createNewEventTask(eventType2, eventTarget2); 927 928 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 704 929 } 705 930 … … 709 934 @Test 710 935 public void test_compare_MouseButtonUp_01() { 711 ITaskFactory taskFactory = new TaskFactory();712 713 936 IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 714 937 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 715 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);716 717 assertLexicallyEqual( task1, task1);938 ITask task1 = createNewEventTask(eventType1, eventTarget1); 939 940 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 718 941 } 719 942 … … 723 946 @Test 724 947 public void test_compare_MouseButtonUp_02() { 725 ITaskFactory taskFactory = new TaskFactory();726 727 948 IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 728 949 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 729 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);950 ITask task1 = createNewEventTask(eventType1, eventTarget1); 730 951 731 952 IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 732 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);733 734 assertLexicallyEqual( task1, task2);953 ITask task2 = createNewEventTask(eventType2, eventTarget1); 954 955 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 735 956 } 736 957 … … 740 961 @Test 741 962 public void test_compare_MouseButtonUp_03() { 742 ITaskFactory taskFactory = new TaskFactory();743 744 963 IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 745 964 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 746 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);965 ITask task1 = createNewEventTask(eventType1, eventTarget1); 747 966 748 967 IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 3); 749 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);750 751 assertSemanticallyEqual( task1, task2);968 ITask task2 = createNewEventTask(eventType2, eventTarget1); 969 970 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 752 971 } 753 972 … … 757 976 @Test 758 977 public void test_compare_MouseButtonUp_04() { 759 ITaskFactory taskFactory = new TaskFactory();760 761 978 IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 762 979 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 763 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);980 ITask task1 = createNewEventTask(eventType1, eventTarget1); 764 981 765 982 IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 3, 2); 766 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);767 768 assertSemanticallyEqual( task1, task2);983 ITask task2 = createNewEventTask(eventType2, eventTarget1); 984 985 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 769 986 } 770 987 … … 774 991 @Test 775 992 public void test_compare_MouseButtonUp_05() { 776 ITaskFactory taskFactory = new TaskFactory();777 778 993 IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 779 994 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 780 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);995 ITask task1 = createNewEventTask(eventType1, eventTarget1); 781 996 782 997 IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.RIGHT, 1, 2); 783 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);784 785 assertUnequal( task1, task2);998 ITask task2 = createNewEventTask(eventType2, eventTarget1); 999 1000 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 786 1001 } 787 1002 … … 791 1006 @Test 792 1007 public void test_compare_MouseButtonUp_06() { 793 ITaskFactory taskFactory = new TaskFactory();794 795 1008 IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 796 1009 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 797 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1010 ITask task1 = createNewEventTask(eventType1, eventTarget1); 798 1011 799 1012 IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 800 1013 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 801 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);802 803 assertUnequal( task1, task2);1014 ITask task2 = createNewEventTask(eventType2, eventTarget2); 1015 1016 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 804 1017 } 805 1018 … … 809 1022 @Test 810 1023 public void test_compare_MouseClick_01() { 811 ITaskFactory taskFactory = new TaskFactory();812 813 1024 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 814 1025 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 815 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);816 817 assertLexicallyEqual( task1, task1);1026 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1027 1028 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 818 1029 } 819 1030 … … 823 1034 @Test 824 1035 public void test_compare_MouseClick_02() { 825 ITaskFactory taskFactory = new TaskFactory();826 827 1036 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 828 1037 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 829 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1038 ITask task1 = createNewEventTask(eventType1, eventTarget1); 830 1039 831 1040 IEventType eventType2 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 832 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);833 834 assertLexicallyEqual( task1, task2);1041 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1042 1043 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 835 1044 } 836 1045 … … 840 1049 @Test 841 1050 public void test_compare_MouseClick_03() { 842 ITaskFactory taskFactory = new TaskFactory();843 844 1051 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 845 1052 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 846 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1053 ITask task1 = createNewEventTask(eventType1, eventTarget1); 847 1054 848 1055 IEventType eventType2 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 3); 849 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);850 851 assertSemanticallyEqual( task1, task2);1056 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1057 1058 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 852 1059 } 853 1060 … … 857 1064 @Test 858 1065 public void test_compare_MouseClick_04() { 859 ITaskFactory taskFactory = new TaskFactory();860 861 1066 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 862 1067 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 863 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1068 ITask task1 = createNewEventTask(eventType1, eventTarget1); 864 1069 865 1070 IEventType eventType2 = new MouseClick(MouseButtonInteraction.Button.LEFT, 3, 2); 866 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);867 868 assertSemanticallyEqual( task1, task2);1071 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1072 1073 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 869 1074 } 870 1075 … … 874 1079 @Test 875 1080 public void test_compare_MouseClick_05() { 876 ITaskFactory taskFactory = new TaskFactory();877 878 1081 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 879 1082 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 880 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1083 ITask task1 = createNewEventTask(eventType1, eventTarget1); 881 1084 882 1085 IEventType eventType2 = new MouseClick(MouseButtonInteraction.Button.RIGHT, 1, 2); 883 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);884 885 assertUnequal( task1, task2);1086 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1087 1088 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 886 1089 } 887 1090 … … 891 1094 @Test 892 1095 public void test_compare_MouseClick_06() { 893 ITaskFactory taskFactory = new TaskFactory();894 895 1096 IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 896 1097 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 897 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1098 ITask task1 = createNewEventTask(eventType1, eventTarget1); 898 1099 899 1100 IEventType eventType2 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 900 1101 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 901 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);902 903 assertUnequal( task1, task2);1102 ITask task2 = createNewEventTask(eventType2, eventTarget2); 1103 1104 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 904 1105 } 905 1106 … … 909 1110 @Test 910 1111 public void test_compare_MouseDoubleClick_01() { 911 ITaskFactory taskFactory = new TaskFactory();912 913 1112 IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 914 1113 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 915 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);916 917 assertLexicallyEqual( task1, task1);1114 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1115 1116 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 918 1117 } 919 1118 … … 923 1122 @Test 924 1123 public void test_compare_MouseDoubleClick_02() { 925 ITaskFactory taskFactory = new TaskFactory();926 927 1124 IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 928 1125 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 929 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1126 ITask task1 = createNewEventTask(eventType1, eventTarget1); 930 1127 931 1128 IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 932 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);933 934 assertLexicallyEqual( task1, task2);1129 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1130 1131 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 935 1132 } 936 1133 … … 940 1137 @Test 941 1138 public void test_compare_MouseDoubleClick_03() { 942 ITaskFactory taskFactory = new TaskFactory();943 944 1139 IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 945 1140 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 946 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1141 ITask task1 = createNewEventTask(eventType1, eventTarget1); 947 1142 948 1143 IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 3); 949 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);950 951 assertSemanticallyEqual( task1, task2);1144 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1145 1146 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 952 1147 } 953 1148 … … 957 1152 @Test 958 1153 public void test_compare_MouseDoubleClick_04() { 959 ITaskFactory taskFactory = new TaskFactory();960 961 1154 IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 962 1155 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 963 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1156 ITask task1 = createNewEventTask(eventType1, eventTarget1); 964 1157 965 1158 IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 3, 2); 966 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);967 968 assertSemanticallyEqual( task1, task2);1159 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1160 1161 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 969 1162 } 970 1163 … … 974 1167 @Test 975 1168 public void test_compare_MouseDoubleClick_05() { 976 ITaskFactory taskFactory = new TaskFactory();977 978 1169 IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 979 1170 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 980 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1171 ITask task1 = createNewEventTask(eventType1, eventTarget1); 981 1172 982 1173 IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.RIGHT, 1, 2); 983 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);984 985 assertUnequal( task1, task2);1174 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1175 1176 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 986 1177 } 987 1178 … … 991 1182 @Test 992 1183 public void test_compare_MouseDoubleClick_06() { 993 ITaskFactory taskFactory = new TaskFactory();994 995 1184 IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 996 1185 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 997 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1186 ITask task1 = createNewEventTask(eventType1, eventTarget1); 998 1187 999 1188 IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 1000 1189 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 1001 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);1002 1003 assertUnequal( task1, task2);1190 ITask task2 = createNewEventTask(eventType2, eventTarget2); 1191 1192 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 1004 1193 } 1005 1194 … … 1009 1198 @Test 1010 1199 public void test_compare_MouseDragAndDrop_01() { 1011 ITaskFactory taskFactory = new TaskFactory();1012 1013 1200 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 1014 1201 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1015 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1016 1017 assertLexicallyEqual( task1, task1);1202 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1203 1204 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 1018 1205 } 1019 1206 … … 1023 1210 @Test 1024 1211 public void test_compare_MouseDragAndDrop_02() { 1025 ITaskFactory taskFactory = new TaskFactory();1026 1027 1212 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 1028 1213 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1029 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1214 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1030 1215 1031 1216 IEventType eventType2 = new MouseDragAndDrop(1, 2, 3, 4); 1032 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1033 1034 assertLexicallyEqual( task1, task2);1217 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1218 1219 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1035 1220 } 1036 1221 … … 1040 1225 @Test 1041 1226 public void test_compare_MouseDragAndDrop_03() { 1042 ITaskFactory taskFactory = new TaskFactory();1043 1044 1227 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 1045 1228 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1046 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1229 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1047 1230 1048 1231 IEventType eventType2 = new MouseDragAndDrop(5, 2, 3, 4); 1049 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1050 1051 assertSemanticallyEqual( task1, task2);1232 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1233 1234 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1052 1235 } 1053 1236 … … 1057 1240 @Test 1058 1241 public void test_compare_MouseDragAndDrop_04() { 1059 ITaskFactory taskFactory = new TaskFactory();1060 1061 1242 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 1062 1243 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1063 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1244 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1064 1245 1065 1246 IEventType eventType2 = new MouseDragAndDrop(1, 5, 3, 4); 1066 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1067 1068 assertSemanticallyEqual( task1, task2);1247 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1248 1249 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1069 1250 } 1070 1251 … … 1074 1255 @Test 1075 1256 public void test_compare_MouseDragAndDrop_05() { 1076 ITaskFactory taskFactory = new TaskFactory();1077 1078 1257 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 1079 1258 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1080 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1259 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1081 1260 1082 1261 IEventType eventType2 = new MouseDragAndDrop(1, 2, 5, 4); 1083 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1084 1085 assertSemanticallyEqual( task1, task2);1262 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1263 1264 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1086 1265 } 1087 1266 … … 1091 1270 @Test 1092 1271 public void test_compare_MouseDragAndDrop_06() { 1093 ITaskFactory taskFactory = new TaskFactory();1094 1095 1272 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 1096 1273 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1097 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1274 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1098 1275 1099 1276 IEventType eventType2 = new MouseDragAndDrop(1, 2, 3, 5); 1100 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1101 1102 assertSemanticallyEqual( task1, task2);1277 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1278 1279 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1103 1280 } 1104 1281 … … 1108 1285 @Test 1109 1286 public void test_compare_MouseDragAndDrop_07() { 1110 ITaskFactory taskFactory = new TaskFactory();1111 1112 1287 IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 1113 1288 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1114 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1289 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1115 1290 1116 1291 IEventType eventType2 = new MouseDragAndDrop(1, 2, 3, 4); 1117 1292 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 1118 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);1119 1120 assertUnequal( task1, task2);1293 ITask task2 = createNewEventTask(eventType2, eventTarget2); 1294 1295 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 1121 1296 } 1122 1297 … … 1126 1301 @Test 1127 1302 public void test_compare_Scroll_01() { 1128 ITaskFactory taskFactory = new TaskFactory();1129 1130 1303 IEventType eventType1 = new Scroll(1, 2); 1131 1304 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1132 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1133 1134 assertLexicallyEqual( task1, task1);1305 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1306 1307 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 1135 1308 } 1136 1309 … … 1140 1313 @Test 1141 1314 public void test_compare_Scroll_02() { 1142 ITaskFactory taskFactory = new TaskFactory();1143 1144 1315 IEventType eventType1 = new Scroll(1, 2); 1145 1316 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1146 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1317 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1147 1318 1148 1319 IEventType eventType2 = new Scroll(1, 2); 1149 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1150 1151 assertLexicallyEqual( task1, task2);1320 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1321 1322 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1152 1323 } 1153 1324 … … 1157 1328 @Test 1158 1329 public void test_compare_Scroll_03() { 1159 ITaskFactory taskFactory = new TaskFactory();1160 1161 1330 IEventType eventType1 = new Scroll(1, 2); 1162 1331 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1163 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1332 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1164 1333 1165 1334 IEventType eventType2 = new Scroll(3, 2); 1166 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1167 1168 assertSemanticallyEqual( task1, task2);1335 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1336 1337 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1169 1338 } 1170 1339 … … 1174 1343 @Test 1175 1344 public void test_compare_Scroll_04() { 1176 ITaskFactory taskFactory = new TaskFactory();1177 1178 1345 IEventType eventType1 = new Scroll(1, 2); 1179 1346 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1180 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1347 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1181 1348 1182 1349 IEventType eventType2 = new Scroll(1, 3); 1183 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1184 1185 assertSemanticallyEqual( task1, task2);1350 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1351 1352 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1186 1353 } 1187 1354 … … 1191 1358 @Test 1192 1359 public void test_compare_Scroll_05() { 1193 ITaskFactory taskFactory = new TaskFactory();1194 1195 1360 IEventType eventType1 = new Scroll(1, 2); 1196 1361 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1197 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1362 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1198 1363 1199 1364 IEventType eventType2 = new Scroll(1, 2); 1200 1365 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 1201 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);1202 1203 assertUnequal( task1, task2);1366 ITask task2 = createNewEventTask(eventType2, eventTarget2); 1367 1368 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 1204 1369 } 1205 1370 … … 1209 1374 @Test 1210 1375 public void test_compare_TextInput_01() { 1211 ITaskFactory taskFactory = new TaskFactory();1212 1213 1376 IEventType eventType1 = new StringEventType("eventType1"); 1214 1377 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); … … 1216 1379 textInputEvents1.add(new Event(eventType1, eventTarget1)); 1217 1380 eventType1 = new TextInput("enteredText1", textInputEvents1); 1218 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1219 1220 assertLexicallyEqual( task1, task1);1381 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1382 1383 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 1221 1384 } 1222 1385 … … 1226 1389 @Test 1227 1390 public void test_compare_TextInput_02() { 1228 ITaskFactory taskFactory = new TaskFactory();1229 1230 1391 IEventType eventType1 = new StringEventType("eventType1"); 1231 1392 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); … … 1233 1394 textInputEvents1.add(new Event(eventType1, eventTarget1)); 1234 1395 eventType1 = new TextInput("enteredText1", textInputEvents1); 1235 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1396 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1236 1397 1237 1398 IEventType eventType2 = new TextInput("enteredText1", textInputEvents1); 1238 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1239 1240 assertLexicallyEqual( task1, task2);1399 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1400 1401 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1241 1402 } 1242 1403 … … 1246 1407 @Test 1247 1408 public void test_compare_TextInput_03() { 1248 ITaskFactory taskFactory = new TaskFactory();1249 1250 1409 IEventType eventType1 = new StringEventType("eventType1"); 1251 1410 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); … … 1253 1412 textInputEvents1.add(new Event(eventType1, eventTarget1)); 1254 1413 eventType1 = new TextInput("enteredText1", textInputEvents1); 1255 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1414 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1256 1415 1257 1416 IEventType eventType2 = new StringEventType("eventType2"); … … 1259 1418 textInputEvents2.add(new Event(eventType2, eventTarget1)); 1260 1419 eventType2 = new TextInput("enteredText1", textInputEvents2); 1261 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1262 1263 assertSyntacticallyEqual( task1, task2);1420 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1421 1422 assertSyntacticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1264 1423 } 1265 1424 … … 1269 1428 @Test 1270 1429 public void test_compare_TextInput_04() { 1271 ITaskFactory taskFactory = new TaskFactory();1272 1273 1430 IEventType eventType1 = new StringEventType("eventType1"); 1274 1431 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); … … 1276 1433 textInputEvents1.add(new Event(eventType1, eventTarget1)); 1277 1434 eventType1 = new TextInput("enteredText1", textInputEvents1); 1278 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1435 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1279 1436 1280 1437 IEventType eventType2 = new StringEventType("eventType2"); … … 1282 1439 textInputEvents2.add(new Event(eventType2, eventTarget1)); 1283 1440 eventType2 = new TextInput("enteredText2", textInputEvents2); 1284 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1285 1286 assertSemanticallyEqual( task1, task2);1441 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1442 1443 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1287 1444 } 1288 1445 … … 1292 1449 @Test 1293 1450 public void test_compare_TextInput_05() { 1294 ITaskFactory taskFactory = new TaskFactory();1295 1296 1451 IEventType eventType1 = new StringEventType("eventType1"); 1297 1452 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); … … 1299 1454 textInputEvents1.add(new Event(eventType1, eventTarget1)); 1300 1455 eventType1 = new TextInput("enteredText1", textInputEvents1); 1301 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1302 1303 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 1304 ITask task2 = taskFactory.createNewEventTask(eventType1, eventTarget2);1305 1306 assertUnequal( task1, task2);1456 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1457 1458 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 1459 ITask task2 = createNewEventTask(eventType1, eventTarget2); 1460 1461 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 1307 1462 } 1308 1463 … … 1312 1467 @Test 1313 1468 public void test_compare_TextSelection_01() { 1314 ITaskFactory taskFactory = new TaskFactory();1315 1316 1469 IEventType eventType1 = new TextSelection(); 1317 1470 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1318 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1319 1320 assertLexicallyEqual( task1, task1);1471 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1472 1473 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 1321 1474 } 1322 1475 … … 1326 1479 @Test 1327 1480 public void test_compare_TextSelection_02() { 1328 ITaskFactory taskFactory = new TaskFactory();1329 1330 1481 IEventType eventType1 = new TextSelection(); 1331 1482 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1332 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1483 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1333 1484 1334 1485 IEventType eventType2 = new TextSelection(); 1335 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1336 1337 assertLexicallyEqual( task1, task2);1486 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1487 1488 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1338 1489 } 1339 1490 … … 1343 1494 @Test 1344 1495 public void test_compare_TextSelection_03() { 1345 ITaskFactory taskFactory = new TaskFactory();1346 1347 1496 IEventType eventType1 = new TextSelection(); 1348 1497 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1349 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1498 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1350 1499 1351 1500 IEventType eventType2 = new TextSelection(); 1352 1501 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 1353 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);1354 1355 assertUnequal( task1, task2);1502 ITask task2 = createNewEventTask(eventType2, eventTarget2); 1503 1504 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 1356 1505 } 1357 1506 … … 1361 1510 @Test 1362 1511 public void test_compare_ValueSelection_01() { 1363 ITaskFactory taskFactory = new TaskFactory();1364 1365 1512 IEventType eventType1 = new ValueSelection<String>("value1"); 1366 1513 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1367 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1368 1369 assertLexicallyEqual( task1, task1);1514 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1515 1516 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task1); 1370 1517 } 1371 1518 … … 1375 1522 @Test 1376 1523 public void test_compare_ValueSelection_02() { 1377 ITaskFactory taskFactory = new TaskFactory();1378 1379 1524 IEventType eventType1 = new ValueSelection<String>("value1"); 1380 1525 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1381 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1526 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1382 1527 1383 1528 IEventType eventType2 = new ValueSelection<String>("value1"); 1384 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1385 1386 assertLexicallyEqual( task1, task2);1529 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1530 1531 assertLexicallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1387 1532 } 1388 1533 … … 1392 1537 @Test 1393 1538 public void test_compare_ValueSelection_03() { 1394 ITaskFactory taskFactory = new TaskFactory();1395 1396 1539 IEventType eventType1 = new ValueSelection<String>("value1"); 1397 1540 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1398 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1541 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1399 1542 1400 1543 IEventType eventType2 = new ValueSelection<String>("value2"); 1401 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1);1402 1403 assertSemanticallyEqual( task1, task2);1544 ITask task2 = createNewEventTask(eventType2, eventTarget1); 1545 1546 assertSemanticallyEqual(new GUIEventTaskComparisonRule(), task1, task2); 1404 1547 } 1405 1548 … … 1409 1552 @Test 1410 1553 public void test_compare_ValueSelection_04() { 1411 ITaskFactory taskFactory = new TaskFactory();1412 1413 1554 IEventType eventType1 = new ValueSelection<String>("value1"); 1414 1555 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 1415 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);1556 ITask task1 = createNewEventTask(eventType1, eventTarget1); 1416 1557 1417 1558 IEventType eventType2 = new ValueSelection<String>("value1"); 1418 1559 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 1419 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 1420 1421 assertUnequal(task1, task2); 1422 } 1423 1424 /** 1425 * 1426 */ 1427 private void assertLexicallyEqual(ITask task1, ITask task2) { 1428 GUIEventTaskComparisonRule rule = new GUIEventTaskComparisonRule(); 1429 1430 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, task2)); 1431 assertTrue(rule.areLexicallyEqual(task1, task2)); 1432 assertTrue(rule.areSyntacticallyEqual(task1, task2)); 1433 assertTrue(rule.areSemanticallyEqual(task1, task2)); 1434 1435 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task2, task1)); 1436 assertTrue(rule.areLexicallyEqual(task2, task1)); 1437 assertTrue(rule.areSyntacticallyEqual(task2, task1)); 1438 assertTrue(rule.areSemanticallyEqual(task2, task1)); 1439 } 1440 1441 /** 1442 * 1443 */ 1444 private void assertSyntacticallyEqual(ITask task1, ITask task2) { 1445 GUIEventTaskComparisonRule rule = new GUIEventTaskComparisonRule(); 1446 1447 assertEquals(TaskEquality.SYNTACTICALLY_EQUAL, rule.compare(task1, task2)); 1448 assertFalse(rule.areLexicallyEqual(task1, task2)); 1449 assertTrue(rule.areSyntacticallyEqual(task1, task2)); 1450 assertTrue(rule.areSemanticallyEqual(task1, task2)); 1451 1452 assertEquals(TaskEquality.SYNTACTICALLY_EQUAL, rule.compare(task2, task1)); 1453 assertFalse(rule.areLexicallyEqual(task2, task1)); 1454 assertTrue(rule.areSyntacticallyEqual(task2, task1)); 1455 assertTrue(rule.areSemanticallyEqual(task2, task1)); 1456 } 1457 1458 /** 1459 * 1460 */ 1461 private void assertSemanticallyEqual(ITask task1, ITask task2) { 1462 GUIEventTaskComparisonRule rule = new GUIEventTaskComparisonRule(); 1463 1464 assertEquals(TaskEquality.SEMANTICALLY_EQUAL, rule.compare(task1, task2)); 1465 assertFalse(rule.areLexicallyEqual(task1, task2)); 1466 assertFalse(rule.areSyntacticallyEqual(task1, task2)); 1467 assertTrue(rule.areSemanticallyEqual(task1, task2)); 1468 1469 assertEquals(TaskEquality.SEMANTICALLY_EQUAL, rule.compare(task2, task1)); 1470 assertFalse(rule.areLexicallyEqual(task2, task1)); 1471 assertFalse(rule.areSyntacticallyEqual(task2, task1)); 1472 assertTrue(rule.areSemanticallyEqual(task2, task1)); 1473 } 1474 1475 /** 1476 * 1477 */ 1478 private void assertUnequal(ITask task1, ITask task2) { 1479 GUIEventTaskComparisonRule rule = new GUIEventTaskComparisonRule(); 1480 1481 assertEquals(TaskEquality.UNEQUAL, rule.compare(task1, task2)); 1482 assertFalse(rule.areLexicallyEqual(task1, task2)); 1483 assertFalse(rule.areSyntacticallyEqual(task1, task2)); 1484 assertFalse(rule.areSemanticallyEqual(task1, task2)); 1485 1486 assertEquals(TaskEquality.UNEQUAL, rule.compare(task2, task1)); 1487 assertFalse(rule.areLexicallyEqual(task2, task1)); 1488 assertFalse(rule.areSyntacticallyEqual(task2, task1)); 1489 assertFalse(rule.areSemanticallyEqual(task2, task1)); 1560 ITask task2 = createNewEventTask(eventType2, eventTarget2); 1561 1562 assertUnequal(new GUIEventTaskComparisonRule(), task1, task2); 1490 1563 } 1491 1564 } -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRuleTest.java
r1190 r1294 23 23 import de.ugoe.cs.autoquest.eventcore.StringEventType; 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.IterationComparisonRule; 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;26 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;29 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;31 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder;32 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;33 28 import de.ugoe.cs.autoquest.test.DummyGUIElement; 34 29 … … 36 31 * @author Patrick Harms 37 32 */ 38 public class IterationComparisonRuleTest { 39 40 /** 41 * 42 */ 43 @Test 44 public void test() { 45 ITaskFactory taskFactory = new TaskFactory(); 46 ITaskBuilder treeBuilder = new TaskBuilder(); 47 33 public class IterationComparisonRuleTest extends AbstractComparisonRuleTest { 34 35 /** 36 * 37 */ 38 @Test 39 public void test_isApplicable_01() { 40 IterationComparisonRule rule = new IterationComparisonRule(); 41 42 ITask task1 = createNewIteration(); 43 44 assertTrue(rule.isApplicable(task1, task1)); 45 } 46 47 /** 48 * 49 */ 50 @Test 51 public void test_isApplicable_02() { 52 IterationComparisonRule rule = new IterationComparisonRule(); 53 54 ITask task1 = createNewIteration(); 55 ITask task2 = createNewIteration(); 56 57 assertTrue(rule.isApplicable(task1, task2)); 58 assertTrue(rule.isApplicable(task2, task1)); 59 } 60 61 /** 62 * 63 */ 64 @Test 65 public void test_isApplicable_03() { 66 IterationComparisonRule rule = new IterationComparisonRule(); 67 68 ITask task1 = createNewIteration(); 69 ITask task2 = createNewSequence(); 70 71 assertFalse(rule.isApplicable(task1, task2)); 72 assertFalse(rule.isApplicable(task2, task1)); 73 } 74 75 /** 76 * 77 */ 78 @Test 79 public void test_isApplicable_04() { 80 IterationComparisonRule rule = new IterationComparisonRule(); 81 82 ITask task1 = createNewIteration(); 83 ITask task2 = createNewSelection(); 84 85 assertFalse(rule.isApplicable(task1, task2)); 86 assertFalse(rule.isApplicable(task2, task1)); 87 } 88 89 /** 90 * 91 */ 92 @Test 93 public void test_isApplicable_05() { 94 IterationComparisonRule rule = new IterationComparisonRule(); 95 96 ITask task1 = createNewIteration(); 97 ITask task2 = createNewOptional(); 98 99 assertFalse(rule.isApplicable(task1, task2)); 100 assertFalse(rule.isApplicable(task2, task1)); 101 } 102 103 /** 104 * 105 */ 106 @Test 107 public void test_isApplicable_06() { 108 IterationComparisonRule rule = new IterationComparisonRule(); 109 110 IEventType eventType1 = new StringEventType("eventType1"); 111 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 112 113 ITask task1 = createNewIteration(); 114 ITask task2 = createNewEventTask(eventType1, eventTarget1); 115 116 assertFalse(rule.isApplicable(task1, task2)); 117 assertFalse(rule.isApplicable(task2, task1)); 118 } 119 120 /** 121 * 122 */ 123 @Test 124 public void test_compare_01() { 125 IterationComparisonRule rule = new IterationComparisonRule(); 126 127 IIteration iteration1 = createNewIteration(); 128 129 assertLexicallyEqual(rule, iteration1, iteration1); 130 } 131 132 /** 133 * 134 */ 135 @Test 136 public void test_compare_02() { 137 IterationComparisonRule rule = new IterationComparisonRule(); 138 139 IIteration iteration1 = createNewIteration(); 140 IIteration iteration2 = createNewIteration(); 141 142 assertLexicallyEqual(rule, iteration1, iteration2); 143 } 144 145 /** 146 * 147 */ 148 @Test 149 public void test_compare_03() { 150 IterationComparisonRule rule = new IterationComparisonRule(); 151 152 IEventType eventType1 = new StringEventType("eventType1"); 153 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 154 155 ITask task1 = createNewEventTask(eventType1, eventTarget1); 156 157 IIteration iteration1 = createNewIteration(); 158 IIteration iteration2 = createNewIteration(); 159 160 setMarkedTask(iteration1, task1); 161 162 assertUnequal(rule, iteration1, iteration2); 163 } 164 165 /** 166 * 167 */ 168 @Test 169 public void test_compare_04() { 170 IterationComparisonRule rule = new IterationComparisonRule(); 171 172 IEventType eventType1 = new StringEventType("eventType1"); 173 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 174 175 ITask task1 = createNewEventTask(eventType1, eventTarget1); 176 177 IIteration iteration1 = createNewIteration(); 178 IIteration iteration2 = createNewIteration(); 179 180 setMarkedTask(iteration1, task1); 181 setMarkedTask(iteration2, task1); 182 183 assertLexicallyEqual(rule, iteration1, iteration2); 184 } 185 186 /** 187 * 188 */ 189 @Test 190 public void test_compare_05() { 48 191 IterationComparisonRule rule = new IterationComparisonRule(); 49 192 … … 54 197 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 55 198 56 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 57 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 58 59 assertFalse(rule.isApplicable(task1, task2)); 60 61 IIteration iteration1 = taskFactory.createNewIteration(); 62 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration1)); 63 64 IIteration iteration2 = taskFactory.createNewIteration(); 65 66 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2)); 67 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1)); 68 69 treeBuilder.setMarkedTask(iteration1, task1); 70 71 assertEquals(TaskEquality.UNEQUAL, rule.compare(iteration1, iteration2)); 72 assertEquals(TaskEquality.UNEQUAL, rule.compare(iteration2, iteration1)); 73 74 treeBuilder.setMarkedTask(iteration2, task1); 75 76 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2)); 77 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1)); 78 79 treeBuilder.setMarkedTask(iteration1, task2); 80 81 assertEquals(TaskEquality.UNEQUAL, rule.compare(iteration1, iteration2)); 82 assertEquals(TaskEquality.UNEQUAL, rule.compare(iteration2, iteration1)); 83 84 treeBuilder.setMarkedTask(iteration2, task2); 85 86 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2)); 87 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1)); 88 89 ISelection selection1 = taskFactory.createNewSelection(); 90 treeBuilder.addChild(selection1, task2); 91 treeBuilder.setMarkedTask(iteration1, selection1); 92 93 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2)); 94 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1)); 95 96 ISelection selection2 = taskFactory.createNewSelection(); 97 treeBuilder.addChild(selection2, task2); 98 treeBuilder.setMarkedTask(iteration2, selection2); 99 100 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2)); 101 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1)); 102 103 assertFalse(rule.isApplicable(iteration1, selection1)); 104 assertFalse(rule.isApplicable(selection1, iteration1)); 105 assertFalse(rule.isApplicable(iteration2, selection1)); 106 assertFalse(rule.isApplicable(selection1, iteration2)); 107 108 assertFalse(rule.isApplicable(iteration1, selection2)); 109 assertFalse(rule.isApplicable(selection2, iteration1)); 110 assertFalse(rule.isApplicable(iteration2, selection2)); 111 assertFalse(rule.isApplicable(selection2, iteration2)); 199 ITask task1 = createNewEventTask(eventType1, eventTarget1); 200 ITask task2 = createNewEventTask(eventType2, eventTarget2); 201 202 IIteration iteration1 = createNewIteration(); 203 IIteration iteration2 = createNewIteration(); 204 205 setMarkedTask(iteration1, task1); 206 setMarkedTask(iteration1, task2); 207 208 assertUnequal(rule, iteration1, iteration2); 209 } 210 211 /** 212 * 213 */ 214 @Test 215 public void test_compare_06() { 216 IterationComparisonRule rule = new IterationComparisonRule(); 217 218 IEventType eventType1 = new StringEventType("eventType1"); 219 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 220 221 ITask task1 = createNewEventTask(eventType1, eventTarget1); 222 223 IIteration iteration1 = createNewIteration(); 224 IIteration iteration2 = createNewIteration(); 225 226 ISelection selection1 = createNewSelection(); 227 addChild(selection1, task1); 228 setMarkedTask(iteration1, selection1); 229 230 setMarkedTask(iteration2, task1); 231 232 assertLexicallyEqual(rule, iteration1, iteration2); 233 } 234 235 /** 236 * 237 */ 238 @Test 239 public void test_compare_07() { 240 IterationComparisonRule rule = new IterationComparisonRule(); 241 242 IEventType eventType1 = new StringEventType("eventType1"); 243 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 244 245 ITask task1 = createNewEventTask(eventType1, eventTarget1); 246 247 IIteration iteration1 = createNewIteration(); 248 IIteration iteration2 = createNewIteration(); 249 250 ISelection selection1 = createNewSelection(); 251 addChild(selection1, task1); 252 setMarkedTask(iteration1, selection1); 253 254 ISelection selection2 = createNewSelection(); 255 addChild(selection2, task1); 256 setMarkedTask(iteration2, selection2); 257 258 assertLexicallyEqual(rule, iteration1, iteration2); 259 } 260 261 /** 262 * 263 */ 264 @Test 265 public void test_compare_08() { 266 IterationComparisonRule rule = new IterationComparisonRule(); 267 268 IEventType eventType1 = new StringEventType("eventType1"); 269 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 270 271 IEventType eventType2 = new StringEventType("eventType2"); 272 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 273 274 ITask task1 = createNewEventTask(eventType1, eventTarget1); 275 ITask task2 = createNewEventTask(eventType2, eventTarget2); 276 277 IIteration iteration1 = createNewIteration(); 278 IIteration iteration2 = createNewIteration(); 279 280 ISelection selection1 = createNewSelection(); 281 addChild(selection1, task1); 282 addChild(selection1, task2); 283 setMarkedTask(iteration1, selection1); 284 285 ISelection selection2 = createNewSelection(); 286 addChild(selection2, task2); 287 setMarkedTask(iteration2, selection2); 288 289 assertLexicallyEqual(rule, iteration1, iteration2); 112 290 } 113 291 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRuleTest.java
r1190 r1294 22 22 import de.ugoe.cs.autoquest.eventcore.IEventType; 23 23 import de.ugoe.cs.autoquest.eventcore.StringEventType; 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;25 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.SelectionComparisonRule; 26 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence;28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;29 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;31 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder;32 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;33 27 import de.ugoe.cs.autoquest.test.DummyGUIElement; 34 28 … … 36 30 * @author Patrick Harms 37 31 */ 38 public class SelectionComparisonRuleTest { 39 40 /** 41 * 42 */ 43 @Test 44 public void test() { 45 ITaskFactory taskFactory = new TaskFactory(); 46 ITaskBuilder treeBuilder = new TaskBuilder(); 47 32 public class SelectionComparisonRuleTest extends AbstractComparisonRuleTest { 33 34 /** 35 * 36 */ 37 @Test 38 public void test_isApplicable_01() { 39 SelectionComparisonRule rule = new SelectionComparisonRule(); 40 41 ITask task1 = createNewSelection(); 42 43 assertTrue(rule.isApplicable(task1, task1)); 44 } 45 46 /** 47 * 48 */ 49 @Test 50 public void test_isApplicable_02() { 51 SelectionComparisonRule rule = new SelectionComparisonRule(); 52 53 ITask task1 = createNewSelection(); 54 ITask task2 = createNewSelection(); 55 56 assertTrue(rule.isApplicable(task1, task2)); 57 assertTrue(rule.isApplicable(task2, task1)); 58 } 59 60 /** 61 * 62 */ 63 @Test 64 public void test_isApplicable_03() { 65 SelectionComparisonRule rule = new SelectionComparisonRule(); 66 67 ITask task1 = createNewSelection(); 68 ITask task2 = createNewSequence(); 69 70 assertFalse(rule.isApplicable(task1, task2)); 71 assertFalse(rule.isApplicable(task2, task1)); 72 } 73 74 /** 75 * 76 */ 77 @Test 78 public void test_isApplicable_04() { 79 SelectionComparisonRule rule = new SelectionComparisonRule(); 80 81 ITask task1 = createNewSelection(); 82 ITask task2 = createNewIteration(); 83 84 assertFalse(rule.isApplicable(task1, task2)); 85 assertFalse(rule.isApplicable(task2, task1)); 86 } 87 88 /** 89 * 90 */ 91 @Test 92 public void test_isApplicable_05() { 93 SelectionComparisonRule rule = new SelectionComparisonRule(); 94 95 ITask task1 = createNewSelection(); 96 ITask task2 = createNewOptional(); 97 98 assertFalse(rule.isApplicable(task1, task2)); 99 assertFalse(rule.isApplicable(task2, task1)); 100 } 101 102 /** 103 * 104 */ 105 @Test 106 public void test_isApplicable_06() { 107 SelectionComparisonRule rule = new SelectionComparisonRule(); 108 109 IEventType eventType1 = new StringEventType("eventType1"); 110 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 111 112 ITask task1 = createNewSelection(); 113 ITask task2 = createNewEventTask(eventType1, eventTarget1); 114 115 assertFalse(rule.isApplicable(task1, task2)); 116 assertFalse(rule.isApplicable(task2, task1)); 117 } 118 119 /** 120 * 121 */ 122 @Test 123 public void test_compare_01() { 124 SelectionComparisonRule rule = new SelectionComparisonRule(); 125 126 ISelection selection1 = createNewSelection(); 127 assertLexicallyEqual(rule, selection1, selection1); 128 } 129 130 /** 131 * 132 */ 133 @Test 134 public void test_compare_02() { 135 SelectionComparisonRule rule = new SelectionComparisonRule(); 136 137 ISelection selection1 = createNewSelection(); 138 ISelection selection2 = createNewSelection(); 139 140 assertLexicallyEqual(rule, selection1, selection2); 141 } 142 143 /** 144 * 145 */ 146 @Test 147 public void test_compare_03() { 148 SelectionComparisonRule rule = new SelectionComparisonRule(); 149 150 IEventType eventType1 = new StringEventType("eventType1"); 151 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 152 153 ITask task1 = createNewEventTask(eventType1, eventTarget1); 154 155 ISelection selection1 = createNewSelection(); 156 ISelection selection2 = createNewSelection(); 157 158 addChild(selection1, task1); 159 160 assertUnequal(rule, selection1, selection2); 161 } 162 163 /** 164 * 165 */ 166 @Test 167 public void test_compare_04() { 168 SelectionComparisonRule rule = new SelectionComparisonRule(); 169 170 IEventType eventType1 = new StringEventType("eventType1"); 171 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 172 173 ITask task1 = createNewEventTask(eventType1, eventTarget1); 174 175 ISelection selection1 = createNewSelection(); 176 ISelection selection2 = createNewSelection(); 177 178 addChild(selection1, task1); 179 addChild(selection2, task1); 180 181 assertLexicallyEqual(rule, selection1, selection2); 182 } 183 184 /** 185 * 186 */ 187 @Test 188 public void test_compare_05() { 48 189 SelectionComparisonRule rule = new SelectionComparisonRule(); 49 190 … … 54 195 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 55 196 56 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 57 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 58 59 assertFalse(rule.isApplicable(task1, task2)); 60 61 ISelection selection1 = taskFactory.createNewSelection(); 62 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection1)); 63 64 ISelection selection2 = taskFactory.createNewSelection(); 65 66 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2)); 67 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1)); 68 69 treeBuilder.addChild(selection1, task1); 70 71 assertEquals(TaskEquality.UNEQUAL, rule.compare(selection1, selection2)); 72 assertEquals(TaskEquality.UNEQUAL, rule.compare(selection2, selection1)); 73 74 treeBuilder.addChild(selection2, task1); 75 76 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2)); 77 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1)); 78 79 treeBuilder.addChild(selection1, task2); 80 81 assertEquals(TaskEquality.UNEQUAL, rule.compare(selection1, selection2)); 82 assertEquals(TaskEquality.UNEQUAL, rule.compare(selection2, selection1)); 83 84 treeBuilder.addChild(selection2, task2); 85 86 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2)); 87 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1)); 88 89 ISelection selection3 = taskFactory.createNewSelection(); 90 treeBuilder.addChild(selection3, task2); 91 treeBuilder.addChild(selection3, task1); 92 93 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection3)); 94 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection3, selection1)); 95 96 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection3)); 97 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection3, selection2)); 98 99 ISequence sequence = taskFactory.createNewSequence(); 100 assertFalse(rule.isApplicable(selection1, sequence)); 101 assertFalse(rule.isApplicable(sequence, selection1)); 102 assertFalse(rule.isApplicable(selection2, sequence)); 103 assertFalse(rule.isApplicable(sequence, selection2)); 104 assertFalse(rule.isApplicable(selection3, sequence)); 105 assertFalse(rule.isApplicable(sequence, selection3)); 197 ITask task1 = createNewEventTask(eventType1, eventTarget1); 198 ITask task2 = createNewEventTask(eventType2, eventTarget2); 199 200 ISelection selection1 = createNewSelection(); 201 ISelection selection2 = createNewSelection(); 202 203 addChild(selection1, task1); 204 addChild(selection2, task2); 205 206 assertUnequal(rule, selection1, selection2); 207 } 208 209 /** 210 * 211 */ 212 @Test 213 public void test_compare_06() { 214 SelectionComparisonRule rule = new SelectionComparisonRule(); 215 216 IEventType eventType1 = new StringEventType("eventType1"); 217 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 218 219 IEventType eventType2 = new StringEventType("eventType2"); 220 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 221 222 ITask task1 = createNewEventTask(eventType1, eventTarget1); 223 ITask task2 = createNewEventTask(eventType2, eventTarget2); 224 225 ISelection selection1 = createNewSelection(); 226 ISelection selection2 = createNewSelection(); 227 228 addChild(selection1, task1); 229 addChild(selection2, task2); 230 231 ISelection selection3 = createNewSelection(); 232 addChild(selection3, task1); 233 assertLexicallyEqual(rule, selection1, selection3); 234 235 addChild(selection3, task2); 236 assertLexicallyEqual(rule, selection2, selection3); 106 237 } 107 238 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRuleTest.java
r1190 r1294 22 22 import de.ugoe.cs.autoquest.eventcore.IEventType; 23 23 import de.ugoe.cs.autoquest.eventcore.StringEventType; 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;25 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.SequenceComparisonRule; 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection;27 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;29 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;31 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder;32 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;33 27 import de.ugoe.cs.autoquest.test.DummyGUIElement; 34 28 … … 36 30 * @author Patrick Harms 37 31 */ 38 public class SequenceComparisonRuleTest { 39 40 /** 41 * 42 */ 43 @Test 44 public void test() { 45 ITaskFactory taskFactory = new TaskFactory(); 46 ITaskBuilder treeBuilder = new TaskBuilder(); 47 32 public class SequenceComparisonRuleTest extends AbstractComparisonRuleTest { 33 34 /** 35 * 36 */ 37 @Test 38 public void test_isApplicable_01() { 39 SequenceComparisonRule rule = new SequenceComparisonRule(); 40 41 ITask task1 = createNewSequence(); 42 43 assertTrue(rule.isApplicable(task1, task1)); 44 } 45 46 /** 47 * 48 */ 49 @Test 50 public void test_isApplicable_02() { 51 SequenceComparisonRule rule = new SequenceComparisonRule(); 52 53 ITask task1 = createNewSequence(); 54 ITask task2 = createNewSequence(); 55 56 assertTrue(rule.isApplicable(task1, task2)); 57 assertTrue(rule.isApplicable(task2, task1)); 58 } 59 60 /** 61 * 62 */ 63 @Test 64 public void test_isApplicable_03() { 65 SequenceComparisonRule rule = new SequenceComparisonRule(); 66 67 ITask task1 = createNewSequence(); 68 ITask task2 = createNewSelection(); 69 70 assertFalse(rule.isApplicable(task1, task2)); 71 assertFalse(rule.isApplicable(task2, task1)); 72 } 73 74 /** 75 * 76 */ 77 @Test 78 public void test_isApplicable_04() { 79 SequenceComparisonRule rule = new SequenceComparisonRule(); 80 81 ITask task1 = createNewSequence(); 82 ITask task2 = createNewIteration(); 83 84 assertFalse(rule.isApplicable(task1, task2)); 85 assertFalse(rule.isApplicable(task2, task1)); 86 } 87 88 /** 89 * 90 */ 91 @Test 92 public void test_isApplicable_05() { 93 SequenceComparisonRule rule = new SequenceComparisonRule(); 94 95 ITask task1 = createNewSequence(); 96 ITask task2 = createNewOptional(); 97 98 assertFalse(rule.isApplicable(task1, task2)); 99 assertFalse(rule.isApplicable(task2, task1)); 100 } 101 102 /** 103 * 104 */ 105 @Test 106 public void test_isApplicable_06() { 107 SequenceComparisonRule rule = new SequenceComparisonRule(); 108 109 IEventType eventType1 = new StringEventType("eventType1"); 110 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 111 112 ITask task1 = createNewSequence(); 113 ITask task2 = createNewEventTask(eventType1, eventTarget1); 114 115 assertFalse(rule.isApplicable(task1, task2)); 116 assertFalse(rule.isApplicable(task2, task1)); 117 } 118 119 /** 120 * 121 */ 122 @Test 123 public void test_compare_01() { 124 SequenceComparisonRule rule = new SequenceComparisonRule(); 125 126 ISequence sequence1 = createNewSequence(); 127 assertLexicallyEqual(rule, sequence1, sequence1); 128 } 129 130 /** 131 * 132 */ 133 @Test 134 public void test_compare_02() { 135 SequenceComparisonRule rule = new SequenceComparisonRule(); 136 137 ISequence sequence1 = createNewSequence(); 138 ISequence sequence2 = createNewSequence(); 139 140 assertLexicallyEqual(rule, sequence1, sequence2); 141 } 142 143 /** 144 * 145 */ 146 @Test 147 public void test_compare_03() { 148 SequenceComparisonRule rule = new SequenceComparisonRule(); 149 150 IEventType eventType1 = new StringEventType("eventType1"); 151 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 152 153 ITask task1 = createNewEventTask(eventType1, eventTarget1); 154 155 ISequence sequence1 = createNewSequence(); 156 ISequence sequence2 = createNewSequence(); 157 158 addChild(sequence1, task1); 159 160 assertUnequal(rule, sequence1, sequence2); 161 } 162 163 /** 164 * 165 */ 166 @Test 167 public void test_compare_04() { 168 SequenceComparisonRule rule = new SequenceComparisonRule(); 169 170 IEventType eventType1 = new StringEventType("eventType1"); 171 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 172 173 ITask task1 = createNewEventTask(eventType1, eventTarget1); 174 175 ISequence sequence1 = createNewSequence(); 176 ISequence sequence2 = createNewSequence(); 177 178 addChild(sequence1, task1); 179 addChild(sequence2, task1); 180 181 assertLexicallyEqual(rule, sequence1, sequence2); 182 } 183 184 /** 185 * 186 */ 187 @Test 188 public void test_compare_05() { 48 189 SequenceComparisonRule rule = new SequenceComparisonRule(); 49 190 … … 54 195 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 55 196 56 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 57 ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 58 59 assertFalse(rule.isApplicable(task1, task2)); 60 61 ISequence sequence1 = taskFactory.createNewSequence(); 62 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(sequence1, sequence1)); 63 64 ISequence sequence2 = taskFactory.createNewSequence(); 65 66 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(sequence1, sequence2)); 67 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(sequence2, sequence1)); 68 69 treeBuilder.addChild(sequence1, task1); 70 71 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence1, sequence2)); 72 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence2, sequence1)); 73 74 treeBuilder.addChild(sequence2, task1); 75 76 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(sequence1, sequence2)); 77 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(sequence2, sequence1)); 78 79 treeBuilder.addChild(sequence1, task2); 80 81 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence1, sequence2)); 82 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence2, sequence1)); 83 84 treeBuilder.addChild(sequence2, task2); 85 86 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(sequence1, sequence2)); 87 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(sequence2, sequence1)); 88 89 ISequence sequence3 = taskFactory.createNewSequence(); 90 treeBuilder.addChild(sequence3, task2); 91 treeBuilder.addChild(sequence3, task1); 92 93 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence1, sequence3)); 94 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence3, sequence1)); 95 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence2, sequence3)); 96 assertEquals(TaskEquality.UNEQUAL, rule.compare(sequence3, sequence2)); 97 98 ISelection selection = taskFactory.createNewSelection(); 99 assertFalse(rule.isApplicable(sequence1, selection)); 100 assertFalse(rule.isApplicable(selection, sequence1)); 101 assertFalse(rule.isApplicable(sequence2, selection)); 102 assertFalse(rule.isApplicable(selection, sequence2)); 103 assertFalse(rule.isApplicable(sequence3, selection)); 104 assertFalse(rule.isApplicable(selection, sequence3)); 197 ITask task1 = createNewEventTask(eventType1, eventTarget1); 198 ITask task2 = createNewEventTask(eventType2, eventTarget2); 199 200 ISequence sequence1 = createNewSequence(); 201 ISequence sequence2 = createNewSequence(); 202 203 addChild(sequence1, task1); 204 addChild(sequence2, task1); 205 206 addChild(sequence1, task2); 207 208 assertUnequal(rule, sequence1, sequence2); 209 } 210 211 /** 212 * 213 */ 214 @Test 215 public void test_compare_06() { 216 SequenceComparisonRule rule = new SequenceComparisonRule(); 217 218 IEventType eventType1 = new StringEventType("eventType1"); 219 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 220 221 IEventType eventType2 = new StringEventType("eventType2"); 222 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 223 224 ITask task1 = createNewEventTask(eventType1, eventTarget1); 225 ITask task2 = createNewEventTask(eventType2, eventTarget2); 226 227 ISequence sequence1 = createNewSequence(); 228 ISequence sequence2 = createNewSequence(); 229 230 addChild(sequence1, task1); 231 addChild(sequence2, task1); 232 233 addChild(sequence1, task2); 234 addChild(sequence2, task2); 235 236 assertLexicallyEqual(rule, sequence1, sequence2); 237 } 238 239 /** 240 * 241 */ 242 @Test 243 public void test_compare_07() { 244 SequenceComparisonRule rule = new SequenceComparisonRule(); 245 246 IEventType eventType1 = new StringEventType("eventType1"); 247 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 248 249 IEventType eventType2 = new StringEventType("eventType2"); 250 IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 251 252 ITask task1 = createNewEventTask(eventType1, eventTarget1); 253 ITask task2 = createNewEventTask(eventType2, eventTarget2); 254 255 ISequence sequence1 = createNewSequence(); 256 ISequence sequence2 = createNewSequence(); 257 258 addChild(sequence1, task1); 259 addChild(sequence1, task2); 260 261 addChild(sequence2, task2); 262 addChild(sequence2, task1); 263 264 assertUnequal(rule, sequence1, sequence2); 105 265 } 106 266 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndIterationComparisonRuleTest.java
r1190 r1294 23 23 import de.ugoe.cs.autoquest.eventcore.StringEventType; 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndIterationComparisonRule; 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;26 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 27 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;29 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;31 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder;32 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;33 28 import de.ugoe.cs.autoquest.test.DummyGUIElement; 34 29 … … 36 31 * @author Patrick Harms 37 32 */ 38 public class TaskAndIterationComparisonRuleTest { 39 40 /** 41 * 42 */ 43 @Test 44 public void test() { 45 ITaskFactory taskFactory = new TaskFactory(); 46 ITaskBuilder treeBuilder = new TaskBuilder(); 47 48 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 49 50 IEventType eventType1 = new StringEventType("eventType1"); 51 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 52 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 53 54 assertNull(rule.compare(task1, task1)); 55 56 IIteration iteration1 = taskFactory.createNewIteration(); 57 assertNull(rule.compare(iteration1, iteration1)); 58 assertNull(rule.compare(task1, iteration1)); 59 assertNull(rule.compare(iteration1, task1)); 60 61 treeBuilder.setMarkedTask(iteration1, task1); 62 63 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, task1)); 64 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, iteration1)); 65 66 ISelection selection1 = taskFactory.createNewSelection(); 67 treeBuilder.addChild(selection1, task1); 68 treeBuilder.setMarkedTask(iteration1, selection1); 69 70 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(iteration1, task1)); 71 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, iteration1)); 33 public class TaskAndIterationComparisonRuleTest extends AbstractComparisonRuleTest { 34 35 /** 36 * 37 */ 38 @Test 39 public void test_isApplicable_01() { 40 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 41 42 ITask task1 = createNewSequence(); 43 44 assertFalse(rule.isApplicable(task1, task1)); 45 } 46 47 /** 48 * 49 */ 50 @Test 51 public void test_isApplicable_02() { 52 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 53 54 ITask task1 = createNewSelection(); 55 56 assertFalse(rule.isApplicable(task1, task1)); 57 } 58 59 /** 60 * 61 */ 62 @Test 63 public void test_isApplicable_03() { 64 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 65 66 ITask task1 = createNewIteration(); 67 68 assertFalse(rule.isApplicable(task1, task1)); 69 } 70 71 /** 72 * 73 */ 74 @Test 75 public void test_isApplicable_04() { 76 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 77 78 ITask task1 = createNewOptional(); 79 80 assertFalse(rule.isApplicable(task1, task1)); 81 } 82 83 /** 84 * 85 */ 86 @Test 87 public void test_isApplicable_05() { 88 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 89 90 IEventType eventType1 = new StringEventType("eventType1"); 91 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 92 93 ITask task1 = createNewEventTask(eventType1, eventTarget1); 94 95 assertFalse(rule.isApplicable(task1, task1)); 96 } 97 98 /** 99 * 100 */ 101 @Test 102 public void test_isApplicable_06() { 103 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 104 105 ITask task1 = createNewIteration(); 106 ITask task2 = createNewSequence(); 107 108 assertTrue(rule.isApplicable(task1, task2)); 109 assertTrue(rule.isApplicable(task2, task1)); 110 } 111 112 /** 113 * 114 */ 115 @Test 116 public void test_isApplicable_07() { 117 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 118 119 ITask task1 = createNewIteration(); 120 ITask task2 = createNewSelection(); 121 122 assertTrue(rule.isApplicable(task1, task2)); 123 assertTrue(rule.isApplicable(task2, task1)); 124 } 125 126 /** 127 * 128 */ 129 @Test 130 public void test_isApplicable_08() { 131 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 132 133 ITask task1 = createNewIteration(); 134 ITask task2 = createNewOptional(); 135 136 assertTrue(rule.isApplicable(task1, task2)); 137 assertTrue(rule.isApplicable(task2, task1)); 138 } 139 140 /** 141 * 142 */ 143 @Test 144 public void test_isApplicable_09() { 145 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 146 147 ITask task1 = createNewIteration(); 148 149 IEventType eventType1 = new StringEventType("eventType1"); 150 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 151 152 ITask task2 = createNewEventTask(eventType1, eventTarget1); 153 154 assertTrue(rule.isApplicable(task1, task2)); 155 assertTrue(rule.isApplicable(task2, task1)); 156 } 157 158 /** 159 * 160 */ 161 @Test 162 public void test_isApplicable_10() { 163 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 164 165 ITask task1 = createNewSequence(); 166 ITask task2 = createNewSelection(); 167 168 assertFalse(rule.isApplicable(task1, task2)); 169 assertFalse(rule.isApplicable(task2, task1)); 170 } 171 172 /** 173 * 174 */ 175 @Test 176 public void test_isApplicable_11() { 177 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 178 179 ITask task1 = createNewSequence(); 180 ITask task2 = createNewOptional(); 181 182 assertFalse(rule.isApplicable(task1, task2)); 183 assertFalse(rule.isApplicable(task2, task1)); 184 } 185 186 /** 187 * 188 */ 189 @Test 190 public void test_isApplicable_12() { 191 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 192 193 ITask task1 = createNewSequence(); 194 195 IEventType eventType1 = new StringEventType("eventType1"); 196 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 197 198 ITask task2 = createNewEventTask(eventType1, eventTarget1); 199 200 assertFalse(rule.isApplicable(task1, task2)); 201 assertFalse(rule.isApplicable(task2, task1)); 202 } 203 204 /** 205 * 206 */ 207 @Test 208 public void test_isApplicable_13() { 209 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 210 211 ITask task1 = createNewSelection(); 212 ITask task2 = createNewOptional(); 213 214 assertFalse(rule.isApplicable(task1, task2)); 215 assertFalse(rule.isApplicable(task2, task1)); 216 } 217 218 /** 219 * 220 */ 221 @Test 222 public void test_isApplicable_14() { 223 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 224 225 ITask task1 = createNewSelection(); 226 227 IEventType eventType1 = new StringEventType("eventType1"); 228 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 229 230 ITask task2 = createNewEventTask(eventType1, eventTarget1); 231 232 assertFalse(rule.isApplicable(task1, task2)); 233 assertFalse(rule.isApplicable(task2, task1)); 234 } 235 236 /** 237 * 238 */ 239 @Test 240 public void test_compare_01() { 241 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 242 243 IEventType eventType1 = new StringEventType("eventType1"); 244 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 245 ITask task1 = createNewEventTask(eventType1, eventTarget1); 246 247 IIteration iteration1 = createNewIteration(); 248 249 assertNullEquality(rule, iteration1, task1); 250 } 251 252 /** 253 * 254 */ 255 @Test 256 public void test_compare_02() { 257 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 258 259 IEventType eventType1 = new StringEventType("eventType1"); 260 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 261 ITask task1 = createNewEventTask(eventType1, eventTarget1); 262 263 IIteration iteration1 = createNewIteration(); 264 setMarkedTask(iteration1, task1); 265 266 assertLexicallyEqual(rule, task1, iteration1); 267 } 268 269 /** 270 * 271 */ 272 @Test 273 public void test_compare_03() { 274 TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 275 276 IEventType eventType1 = new StringEventType("eventType1"); 277 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 278 ITask task1 = createNewEventTask(eventType1, eventTarget1); 279 280 IIteration iteration1 = createNewIteration(); 281 282 ISelection selection1 = createNewSelection(); 283 addChild(selection1, task1); 284 setMarkedTask(iteration1, selection1); 285 286 assertLexicallyEqual(rule, task1, iteration1); 72 287 } 73 288 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRuleTest.java
r1190 r1294 23 23 import de.ugoe.cs.autoquest.eventcore.StringEventType; 24 24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndSelectionComparisonRule; 25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;26 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;28 26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;30 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder;31 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;32 27 import de.ugoe.cs.autoquest.test.DummyGUIElement; 33 28 … … 35 30 * @author Patrick Harms 36 31 */ 37 public class TaskAndSelectionComparisonRuleTest { 38 39 /** 40 * 41 */ 42 @Test 43 public void test() { 44 ITaskFactory taskFactory = new TaskFactory(); 45 ITaskBuilder treeBuilder = new TaskBuilder(); 46 47 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 48 49 IEventType eventType1 = new StringEventType("eventType1"); 50 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 51 ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 52 53 assertNull(rule.compare(task1, task1)); 54 55 ISelection selection1 = taskFactory.createNewSelection(); 56 assertNull(rule.compare(selection1, selection1)); 57 assertNull(rule.compare(task1, selection1)); 58 assertNull(rule.compare(selection1, task1)); 59 60 treeBuilder.addChild(selection1, task1); 61 62 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, task1)); 63 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, selection1)); 64 65 selection1 = taskFactory.createNewSelection(); 66 ISelection selection2 = taskFactory.createNewSelection(); 67 treeBuilder.addChild(selection2, task1); 68 treeBuilder.addChild(selection1, selection2); 69 70 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, task1)); 71 assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, selection1)); 32 public class TaskAndSelectionComparisonRuleTest extends AbstractComparisonRuleTest { 33 34 /** 35 * 36 */ 37 @Test 38 public void test_isApplicable_01() { 39 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 40 41 ITask task1 = createNewSequence(); 42 43 assertFalse(rule.isApplicable(task1, task1)); 44 } 45 46 /** 47 * 48 */ 49 @Test 50 public void test_isApplicable_02() { 51 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 52 53 ITask task1 = createNewSelection(); 54 55 assertFalse(rule.isApplicable(task1, task1)); 56 } 57 58 /** 59 * 60 */ 61 @Test 62 public void test_isApplicable_03() { 63 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 64 65 ITask task1 = createNewIteration(); 66 67 assertFalse(rule.isApplicable(task1, task1)); 68 } 69 70 /** 71 * 72 */ 73 @Test 74 public void test_isApplicable_04() { 75 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 76 77 ITask task1 = createNewOptional(); 78 79 assertFalse(rule.isApplicable(task1, task1)); 80 } 81 82 /** 83 * 84 */ 85 @Test 86 public void test_isApplicable_05() { 87 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 88 89 IEventType eventType1 = new StringEventType("eventType1"); 90 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 91 92 ITask task1 = createNewEventTask(eventType1, eventTarget1); 93 94 assertFalse(rule.isApplicable(task1, task1)); 95 } 96 97 /** 98 * 99 */ 100 @Test 101 public void test_isApplicable_06() { 102 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 103 104 ITask task1 = createNewSelection(); 105 ITask task2 = createNewSequence(); 106 107 assertTrue(rule.isApplicable(task1, task2)); 108 assertTrue(rule.isApplicable(task2, task1)); 109 } 110 111 /** 112 * 113 */ 114 @Test 115 public void test_isApplicable_07() { 116 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 117 118 ITask task1 = createNewSelection(); 119 ITask task2 = createNewIteration(); 120 121 assertTrue(rule.isApplicable(task1, task2)); 122 assertTrue(rule.isApplicable(task2, task1)); 123 } 124 125 /** 126 * 127 */ 128 @Test 129 public void test_isApplicable_08() { 130 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 131 132 ITask task1 = createNewSelection(); 133 ITask task2 = createNewOptional(); 134 135 assertTrue(rule.isApplicable(task1, task2)); 136 assertTrue(rule.isApplicable(task2, task1)); 137 } 138 139 /** 140 * 141 */ 142 @Test 143 public void test_isApplicable_09() { 144 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 145 146 ITask task1 = createNewSelection(); 147 148 IEventType eventType1 = new StringEventType("eventType1"); 149 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 150 151 ITask task2 = createNewEventTask(eventType1, eventTarget1); 152 153 assertTrue(rule.isApplicable(task1, task2)); 154 assertTrue(rule.isApplicable(task2, task1)); 155 } 156 157 /** 158 * 159 */ 160 @Test 161 public void test_isApplicable_10() { 162 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 163 164 ITask task1 = createNewSequence(); 165 ITask task2 = createNewIteration(); 166 167 assertFalse(rule.isApplicable(task1, task2)); 168 assertFalse(rule.isApplicable(task2, task1)); 169 } 170 171 /** 172 * 173 */ 174 @Test 175 public void test_isApplicable_11() { 176 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 177 178 ITask task1 = createNewSequence(); 179 ITask task2 = createNewOptional(); 180 181 assertFalse(rule.isApplicable(task1, task2)); 182 assertFalse(rule.isApplicable(task2, task1)); 183 } 184 185 /** 186 * 187 */ 188 @Test 189 public void test_isApplicable_12() { 190 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 191 192 ITask task1 = createNewSequence(); 193 194 IEventType eventType1 = new StringEventType("eventType1"); 195 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 196 197 ITask task2 = createNewEventTask(eventType1, eventTarget1); 198 199 assertFalse(rule.isApplicable(task1, task2)); 200 assertFalse(rule.isApplicable(task2, task1)); 201 } 202 203 /** 204 * 205 */ 206 @Test 207 public void test_isApplicable_13() { 208 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 209 210 ITask task1 = createNewIteration(); 211 ITask task2 = createNewOptional(); 212 213 assertFalse(rule.isApplicable(task1, task2)); 214 assertFalse(rule.isApplicable(task2, task1)); 215 } 216 217 /** 218 * 219 */ 220 @Test 221 public void test_isApplicable_14() { 222 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 223 224 ITask task1 = createNewIteration(); 225 226 IEventType eventType1 = new StringEventType("eventType1"); 227 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 228 229 ITask task2 = createNewEventTask(eventType1, eventTarget1); 230 231 assertFalse(rule.isApplicable(task1, task2)); 232 assertFalse(rule.isApplicable(task2, task1)); 233 } 234 235 /** 236 * 237 */ 238 @Test 239 public void test_compare_01() { 240 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 241 242 IEventType eventType1 = new StringEventType("eventType1"); 243 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 244 ITask task1 = createNewEventTask(eventType1, eventTarget1); 245 246 ISelection selection1 = createNewSelection(); 247 248 assertNullEquality(rule, task1, selection1); 249 } 250 251 /** 252 * 253 */ 254 @Test 255 public void test_compare_02() { 256 TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 257 258 IEventType eventType1 = new StringEventType("eventType1"); 259 IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 260 ITask task1 = createNewEventTask(eventType1, eventTarget1); 261 262 ISelection selection1 = createNewSelection(); 263 addChild(selection1, task1); 264 265 assertLexicallyEqual(rule, task1, selection1); 72 266 } 73 267 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java
r1281 r1294 33 33 import de.ugoe.cs.autoquest.tasktrees.TaskTreeValidator; 34 34 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 35 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 35 36 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceList; 36 37 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; … … 74 75 * 75 76 */ 76 protected void applyRule(Class<? extends ITaskInstance ListScopeRule> ruleClass,77 String 78 String 77 protected void applyRule(Class<? extends ITaskInstanceScopeRule> ruleClass, 78 String inputSpec, 79 String expectedOutputSpec) 79 80 { 80 ITaskInstance ListScopeRule rule = null;81 ITaskInstanceScopeRule rule = null; 81 82 82 83 CONSTRUCTOR_ITERATION: … … 100 101 101 102 try { 102 rule = (ITaskInstance ListScopeRule) constructor.newInstance(parameters.toArray());103 rule = (ITaskInstanceScopeRule) constructor.newInstance(parameters.toArray()); 103 104 } 104 105 catch (IllegalArgumentException e) { … … 127 128 RuleApplicationStatus status; 128 129 129 ITaskInstance List inputList =decoder.decode(inputSpec);130 131 Stack<ITaskInstance List> toBeAppliedOn = new Stack<ITaskInstanceList>();130 ITaskInstance inputList = (ITaskInstance) decoder.decode(inputSpec); 131 132 Stack<ITaskInstance> toBeAppliedOn = new Stack<ITaskInstance>(); 132 133 toBeAppliedOn.push(inputList); 133 134 … … 156 157 while ((!toBeAppliedOn.isEmpty()) || (status == RuleApplicationStatus.FINISHED)); 157 158 158 ITaskInstance List expectedList =decoder.decode(expectedOutputSpec);159 160 new TaskTreeChecker().assertTaskInstance ListsEqual(expectedList, inputList);159 ITaskInstance expectedList = (ITaskInstance) decoder.decode(expectedOutputSpec); 160 161 new TaskTreeChecker().assertTaskInstancesEqual(expectedList, inputList); 161 162 } 162 163 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrieTest.java
r1285 r1294 1510 1510 int order = 3; 1511 1511 1512 TaskInstanceTrieTester tester = new TaskInstanceTrieTester(1000, 100000 0, order);1513 1514 long start = System.currentTimeMillis(); 1515 fixture.trainSessions(Arrays.asList(tester.userSession), order); 1516 System.out.println("testing session with 100000 0task instances and 1000 symbols took " +1512 TaskInstanceTrieTester tester = new TaskInstanceTrieTester(1000, 100000, order); 1513 1514 long start = System.currentTimeMillis(); 1515 fixture.trainSessions(Arrays.asList(tester.userSession), order); 1516 System.out.println("testing session with 100000 task instances and 1000 symbols took " + 1517 1517 (System.currentTimeMillis() - start) + "ms"); 1518 1518 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolBucketedMapTest.java
r1285 r1294 28 28 import org.junit.Test; 29 29 30 import de.ugoe.cs.autoquest.eventcore.Event; 30 31 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 32 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 33 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 31 34 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 32 35 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; … … 60 63 @Test 61 64 public void testSymbolMap_1() { 62 SymbolMap<ITaskInstance, String> symbolMap = 63 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));65 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 66 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 64 67 65 68 assertNotNull(symbolMap); … … 69 72 @Test 70 73 public void testSymbolMap_2() { 71 TaskSymbolBucketedMap<String> symbolMap1 = 72 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));74 TaskSymbolBucketedMap<String> symbolMap1 = new TaskSymbolBucketedMap<String> 75 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 73 76 74 77 ITaskInstance taskInstance = createTaskInstance("symbol"); … … 89 92 @Test 90 93 public void testAddSymbol_1() { 91 SymbolMap<ITaskInstance, String> symbolMap = 92 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));94 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 95 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 93 96 94 97 ITaskInstance taskInstance = createTaskInstance("symbol"); … … 102 105 @Test 103 106 public void testAddSymbol_2() { 104 SymbolMap<ITaskInstance, String> symbolMap = 105 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));107 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 108 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 106 109 107 110 int entryCount = 2000; … … 122 125 @Test 123 126 public void testAddSymbol_3() { 124 SymbolMap<ITaskInstance, String> symbolMap = 125 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));127 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 128 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 126 129 127 130 int entryCount = 2000; … … 148 151 @Test(expected = java.lang.IllegalArgumentException.class) 149 152 public void testAddSymbol_4() { 150 SymbolMap<ITaskInstance, String> symbolMap = 151 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));153 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 154 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 152 155 153 156 symbolMap.addSymbol(null, null); … … 156 159 @Test 157 160 public void testSize_1() { 158 SymbolMap<ITaskInstance, String> symbolMap = 159 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));161 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 162 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 160 163 161 164 assertEquals(0, symbolMap.size()); … … 164 167 @Test 165 168 public void testSize_2() { 166 SymbolMap<ITaskInstance, String> symbolMap = 167 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));169 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 170 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 168 171 169 172 symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); … … 174 177 @Test 175 178 public void testSize_3() { 176 SymbolMap<ITaskInstance, String> symbolMap = 177 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));179 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 180 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 178 181 179 182 int entryCount = 2000; … … 188 191 @Test 189 192 public void testSize_4() { 190 SymbolMap<ITaskInstance, String> symbolMap = 191 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));193 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 194 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 192 195 193 196 int entryCount = 2000; … … 207 210 @Test 208 211 public void testSize_5() { 209 SymbolMap<ITaskInstance, String> symbolMap = 210 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));212 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 213 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 211 214 212 215 int entryCount = 2000; … … 225 228 @Test 226 229 public void testIsEmpty_1() { 227 SymbolMap<ITaskInstance, String> symbolMap = 228 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));230 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 231 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 229 232 230 233 assertTrue(symbolMap.isEmpty()); … … 233 236 @Test 234 237 public void testIsEmpty_2() { 235 SymbolMap<ITaskInstance, String> symbolMap = 236 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));238 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 239 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 237 240 238 241 symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); … … 243 246 @Test 244 247 public void testIsEmpty_3() { 245 SymbolMap<ITaskInstance, String> symbolMap = 246 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));248 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 249 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 247 250 248 251 int entryCount = 2000; … … 257 260 @Test 258 261 public void testIsEmpty_4() { 259 SymbolMap<ITaskInstance, String> symbolMap = 260 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));262 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 263 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 261 264 262 265 int entryCount = 2000; … … 276 279 @Test 277 280 public void testIsEmpty_5() { 278 SymbolMap<ITaskInstance, String> symbolMap = 279 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));281 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 282 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 280 283 281 284 int entryCount = 2000; … … 294 297 @Test 295 298 public void testContainsSymbol_1() { 296 SymbolMap<ITaskInstance, String> symbolMap = 297 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));299 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 300 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 298 301 299 302 assertFalse(symbolMap.containsSymbol(createTaskInstance("symbol"))); … … 302 305 @Test 303 306 public void testContainsSymbol_2() { 304 SymbolMap<ITaskInstance, String> symbolMap = 305 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));307 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 308 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 306 309 307 310 symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); … … 312 315 @Test 313 316 public void testContainsSymbol_3() { 314 SymbolMap<ITaskInstance, String> symbolMap = 315 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));317 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 318 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 316 319 317 320 int entryCount = 2000; … … 328 331 @Test 329 332 public void testContainsSymbol_4() { 330 SymbolMap<ITaskInstance, String> symbolMap = 331 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));333 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 334 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 332 335 333 336 int entryCount = 2000; … … 349 352 @Test 350 353 public void testContainsSymbol_5() { 351 SymbolMap<ITaskInstance, String> symbolMap = 352 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));354 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 355 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 353 356 354 357 int entryCount = 2000; … … 377 380 @Test(expected = java.lang.IllegalArgumentException.class) 378 381 public void testContainsSymbol_6() { 379 SymbolMap<ITaskInstance, String> symbolMap = 380 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));382 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 383 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 381 384 382 385 symbolMap.containsSymbol(null); … … 385 388 @Test 386 389 public void testGetValue_1() { 387 SymbolMap<ITaskInstance, String> symbolMap = 388 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));390 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 391 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 389 392 390 393 assertNull(symbolMap.getValue(createTaskInstance("symbol"))); … … 393 396 @Test 394 397 public void testGetValue_2() { 395 SymbolMap<ITaskInstance, String> symbolMap = 396 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));398 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 399 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 397 400 398 401 symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); … … 403 406 @Test 404 407 public void testGetValue_3() { 405 SymbolMap<ITaskInstance, String> symbolMap = 406 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));408 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 409 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 407 410 408 411 symbolMap.addSymbol(createTaskInstance("symbol1"), null); … … 413 416 @Test 414 417 public void testGetValue_4() { 415 SymbolMap<ITaskInstance, String> symbolMap = 416 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));418 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 419 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 417 420 418 421 int entryCount = 2000; … … 429 432 @Test 430 433 public void testGetValue_5() { 431 SymbolMap<ITaskInstance, String> symbolMap = 432 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));434 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 435 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 433 436 434 437 int entryCount = 2000; … … 455 458 @Test 456 459 public void testGetValue_6() { 457 SymbolMap<ITaskInstance, String> symbolMap = 458 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));460 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 461 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 459 462 460 463 int entryCount = 2000; … … 483 486 @Test(expected = java.lang.IllegalArgumentException.class) 484 487 public void testGetValue_7() { 485 SymbolMap<ITaskInstance, String> symbolMap = 486 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));488 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 489 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 487 490 488 491 symbolMap.getValue(null); … … 491 494 @Test 492 495 public void testRemoveSymbol_1() { 493 SymbolMap<ITaskInstance, String> symbolMap = 494 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));496 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 497 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 495 498 496 499 assertNull(symbolMap.removeSymbol(createTaskInstance("symbol"))); … … 499 502 @Test 500 503 public void testRemoveSymbol_2() { 501 SymbolMap<ITaskInstance, String> symbolMap = 502 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));504 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 505 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 503 506 504 507 symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); … … 510 513 @Test 511 514 public void testRemoveSymbol_3() { 512 SymbolMap<ITaskInstance, String> symbolMap = 513 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));515 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 516 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 514 517 515 518 symbolMap.addSymbol(createTaskInstance("symbol1"), null); … … 521 524 @Test 522 525 public void testRemoveSymbol_4() { 523 SymbolMap<ITaskInstance, String> symbolMap = 524 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));526 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 527 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 525 528 526 529 int entryCount = 2000; … … 539 542 @Test 540 543 public void testRemoveSymbol_5() { 541 SymbolMap<ITaskInstance, String> symbolMap = 542 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));544 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 545 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 543 546 544 547 int entryCount = 2000; … … 567 570 @Test 568 571 public void testRemoveSymbol_6() { 569 SymbolMap<ITaskInstance, String> symbolMap = 570 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));572 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 573 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 571 574 572 575 int entryCount = 2000; … … 597 600 @Test(expected = java.lang.IllegalArgumentException.class) 598 601 public void testRemoveSymbol_7() { 599 SymbolMap<ITaskInstance, String> symbolMap = 600 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));602 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 603 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 601 604 602 605 symbolMap.removeSymbol(null); … … 605 608 @Test 606 609 public void testGetSymbols_1() { 607 SymbolMap<ITaskInstance, String> symbolMap = 608 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));610 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 611 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 609 612 610 613 assertNotNull(symbolMap.getSymbols()); … … 614 617 @Test 615 618 public void testGetSymbols_2() { 616 SymbolMap<ITaskInstance, String> symbolMap = 617 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));619 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 620 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 618 621 619 622 ITaskInstance task = createTaskInstance("symbol1"); … … 627 630 @Test 628 631 public void testGetSymbols_3() { 629 SymbolMap<ITaskInstance, String> symbolMap = 630 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));632 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 633 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 631 634 632 635 ITaskInstance task = createTaskInstance("symbol1"); … … 640 643 @Test 641 644 public void testGetSymbols_4() { 642 SymbolMap<ITaskInstance, String> symbolMap = 643 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));645 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 646 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 644 647 Set<ITaskInstance> expectedSymbols = new HashSet<ITaskInstance>(); 645 648 … … 667 670 @Test 668 671 public void testGetSymbols_5() { 669 SymbolMap<ITaskInstance, String> symbolMap = 670 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));672 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 673 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 671 674 Set<ITaskInstance> expectedSymbols = new HashSet<ITaskInstance>(); 672 675 … … 701 704 @Test 702 705 public void testGetSymbols_6() { 703 SymbolMap<ITaskInstance, String> symbolMap = 704 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));706 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 707 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 705 708 List<ITaskInstance> expectedSymbols = new ArrayList<ITaskInstance>(); 706 709 … … 732 735 @Test 733 736 public void testGetValues_1() { 734 SymbolMap<ITaskInstance, String> symbolMap = 735 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));737 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 738 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 736 739 737 740 assertNotNull(symbolMap.getValues()); … … 741 744 @Test 742 745 public void testGetValues_2() { 743 SymbolMap<ITaskInstance, String> symbolMap = 744 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));746 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 747 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 745 748 746 749 symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); … … 753 756 @Test 754 757 public void testGetValues_3() { 755 SymbolMap<ITaskInstance, String> symbolMap = 756 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));758 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 759 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 757 760 758 761 symbolMap.addSymbol(createTaskInstance("symbol1"), null); … … 765 768 @Test 766 769 public void testGetValues_4() { 767 SymbolMap<ITaskInstance, String> symbolMap = 768 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));770 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 771 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 769 772 Set<String> expectedValues = new HashSet<String>(); 770 773 … … 791 794 @Test 792 795 public void testGetValues_5() { 793 SymbolMap<ITaskInstance, String> symbolMap = 794 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));796 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 797 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 795 798 Set<String> expectedValues = new HashSet<String>(); 796 799 … … 823 826 @Test 824 827 public void testGetValues_6() { 825 SymbolMap<ITaskInstance, String> symbolMap = 826 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));828 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 829 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 827 830 Set<String> expectedValues = new HashSet<String>(); 828 831 … … 854 857 @Test 855 858 public void testClear_1() { 856 SymbolMap<ITaskInstance, String> symbolMap = 857 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));859 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 860 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 858 861 859 862 symbolMap.clear(); … … 863 866 @Test 864 867 public void testClear_2() { 865 SymbolMap<ITaskInstance, String> symbolMap = 866 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));868 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 869 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 867 870 868 871 symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); … … 874 877 @Test 875 878 public void testClear_3() { 876 SymbolMap<ITaskInstance, String> symbolMap = 877 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));879 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 880 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 878 881 879 882 symbolMap.addSymbol(createTaskInstance("symbol1"), null); … … 885 888 @Test 886 889 public void testClear_4() { 887 SymbolMap<ITaskInstance, String> symbolMap = 888 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));890 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 891 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 889 892 890 893 int entryCount = 2000; … … 900 903 @Test 901 904 public void testClear_5() { 902 SymbolMap<ITaskInstance, String> symbolMap = 903 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));905 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 906 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 904 907 905 908 int entryCount = 2000; … … 920 923 @Test 921 924 public void testClear_6() { 922 SymbolMap<ITaskInstance, String> symbolMap = 923 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));925 SymbolMap<ITaskInstance, String> symbolMap = new TaskSymbolBucketedMap<String> 926 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 924 927 925 928 int entryCount = 2000; … … 939 942 @Test 940 943 public void testEquals_1() { 941 SymbolMap<ITaskInstance, String> symbolMap1 = 942 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));943 944 SymbolMap<ITaskInstance, String> symbolMap2 = 945 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));944 SymbolMap<ITaskInstance, String> symbolMap1 = new TaskSymbolBucketedMap<String> 945 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 946 947 SymbolMap<ITaskInstance, String> symbolMap2 = new TaskSymbolBucketedMap<String> 948 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 946 949 947 950 assertTrue(symbolMap1.equals(symbolMap2)); … … 950 953 @Test 951 954 public void testEquals_2() { 952 SymbolMap<ITaskInstance, String> symbolMap1 = 953 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));954 955 SymbolMap<ITaskInstance, String> symbolMap2 = 956 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));955 SymbolMap<ITaskInstance, String> symbolMap1 = new TaskSymbolBucketedMap<String> 956 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 957 958 SymbolMap<ITaskInstance, String> symbolMap2 = new TaskSymbolBucketedMap<String> 959 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 957 960 958 961 symbolMap1.addSymbol(createTaskInstance("symbol1"), "value1"); … … 963 966 @Test 964 967 public void testEquals_3() { 965 SymbolMap<ITaskInstance, String> symbolMap1 = 966 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));967 968 SymbolMap<ITaskInstance, String> symbolMap2 = 969 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));968 SymbolMap<ITaskInstance, String> symbolMap1 = new TaskSymbolBucketedMap<String> 969 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 970 971 SymbolMap<ITaskInstance, String> symbolMap2 = new TaskSymbolBucketedMap<String> 972 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 970 973 971 974 ITaskInstance task = createTaskInstance("symbol1"); … … 978 981 @Test 979 982 public void testEquals_4() { 980 SymbolMap<ITaskInstance, String> symbolMap1 = 981 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));983 SymbolMap<ITaskInstance, String> symbolMap1 = new TaskSymbolBucketedMap<String> 984 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 982 985 983 SymbolMap<ITaskInstance, String> symbolMap2 = 984 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));986 SymbolMap<ITaskInstance, String> symbolMap2 = new TaskSymbolBucketedMap<String> 987 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 985 988 986 989 int entryCount = 1000; … … 997 1000 @Test 998 1001 public void testEquals_5() { 999 SymbolMap<ITaskInstance, String> symbolMap1 = 1000 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));1002 SymbolMap<ITaskInstance, String> symbolMap1 = new TaskSymbolBucketedMap<String> 1003 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 1001 1004 1002 SymbolMap<ITaskInstance, String> symbolMap2 = 1003 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));1005 SymbolMap<ITaskInstance, String> symbolMap2 = new TaskSymbolBucketedMap<String> 1006 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 1004 1007 1005 1008 int entryCount = 1000; … … 1024 1027 @Test 1025 1028 public void testEquals_6() { 1026 SymbolMap<ITaskInstance, String> symbolMap1 = 1027 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));1029 SymbolMap<ITaskInstance, String> symbolMap1 = new TaskSymbolBucketedMap<String> 1030 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 1028 1031 1029 SymbolMap<ITaskInstance, String> symbolMap2 = 1030 new TaskSymbolBucketedMap<String>(new TaskComparator(TaskEquality.SEMANTICALLY_EQUAL));1032 SymbolMap<ITaskInstance, String> symbolMap2 = new TaskSymbolBucketedMap<String> 1033 (new TaskInstanceComparator(TaskEquality.SEMANTICALLY_EQUAL)); 1031 1034 1032 1035 int entryCount = 1000; … … 1052 1055 1053 1056 /** 1054 * <p>1055 * TODO: comment1056 * </p>1057 1057 * 1058 * @param string1059 * @return1060 1058 */ 1061 1059 private ITaskInstance createTaskInstance(String id) { 1062 1060 ITask task = tasks.get(id); 1063 1061 Event event = null; 1062 1064 1063 if (task == null) { 1065 task = taskFactory.createNewEventTask1066 (new DummyInteraction(id, 0), new DummyGUIElement("default"));1067 1064 event = new Event(new DummyInteraction(id, 0), new DummyGUIElement("default")); 1065 task = taskFactory.createNewEventTask(event.toString()); 1066 1068 1067 tasks.put(id, task); 1069 1068 } 1070 1071 return taskFactory.createNewTaskInstance(task); 1069 else { 1070 event = ((IEventTaskInstance) task.getInstances().iterator().next()).getEvent(); 1071 } 1072 1073 return taskFactory.createNewTaskInstance((IEventTask) task, event); 1072 1074 } 1073 1075 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolIdentityMapTest.java
r1285 r1294 28 28 import org.junit.Test; 29 29 30 import de.ugoe.cs.autoquest.eventcore.Event; 31 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 32 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 30 33 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 31 34 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; … … 1054 1057 " took " + (System.currentTimeMillis() - start)); 1055 1058 } 1059 1056 1060 /** 1057 * <p>1058 * TODO: comment1059 * </p>1060 1061 * 1061 * @param string1062 * @return1063 1062 */ 1064 1063 private ITaskInstance createTaskInstance(String id) { 1065 1064 ITask task = tasks.get(id); 1065 Event event = null; 1066 1066 1067 1067 if (task == null) { 1068 task = taskFactory.createNewEventTask1069 (new DummyInteraction(id, 0), new DummyGUIElement("default"));1068 event = new Event(new DummyInteraction(id, 0), new DummyGUIElement("default")); 1069 task = taskFactory.createNewEventTask(event.toString()); 1070 1070 1071 1071 tasks.put(id, task); 1072 1072 } 1073 1074 return taskFactory.createNewTaskInstance(task); 1073 else { 1074 event = ((IEventTaskInstance) task.getInstances().iterator().next()).getEvent(); 1075 } 1076 1077 return taskFactory.createNewTaskInstance((IEventTask) task, event); 1075 1078 } 1076 1079 -
trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModelTest.java
r1146 r1294 24 24 import org.junit.Test; 25 25 26 import de.ugoe.cs.autoquest.eventcore.Event; 26 27 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 27 28 import de.ugoe.cs.autoquest.eventcore.IEventType; 28 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 29 31 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 32 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIterationInstance; 30 33 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 34 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptionalInstance; 31 35 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 36 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance; 32 37 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 38 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequenceInstance; 33 39 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 34 40 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; … … 45 51 46 52 /** 47 * TODO comment 48 * 49 * @version $Revision: $ $Date: 02.04.2012$ 50 * @author 2012, last modified by $Author: patrick$ 53 * 51 54 */ 52 55 public class TaskModelTest { … … 69 72 IEventTarget eventTarget = new DummyGUIElement("elem"); 70 73 71 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);74 IEventTask task = createNewEventTask(eventType, eventTarget); 72 75 73 76 assertNotNull(task); … … 76 79 assertTrue(task.equals(task)); 77 80 78 assertEquals(eventType, task.getEventType()); 79 assertEquals(eventTarget, task.getEventTarget()); 81 IEventTaskInstance instance = (IEventTaskInstance) task.getInstances().iterator().next(); 82 assertEquals(eventType, instance.getEvent().getType()); 83 assertEquals(eventTarget, instance.getEvent().getTarget()); 80 84 } 81 85 … … 88 92 IEventTarget eventTarget = new DummyGUIElement("elem"); 89 93 90 IEventTask task1 = taskFactory.createNewEventTask(eventType, eventTarget);91 IEventTask task2 = taskFactory.createNewEventTask(eventType, eventTarget);94 IEventTask task1 = createNewEventTask(eventType, eventTarget); 95 IEventTask task2 = createNewEventTask(eventType, eventTarget); 92 96 93 97 // the tasks will not be equal as they should have a different id … … 103 107 IEventTarget eventTarget = new DummyGUIElement("elem"); 104 108 105 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);106 ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task);107 ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task);109 IEventTask task = createNewEventTask(eventType, eventTarget); 110 ITaskInstance taskInstance1 = createNewTaskInstance(task); 111 ITaskInstance taskInstance2 = createNewTaskInstance(task); 108 112 109 113 assertFalse(taskInstance1.equals(taskInstance2)); … … 133 137 IEventTarget eventTarget = new DummyGUIElement("elem"); 134 138 135 IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget);139 IEventTask child = createNewEventTask(eventType, eventTarget); 136 140 137 141 ISequence task = taskFactory.createNewSequence(); … … 152 156 IEventTarget eventTarget = new DummyGUIElement("elem"); 153 157 154 IEventTask child1 = taskFactory.createNewEventTask(eventType, eventTarget);155 IEventTask child2 = taskFactory.createNewEventTask(eventType, eventTarget);156 IEventTask child3 = taskFactory.createNewEventTask(eventType, eventTarget);157 IEventTask child4 = taskFactory.createNewEventTask(eventType, eventTarget);158 IEventTask child5 = taskFactory.createNewEventTask(eventType, eventTarget);158 IEventTask child1 = createNewEventTask(eventType, eventTarget); 159 IEventTask child2 = createNewEventTask(eventType, eventTarget); 160 IEventTask child3 = createNewEventTask(eventType, eventTarget); 161 IEventTask child4 = createNewEventTask(eventType, eventTarget); 162 IEventTask child5 = createNewEventTask(eventType, eventTarget); 159 163 160 164 ISequence task = taskFactory.createNewSequence(); … … 198 202 IEventTarget eventTarget = new DummyGUIElement("elem"); 199 203 200 IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget);204 IEventTask child = createNewEventTask(eventType, eventTarget); 201 205 202 206 ISelection task = taskFactory.createNewSelection(); … … 217 221 IEventTarget eventTarget = new DummyGUIElement("elem"); 218 222 219 IEventTask child1 = taskFactory.createNewEventTask(eventType, eventTarget);220 IEventTask child2 = taskFactory.createNewEventTask(eventType, eventTarget);221 IEventTask child3 = taskFactory.createNewEventTask(eventType, eventTarget);222 IEventTask child4 = taskFactory.createNewEventTask(eventType, eventTarget);223 IEventTask child5 = taskFactory.createNewEventTask(eventType, eventTarget);223 IEventTask child1 = createNewEventTask(eventType, eventTarget); 224 IEventTask child2 = createNewEventTask(eventType, eventTarget); 225 IEventTask child3 = createNewEventTask(eventType, eventTarget); 226 IEventTask child4 = createNewEventTask(eventType, eventTarget); 227 IEventTask child5 = createNewEventTask(eventType, eventTarget); 224 228 225 229 ISelection task = taskFactory.createNewSelection(); … … 262 266 IEventTarget eventTarget = new DummyGUIElement("elem"); 263 267 264 IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget);268 IEventTask child = createNewEventTask(eventType, eventTarget); 265 269 266 270 IIteration task = taskFactory.createNewIteration(); … … 279 283 IEventTarget eventTarget = new DummyGUIElement("elem"); 280 284 281 IEventTask child1 = taskFactory.createNewEventTask(eventType, eventTarget);282 IEventTask child2 = taskFactory.createNewEventTask(eventType, eventTarget);285 IEventTask child1 = createNewEventTask(eventType, eventTarget); 286 IEventTask child2 = createNewEventTask(eventType, eventTarget); 283 287 284 288 IIteration task = taskFactory.createNewIteration(); … … 312 316 IEventTarget eventTarget = new DummyGUIElement("elem"); 313 317 314 IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget);318 IEventTask child = createNewEventTask(eventType, eventTarget); 315 319 316 320 IOptional task = taskFactory.createNewOptional(); … … 329 333 IEventTarget eventTarget = new DummyGUIElement("elem"); 330 334 331 IEventTask child1 = taskFactory.createNewEventTask(eventType, eventTarget);332 IEventTask child2 = taskFactory.createNewEventTask(eventType, eventTarget);335 IEventTask child1 = createNewEventTask(eventType, eventTarget); 336 IEventTask child2 = createNewEventTask(eventType, eventTarget); 333 337 334 338 IOptional task = taskFactory.createNewOptional(); … … 348 352 IEventTarget eventTarget = new DummyGUIElement("elem"); 349 353 350 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);351 352 I TaskInstance taskInstance = taskFactory.createNewTaskInstance(task);354 IEventTask task = createNewEventTask(eventType, eventTarget); 355 356 IEventTaskInstance taskInstance = createNewTaskInstance(task); 353 357 354 358 assertNotNull(taskInstance); … … 356 360 assertTrue(taskInstance.equals(taskInstance)); 357 361 assertFalse(taskInstance.equals(task)); 358 assertNotNull(taskInstance.getChildren());359 assertEquals(0, taskInstance.getChildren().size());360 362 } 361 363 … … 368 370 IEventTarget eventTarget = new DummyGUIElement("elem"); 369 371 370 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);371 372 ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task);373 ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task);372 IEventTask task = createNewEventTask(eventType, eventTarget); 373 374 ITaskInstance taskInstance1 = createNewTaskInstance(task); 375 ITaskInstance taskInstance2 = createNewTaskInstance(task); 374 376 375 377 assertFalse(taskInstance1.equals(taskInstance2)); 376 }377 378 /**379 *380 */381 @Test(expected=IllegalArgumentException.class)382 public void test_EventTaskInstance_03() throws Exception {383 IEventType eventType = new DummyInteraction("interaction", 1);384 IEventTarget eventTarget = new DummyGUIElement("elem");385 386 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);387 388 ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task);389 ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task);390 391 taskBuilder.addChild(taskInstance1, taskInstance2);392 378 } 393 379 … … 400 386 IEventTarget eventTarget = new DummyGUIElement("elem"); 401 387 402 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);388 IEventTask task = createNewEventTask(eventType, eventTarget); 403 389 404 390 ISequence sequence = taskFactory.createNewSequence(); 405 391 406 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);407 I TaskInstance sequenceInstance = taskFactory.createNewTaskInstance(sequence);392 ITaskInstance taskInstance = createNewTaskInstance(task); 393 ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); 408 394 409 395 taskBuilder.addChild(sequenceInstance, taskInstance); … … 418 404 IEventTarget eventTarget = new DummyGUIElement("elem"); 419 405 420 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);406 IEventTask task = createNewEventTask(eventType, eventTarget); 421 407 422 408 ISequence sequence = taskFactory.createNewSequence(); 423 409 taskBuilder.addChild(sequence, task); 424 410 425 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);426 I TaskInstance sequenceInstance = taskFactory.createNewTaskInstance(sequence);411 ITaskInstance taskInstance = createNewTaskInstance(task); 412 ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); 427 413 428 414 taskBuilder.addChild(sequenceInstance, taskInstance); 429 415 430 assertNotNull(sequenceInstance.getChildren()); 431 assertEquals(1, sequenceInstance.getChildren().size()); 432 assertEquals(taskInstance, sequenceInstance.getChildren().get(0)); 416 assertEquals(1, sequenceInstance.size()); 417 assertEquals(taskInstance, sequenceInstance.get(0)); 433 418 } 434 419 … … 441 426 IEventTarget eventTarget = new DummyGUIElement("elem"); 442 427 443 IEventTask task1 = taskFactory.createNewEventTask(eventType, eventTarget);444 IEventTask task2 = taskFactory.createNewEventTask(eventType, eventTarget);445 IEventTask task3 = taskFactory.createNewEventTask(eventType, eventTarget);446 IEventTask task4 = taskFactory.createNewEventTask(eventType, eventTarget);447 IEventTask task5 = taskFactory.createNewEventTask(eventType, eventTarget);428 IEventTask task1 = createNewEventTask(eventType, eventTarget); 429 IEventTask task2 = createNewEventTask(eventType, eventTarget); 430 IEventTask task3 = createNewEventTask(eventType, eventTarget); 431 IEventTask task4 = createNewEventTask(eventType, eventTarget); 432 IEventTask task5 = createNewEventTask(eventType, eventTarget); 448 433 449 434 ISequence sequence = taskFactory.createNewSequence(); … … 454 439 taskBuilder.addChild(sequence, task5); 455 440 456 ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task1);457 ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task2);458 ITaskInstance taskInstance3 = taskFactory.createNewTaskInstance(task3);459 ITaskInstance taskInstance4 = taskFactory.createNewTaskInstance(task4);460 ITaskInstance taskInstance5 = taskFactory.createNewTaskInstance(task5);461 I TaskInstance sequenceInstance = taskFactory.createNewTaskInstance(sequence);441 ITaskInstance taskInstance1 = createNewTaskInstance(task1); 442 ITaskInstance taskInstance2 = createNewTaskInstance(task2); 443 ITaskInstance taskInstance3 = createNewTaskInstance(task3); 444 ITaskInstance taskInstance4 = createNewTaskInstance(task4); 445 ITaskInstance taskInstance5 = createNewTaskInstance(task5); 446 ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); 462 447 463 448 taskBuilder.addChild(sequenceInstance, taskInstance1); … … 467 452 taskBuilder.addChild(sequenceInstance, taskInstance5); 468 453 469 assertNotNull(sequenceInstance.getChildren()); 470 assertEquals(5, sequenceInstance.getChildren().size()); 471 assertEquals(taskInstance1, sequenceInstance.getChildren().get(0)); 472 assertEquals(taskInstance2, sequenceInstance.getChildren().get(1)); 473 assertEquals(taskInstance3, sequenceInstance.getChildren().get(2)); 474 assertEquals(taskInstance4, sequenceInstance.getChildren().get(3)); 475 assertEquals(taskInstance5, sequenceInstance.getChildren().get(4)); 454 assertEquals(5, sequenceInstance.size()); 455 assertEquals(taskInstance1, sequenceInstance.get(0)); 456 assertEquals(taskInstance2, sequenceInstance.get(1)); 457 assertEquals(taskInstance3, sequenceInstance.get(2)); 458 assertEquals(taskInstance4, sequenceInstance.get(3)); 459 assertEquals(taskInstance5, sequenceInstance.get(4)); 476 460 } 477 461 … … 484 468 IEventTarget eventTarget = new DummyGUIElement("elem"); 485 469 486 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);470 IEventTask task = createNewEventTask(eventType, eventTarget); 487 471 488 472 ISelection selection = taskFactory.createNewSelection(); 489 473 490 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);491 I TaskInstance selectionInstance = taskFactory.createNewTaskInstance(selection);492 493 taskBuilder. addChild(selectionInstance, taskInstance);474 ITaskInstance taskInstance = createNewTaskInstance(task); 475 ISelectionInstance selectionInstance = createNewTaskInstance(selection); 476 477 taskBuilder.setChild(selectionInstance, taskInstance); 494 478 } 495 479 … … 502 486 IEventTarget eventTarget = new DummyGUIElement("elem"); 503 487 504 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);488 IEventTask task = createNewEventTask(eventType, eventTarget); 505 489 506 490 ISelection selection = taskFactory.createNewSelection(); 507 491 taskBuilder.addChild(selection, task); 508 492 509 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 510 ITaskInstance selectionInstance = taskFactory.createNewTaskInstance(selection); 511 512 taskBuilder.addChild(selectionInstance, taskInstance); 513 514 assertNotNull(selectionInstance.getChildren()); 515 assertEquals(1, selectionInstance.getChildren().size()); 516 assertEquals(taskInstance, selectionInstance.getChildren().get(0)); 517 } 518 519 /** 520 * 521 */ 522 @Test(expected=IllegalArgumentException.class) 493 ITaskInstance taskInstance = createNewTaskInstance(task); 494 ISelectionInstance selectionInstance = createNewTaskInstance(selection); 495 496 taskBuilder.setChild(selectionInstance, taskInstance); 497 498 assertNotNull(selectionInstance.getChild()); 499 assertEquals(taskInstance, selectionInstance.getChild()); 500 } 501 502 /** 503 * 504 */ 505 @Test 523 506 public void test_SelectionInstance_03() throws Exception { 524 507 IEventType eventType = new DummyInteraction("interaction", 1); 525 508 IEventTarget eventTarget = new DummyGUIElement("elem"); 526 509 527 IEventTask task1 = taskFactory.createNewEventTask(eventType, eventTarget);528 IEventTask task2 = taskFactory.createNewEventTask(eventType, eventTarget);529 IEventTask task3 = taskFactory.createNewEventTask(eventType, eventTarget);530 IEventTask task4 = taskFactory.createNewEventTask(eventType, eventTarget);531 IEventTask task5 = taskFactory.createNewEventTask(eventType, eventTarget);510 IEventTask task1 = createNewEventTask(eventType, eventTarget); 511 IEventTask task2 = createNewEventTask(eventType, eventTarget); 512 IEventTask task3 = createNewEventTask(eventType, eventTarget); 513 IEventTask task4 = createNewEventTask(eventType, eventTarget); 514 IEventTask task5 = createNewEventTask(eventType, eventTarget); 532 515 533 516 ISelection selection = taskFactory.createNewSelection(); … … 538 521 taskBuilder.addChild(selection, task5); 539 522 540 ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task1); 541 ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task2); 542 ITaskInstance selectionInstance = taskFactory.createNewTaskInstance(selection); 543 544 taskBuilder.addChild(selectionInstance, taskInstance1); 545 taskBuilder.addChild(selectionInstance, taskInstance2); 523 ITaskInstance taskInstance1 = createNewTaskInstance(task1); 524 ITaskInstance taskInstance2 = createNewTaskInstance(task2); 525 ISelectionInstance selectionInstance = createNewTaskInstance(selection); 526 527 taskBuilder.setChild(selectionInstance, taskInstance1); 528 taskBuilder.setChild(selectionInstance, taskInstance2); 529 530 assertEquals(taskInstance2, selectionInstance.getChild()); 546 531 } 547 532 … … 554 539 IEventTarget eventTarget = new DummyGUIElement("elem"); 555 540 556 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);541 IEventTask task = createNewEventTask(eventType, eventTarget); 557 542 558 543 IIteration iteration = taskFactory.createNewIteration(); 559 544 560 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);561 I TaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration);545 ITaskInstance taskInstance = createNewTaskInstance(task); 546 IIterationInstance iterationInstance = createNewTaskInstance(iteration); 562 547 563 548 taskBuilder.addChild(iterationInstance, taskInstance); … … 572 557 IEventTarget eventTarget = new DummyGUIElement("elem"); 573 558 574 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);559 IEventTask task = createNewEventTask(eventType, eventTarget); 575 560 576 561 IIteration iteration = taskFactory.createNewIteration(); 577 562 taskBuilder.setMarkedTask(iteration, task); 578 563 579 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);580 I TaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration);564 ITaskInstance taskInstance = createNewTaskInstance(task); 565 IIterationInstance iterationInstance = createNewTaskInstance(iteration); 581 566 582 567 taskBuilder.addChild(iterationInstance, taskInstance); 583 568 584 assertNotNull(iterationInstance.getChildren()); 585 assertEquals(1, iterationInstance.getChildren().size()); 586 assertEquals(taskInstance, iterationInstance.getChildren().get(0)); 569 assertEquals(1, iterationInstance.size()); 570 assertEquals(taskInstance, iterationInstance.get(0)); 587 571 } 588 572 … … 595 579 IEventTarget eventTarget = new DummyGUIElement("elem"); 596 580 597 IEventTask task1 = taskFactory.createNewEventTask(eventType, eventTarget);598 IEventTask task2 = taskFactory.createNewEventTask(eventType, eventTarget);581 IEventTask task1 = createNewEventTask(eventType, eventTarget); 582 IEventTask task2 = createNewEventTask(eventType, eventTarget); 599 583 600 584 IIteration iteration = taskFactory.createNewIteration(); … … 602 586 taskBuilder.setMarkedTask(iteration, task2); 603 587 604 ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task1);605 I TaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration);588 ITaskInstance taskInstance1 = createNewTaskInstance(task1); 589 IIterationInstance iterationInstance = createNewTaskInstance(iteration); 606 590 607 591 taskBuilder.addChild(iterationInstance, taskInstance1); … … 616 600 IEventTarget eventTarget = new DummyGUIElement("elem"); 617 601 618 IEventTask task1 = taskFactory.createNewEventTask(eventType, eventTarget);619 IEventTask task2 = taskFactory.createNewEventTask(eventType, eventTarget);602 IEventTask task1 = createNewEventTask(eventType, eventTarget); 603 IEventTask task2 = createNewEventTask(eventType, eventTarget); 620 604 621 605 IIteration iteration = taskFactory.createNewIteration(); … … 623 607 taskBuilder.setMarkedTask(iteration, task2); 624 608 625 ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task2);626 I TaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration);609 ITaskInstance taskInstance2 = createNewTaskInstance(task2); 610 IIterationInstance iterationInstance = createNewTaskInstance(iteration); 627 611 628 612 taskBuilder.addChild(iterationInstance, taskInstance2); 629 613 630 assertNotNull(iterationInstance.getChildren()); 631 assertEquals(1, iterationInstance.getChildren().size()); 632 assertEquals(taskInstance2, iterationInstance.getChildren().get(0)); 614 assertEquals(1, iterationInstance.size()); 615 assertEquals(taskInstance2, iterationInstance.get(0)); 633 616 } 634 617 … … 641 624 IEventTarget eventTarget = new DummyGUIElement("elem"); 642 625 643 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);626 IEventTask task = createNewEventTask(eventType, eventTarget); 644 627 645 628 IOptional optional = taskFactory.createNewOptional(); 646 629 647 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);648 I TaskInstance optionalInstance = taskFactory.createNewTaskInstance(optional);649 650 taskBuilder. addChild(optionalInstance, taskInstance);630 ITaskInstance taskInstance = createNewTaskInstance(task); 631 IOptionalInstance optionalInstance = createNewTaskInstance(optional); 632 633 taskBuilder.setChild(optionalInstance, taskInstance); 651 634 } 652 635 … … 659 642 IEventTarget eventTarget = new DummyGUIElement("elem"); 660 643 661 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);644 IEventTask task = createNewEventTask(eventType, eventTarget); 662 645 663 646 IOptional optional = taskFactory.createNewOptional(); 664 647 taskBuilder.setMarkedTask(optional, task); 665 648 666 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 667 ITaskInstance optionalInstance = taskFactory.createNewTaskInstance(optional); 668 669 taskBuilder.addChild(optionalInstance, taskInstance); 670 671 assertNotNull(optionalInstance.getChildren()); 672 assertEquals(1, optionalInstance.getChildren().size()); 673 assertEquals(taskInstance, optionalInstance.getChildren().get(0)); 649 ITaskInstance taskInstance = createNewTaskInstance(task); 650 IOptionalInstance optionalInstance = createNewTaskInstance(optional); 651 652 taskBuilder.setChild(optionalInstance, taskInstance); 653 654 assertNotNull(optionalInstance.getChild()); 655 assertEquals(taskInstance, optionalInstance.getChild()); 674 656 } 675 657 … … 682 664 IEventTarget eventTarget = new DummyGUIElement("elem"); 683 665 684 IEventTask task1 = taskFactory.createNewEventTask(eventType, eventTarget);685 IEventTask task2 = taskFactory.createNewEventTask(eventType, eventTarget);666 IEventTask task1 = createNewEventTask(eventType, eventTarget); 667 IEventTask task2 = createNewEventTask(eventType, eventTarget); 686 668 687 669 IOptional optional = taskFactory.createNewOptional(); … … 689 671 taskBuilder.setMarkedTask(optional, task2); 690 672 691 ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task1);692 I TaskInstance optionalInstance = taskFactory.createNewTaskInstance(optional);693 694 taskBuilder. addChild(optionalInstance, taskInstance1);673 ITaskInstance taskInstance1 = createNewTaskInstance(task1); 674 IOptionalInstance optionalInstance = createNewTaskInstance(optional); 675 676 taskBuilder.setChild(optionalInstance, taskInstance1); 695 677 } 696 678 … … 703 685 IEventTarget eventTarget = new DummyGUIElement("elem"); 704 686 705 IEventTask task1 = taskFactory.createNewEventTask(eventType, eventTarget);706 IEventTask task2 = taskFactory.createNewEventTask(eventType, eventTarget);687 IEventTask task1 = createNewEventTask(eventType, eventTarget); 688 IEventTask task2 = createNewEventTask(eventType, eventTarget); 707 689 708 690 IOptional optional = taskFactory.createNewOptional(); … … 710 692 taskBuilder.setMarkedTask(optional, task2); 711 693 712 ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task2); 713 ITaskInstance optionalInstance = taskFactory.createNewTaskInstance(optional); 714 715 taskBuilder.addChild(optionalInstance, taskInstance2); 716 717 assertNotNull(optionalInstance.getChildren()); 718 assertEquals(1, optionalInstance.getChildren().size()); 719 assertEquals(taskInstance2, optionalInstance.getChildren().get(0)); 694 ITaskInstance taskInstance2 = createNewTaskInstance(task2); 695 IOptionalInstance optionalInstance = createNewTaskInstance(optional); 696 697 taskBuilder.setChild(optionalInstance, taskInstance2); 698 699 assertNotNull(optionalInstance.getChild()); 700 assertEquals(taskInstance2, optionalInstance.getChild()); 720 701 } 721 702 … … 740 721 IEventTarget eventTarget = new DummyGUIElement("elem"); 741 722 742 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);723 IEventTask task = createNewEventTask(eventType, eventTarget); 743 724 744 725 IUserSession userSession = taskFactory.createUserSession(); 745 726 746 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);727 ITaskInstance taskInstance = createNewTaskInstance(task); 747 728 748 729 taskBuilder.addExecutedTask(userSession, taskInstance); … … 761 742 IEventTarget eventTarget = new DummyGUIElement("elem"); 762 743 763 IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget);744 IEventTask task = createNewEventTask(eventType, eventTarget); 764 745 ISequence sequence = taskFactory.createNewSequence(); 765 746 ISelection selection = taskFactory.createNewSelection(); … … 772 753 taskBuilder.setMarkedTask(optional, task); 773 754 774 ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task);775 I TaskInstance sequenceInstance = taskFactory.createNewTaskInstance(sequence);776 I TaskInstance selectionInstance = taskFactory.createNewTaskInstance(selection);777 I TaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration);778 I TaskInstance optionalInstance = taskFactory.createNewTaskInstance(optional);779 780 taskBuilder.addChild(sequenceInstance, taskFactory.createNewTaskInstance(task));781 taskBuilder. addChild(selectionInstance, taskFactory.createNewTaskInstance(task));782 taskBuilder.addChild(iterationInstance, taskFactory.createNewTaskInstance(task));783 taskBuilder. addChild(optionalInstance, taskFactory.createNewTaskInstance(task));755 ITaskInstance taskInstance = createNewTaskInstance(task); 756 ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); 757 ISelectionInstance selectionInstance = createNewTaskInstance(selection); 758 IIterationInstance iterationInstance = createNewTaskInstance(iteration); 759 IOptionalInstance optionalInstance = createNewTaskInstance(optional); 760 761 taskBuilder.addChild(sequenceInstance, createNewTaskInstance(task)); 762 taskBuilder.setChild(selectionInstance, createNewTaskInstance(task)); 763 taskBuilder.addChild(iterationInstance, createNewTaskInstance(task)); 764 taskBuilder.setChild(optionalInstance, createNewTaskInstance(task)); 784 765 785 766 IUserSession userSession = taskFactory.createUserSession(); … … 823 804 } 824 805 825 ITaskInstance taskInstance = instantiateTask(task, noOfMaxChildren); 806 ISequenceInstance sequenceInstance = 807 (ISequenceInstance) instantiateTask(task, noOfMaxChildren); 826 808 827 809 System.err.println(" creating user session"); … … 829 811 IUserSession session = taskFactory.createUserSession(); 830 812 831 for (ITaskInstance child : taskInstance.getChildren()) {813 for (ITaskInstance child : sequenceInstance) { 832 814 taskBuilder.addExecutedTask(session, child); 833 815 } … … 836 818 sessions.add(session); 837 819 838 ITaskModel task Tree= taskFactory.createTaskModel(sessions);820 ITaskModel taskModel = taskFactory.createTaskModel(sessions); 839 821 840 822 System.err.println(" validating task tree"); 841 823 Map<ITask, ITaskInfo> actualTaskInfos = new HashMap<ITask, ITaskInfo>(); 842 824 843 for (ITask currentTask : task Tree.getTasks()) {844 actualTaskInfos.put(currentTask, task Tree.getTaskInfo(currentTask));825 for (ITask currentTask : taskModel.getTasks()) { 826 actualTaskInfos.put(currentTask, taskModel.getTaskInfo(currentTask)); 845 827 } 846 828 … … 988 970 Thread.sleep(2); 989 971 long id = System.currentTimeMillis(); 990 IEventTask task = taskFactory.createNewEventTask972 IEventTask task = createNewEventTask 991 973 (new DummyInteraction("interaction" + id, 1), new DummyGUIElement("elem" + id)); 992 974 … … 1064 1046 1065 1047 for (int i = 0; i < noOfChildren; i++) { 1066 ITask child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1048 ITask child; 1049 do { 1050 child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1051 } 1052 while (child instanceof ISelection); 1053 1067 1054 taskBuilder.addChild(selection, child); 1068 1055 } … … 1099 1086 IIteration iteration = taskFactory.createNewIteration(); 1100 1087 1101 ITask child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1088 ITask child; 1089 do { 1090 child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1091 } 1092 while ((child instanceof IOptional) || (child instanceof IIteration)); 1093 1102 1094 taskBuilder.setMarkedTask(iteration, child); 1103 1095 … … 1133 1125 IOptional optional = taskFactory.createNewOptional(); 1134 1126 1135 ITask child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1127 ITask child; 1128 do { 1129 child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); 1130 } 1131 while (child instanceof IOptional); 1132 1136 1133 taskBuilder.setMarkedTask(optional, child); 1137 1134 … … 1193 1190 */ 1194 1191 private ITaskInstance instantiateTask(ITask task, int maxIterationCount) throws Exception { 1195 ITaskInstance instance = taskFactory.createNewTaskInstance(task);1192 ITaskInstance instance = createNewTaskInstance(task); 1196 1193 1197 1194 if (task instanceof ISequence) { 1198 1195 for (ITask child : ((ISequence) task).getChildren()) { 1199 taskBuilder.addChild(instance, instantiateTask(child, maxIterationCount)); 1196 taskBuilder.addChild 1197 ((ISequenceInstance) instance, instantiateTask(child, maxIterationCount)); 1200 1198 } 1201 1199 } … … 1203 1201 List<ITask> children = ((ISelection) task).getChildren(); 1204 1202 int index = randomize(children.size()); 1205 taskBuilder.addChild(instance, instantiateTask(children.get(index), maxIterationCount)); 1203 taskBuilder.setChild((ISelectionInstance) instance, 1204 instantiateTask(children.get(index),maxIterationCount)); 1206 1205 } 1207 1206 else if (task instanceof IIteration) { … … 1210 1209 1211 1210 for (int i = 0; i < count; i++) { 1212 taskBuilder.addChild(instance, instantiateTask(child, maxIterationCount)); 1211 taskBuilder.addChild 1212 ((IIterationInstance) instance, instantiateTask(child, maxIterationCount)); 1213 1213 } 1214 1214 } … … 1217 1217 1218 1218 if (randomize(1) == 0) { 1219 taskBuilder.addChild(instance, instantiateTask(child, maxIterationCount)); 1219 taskBuilder.setChild((IOptionalInstance) instance, 1220 instantiateTask(child, maxIterationCount)); 1220 1221 } 1221 1222 } … … 1244 1245 return value + min; 1245 1246 } 1247 1248 /** 1249 * 1250 */ 1251 protected IEventTask createNewEventTask(IEventType eventType, IEventTarget eventTarget) { 1252 IEventTask eventTask = taskFactory.createNewEventTask(eventType + " --> " + eventTarget); 1253 taskFactory.createNewTaskInstance(eventTask, new Event(eventType, eventTarget)); 1254 return eventTask; 1255 } 1256 1257 /** 1258 * 1259 */ 1260 private ITaskInstance createNewTaskInstance(ITask task) { 1261 if (task instanceof IEventTask) { 1262 return createNewTaskInstance((IEventTask) task); 1263 } 1264 else if (task instanceof ISequence) { 1265 return createNewTaskInstance((ISequence) task); 1266 } 1267 else if (task instanceof ISelection) { 1268 return createNewTaskInstance((ISelection) task); 1269 } 1270 else if (task instanceof IIteration) { 1271 return createNewTaskInstance((IIteration) task); 1272 } 1273 else if (task instanceof IOptional) { 1274 return createNewTaskInstance((IOptional) task); 1275 } 1276 1277 throw new IllegalArgumentException("unknown type of task"); 1278 } 1279 1280 /** 1281 * 1282 */ 1283 private IEventTaskInstance createNewTaskInstance(IEventTask task) { 1284 IEventTaskInstance existingInstance = 1285 (IEventTaskInstance) task.getInstances().iterator().next(); 1286 return taskFactory.createNewTaskInstance(task, existingInstance.getEvent()); 1287 } 1288 1289 /** 1290 * 1291 */ 1292 private ISequenceInstance createNewTaskInstance(ISequence task) { 1293 return taskFactory.createNewTaskInstance(task); 1294 } 1295 1296 /** 1297 * 1298 */ 1299 private ISelectionInstance createNewTaskInstance(ISelection task) { 1300 return taskFactory.createNewTaskInstance(task); 1301 } 1302 1303 /** 1304 * 1305 */ 1306 private IIterationInstance createNewTaskInstance(IIteration task) { 1307 return taskFactory.createNewTaskInstance(task); 1308 } 1309 1310 /** 1311 * 1312 */ 1313 private IOptionalInstance createNewTaskInstance(IOptional task) { 1314 return taskFactory.createNewTaskInstance(task); 1315 } 1316 1246 1317 }
Note: See TracChangeset
for help on using the changeset viewer.