source: branches/autoquest-core-tasktrees-alignment-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignmentTest.java @ 1693

Last change on this file since 1693 was 1693, checked in by rkrimmel, 10 years ago

Creating more complex models...

File size: 6.1 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
16
17import org.junit.Test;
18
19import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.Match;
20import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence;
21
22/**
23 * @author Patrick Harms
24 */
25public class SequenceForTaskDetectionRuleAlignmentTest extends AbstractTemporalRelationshipTC {
26
27       
28        @Test
29        public void test_MatchAsSequences() {
30                Match m1 = new Match();
31                int[] pat1 = new int[]{2,1,3,-1,3,5,4,8,3,1};
32                int[] pat2 = new int[]{1,2,3, 4,3,4,5,3,3,-1};
33                NumberSequence ns1 = new NumberSequence(10);
34                NumberSequence ns2 = new NumberSequence(10);
35                ns1.setSequence(pat1);
36                ns2.setSequence(pat2);
37                m1.setFirstSequence(ns1);
38                m1.setSecondSequence(ns1);
39               
40               
41        }
42       
43    /**
44     *
45     */
46    @Test
47    public void test_TaskDetection_01() throws Exception {
48        String input =
49            "UserSession {" +
50            "  Event noise0 {}" +
51            "  Event action1 {}" +
52            "  Event action2 {}" +
53            "  Event action3 {}" +
54            "  Event action4 {}" +
55            "  Event noise1 {}" +
56            "  Event noise2 {}" +
57            "  Event action1 {}" +
58            "  Event action2 {}" +
59            "  Event action3 {}" +
60            "  Event action4 {}" +
61            "  Event noise3 {}" +
62            "  Event noise4 {}" +
63            "  Event noise5 {}" +
64            "  Event noise6 {}" +
65            "  Event action1 {}" +
66            "  Event action2 {}" +
67            "  Event action3 {}" +
68            "  Event action4 {}" +
69            "  Event action1 {}" +
70            "  Event action2 {}" +
71            "  Event action3 {}" +
72            "  Event action4 {}" +
73            "  Event noise7 {}" +
74            "}";
75
76        String output =
77            "UserSession {" +
78            "  Event noise0 {}" +
79            "  Iteration iteration1 {" +
80            "    Sequence sequence1 {" +
81            "      Event action1 {}" +
82            "      Event action2 {}" +
83            "      Event action3 {}" +
84            "      Event action4 {}" +
85            "    }" +
86            "  }" +
87            "  Event noise1 {}" +
88            "  Event noise2 {}" +
89            "  Iteration iteration1 {" +
90            "    Sequence sequence1 {" +
91            "      Event action1 {}" +
92            "      Event action2 {}" +
93            "      Event action3 {}" +
94            "      Event action4 {}" +
95            "    }" +
96            "  }" +
97            "  Event noise3 {}" +
98            "  Event noise4 {}" +
99            "  Event noise5 {}" +
100            "  Event noise6 {}" +
101            "  Iteration iteration1 {" +
102            "    Sequence sequence1 {" +
103            "      Event action1 {}" +
104            "      Event action2 {}" +
105            "      Event action3 {}" +
106            "      Event action4 {}" +
107            "    }" +
108            "    Sequence sequence1 {" +
109            "      Event action1 {}" +
110            "      Event action2 {}" +
111            "      Event action3 {}" +
112            "      Event action4 {}" +
113            "    }" +
114            "  }" +
115            "  Event noise7 {}" +
116            "}";
117
118        applySessionScopeRule(SequenceForTaskDetectionRuleAlignment.class, input, output);
119    }
120
121    /**
122     *
123     */
124    @Test
125    public void test_TaskDetection_02() throws Exception {
126        String input =
127            "UserSession {" +
128            "  Event noise0 {}" +
129            "  Event action1 {}" +
130            "  Event action2 {}" +
131            "  Event noise1 {}" +
132            "  Event noise2 {}" +
133            "  Event action3 {}" +
134            "  Event action1 {}" +
135            "  Event action2 {}" +
136            "  Event action4 {}" +
137            "  Event noise3 {}" +
138            "  Event noise4 {}" +
139            "  Event noise5 {}" +
140            "  Event noise6 {}" +
141            "  Event action1 {}" +
142            "  Event action2 {}" +
143            "  Event action3 {}" +
144            "  Event action4 {}" +
145            "  Event action1 {}" +
146            "  Event action2 {}" +
147            "  Event action3 {}" +
148            "  Event action4 {}" +
149            "  Event noise7 {}" +
150            "}";
151
152        String output =
153            "UserSession {" +
154            "  Event noise0 {}" +
155            "  Sequence sequence1 {" +
156            "    Event action1 {}" +
157            "    Event action2 {}" +
158            "  }" +
159            "  Event noise1 {}" +
160            "  Event noise2 {}" +
161            "  Event action3 {}" +
162            "  Sequence sequence1 {" +
163            "    Event action1 {}" +
164            "    Event action2 {}" +
165            "  }" +
166            "  Event action4 {}" +
167            "  Event noise3 {}" +
168            "  Event noise4 {}" +
169            "  Event noise5 {}" +
170            "  Event noise6 {}" +
171            "  Iteration iteration1 {" +
172            "    Sequence sequence3 {" +
173            "      Sequence sequence1 {" +
174            "        Event action1 {}" +
175            "        Event action2 {}" +
176            "      }" +
177            "      Event action3 {}" +
178            "      Event action4 {}" +
179            "    }" +
180            "    Sequence sequence3 {" +
181            "      Sequence sequence1 {" +
182            "        Event action1 {}" +
183            "        Event action2 {}" +
184            "      }" +
185            "      Event action3 {}" +
186            "      Event action4 {}" +
187            "    }" +
188            "  }" +
189            "  Event noise7 {}" +
190            "}";
191
192        applySessionScopeRule(SequenceForTaskDetectionRuleAlignment.class, input, output);
193    }
194
195}
Note: See TracBrowser for help on using the repository browser.