Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsPatternTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsPatternTest.java	(revision 1152)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsPatternTest.java	(revision 1171)
@@ -16,5 +16,4 @@
 
 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT;
-import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION;
 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SELECTION;
 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE;
@@ -23,8 +22,8 @@
 import org.junit.Test;
 
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern;
 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternBuilder;
-import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil;
+import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskModelUtil;
 
 /**
@@ -37,14 +36,18 @@
 public class ContainsPatternTest {
 
-    @Test
-    public void sequence_ends_with_positive_1() {
+	@Test
+    public void contains_pattern_positive() {
         // Given
-        String spec = "Sequence {" +
-        	      "  Selection {" + 
-                      "    TextInput () {}" +
-                      "    MouseClick () {}" +
+        String spec = "UserSession {" +
+                      "  Sequence seq1 {" +
+        	          "    Selection sel1 {" + 
+                      "      TextInput t1 {}" +
+                      "    }" +
+                      "    Selection sel1 {" +
+                      "      MouseClick t2 {}" +
+                      "    }" +
                       "  }" + 
                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        ITaskModel taskTree = GenerateTaskModelUtil.getTaskModelFromSpec(spec);
         UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
         UsagePattern containsPattern = patternBuilder.concernedNode(SELECTION).startsWith(TEXT_INPUT).endsWith(TEXT_INPUT).build();
@@ -57,317 +60,23 @@
     
     @Test
-    public void sequence_ends_with_positive_2() {
+    public void contains_pattern_negative() {
         // Given
-        String spec = "Selection {" +
-                      "  EventTask target1 {}" +
-                      "  Sequence {" +
-                      "    EventTask target2 {}" +
-                      "    TextInput target3 {}" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void sequence_ends_with_positive_3() {
-        // Given
-        String spec =  "Sequence {" +
-                       "  Optional {" +
-                       "    Sequence {" +
-                       "      EventTask target4 {}" +
-                       "      EventTask target3 {}" +
-                       "    }" +
-                       "  }" +
-                       "  EventTask target1 {}" +
-                       "  EventTask target2 {}" +
-                       "  EventTask target3 {}" +
-                       "  EventTask target4 {}" +
-                       "  Selection {" +
-                       "    EventTask target5 {}" +
-                       "    Sequence {" +
-                       "      EventTask target4 {}" +
-                       "      EventTask target2 {}" +
-                       "    }" +
-                       "  }" +
-                       "  EventTask target6 {}" +
-                       "  TextInput target7 {}" +
-                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-   
-    @Test
-    public void sequence_ends_with_negative_1() {
-        // Given
-        String spec = "Sequence {" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void sequence_ends_with_negative_2() {
-        // Given
-        String spec = "Selection {" +
-                      "  Sequence {" +
-                      "    EventTask target1 {}" +
-                      "    EventTask target2 {}" +
-                      "  }" +
-                      "  Sequence {" +
-                      "    EventTask target3 {}" +
-                      "    EventTask target4 {}" +
-                      "  }" +
-                      "  Sequence {" +
-                      "    EventTask target5 {}" +
-                      "    EventTask target6 {}" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void sequence_ends_with_negative_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    EventTask target2 {}" +
-                      "    EventTask target3 {}" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_ends_with_positive_1() {
-        // Given
-        String spec = "Iteration {" + 
-                      "  TextInput () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_ends_with_positive_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Sequence {" +
-                      "    EventTask target1 {}" +
-                      "    Selection {" +
-                      "      EventTask target2 {}" +
-                      "      TextInput target2 {}" +
+        String spec = "UserSession {" +
+                      "  Iteration it1 {" +
+                      "    Selection sel1 {" +
+                      "      Sequence seq1 {" +
+                      "        EventTask t1 {}" +
+                      "        EventTask t2 {}" +
+                      "      }" +
+                      "    }" +
+                      "    Selection sel1 {" +
+                      "      Sequence seq2 {" +
+                      "        EventTask t2 {}" +
+                      "        EventTask t1 {}" +
+                      "      }" +
                       "    }" +
                       "  }" +
                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_ends_with_positive_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    TextInput target1 {}" +
-                      "    Sequence {" +
-                      "      EventTask target2 {}" +
-                      "      EventTask target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_ends_with_negative_1() {
-        // Given
-        String spec = "Iteration {" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_ends_with_negative_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Sequence {" +
-                      "    EventTask target1 {}" +
-                      "    Optional {" +
-                      "      EventTask target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_ends_with_negative_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    EventTask target1 {}" +
-                      "    Sequence {" +
-                      "      EventTask target2 {}" +
-                      "      EventTask target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void selection_ends_with_positive_1() {
-        // Given
-        String spec = "Selection {" + 
-                      "  MouseClick () {}" + 
-                      "  TextInput () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_ends_with_positive_2() {
-        // Given
-        String spec = "Sequence {" +
-                      "  Optional {" +
-                      "    Sequence {" +
-                      "      EventTask target4 {}" +
-                      "      EventTask target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "  EventTask target1 {}" +
-                      "  EventTask target2 {}" +
-                      "  EventTask target3 {}" +
-                      "  EventTask target4 {}" +
-                      "  Selection {" +
-                      "    EventTask target5 {}" +
-                      "    Sequence {" +
-                      "      EventTask target4 {}" +
-                      "      TextInput target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "  EventTask target6 {}" +
-                      "  EventTask target7 {}" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_ends_with_positive_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      EventTask target3 {}" +
-                      "      TextInput target4 {}" +
-                      "    }" +
-                      "    Sequence {" +
-                      "      TextInput target5 {}" +
-                      "      EventTask target6 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_ends_with_negative_1() {
-        // Given
-        String spec = "Selection {" + 
-                      "  DragAndDrop () {}" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void selection_ends_with_negative_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      EventTask target3 {}" +
-                      "      EventTask target4 {}" +
-                      "    }" +
-                      "    Sequence {" +
-                      "      EventTask target5 {}" +
-                      "      EventTask target6 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        ITaskModel taskTree = GenerateTaskModelUtil.getTaskModelFromSpec(spec);
         UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).build();
         // When
