Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java	(revision 1132)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java	(revision 1146)
@@ -17,11 +17,4 @@
 import org.junit.Test;
 
-import de.ugoe.cs.autoquest.eventcore.IEventTarget;
-import de.ugoe.cs.autoquest.eventcore.gui.IInteraction;
-import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
-import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEquality;
-import de.ugoe.cs.autoquest.test.DummyGUIElement;
-import de.ugoe.cs.autoquest.test.DummyInteraction;
-
 /**
  * TODO comment
@@ -36,67 +29,150 @@
      */
     @Test
-    public void testTaskDetection() throws Exception {
-        IEventTarget element1 = new DummyGUIElement("elem1");
-        
-        IInteraction action1 = new DummyInteraction("action1", 1);
-        IInteraction action2 = new DummyInteraction("action2", 1);
-        IInteraction action3 = new DummyInteraction("action3", 1);
-        IInteraction action4 = new DummyInteraction("action4", 1);
-        
-        simulateEvent(new DummyInteraction("noise0", 1), element1);
-        simulateEvent(action1, element1);
-        simulateEvent(action2, element1);
-        simulateEvent(action3, element1);
-        simulateEvent(action4, element1);
-        simulateEvent(new DummyInteraction("noise1", 1), element1);
-        simulateEvent(new DummyInteraction("noise2", 1), element1);
-        simulateEvent(action1, element1);
-        simulateEvent(action2, element1);
-        simulateEvent(action3, element1);
-        simulateEvent(action4, element1);
-        simulateEvent(new DummyInteraction("noise3", 1), element1);
-        simulateEvent(new DummyInteraction("noise4", 1), element1);
-        simulateEvent(new DummyInteraction("noise5", 1), element1);
-        simulateEvent(new DummyInteraction("noise6", 1), element1);
-        simulateEvent(action1, element1);
-        simulateEvent(action2, element1);
-        simulateEvent(action3, element1);
-        simulateEvent(action4, element1);
-        simulateEvent(new DummyInteraction("noise7", 1), element1);
-        simulateEvent(new DummyInteraction("noise8", 1), element1);
-        
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence root {" +
-             "  Sequence session1 {" +
-             "    Event noise0 {}" +
-             "    Sequence sequence2 {" +
-             "      Event action1 {}" +
-             "      Event action2 {}" +
-             "      Event action3 {}" +
-             "      Event action4 {}" +
-             "    }" +
-             "    Event noise1 {}" +
-             "    Event noise2 {}" +
-             "    Sequence sequence2 {" +
-             "      Event action1 {}" +
-             "      Event action2 {}" +
-             "      Event action3 {}" +
-             "      Event action4 {}" +
-             "    }" +
-             "    Event noise3 {}" +
-             "    Event noise4 {}" +
-             "    Event noise5 {}" +
-             "    Event noise6 {}" +
-             "    Sequence sequence2 {" +
-             "      Event action1 {}" +
-             "      Event action2 {}" +
-             "      Event action3 {}" +
-             "      Event action4 {}" +
-             "    }" +
-             "    Event noise7 {}" +
-             "    Event noise8 {}" +
-             "  }" +
-             "}", getTaskTree(SequenceForTaskDetectionRule.class, NodeEquality.LEXICALLY_EQUAL, true));
+    public void test_TaskDetection_01() throws Exception {
+        String input =
+            "UserSession {" +
+            "  Event noise0 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event action3 {}" +
+            "  Event action4 {}" +
+            "  Event noise1 {}" +
+            "  Event noise2 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event action3 {}" +
+            "  Event action4 {}" +
+            "  Event noise3 {}" +
+            "  Event noise4 {}" +
+            "  Event noise5 {}" +
+            "  Event noise6 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event action3 {}" +
+            "  Event action4 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event action3 {}" +
+            "  Event action4 {}" +
+            "  Event noise7 {}" +
+            "}";
 
+        String output =
+            "UserSession {" +
+            "  Event noise0 {}" +
+            "  Iteration iteration1 {" +
+            "    Sequence sequence1 {" +
+            "      Event action1 {}" +
+            "      Event action2 {}" +
+            "      Event action3 {}" +
+            "      Event action4 {}" +
+            "    }" +
+            "  }" +
+            "  Event noise1 {}" +
+            "  Event noise2 {}" +
+            "  Iteration iteration1 {" +
+            "    Sequence sequence1 {" +
+            "      Event action1 {}" +
+            "      Event action2 {}" +
+            "      Event action3 {}" +
+            "      Event action4 {}" +
+            "    }" +
+            "  }" +
+            "  Event noise3 {}" +
+            "  Event noise4 {}" +
+            "  Event noise5 {}" +
+            "  Event noise6 {}" +
+            "  Iteration iteration1 {" +
+            "    Sequence sequence1 {" +
+            "      Event action1 {}" +
+            "      Event action2 {}" +
+            "      Event action3 {}" +
+            "      Event action4 {}" +
+            "    }" +
+            "    Sequence sequence1 {" +
+            "      Event action1 {}" +
+            "      Event action2 {}" +
+            "      Event action3 {}" +
+            "      Event action4 {}" +
+            "    }" +
+            "  }" +
+            "  Event noise7 {}" +
+            "}";
+
+        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_TaskDetection_02() throws Exception {
+        String input =
+            "UserSession {" +
+            "  Event noise0 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event noise1 {}" +
+            "  Event noise2 {}" +
+            "  Event action3 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event action4 {}" +
+            "  Event noise3 {}" +
+            "  Event noise4 {}" +
+            "  Event noise5 {}" +
+            "  Event noise6 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event action3 {}" +
+            "  Event action4 {}" +
+            "  Event action1 {}" +
+            "  Event action2 {}" +
+            "  Event action3 {}" +
+            "  Event action4 {}" +
+            "  Event noise7 {}" +
+            "}";
+
+        String output =
+            "UserSession {" +
+            "  Event noise0 {}" +
+            "  Sequence sequence1 {" +
+            "    Event action1 {}" +
+            "    Event action2 {}" +
+            "  }" +
+            "  Event noise1 {}" +
+            "  Event noise2 {}" +
+            "  Event action3 {}" +
+            "  Sequence sequence1 {" +
+            "    Event action1 {}" +
+            "    Event action2 {}" +
+            "  }" +
+            "  Event action4 {}" +
+            "  Event noise3 {}" +
+            "  Event noise4 {}" +
+            "  Event noise5 {}" +
+            "  Event noise6 {}" +
+            "  Iteration iteration1 {" +
+            "    Sequence sequence3 {" +
+            "      Sequence sequence1 {" +
+            "        Event action1 {}" +
+            "        Event action2 {}" +
+            "      }" +
+            "      Event action3 {}" +
+            "      Event action4 {}" +
+            "    }" +
+            "    Sequence sequence3 {" +
+            "      Sequence sequence1 {" +
+            "        Event action1 {}" +
+            "        Event action2 {}" +
+            "      }" +
+            "      Event action3 {}" +
+            "      Event action4 {}" +
+            "    }" +
+            "  }" +
+            "  Event noise7 {}" +
+            "}";
+
+        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
     }
 
