Ignore:
Timestamp:
08/14/13 17:04:42 (11 years ago)
Author:
pharms
Message:
  • rework of task model to move event instance stuff to task instances
  • introduction of sequence, selection, iteration and optional instances
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  
    6868    public void testOneEventOnOneElement() { 
    6969        simulateEvent(new DummyInteraction("bla", 1), new DummyGUIElement("elem1")); 
    70         new TaskTreeChecker().assertTaskInstanceList 
     70        new TaskTreeChecker().assertUserSession 
    7171            ("UserSession session {" + 
    7272             "  Event bla {}" + 
     
    8686        simulateEvent(new DummyInteraction("ble", 1), eventTarget); 
    8787 
    88         new TaskTreeChecker().assertTaskInstanceList 
     88        new TaskTreeChecker().assertUserSession 
    8989            ("UserSession session {" + 
    9090             "  Event bla {}" + 
     
    114114        simulateEvent(new DummyInteraction("blum", 1), eventTarget6); 
    115115 
    116         new TaskTreeChecker(true).assertTaskInstanceList 
     116        new TaskTreeChecker(true).assertUserSession 
    117117            ("UserSession session {" + 
    118118             "  Event bla {}" + 
     
    152152        simulateEvent(new DummyInteraction("blop", 1), eventTarget6); 
    153153 
    154         new TaskTreeChecker().assertTaskInstanceList 
     154        new TaskTreeChecker().assertUserSession 
    155155            ("UserSession session {" + 
    156156             "  Event bla {}" + 
     
    181181        simulateEvent(event1, eventTarget1); 
    182182        simulateEvent(event1, eventTarget1); 
    183         new TaskTreeChecker().assertTaskInstanceList 
     183        new TaskTreeChecker().assertUserSession 
    184184            ("UserSession session {" + 
    185185             "  Iteration iteration1 {" + 
     
    201201        } 
    202202 
    203         new TaskTreeChecker().assertTaskInstanceList 
     203        new TaskTreeChecker().assertUserSession 
    204204            ("UserSession session {" + 
    205205             "  Iteration iteration1 {" + 
     
    240240        simulateEvent(event5, eventTarget1); 
    241241 
    242         new TaskTreeChecker().assertTaskInstanceList 
     242        new TaskTreeChecker().assertUserSession 
    243243            ("UserSession session {" + 
    244244             "  Event bli {}" + 
     
    285285        } 
    286286 
    287         new TaskTreeChecker(true).assertTaskInstanceList 
     287        new TaskTreeChecker(true).assertUserSession 
    288288            ("UserSession session {" + 
    289289             "  Iteration iteration2 {" + 
     
    426426        simulateEvent(event3, eventTarget1); 
    427427         
    428         new TaskTreeChecker().assertTaskInstanceList 
     428        new TaskTreeChecker().assertUserSession 
    429429            ("UserSession session {" + 
    430430             "  Iteration iteration1 {" + 
     
    459459        } 
    460460 
    461         new TaskTreeChecker().assertTaskInstanceList 
     461        new TaskTreeChecker().assertUserSession 
    462462            ("UserSession session {" + 
    463463             "  Iteration iteration1 {" + 
     
    540540        simulateEvent(event6, eventTarget1); 
    541541 
    542         new TaskTreeChecker().assertTaskInstanceList 
     542        new TaskTreeChecker().assertUserSession 
    543543            ("UserSession session {" + 
    544544             "  Event ble {}" + 
     
    610610        } 
    611611 
    612         new TaskTreeChecker().assertTaskInstanceList 
     612        new TaskTreeChecker().assertUserSession 
    613613            ("UserSession session {" + 
    614614             "  Iteration iteration3 {" + 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/EventTaskComparisonRuleTest.java

    r1146 r1294  
    2525import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2626import 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; 
    2927import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    3028 
     
    3230 * @author Patrick Harms 
    3331 */ 
    34 public class EventTaskComparisonRuleTest { 
     32public class EventTaskComparisonRuleTest extends AbstractComparisonRuleTest { 
    3533 
    3634    /** 
     
    3937    @Test 
    4038    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); 
    4844 
    4945        assertTrue(rule.isApplicable(task1, task1)); 
     
    5551    @Test 
    5652    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); 
    6458 
    6559        IEventType eventType2 = new StringEventType("eventType2"); 
    6660        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    67         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     61        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    6862 
    6963        assertTrue(rule.isApplicable(task1, task2)); 
     
    7670    @Test 
    7771    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); 
    8577        
    86         ITask selection = taskFactory.createNewSelection(); 
     78        ITask selection = createNewSelection(); 
    8779 
    8880        assertFalse(rule.isApplicable(task1, selection)); 
     
    9587    @Test 
    9688    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(); 
    10696 
    10797        assertFalse(rule.isApplicable(task1, sequence)); 
     
    114104    @Test 
    115105    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(); 
    125113 
    126114        assertFalse(rule.isApplicable(task1, iteration)); 
     
    133121    @Test 
    134122    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(); 
    144130 
    145131        assertFalse(rule.isApplicable(task1, optional)); 
     
    151137     */ 
    152138    @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 
    153251    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); 
    161257         
    162258        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, task1)); 
     
    171267    @Test 
    172268    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); 
    182276         
    183277        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(task1, task2)); 
     
    197291    @Test 
    198292    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); 
    206298         
    207299        IEventType eventType2 = new StringEventType("eventType2"); 
    208         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget1); 
     300        ITask task2 = createNewEventTask(eventType2, eventTarget1); 
    209301 
    210302        assertEquals(TaskEquality.UNEQUAL, rule.compare(task1, task2)); 
     
    224316    @Test 
    225317    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); 
    233323         
    234324        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    235         ITask task2 = taskFactory.createNewEventTask(eventType1, eventTarget2); 
     325        ITask task2 = createNewEventTask(eventType1, eventTarget2); 
    236326         
    237327        assertEquals(TaskEquality.UNEQUAL, rule.compare(task1, task2)); 
     
    252342    @Test 
    253343    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); 
    261349         
    262350        IEventType eventType2 = new StringEventType("eventType2"); 
    263351        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    264         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     352        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    265353         
    266354        assertEquals(TaskEquality.UNEQUAL, rule.compare(task1, task2)); 
     
    275363    } 
    276364 
     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 
    277529} 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/GUIEventTaskComparisonRuleTest.java

    r1146 r1294  
    4242import de.ugoe.cs.autoquest.keyboardmaps.VirtualKey; 
    4343import 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; 
    4644import 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; 
    4945import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    5046 
     
    5248 * @author Patrick Harms 
    5349 */ 
    54 public class GUIEventTaskComparisonRuleTest { 
     50public class GUIEventTaskComparisonRuleTest extends AbstractComparisonRuleTest { 
    5551 
    5652    /** 
     
    5955    @Test 
    6056    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); 
    6862 
    6963        assertTrue(rule.isApplicable(task1, task1)); 
     
    7569    @Test 
    7670    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); 
    8476 
    8577        IEventType eventType2 = new StringEventType("eventType2"); 
    8678        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    87         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     79        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    8880 
    8981        assertTrue(rule.isApplicable(task1, task2)); 
     
    9688    @Test 
    9789    public void test_isApplicable_03() { 
    98         ITaskFactory taskFactory = new TaskFactory(); 
    99  
    10090        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    10191 
    10292        IEventType eventType1 = new KeyboardFocusChange(); 
    10393        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    104         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     94        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    10595 
    10696        IEventType eventType2 = new KeyboardFocusChange(); 
    10797        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    108         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     98        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    10999 
    110100        assertTrue(rule.isApplicable(task1, task2)); 
     
    117107    @Test 
    118108    public void test_isApplicable_04() { 
    119         ITaskFactory taskFactory = new TaskFactory(); 
    120  
    121109        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    122110 
    123111        IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 
    124112        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    125         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     113        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    126114 
    127115        IEventType eventType2 = new KeyReleased(VirtualKey.LETTER_B); 
    128116        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    129         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     117        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    130118 
    131119        assertTrue(rule.isApplicable(task1, task2)); 
     
    138126    @Test 
    139127    public void test_isApplicable_05() { 
    140         ITaskFactory taskFactory = new TaskFactory(); 
    141  
    142128        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    143129 
    144130        IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_C); 
    145131        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    146         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     132        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    147133 
    148134        IEventType eventType2 = new KeyTyped(VirtualKey.LETTER_D); 
    149135        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    150         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     136        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    151137 
    152138        assertTrue(rule.isApplicable(task1, task2)); 
     
    159145    @Test 
    160146    public void test_isApplicable_06() { 
    161         ITaskFactory taskFactory = new TaskFactory(); 
    162  
    163147        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    164148 
    165149        IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 5, 6); 
    166150        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    167         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     151        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    168152 
    169153        IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.MIDDLE, 3, 1); 
    170154        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    171         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     155        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    172156 
    173157        assertTrue(rule.isApplicable(task1, task2)); 
     
    180164    @Test 
    181165    public void test_isApplicable_07() { 
    182         ITaskFactory taskFactory = new TaskFactory(); 
    183  
    184166        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    185167 
    186168        IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.RIGHT, 4, 7); 
    187169        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    188         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     170        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    189171 
    190172        IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.X, 9, 12); 
    191173        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    192         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     174        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    193175 
    194176        assertTrue(rule.isApplicable(task1, task2)); 
     
    201183    @Test 
    202184    public void test_isApplicable_08() { 
    203         ITaskFactory taskFactory = new TaskFactory(); 
    204  
    205185        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    206186 
    207187        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    208188        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    209         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     189        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    210190 
    211191        IEventType eventType2 = new MouseDragAndDrop(5, 6, 7, 8); 
    212192        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    213         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     193        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    214194 
    215195        assertTrue(rule.isApplicable(task1, task2)); 
     
    222202    @Test 
    223203    public void test_isApplicable_09() { 
    224         ITaskFactory taskFactory = new TaskFactory(); 
    225  
    226204        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    227205 
    228206        IEventType eventType1 = new Scroll(1, 2); 
    229207        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    230         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     208        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    231209 
    232210        IEventType eventType2 = new Scroll(3, 4); 
    233211        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    234         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     212        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    235213 
    236214        assertTrue(rule.isApplicable(task1, task2)); 
     
    243221    @Test 
    244222    public void test_isApplicable_10() { 
    245         ITaskFactory taskFactory = new TaskFactory(); 
    246  
    247223        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    248224 
     
    250226        IEventType eventType1 = new TextInput("text1", inputEvents); 
    251227        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    252         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     228        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    253229 
    254230        IEventType eventType2 = new TextInput("text2", inputEvents); 
    255231        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    256         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     232        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    257233 
    258234        assertTrue(rule.isApplicable(task1, task2)); 
     
    265241    @Test 
    266242    public void test_isApplicable_11() { 
    267         ITaskFactory taskFactory = new TaskFactory(); 
    268  
    269243        EventTaskComparisonRule rule = new EventTaskComparisonRule(); 
    270244 
    271245        IEventType eventType1 = new TextSelection(); 
    272246        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    273         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     247        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    274248 
    275249        IEventType eventType2 = new ValueSelection<String>("value"); 
    276250        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    277         ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2); 
     251        ITask task2 = createNewEventTask(eventType2, eventTarget2); 
    278252 
    279253        assertTrue(rule.isApplicable(task1, task2)); 
     
    286260    @Test 
    287261    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(); 
    297269 
    298270        assertFalse(rule.isApplicable(task1, selection)); 
     
    305277    @Test 
    306278    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(); 
    316286 
    317287        assertFalse(rule.isApplicable(task1, sequence)); 
     
    324294    @Test 
    325295    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(); 
    335303 
    336304        assertFalse(rule.isApplicable(task1, iteration)); 
     
    343311    @Test 
    344312    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(); 
    354320 
    355321        assertFalse(rule.isApplicable(task1, optional)); 
     
    357323    } 
    358324 
     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 
    359626    /** 
    360627     * 
     
    362629    @Test 
    363630    public void test_compare_KeyboardFocusChange_01() { 
    364         ITaskFactory taskFactory = new TaskFactory(); 
    365          
    366631        IEventType eventType1 = new KeyboardFocusChange(); 
    367632        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); 
    371636    } 
    372637 
     
    376641    @Test 
    377642    public void test_compare_KeyboardFocusChange_02() { 
    378         ITaskFactory taskFactory = new TaskFactory(); 
    379          
    380643        IEventType eventType1 = new KeyboardFocusChange(); 
    381644        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    382         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     645        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    383646 
    384647        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); 
    388651    } 
    389652 
     
    393656    @Test 
    394657    public void test_compare_KeyboardFocusChange_03() { 
    395         ITaskFactory taskFactory = new TaskFactory(); 
    396          
    397658        IEventType eventType1 = new KeyboardFocusChange(); 
    398659        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    399         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     660        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    400661 
    401662        IEventType eventType2 = new KeyboardFocusChange(); 
    402663        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); 
    406667    } 
    407668 
     
    411672    @Test 
    412673    public void test_compare_KeyPressed_01() { 
    413         ITaskFactory taskFactory = new TaskFactory(); 
    414          
    415674        IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 
    416675        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); 
    420679    } 
    421680 
     
    425684    @Test 
    426685    public void test_compare_KeyPressed_02() { 
    427         ITaskFactory taskFactory = new TaskFactory(); 
    428          
    429686        IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 
    430687        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    431         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     688        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    432689         
    433690        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); 
    437694    } 
    438695 
     
    442699    @Test 
    443700    public void test_compare_KeyPressed_03() { 
    444         ITaskFactory taskFactory = new TaskFactory(); 
    445          
    446701        IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 
    447702        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    448         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     703        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    449704         
    450705        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); 
    454709    } 
    455710 
     
    459714    @Test 
    460715    public void test_compare_KeyPressed_04() { 
    461         ITaskFactory taskFactory = new TaskFactory(); 
    462          
    463716        IEventType eventType1 = new KeyPressed(VirtualKey.LETTER_A); 
    464717        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    465         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     718        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    466719         
    467720        IEventType eventType2 = new KeyPressed(VirtualKey.LETTER_A); 
    468721        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); 
    472725    } 
    473726     
     
    477730    @Test 
    478731    public void test_compare_KeyReleased_01() { 
    479         ITaskFactory taskFactory = new TaskFactory(); 
    480          
    481732        IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 
    482733        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); 
    486737    } 
    487738 
     
    491742    @Test 
    492743    public void test_compare_KeyReleased_02() { 
    493         ITaskFactory taskFactory = new TaskFactory(); 
    494          
    495744        IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 
    496745        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    497         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     746        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    498747         
    499748        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); 
    503752    } 
    504753 
     
    508757    @Test 
    509758    public void test_compare_KeyReleased_03() { 
    510         ITaskFactory taskFactory = new TaskFactory(); 
    511          
    512759        IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 
    513760        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    514         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     761        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    515762         
    516763        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); 
    520767    } 
    521768 
     
    525772    @Test 
    526773    public void test_compare_KeyReleased_04() { 
    527         ITaskFactory taskFactory = new TaskFactory(); 
    528          
    529774        IEventType eventType1 = new KeyReleased(VirtualKey.LETTER_A); 
    530775        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    531         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     776        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    532777         
    533778        IEventType eventType2 = new KeyReleased(VirtualKey.LETTER_A); 
    534779        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); 
    538783    } 
    539784     
     
    543788    @Test 
    544789    public void test_compare_KeyTyped_01() { 
    545         ITaskFactory taskFactory = new TaskFactory(); 
    546          
    547790        IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 
    548791        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); 
    552795    } 
    553796 
     
    557800    @Test 
    558801    public void test_compare_KeyTyped_02() { 
    559         ITaskFactory taskFactory = new TaskFactory(); 
    560          
    561802        IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 
    562803        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    563         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     804        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    564805         
    565806        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); 
    569810    } 
    570811 
     
    574815    @Test 
    575816    public void test_compare_KeyTyped_03() { 
    576         ITaskFactory taskFactory = new TaskFactory(); 
    577          
    578817        IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 
    579818        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    580         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     819        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    581820         
    582821        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); 
    586825    } 
    587826 
     
    591830    @Test 
    592831    public void test_compare_KeyTyped_04() { 
    593         ITaskFactory taskFactory = new TaskFactory(); 
    594          
    595832        IEventType eventType1 = new KeyTyped(VirtualKey.LETTER_A); 
    596833        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    597         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     834        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    598835         
    599836        IEventType eventType2 = new KeyTyped(VirtualKey.LETTER_A); 
    600837        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); 
    604841    } 
    605842     
     
    609846    @Test 
    610847    public void test_compare_MouseButtonDown_01() { 
    611         ITaskFactory taskFactory = new TaskFactory(); 
    612          
    613848        IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 
    614849        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); 
    618853    } 
    619854 
     
    623858    @Test 
    624859    public void test_compare_MouseButtonDown_02() { 
    625         ITaskFactory taskFactory = new TaskFactory(); 
    626          
    627860        IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 
    628861        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    629         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     862        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    630863         
    631864        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); 
    635868    } 
    636869 
     
    640873    @Test 
    641874    public void test_compare_MouseButtonDown_03() { 
    642         ITaskFactory taskFactory = new TaskFactory(); 
    643          
    644875        IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 
    645876        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    646         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     877        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    647878         
    648879        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); 
    652883    } 
    653884 
     
    657888    @Test 
    658889    public void test_compare_MouseButtonDown_04() { 
    659         ITaskFactory taskFactory = new TaskFactory(); 
    660          
    661890        IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 
    662891        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    663         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     892        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    664893         
    665894        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); 
    669898    } 
    670899 
     
    674903    @Test 
    675904    public void test_compare_MouseButtonDown_05() { 
    676         ITaskFactory taskFactory = new TaskFactory(); 
    677          
    678905        IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 
    679906        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    680         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     907        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    681908         
    682909        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); 
    686913    } 
    687914     
     
    691918    @Test 
    692919    public void test_compare_MouseButtonDown_06() { 
    693         ITaskFactory taskFactory = new TaskFactory(); 
    694          
    695920        IEventType eventType1 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 
    696921        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    697         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     922        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    698923         
    699924        IEventType eventType2 = new MouseButtonDown(MouseButtonInteraction.Button.LEFT, 1, 2); 
    700925        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); 
    704929    } 
    705930     
     
    709934    @Test 
    710935    public void test_compare_MouseButtonUp_01() { 
    711         ITaskFactory taskFactory = new TaskFactory(); 
    712          
    713936        IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 
    714937        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); 
    718941    } 
    719942 
     
    723946    @Test 
    724947    public void test_compare_MouseButtonUp_02() { 
    725         ITaskFactory taskFactory = new TaskFactory(); 
    726          
    727948        IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 
    728949        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    729         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     950        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    730951         
    731952        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); 
    735956    } 
    736957 
     
    740961    @Test 
    741962    public void test_compare_MouseButtonUp_03() { 
    742         ITaskFactory taskFactory = new TaskFactory(); 
    743          
    744963        IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 
    745964        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    746         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     965        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    747966         
    748967        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); 
    752971    } 
    753972 
     
    757976    @Test 
    758977    public void test_compare_MouseButtonUp_04() { 
    759         ITaskFactory taskFactory = new TaskFactory(); 
    760          
    761978        IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 
    762979        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    763         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     980        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    764981         
    765982        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); 
    769986    } 
    770987 
     
    774991    @Test 
    775992    public void test_compare_MouseButtonUp_05() { 
    776         ITaskFactory taskFactory = new TaskFactory(); 
    777          
    778993        IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 
    779994        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    780         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     995        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    781996         
    782997        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); 
    7861001    } 
    7871002     
     
    7911006    @Test 
    7921007    public void test_compare_MouseButtonUp_06() { 
    793         ITaskFactory taskFactory = new TaskFactory(); 
    794          
    7951008        IEventType eventType1 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 
    7961009        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    797         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1010        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    7981011         
    7991012        IEventType eventType2 = new MouseButtonUp(MouseButtonInteraction.Button.LEFT, 1, 2); 
    8001013        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); 
    8041017    } 
    8051018     
     
    8091022    @Test 
    8101023    public void test_compare_MouseClick_01() { 
    811         ITaskFactory taskFactory = new TaskFactory(); 
    812          
    8131024        IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    8141025        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); 
    8181029    } 
    8191030 
     
    8231034    @Test 
    8241035    public void test_compare_MouseClick_02() { 
    825         ITaskFactory taskFactory = new TaskFactory(); 
    826          
    8271036        IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    8281037        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    829         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1038        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    8301039         
    8311040        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); 
    8351044    } 
    8361045 
     
    8401049    @Test 
    8411050    public void test_compare_MouseClick_03() { 
    842         ITaskFactory taskFactory = new TaskFactory(); 
    843          
    8441051        IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    8451052        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    846         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1053        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    8471054         
    8481055        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); 
    8521059    } 
    8531060 
     
    8571064    @Test 
    8581065    public void test_compare_MouseClick_04() { 
    859         ITaskFactory taskFactory = new TaskFactory(); 
    860          
    8611066        IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    8621067        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    863         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1068        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    8641069         
    8651070        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); 
    8691074    } 
    8701075 
     
    8741079    @Test 
    8751080    public void test_compare_MouseClick_05() { 
    876         ITaskFactory taskFactory = new TaskFactory(); 
    877          
    8781081        IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    8791082        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    880         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1083        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    8811084         
    8821085        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); 
    8861089    } 
    8871090     
     
    8911094    @Test 
    8921095    public void test_compare_MouseClick_06() { 
    893         ITaskFactory taskFactory = new TaskFactory(); 
    894          
    8951096        IEventType eventType1 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    8961097        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    897         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1098        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    8981099         
    8991100        IEventType eventType2 = new MouseClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    9001101        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); 
    9041105    } 
    9051106     
     
    9091110    @Test 
    9101111    public void test_compare_MouseDoubleClick_01() { 
    911         ITaskFactory taskFactory = new TaskFactory(); 
    912          
    9131112        IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    9141113        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); 
    9181117    } 
    9191118 
     
    9231122    @Test 
    9241123    public void test_compare_MouseDoubleClick_02() { 
    925         ITaskFactory taskFactory = new TaskFactory(); 
    926          
    9271124        IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    9281125        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    929         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1126        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    9301127         
    9311128        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); 
    9351132    } 
    9361133 
     
    9401137    @Test 
    9411138    public void test_compare_MouseDoubleClick_03() { 
    942         ITaskFactory taskFactory = new TaskFactory(); 
    943          
    9441139        IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    9451140        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    946         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1141        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    9471142         
    9481143        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); 
    9521147    } 
    9531148 
     
    9571152    @Test 
    9581153    public void test_compare_MouseDoubleClick_04() { 
    959         ITaskFactory taskFactory = new TaskFactory(); 
    960          
    9611154        IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    9621155        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    963         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1156        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    9641157         
    9651158        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); 
    9691162    } 
    9701163 
     
    9741167    @Test 
    9751168    public void test_compare_MouseDoubleClick_05() { 
    976         ITaskFactory taskFactory = new TaskFactory(); 
    977          
    9781169        IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    9791170        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    980         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1171        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    9811172         
    9821173        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); 
    9861177    } 
    9871178     
     
    9911182    @Test 
    9921183    public void test_compare_MouseDoubleClick_06() { 
    993         ITaskFactory taskFactory = new TaskFactory(); 
    994          
    9951184        IEventType eventType1 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    9961185        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    997         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1186        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    9981187         
    9991188        IEventType eventType2 = new MouseDoubleClick(MouseButtonInteraction.Button.LEFT, 1, 2); 
    10001189        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); 
    10041193    } 
    10051194     
     
    10091198    @Test 
    10101199    public void test_compare_MouseDragAndDrop_01() { 
    1011         ITaskFactory taskFactory = new TaskFactory(); 
    1012          
    10131200        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    10141201        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); 
    10181205    } 
    10191206 
     
    10231210    @Test 
    10241211    public void test_compare_MouseDragAndDrop_02() { 
    1025         ITaskFactory taskFactory = new TaskFactory(); 
    1026          
    10271212        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    10281213        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1029         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1214        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    10301215         
    10311216        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); 
    10351220    } 
    10361221 
     
    10401225    @Test 
    10411226    public void test_compare_MouseDragAndDrop_03() { 
    1042         ITaskFactory taskFactory = new TaskFactory(); 
    1043          
    10441227        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    10451228        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1046         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1229        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    10471230         
    10481231        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); 
    10521235    } 
    10531236 
     
    10571240    @Test 
    10581241    public void test_compare_MouseDragAndDrop_04() { 
    1059         ITaskFactory taskFactory = new TaskFactory(); 
    1060          
    10611242        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    10621243        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1063         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1244        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    10641245         
    10651246        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); 
    10691250    } 
    10701251 
     
    10741255    @Test 
    10751256    public void test_compare_MouseDragAndDrop_05() { 
    1076         ITaskFactory taskFactory = new TaskFactory(); 
    1077          
    10781257        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    10791258        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1080         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1259        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    10811260         
    10821261        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); 
    10861265    } 
    10871266 
     
    10911270    @Test 
    10921271    public void test_compare_MouseDragAndDrop_06() { 
    1093         ITaskFactory taskFactory = new TaskFactory(); 
    1094          
    10951272        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    10961273        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1097         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1274        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    10981275         
    10991276        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); 
    11031280    } 
    11041281 
     
    11081285    @Test 
    11091286    public void test_compare_MouseDragAndDrop_07() { 
    1110         ITaskFactory taskFactory = new TaskFactory(); 
    1111          
    11121287        IEventType eventType1 = new MouseDragAndDrop(1, 2, 3, 4); 
    11131288        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1114         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1289        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    11151290         
    11161291        IEventType eventType2 = new MouseDragAndDrop(1, 2, 3, 4); 
    11171292        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); 
    11211296    } 
    11221297 
     
    11261301    @Test 
    11271302    public void test_compare_Scroll_01() { 
    1128         ITaskFactory taskFactory = new TaskFactory(); 
    1129          
    11301303        IEventType eventType1 = new Scroll(1, 2); 
    11311304        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); 
    11351308    } 
    11361309 
     
    11401313    @Test 
    11411314    public void test_compare_Scroll_02() { 
    1142         ITaskFactory taskFactory = new TaskFactory(); 
    1143          
    11441315        IEventType eventType1 = new Scroll(1, 2); 
    11451316        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1146         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1317        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    11471318         
    11481319        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); 
    11521323    } 
    11531324 
     
    11571328    @Test 
    11581329    public void test_compare_Scroll_03() { 
    1159         ITaskFactory taskFactory = new TaskFactory(); 
    1160          
    11611330        IEventType eventType1 = new Scroll(1, 2); 
    11621331        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1163         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1332        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    11641333         
    11651334        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); 
    11691338    } 
    11701339 
     
    11741343    @Test 
    11751344    public void test_compare_Scroll_04() { 
    1176         ITaskFactory taskFactory = new TaskFactory(); 
    1177          
    11781345        IEventType eventType1 = new Scroll(1, 2); 
    11791346        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1180         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1347        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    11811348         
    11821349        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); 
    11861353    } 
    11871354 
     
    11911358    @Test 
    11921359    public void test_compare_Scroll_05() { 
    1193         ITaskFactory taskFactory = new TaskFactory(); 
    1194          
    11951360        IEventType eventType1 = new Scroll(1, 2); 
    11961361        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1197         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1362        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    11981363         
    11991364        IEventType eventType2 = new Scroll(1, 2); 
    12001365        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); 
    12041369    } 
    12051370     
     
    12091374    @Test 
    12101375    public void test_compare_TextInput_01() { 
    1211         ITaskFactory taskFactory = new TaskFactory(); 
    1212          
    12131376        IEventType eventType1 = new StringEventType("eventType1"); 
    12141377        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
     
    12161379        textInputEvents1.add(new Event(eventType1, eventTarget1)); 
    12171380        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); 
    12211384    } 
    12221385     
     
    12261389    @Test 
    12271390    public void test_compare_TextInput_02() { 
    1228         ITaskFactory taskFactory = new TaskFactory(); 
    1229          
    12301391        IEventType eventType1 = new StringEventType("eventType1"); 
    12311392        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
     
    12331394        textInputEvents1.add(new Event(eventType1, eventTarget1)); 
    12341395        eventType1 = new TextInput("enteredText1", textInputEvents1); 
    1235         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1396        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    12361397         
    12371398        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); 
    12411402    } 
    12421403     
     
    12461407    @Test 
    12471408    public void test_compare_TextInput_03() { 
    1248         ITaskFactory taskFactory = new TaskFactory(); 
    1249          
    12501409        IEventType eventType1 = new StringEventType("eventType1"); 
    12511410        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
     
    12531412        textInputEvents1.add(new Event(eventType1, eventTarget1)); 
    12541413        eventType1 = new TextInput("enteredText1", textInputEvents1); 
    1255         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1414        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    12561415         
    12571416        IEventType eventType2 = new StringEventType("eventType2"); 
     
    12591418        textInputEvents2.add(new Event(eventType2, eventTarget1)); 
    12601419        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); 
    12641423    } 
    12651424     
     
    12691428    @Test 
    12701429    public void test_compare_TextInput_04() { 
    1271         ITaskFactory taskFactory = new TaskFactory(); 
    1272          
    12731430        IEventType eventType1 = new StringEventType("eventType1"); 
    12741431        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
     
    12761433        textInputEvents1.add(new Event(eventType1, eventTarget1)); 
    12771434        eventType1 = new TextInput("enteredText1", textInputEvents1); 
    1278         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1435        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    12791436         
    12801437        IEventType eventType2 = new StringEventType("eventType2"); 
     
    12821439        textInputEvents2.add(new Event(eventType2, eventTarget1)); 
    12831440        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); 
    12871444    } 
    12881445     
     
    12921449    @Test 
    12931450    public void test_compare_TextInput_05() { 
    1294         ITaskFactory taskFactory = new TaskFactory(); 
    1295          
    12961451        IEventType eventType1 = new StringEventType("eventType1"); 
    12971452        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
     
    12991454        textInputEvents1.add(new Event(eventType1, eventTarget1)); 
    13001455        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); 
    13071462    } 
    13081463 
     
    13121467    @Test 
    13131468    public void test_compare_TextSelection_01() { 
    1314         ITaskFactory taskFactory = new TaskFactory(); 
    1315          
    13161469        IEventType eventType1 = new TextSelection(); 
    13171470        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); 
    13211474    } 
    13221475 
     
    13261479    @Test 
    13271480    public void test_compare_TextSelection_02() { 
    1328         ITaskFactory taskFactory = new TaskFactory(); 
    1329          
    13301481        IEventType eventType1 = new TextSelection(); 
    13311482        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1332         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1483        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    13331484 
    13341485        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); 
    13381489    } 
    13391490 
     
    13431494    @Test 
    13441495    public void test_compare_TextSelection_03() { 
    1345         ITaskFactory taskFactory = new TaskFactory(); 
    1346          
    13471496        IEventType eventType1 = new TextSelection(); 
    13481497        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1349         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1498        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    13501499 
    13511500        IEventType eventType2 = new TextSelection(); 
    13521501        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); 
    13561505    } 
    13571506 
     
    13611510    @Test 
    13621511    public void test_compare_ValueSelection_01() { 
    1363         ITaskFactory taskFactory = new TaskFactory(); 
    1364          
    13651512        IEventType eventType1 = new ValueSelection<String>("value1"); 
    13661513        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); 
    13701517    } 
    13711518 
     
    13751522    @Test 
    13761523    public void test_compare_ValueSelection_02() { 
    1377         ITaskFactory taskFactory = new TaskFactory(); 
    1378          
    13791524        IEventType eventType1 = new ValueSelection<String>("value1"); 
    13801525        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1381         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1526        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    13821527         
    13831528        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); 
    13871532    } 
    13881533 
     
    13921537    @Test 
    13931538    public void test_compare_ValueSelection_03() { 
    1394         ITaskFactory taskFactory = new TaskFactory(); 
    1395          
    13961539        IEventType eventType1 = new ValueSelection<String>("value1"); 
    13971540        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1398         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1541        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    13991542         
    14001543        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); 
    14041547    } 
    14051548 
     
    14091552    @Test 
    14101553    public void test_compare_ValueSelection_04() { 
    1411         ITaskFactory taskFactory = new TaskFactory(); 
    1412          
    14131554        IEventType eventType1 = new ValueSelection<String>("value1"); 
    14141555        IEventTarget eventTarget1 = new DummyGUIElement("elem1"); 
    1415         ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1); 
     1556        ITask task1 = createNewEventTask(eventType1, eventTarget1); 
    14161557         
    14171558        IEventType eventType2 = new ValueSelection<String>("value1"); 
    14181559        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); 
    14901563    } 
    14911564} 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRuleTest.java

    r1190 r1294  
    2323import de.ugoe.cs.autoquest.eventcore.StringEventType; 
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.IterationComparisonRule; 
    25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2625import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
    2927import 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; 
    3328import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    3429 
     
    3631 * @author Patrick Harms 
    3732 */ 
    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          
     33public 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() { 
    48191        IterationComparisonRule rule = new IterationComparisonRule(); 
    49192         
     
    54197        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    55198 
    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); 
    112290    } 
    113291 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRuleTest.java

    r1190 r1294  
    2222import de.ugoe.cs.autoquest.eventcore.IEventType; 
    2323import de.ugoe.cs.autoquest.eventcore.StringEventType; 
    24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2524import de.ugoe.cs.autoquest.tasktrees.taskequality.SelectionComparisonRule; 
    2625import 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; 
    2926import 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; 
    3327import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    3428 
     
    3630 * @author Patrick Harms 
    3731 */ 
    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          
     32public 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() { 
    48189        SelectionComparisonRule rule = new SelectionComparisonRule(); 
    49190         
     
    54195        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    55196 
    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); 
    106237    } 
    107238 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRuleTest.java

    r1190 r1294  
    2222import de.ugoe.cs.autoquest.eventcore.IEventType; 
    2323import de.ugoe.cs.autoquest.eventcore.StringEventType; 
    24 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2524import de.ugoe.cs.autoquest.tasktrees.taskequality.SequenceComparisonRule; 
    26 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    2725import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
    28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
    2926import 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; 
    3327import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    3428 
     
    3630 * @author Patrick Harms 
    3731 */ 
    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          
     32public 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() { 
    48189        SequenceComparisonRule rule = new SequenceComparisonRule(); 
    49190         
     
    54195        IEventTarget eventTarget2 = new DummyGUIElement("elem2"); 
    55196 
    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); 
    105265    } 
    106266 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndIterationComparisonRuleTest.java

    r1190 r1294  
    2323import de.ugoe.cs.autoquest.eventcore.StringEventType; 
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndIterationComparisonRule; 
    25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2625import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    28 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
    2927import 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; 
    3328import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    3429 
     
    3631 * @author Patrick Harms 
    3732 */ 
    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)); 
     33public 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); 
    72287    } 
    73288 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRuleTest.java

    r1190 r1294  
    2323import de.ugoe.cs.autoquest.eventcore.StringEventType; 
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndSelectionComparisonRule; 
    25 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2625import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    27 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
    2826import 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; 
    3227import de.ugoe.cs.autoquest.test.DummyGUIElement; 
    3328 
     
    3530 * @author Patrick Harms 
    3631 */ 
    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)); 
     32public 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); 
    72266    } 
    73267 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java

    r1281 r1294  
    3333import de.ugoe.cs.autoquest.tasktrees.TaskTreeValidator; 
    3434import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
     35import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 
    3536import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceList; 
    3637import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
     
    7475     * 
    7576     */ 
    76     protected void applyRule(Class<? extends ITaskInstanceListScopeRule> ruleClass, 
    77                              String                                      inputSpec, 
    78                              String                                      expectedOutputSpec) 
     77    protected void applyRule(Class<? extends ITaskInstanceScopeRule> ruleClass, 
     78                             String                                  inputSpec, 
     79                             String                                  expectedOutputSpec) 
    7980    { 
    80         ITaskInstanceListScopeRule rule = null; 
     81        ITaskInstanceScopeRule rule = null; 
    8182         
    8283        CONSTRUCTOR_ITERATION: 
     
    100101             
    101102            try { 
    102                 rule = (ITaskInstanceListScopeRule) constructor.newInstance(parameters.toArray()); 
     103                rule = (ITaskInstanceScopeRule) constructor.newInstance(parameters.toArray()); 
    103104            } 
    104105            catch (IllegalArgumentException e) { 
     
    127128        RuleApplicationStatus status; 
    128129         
    129         ITaskInstanceList inputList = decoder.decode(inputSpec); 
    130          
    131         Stack<ITaskInstanceList> toBeAppliedOn = new Stack<ITaskInstanceList>(); 
     130        ITaskInstance inputList = (ITaskInstance) decoder.decode(inputSpec); 
     131         
     132        Stack<ITaskInstance> toBeAppliedOn = new Stack<ITaskInstance>(); 
    132133        toBeAppliedOn.push(inputList); 
    133134         
     
    156157        while ((!toBeAppliedOn.isEmpty()) || (status == RuleApplicationStatus.FINISHED)); 
    157158 
    158         ITaskInstanceList expectedList = decoder.decode(expectedOutputSpec); 
    159          
    160         new TaskTreeChecker().assertTaskInstanceListsEqual(expectedList, inputList); 
     159        ITaskInstance expectedList = (ITaskInstance) decoder.decode(expectedOutputSpec); 
     160         
     161        new TaskTreeChecker().assertTaskInstancesEqual(expectedList, inputList); 
    161162    } 
    162163 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrieTest.java

    r1285 r1294  
    15101510        int order = 3; 
    15111511         
    1512         TaskInstanceTrieTester tester = new TaskInstanceTrieTester(1000, 1000000, order); 
    1513  
    1514         long start = System.currentTimeMillis(); 
    1515         fixture.trainSessions(Arrays.asList(tester.userSession), order); 
    1516         System.out.println("testing session with 1000000 task 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 " + 
    15171517                           (System.currentTimeMillis() - start) + "ms"); 
    15181518         
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolBucketedMapTest.java

    r1285 r1294  
    2828import org.junit.Test; 
    2929 
     30import de.ugoe.cs.autoquest.eventcore.Event; 
    3031import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
     32import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
     33import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 
    3134import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    3235import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; 
     
    6063    @Test 
    6164    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)); 
    6467         
    6568        assertNotNull(symbolMap); 
     
    6972    @Test 
    7073    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)); 
    7376         
    7477        ITaskInstance taskInstance = createTaskInstance("symbol"); 
     
    8992    @Test 
    9093    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)); 
    9396             
    9497        ITaskInstance taskInstance = createTaskInstance("symbol"); 
     
    102105    @Test 
    103106    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)); 
    106109         
    107110        int entryCount = 2000; 
     
    122125    @Test 
    123126    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)); 
    126129         
    127130        int entryCount = 2000; 
     
    148151    @Test(expected = java.lang.IllegalArgumentException.class) 
    149152    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)); 
    152155             
    153156        symbolMap.addSymbol(null, null); 
     
    156159    @Test 
    157160    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)); 
    160163             
    161164        assertEquals(0, symbolMap.size()); 
     
    164167    @Test 
    165168    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)); 
    168171             
    169172        symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    174177    @Test 
    175178    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)); 
    178181         
    179182        int entryCount = 2000; 
     
    188191    @Test 
    189192    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)); 
    192195         
    193196        int entryCount = 2000; 
     
    207210    @Test 
    208211    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)); 
    211214         
    212215        int entryCount = 2000; 
     
    225228    @Test 
    226229    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)); 
    229232             
    230233        assertTrue(symbolMap.isEmpty()); 
     
    233236    @Test 
    234237    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)); 
    237240             
    238241        symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    243246    @Test 
    244247    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)); 
    247250         
    248251        int entryCount = 2000; 
     
    257260    @Test 
    258261    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)); 
    261264         
    262265        int entryCount = 2000; 
     
    276279    @Test 
    277280    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)); 
    280283         
    281284        int entryCount = 2000; 
     
    294297    @Test 
    295298    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)); 
    298301             
    299302        assertFalse(symbolMap.containsSymbol(createTaskInstance("symbol"))); 
     
    302305    @Test 
    303306    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)); 
    306309             
    307310        symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    312315    @Test 
    313316    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)); 
    316319         
    317320        int entryCount = 2000; 
     
    328331    @Test 
    329332    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)); 
    332335         
    333336        int entryCount = 2000; 
     
    349352    @Test 
    350353    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)); 
    353356         
    354357        int entryCount = 2000; 
     
    377380    @Test(expected = java.lang.IllegalArgumentException.class) 
    378381    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)); 
    381384             
    382385        symbolMap.containsSymbol(null); 
     
    385388    @Test 
    386389    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)); 
    389392             
    390393        assertNull(symbolMap.getValue(createTaskInstance("symbol"))); 
     
    393396    @Test 
    394397    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)); 
    397400             
    398401        symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    403406    @Test 
    404407    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)); 
    407410             
    408411        symbolMap.addSymbol(createTaskInstance("symbol1"), null); 
     
    413416    @Test 
    414417    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)); 
    417420         
    418421        int entryCount = 2000; 
     
    429432    @Test 
    430433    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)); 
    433436         
    434437        int entryCount = 2000; 
     
    455458    @Test 
    456459    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)); 
    459462         
    460463        int entryCount = 2000; 
     
    483486    @Test(expected = java.lang.IllegalArgumentException.class) 
    484487    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)); 
    487490             
    488491        symbolMap.getValue(null); 
     
    491494    @Test 
    492495    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)); 
    495498             
    496499        assertNull(symbolMap.removeSymbol(createTaskInstance("symbol"))); 
     
    499502    @Test 
    500503    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)); 
    503506             
    504507        symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    510513    @Test 
    511514    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)); 
    514517             
    515518        symbolMap.addSymbol(createTaskInstance("symbol1"), null); 
     
    521524    @Test 
    522525    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)); 
    525528         
    526529        int entryCount = 2000; 
     
    539542    @Test 
    540543    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)); 
    543546         
    544547        int entryCount = 2000; 
     
    567570    @Test 
    568571    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)); 
    571574         
    572575        int entryCount = 2000; 
     
    597600    @Test(expected = java.lang.IllegalArgumentException.class) 
    598601    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)); 
    601604             
    602605        symbolMap.removeSymbol(null); 
     
    605608    @Test 
    606609    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)); 
    609612             
    610613        assertNotNull(symbolMap.getSymbols()); 
     
    614617    @Test 
    615618    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)); 
    618621          
    619622        ITaskInstance task = createTaskInstance("symbol1"); 
     
    627630    @Test 
    628631    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)); 
    631634             
    632635        ITaskInstance task = createTaskInstance("symbol1"); 
     
    640643    @Test 
    641644    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)); 
    644647        Set<ITaskInstance> expectedSymbols = new HashSet<ITaskInstance>(); 
    645648         
     
    667670    @Test 
    668671    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)); 
    671674        Set<ITaskInstance> expectedSymbols = new HashSet<ITaskInstance>(); 
    672675         
     
    701704    @Test 
    702705    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)); 
    705708        List<ITaskInstance> expectedSymbols = new ArrayList<ITaskInstance>(); 
    706709         
     
    732735    @Test 
    733736    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)); 
    736739             
    737740        assertNotNull(symbolMap.getValues()); 
     
    741744    @Test 
    742745    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)); 
    745748             
    746749        symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    753756    @Test 
    754757    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)); 
    757760             
    758761        symbolMap.addSymbol(createTaskInstance("symbol1"), null); 
     
    765768    @Test 
    766769    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)); 
    769772        Set<String> expectedValues = new HashSet<String>(); 
    770773         
     
    791794    @Test 
    792795    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)); 
    795798        Set<String> expectedValues = new HashSet<String>(); 
    796799         
     
    823826    @Test 
    824827    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)); 
    827830        Set<String> expectedValues = new HashSet<String>(); 
    828831         
     
    854857    @Test 
    855858    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)); 
    858861         
    859862        symbolMap.clear(); 
     
    863866    @Test 
    864867    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)); 
    867870             
    868871        symbolMap.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    874877    @Test 
    875878    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)); 
    878881             
    879882        symbolMap.addSymbol(createTaskInstance("symbol1"), null); 
     
    885888    @Test 
    886889    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)); 
    889892         
    890893        int entryCount = 2000; 
     
    900903    @Test 
    901904    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)); 
    904907         
    905908        int entryCount = 2000; 
     
    920923    @Test 
    921924    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)); 
    924927         
    925928        int entryCount = 2000; 
     
    939942    @Test 
    940943    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)); 
    946949         
    947950        assertTrue(symbolMap1.equals(symbolMap2)); 
     
    950953    @Test 
    951954    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)); 
    957960             
    958961        symbolMap1.addSymbol(createTaskInstance("symbol1"), "value1"); 
     
    963966    @Test 
    964967    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)); 
    970973         
    971974        ITaskInstance task = createTaskInstance("symbol1"); 
     
    978981    @Test 
    979982    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)); 
    982985                 
    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)); 
    985988         
    986989        int entryCount = 1000; 
     
    9971000    @Test 
    9981001    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)); 
    10011004                
    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)); 
    10041007         
    10051008        int entryCount = 1000; 
     
    10241027    @Test 
    10251028    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)); 
    10281031                 
    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)); 
    10311034         
    10321035        int entryCount = 1000; 
     
    10521055     
    10531056    /** 
    1054      * <p> 
    1055      * TODO: comment 
    1056      * </p> 
    10571057     * 
    1058      * @param string 
    1059      * @return 
    10601058     */ 
    10611059    private ITaskInstance createTaskInstance(String id) { 
    10621060        ITask task = tasks.get(id); 
    1063          
     1061        Event event = null; 
     1062        
    10641063        if (task == null) { 
    1065             task = taskFactory.createNewEventTask 
    1066                 (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            
    10681067            tasks.put(id, task); 
    10691068        } 
    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); 
    10721074    } 
    10731075 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolIdentityMapTest.java

    r1285 r1294  
    2828import org.junit.Test; 
    2929 
     30import de.ugoe.cs.autoquest.eventcore.Event; 
     31import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
     32import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 
    3033import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    3134import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; 
     
    10541057                           " took " + (System.currentTimeMillis() - start)); 
    10551058    } 
     1059     
    10561060    /** 
    1057      * <p> 
    1058      * TODO: comment 
    1059      * </p> 
    10601061     * 
    1061      * @param string 
    1062      * @return 
    10631062     */ 
    10641063    private ITaskInstance createTaskInstance(String id) { 
    10651064        ITask task = tasks.get(id); 
     1065        Event event = null; 
    10661066         
    10671067        if (task == null) { 
    1068             task = taskFactory.createNewEventTask 
    1069                 (new DummyInteraction(id, 0), new DummyGUIElement("default")); 
     1068            event = new Event(new DummyInteraction(id, 0), new DummyGUIElement("default")); 
     1069            task = taskFactory.createNewEventTask(event.toString()); 
    10701070             
    10711071            tasks.put(id, task); 
    10721072        } 
    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); 
    10751078    } 
    10761079 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModelTest.java

    r1146 r1294  
    2424import org.junit.Test; 
    2525 
     26import de.ugoe.cs.autoquest.eventcore.Event; 
    2627import de.ugoe.cs.autoquest.eventcore.IEventTarget; 
    2728import de.ugoe.cs.autoquest.eventcore.IEventType; 
    2829import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
     30import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 
    2931import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
     32import de.ugoe.cs.autoquest.tasktrees.treeifc.IIterationInstance; 
    3033import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 
     34import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptionalInstance; 
    3135import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
     36import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance; 
    3237import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
     38import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequenceInstance; 
    3339import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
    3440import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 
     
    4551 
    4652/** 
    47  * TODO comment 
    48  *  
    49  * @version $Revision: $ $Date: 02.04.2012$ 
    50  * @author 2012, last modified by $Author: patrick$ 
     53 * 
    5154 */ 
    5255public class TaskModelTest { 
     
    6972        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    7073         
    71         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     74        IEventTask task = createNewEventTask(eventType, eventTarget); 
    7275         
    7376        assertNotNull(task); 
     
    7679        assertTrue(task.equals(task)); 
    7780         
    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()); 
    8084    } 
    8185 
     
    8892        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    8993         
    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); 
    9296         
    9397        // the tasks will not be equal as they should have a different id 
     
    103107        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    104108         
    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); 
    108112         
    109113        assertFalse(taskInstance1.equals(taskInstance2)); 
     
    133137        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    134138         
    135         IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget); 
     139        IEventTask child = createNewEventTask(eventType, eventTarget); 
    136140 
    137141        ISequence task = taskFactory.createNewSequence(); 
     
    152156        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    153157         
    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); 
    159163 
    160164        ISequence task = taskFactory.createNewSequence(); 
     
    198202        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    199203         
    200         IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget); 
     204        IEventTask child = createNewEventTask(eventType, eventTarget); 
    201205 
    202206        ISelection task = taskFactory.createNewSelection(); 
     
    217221        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    218222         
    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); 
    224228 
    225229        ISelection task = taskFactory.createNewSelection(); 
     
    262266        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    263267         
    264         IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget); 
     268        IEventTask child = createNewEventTask(eventType, eventTarget); 
    265269 
    266270        IIteration task = taskFactory.createNewIteration(); 
     
    279283        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    280284         
    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); 
    283287 
    284288        IIteration task = taskFactory.createNewIteration(); 
     
    312316        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    313317         
    314         IEventTask child = taskFactory.createNewEventTask(eventType, eventTarget); 
     318        IEventTask child = createNewEventTask(eventType, eventTarget); 
    315319 
    316320        IOptional task = taskFactory.createNewOptional(); 
     
    329333        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    330334         
    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); 
    333337 
    334338        IOptional task = taskFactory.createNewOptional(); 
     
    348352        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    349353         
    350         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
    351          
    352         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
     354        IEventTask task = createNewEventTask(eventType, eventTarget); 
     355         
     356        IEventTaskInstance taskInstance = createNewTaskInstance(task); 
    353357         
    354358        assertNotNull(taskInstance); 
     
    356360        assertTrue(taskInstance.equals(taskInstance)); 
    357361        assertFalse(taskInstance.equals(task)); 
    358         assertNotNull(taskInstance.getChildren()); 
    359         assertEquals(0, taskInstance.getChildren().size()); 
    360362    } 
    361363 
     
    368370        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    369371         
    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); 
    374376         
    375377        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); 
    392378    } 
    393379 
     
    400386        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    401387         
    402         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     388        IEventTask task = createNewEventTask(eventType, eventTarget); 
    403389         
    404390        ISequence sequence = taskFactory.createNewSequence(); 
    405391         
    406         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
    407         ITaskInstance sequenceInstance = taskFactory.createNewTaskInstance(sequence); 
     392        ITaskInstance taskInstance = createNewTaskInstance(task); 
     393        ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); 
    408394         
    409395        taskBuilder.addChild(sequenceInstance, taskInstance); 
     
    418404        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    419405         
    420         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     406        IEventTask task = createNewEventTask(eventType, eventTarget); 
    421407         
    422408        ISequence sequence = taskFactory.createNewSequence(); 
    423409        taskBuilder.addChild(sequence, task); 
    424410         
    425         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
    426         ITaskInstance sequenceInstance = taskFactory.createNewTaskInstance(sequence); 
     411        ITaskInstance taskInstance = createNewTaskInstance(task); 
     412        ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); 
    427413         
    428414        taskBuilder.addChild(sequenceInstance, taskInstance); 
    429415         
    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)); 
    433418    } 
    434419 
     
    441426        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    442427         
    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); 
    448433         
    449434        ISequence sequence = taskFactory.createNewSequence(); 
     
    454439        taskBuilder.addChild(sequence, task5); 
    455440         
    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         ITaskInstance 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); 
    462447         
    463448        taskBuilder.addChild(sequenceInstance, taskInstance1); 
     
    467452        taskBuilder.addChild(sequenceInstance, taskInstance5); 
    468453         
    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)); 
    476460    } 
    477461 
     
    484468        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    485469         
    486         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     470        IEventTask task = createNewEventTask(eventType, eventTarget); 
    487471         
    488472        ISelection selection = taskFactory.createNewSelection(); 
    489473         
    490         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
    491         ITaskInstance 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); 
    494478    } 
    495479 
     
    502486        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    503487         
    504         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     488        IEventTask task = createNewEventTask(eventType, eventTarget); 
    505489         
    506490        ISelection selection = taskFactory.createNewSelection(); 
    507491        taskBuilder.addChild(selection, task); 
    508492         
    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 
    523506    public void test_SelectionInstance_03() throws Exception { 
    524507        IEventType eventType = new DummyInteraction("interaction", 1); 
    525508        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    526509         
    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); 
    532515         
    533516        ISelection selection = taskFactory.createNewSelection(); 
     
    538521        taskBuilder.addChild(selection, task5); 
    539522         
    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()); 
    546531    } 
    547532 
     
    554539        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    555540         
    556         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     541        IEventTask task = createNewEventTask(eventType, eventTarget); 
    557542         
    558543        IIteration iteration = taskFactory.createNewIteration(); 
    559544         
    560         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
    561         ITaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration); 
     545        ITaskInstance taskInstance = createNewTaskInstance(task); 
     546        IIterationInstance iterationInstance = createNewTaskInstance(iteration); 
    562547         
    563548        taskBuilder.addChild(iterationInstance, taskInstance); 
     
    572557        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    573558         
    574         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     559        IEventTask task = createNewEventTask(eventType, eventTarget); 
    575560         
    576561        IIteration iteration = taskFactory.createNewIteration(); 
    577562        taskBuilder.setMarkedTask(iteration, task); 
    578563         
    579         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
    580         ITaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration); 
     564        ITaskInstance taskInstance = createNewTaskInstance(task); 
     565        IIterationInstance iterationInstance = createNewTaskInstance(iteration); 
    581566         
    582567        taskBuilder.addChild(iterationInstance, taskInstance); 
    583568         
    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)); 
    587571    } 
    588572 
     
    595579        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    596580         
    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); 
    599583         
    600584        IIteration iteration = taskFactory.createNewIteration(); 
     
    602586        taskBuilder.setMarkedTask(iteration, task2); 
    603587         
    604         ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task1); 
    605         ITaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration); 
     588        ITaskInstance taskInstance1 = createNewTaskInstance(task1); 
     589        IIterationInstance iterationInstance = createNewTaskInstance(iteration); 
    606590         
    607591        taskBuilder.addChild(iterationInstance, taskInstance1); 
     
    616600        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    617601         
    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); 
    620604         
    621605        IIteration iteration = taskFactory.createNewIteration(); 
     
    623607        taskBuilder.setMarkedTask(iteration, task2); 
    624608         
    625         ITaskInstance taskInstance2 = taskFactory.createNewTaskInstance(task2); 
    626         ITaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration); 
     609        ITaskInstance taskInstance2 = createNewTaskInstance(task2); 
     610        IIterationInstance iterationInstance = createNewTaskInstance(iteration); 
    627611         
    628612        taskBuilder.addChild(iterationInstance, taskInstance2); 
    629613         
    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)); 
    633616    } 
    634617 
     
    641624        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    642625         
    643         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     626        IEventTask task = createNewEventTask(eventType, eventTarget); 
    644627         
    645628        IOptional optional = taskFactory.createNewOptional(); 
    646629         
    647         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
    648         ITaskInstance 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); 
    651634    } 
    652635 
     
    659642        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    660643         
    661         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     644        IEventTask task = createNewEventTask(eventType, eventTarget); 
    662645         
    663646        IOptional optional = taskFactory.createNewOptional(); 
    664647        taskBuilder.setMarkedTask(optional, task); 
    665648         
    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()); 
    674656    } 
    675657 
     
    682664        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    683665         
    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); 
    686668         
    687669        IOptional optional = taskFactory.createNewOptional(); 
     
    689671        taskBuilder.setMarkedTask(optional, task2); 
    690672         
    691         ITaskInstance taskInstance1 = taskFactory.createNewTaskInstance(task1); 
    692         ITaskInstance 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); 
    695677    } 
    696678 
     
    703685        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    704686         
    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); 
    707689         
    708690        IOptional optional = taskFactory.createNewOptional(); 
     
    710692        taskBuilder.setMarkedTask(optional, task2); 
    711693         
    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()); 
    720701    } 
    721702 
     
    740721        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    741722         
    742         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     723        IEventTask task = createNewEventTask(eventType, eventTarget); 
    743724         
    744725        IUserSession userSession = taskFactory.createUserSession(); 
    745726         
    746         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
     727        ITaskInstance taskInstance = createNewTaskInstance(task); 
    747728         
    748729        taskBuilder.addExecutedTask(userSession, taskInstance); 
     
    761742        IEventTarget eventTarget = new DummyGUIElement("elem"); 
    762743         
    763         IEventTask task = taskFactory.createNewEventTask(eventType, eventTarget); 
     744        IEventTask task = createNewEventTask(eventType, eventTarget); 
    764745        ISequence sequence = taskFactory.createNewSequence(); 
    765746        ISelection selection = taskFactory.createNewSelection(); 
     
    772753        taskBuilder.setMarkedTask(optional, task); 
    773754         
    774         ITaskInstance taskInstance = taskFactory.createNewTaskInstance(task); 
    775         ITaskInstance sequenceInstance = taskFactory.createNewTaskInstance(sequence); 
    776         ITaskInstance selectionInstance = taskFactory.createNewTaskInstance(selection); 
    777         ITaskInstance iterationInstance = taskFactory.createNewTaskInstance(iteration); 
    778         ITaskInstance 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)); 
    784765         
    785766        IUserSession userSession = taskFactory.createUserSession(); 
     
    823804            } 
    824805             
    825             ITaskInstance taskInstance = instantiateTask(task, noOfMaxChildren); 
     806            ISequenceInstance sequenceInstance = 
     807                (ISequenceInstance) instantiateTask(task, noOfMaxChildren); 
    826808             
    827809            System.err.println("  creating user session"); 
     
    829811            IUserSession session = taskFactory.createUserSession(); 
    830812             
    831             for (ITaskInstance child : taskInstance.getChildren()) { 
     813            for (ITaskInstance child : sequenceInstance) { 
    832814                taskBuilder.addExecutedTask(session, child); 
    833815            } 
     
    836818            sessions.add(session); 
    837819             
    838             ITaskModel taskTree = taskFactory.createTaskModel(sessions); 
     820            ITaskModel taskModel = taskFactory.createTaskModel(sessions); 
    839821 
    840822            System.err.println("  validating task tree"); 
    841823            Map<ITask, ITaskInfo> actualTaskInfos = new HashMap<ITask, ITaskInfo>(); 
    842824             
    843             for (ITask currentTask : taskTree.getTasks()) { 
    844                 actualTaskInfos.put(currentTask, taskTree.getTaskInfo(currentTask)); 
     825            for (ITask currentTask : taskModel.getTasks()) { 
     826                actualTaskInfos.put(currentTask, taskModel.getTaskInfo(currentTask)); 
    845827            } 
    846828             
     
    988970        Thread.sleep(2); 
    989971        long id = System.currentTimeMillis(); 
    990         IEventTask task = taskFactory.createNewEventTask 
     972        IEventTask task = createNewEventTask 
    991973            (new DummyInteraction("interaction" + id, 1), new DummyGUIElement("elem" + id)); 
    992974 
     
    10641046         
    10651047        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             
    10671054            taskBuilder.addChild(selection, child); 
    10681055        } 
     
    10991086        IIteration iteration = taskFactory.createNewIteration(); 
    11001087 
    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         
    11021094        taskBuilder.setMarkedTask(iteration, child); 
    11031095 
     
    11331125        IOptional optional = taskFactory.createNewOptional(); 
    11341126 
    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         
    11361133        taskBuilder.setMarkedTask(optional, child); 
    11371134 
     
    11931190     */ 
    11941191    private ITaskInstance instantiateTask(ITask task, int maxIterationCount) throws Exception { 
    1195         ITaskInstance instance = taskFactory.createNewTaskInstance(task); 
     1192        ITaskInstance instance = createNewTaskInstance(task); 
    11961193 
    11971194        if (task instanceof ISequence) { 
    11981195            for (ITask child : ((ISequence) task).getChildren()) { 
    1199                 taskBuilder.addChild(instance, instantiateTask(child, maxIterationCount)); 
     1196                taskBuilder.addChild 
     1197                    ((ISequenceInstance) instance, instantiateTask(child, maxIterationCount)); 
    12001198            } 
    12011199        } 
     
    12031201            List<ITask> children = ((ISelection) task).getChildren(); 
    12041202            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)); 
    12061205        } 
    12071206        else if (task instanceof IIteration) { 
     
    12101209             
    12111210            for (int i = 0; i < count; i++) { 
    1212                 taskBuilder.addChild(instance, instantiateTask(child, maxIterationCount)); 
     1211                taskBuilder.addChild 
     1212                    ((IIterationInstance) instance, instantiateTask(child, maxIterationCount)); 
    12131213            } 
    12141214        } 
     
    12171217             
    12181218            if (randomize(1) == 0) { 
    1219                 taskBuilder.addChild(instance, instantiateTask(child, maxIterationCount)); 
     1219                taskBuilder.setChild((IOptionalInstance) instance, 
     1220                                     instantiateTask(child, maxIterationCount)); 
    12201221            } 
    12211222        } 
     
    12441245        return value + min; 
    12451246    } 
     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 
    12461317} 
Note: See TracChangeset for help on using the changeset viewer.