Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRuleTest.java	(revision 1190)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRuleTest.java	(revision 1294)
@@ -22,13 +22,7 @@
 import de.ugoe.cs.autoquest.eventcore.IEventType;
 import de.ugoe.cs.autoquest.eventcore.StringEventType;
-import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;
 import de.ugoe.cs.autoquest.tasktrees.taskequality.SelectionComparisonRule;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory;
-import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder;
-import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;
 import de.ugoe.cs.autoquest.test.DummyGUIElement;
 
@@ -36,14 +30,161 @@
  * @author Patrick Harms
  */
-public class SelectionComparisonRuleTest {
-
-    /**
-     * 
-     */
-    @Test
-    public void test() {
-        ITaskFactory taskFactory = new TaskFactory();
-        ITaskBuilder treeBuilder = new TaskBuilder();
-        
+public class SelectionComparisonRuleTest extends AbstractComparisonRuleTest {
+
+    /**
+     *
+     */
+    @Test
+    public void test_isApplicable_01() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+        
+        ITask task1 = createNewSelection();
+        
+        assertTrue(rule.isApplicable(task1, task1));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_isApplicable_02() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+
+        ITask task1 = createNewSelection();
+        ITask task2 = createNewSelection();
+        
+        assertTrue(rule.isApplicable(task1, task2));
+        assertTrue(rule.isApplicable(task2, task1));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_isApplicable_03() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+
+        ITask task1 = createNewSelection();
+        ITask task2 = createNewSequence();
+        
+        assertFalse(rule.isApplicable(task1, task2));
+        assertFalse(rule.isApplicable(task2, task1));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_isApplicable_04() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+
+        ITask task1 = createNewSelection();
+        ITask task2 = createNewIteration();
+        
+        assertFalse(rule.isApplicable(task1, task2));
+        assertFalse(rule.isApplicable(task2, task1));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_isApplicable_05() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+
+        ITask task1 = createNewSelection();
+        ITask task2 = createNewOptional();
+        
+        assertFalse(rule.isApplicable(task1, task2));
+        assertFalse(rule.isApplicable(task2, task1));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_isApplicable_06() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+        
+        IEventType eventType1 = new StringEventType("eventType1");
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+
+        ITask task1 = createNewSelection();
+        ITask task2 = createNewEventTask(eventType1, eventTarget1);
+        
+        assertFalse(rule.isApplicable(task1, task2));
+        assertFalse(rule.isApplicable(task2, task1));
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_compare_01() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+        
+        ISelection selection1 = createNewSelection();
+        assertLexicallyEqual(rule, selection1, selection1);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_compare_02() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+        
+        ISelection selection1 = createNewSelection();
+        ISelection selection2 = createNewSelection();
+        
+        assertLexicallyEqual(rule, selection1, selection2);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_compare_03() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+        
+        IEventType eventType1 = new StringEventType("eventType1");
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+
+        ITask task1 = createNewEventTask(eventType1, eventTarget1);
+        
+        ISelection selection1 = createNewSelection();
+        ISelection selection2 = createNewSelection();
+        
+        addChild(selection1, task1);
+        
+        assertUnequal(rule, selection1, selection2);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_compare_04() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+        
+        IEventType eventType1 = new StringEventType("eventType1");
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+
+        ITask task1 = createNewEventTask(eventType1, eventTarget1);
+        
+        ISelection selection1 = createNewSelection();
+        ISelection selection2 = createNewSelection();
+        
+        addChild(selection1, task1);
+        addChild(selection2, task1);
+        
+        assertLexicallyEqual(rule, selection1, selection2);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_compare_05() {
         SelectionComparisonRule rule = new SelectionComparisonRule();
         
@@ -54,54 +195,44 @@
         IEventTarget eventTarget2 = new DummyGUIElement("elem2");
 
-        ITask task1 = taskFactory.createNewEventTask(eventType1, eventTarget1);
-        ITask task2 = taskFactory.createNewEventTask(eventType2, eventTarget2);
-        
-        assertFalse(rule.isApplicable(task1, task2));
-        
-        ISelection selection1 = taskFactory.createNewSelection();
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection1));
-
-        ISelection selection2 = taskFactory.createNewSelection();
-        
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2));
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1));
-        
-        treeBuilder.addChild(selection1, task1);
-        
-        assertEquals(TaskEquality.UNEQUAL, rule.compare(selection1, selection2));
-        assertEquals(TaskEquality.UNEQUAL, rule.compare(selection2, selection1));
-        
-        treeBuilder.addChild(selection2, task1);
-        
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2));
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1));
-        
-        treeBuilder.addChild(selection1, task2);
-        
-        assertEquals(TaskEquality.UNEQUAL, rule.compare(selection1, selection2));
-        assertEquals(TaskEquality.UNEQUAL, rule.compare(selection2, selection1));
-        
-        treeBuilder.addChild(selection2, task2);
-        
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2));
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1));
-        
-        ISelection selection3 = taskFactory.createNewSelection();
-        treeBuilder.addChild(selection3, task2);
-        treeBuilder.addChild(selection3, task1);
-        
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection3));
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection3, selection1));
-        
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection3));
-        assertEquals(TaskEquality.LEXICALLY_EQUAL, rule.compare(selection3, selection2));
-
-        ISequence sequence = taskFactory.createNewSequence();
-        assertFalse(rule.isApplicable(selection1, sequence));
-        assertFalse(rule.isApplicable(sequence, selection1));
-        assertFalse(rule.isApplicable(selection2, sequence));
-        assertFalse(rule.isApplicable(sequence, selection2));
-        assertFalse(rule.isApplicable(selection3, sequence));
-        assertFalse(rule.isApplicable(sequence, selection3));
+        ITask task1 = createNewEventTask(eventType1, eventTarget1);
+        ITask task2 = createNewEventTask(eventType2, eventTarget2);
+        
+        ISelection selection1 = createNewSelection();
+        ISelection selection2 = createNewSelection();
+        
+        addChild(selection1, task1);
+        addChild(selection2, task2);
+        
+        assertUnequal(rule, selection1, selection2);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_compare_06() {
+        SelectionComparisonRule rule = new SelectionComparisonRule();
+        
+        IEventType eventType1 = new StringEventType("eventType1");
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+
+        IEventType eventType2 = new StringEventType("eventType2");
+        IEventTarget eventTarget2 = new DummyGUIElement("elem2");
+
+        ITask task1 = createNewEventTask(eventType1, eventTarget1);
+        ITask task2 = createNewEventTask(eventType2, eventTarget2);
+        
+        ISelection selection1 = createNewSelection();
+        ISelection selection2 = createNewSelection();
+        
+        addChild(selection1, task1);
+        addChild(selection2, task2);
+        
+        ISelection selection3 = createNewSelection();
+        addChild(selection3, task1);
+        assertLexicallyEqual(rule, selection1, selection3);
+        
+        addChild(selection3, task2);
+        assertLexicallyEqual(rule, selection2, selection3);
     }
 
