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 | |
---|
15 | package de.ugoe.cs.autoquest.tasktrees.temporalrelation; |
---|
16 | |
---|
17 | import org.junit.Test; |
---|
18 | |
---|
19 | /** |
---|
20 | * TODO comment |
---|
21 | * |
---|
22 | * @version $Revision: $ $Date: 28.04.2012$ |
---|
23 | * @author 2012, last modified by $Author: patrick$ |
---|
24 | */ |
---|
25 | public class SequenceForTaskDetectionRuleTest extends AbstractTemporalRelationshipTC { |
---|
26 | |
---|
27 | /** |
---|
28 | * |
---|
29 | */ |
---|
30 | @Test |
---|
31 | public void test_TaskDetection_01() throws Exception { |
---|
32 | String input = |
---|
33 | "UserSession {" + |
---|
34 | " Event noise0 {}" + |
---|
35 | " Event action1 {}" + |
---|
36 | " Event action2 {}" + |
---|
37 | " Event action3 {}" + |
---|
38 | " Event action4 {}" + |
---|
39 | " Event noise1 {}" + |
---|
40 | " Event noise2 {}" + |
---|
41 | " Event action1 {}" + |
---|
42 | " Event action2 {}" + |
---|
43 | " Event action3 {}" + |
---|
44 | " Event action4 {}" + |
---|
45 | " Event noise3 {}" + |
---|
46 | " Event noise4 {}" + |
---|
47 | " Event noise5 {}" + |
---|
48 | " Event noise6 {}" + |
---|
49 | " Event action1 {}" + |
---|
50 | " Event action2 {}" + |
---|
51 | " Event action3 {}" + |
---|
52 | " Event action4 {}" + |
---|
53 | " Event action1 {}" + |
---|
54 | " Event action2 {}" + |
---|
55 | " Event action3 {}" + |
---|
56 | " Event action4 {}" + |
---|
57 | " Event noise7 {}" + |
---|
58 | "}"; |
---|
59 | |
---|
60 | String output = |
---|
61 | "UserSession {" + |
---|
62 | " Event noise0 {}" + |
---|
63 | " Iteration iteration1 {" + |
---|
64 | " Sequence sequence1 {" + |
---|
65 | " Event action1 {}" + |
---|
66 | " Event action2 {}" + |
---|
67 | " Event action3 {}" + |
---|
68 | " Event action4 {}" + |
---|
69 | " }" + |
---|
70 | " }" + |
---|
71 | " Event noise1 {}" + |
---|
72 | " Event noise2 {}" + |
---|
73 | " Iteration iteration1 {" + |
---|
74 | " Sequence sequence1 {" + |
---|
75 | " Event action1 {}" + |
---|
76 | " Event action2 {}" + |
---|
77 | " Event action3 {}" + |
---|
78 | " Event action4 {}" + |
---|
79 | " }" + |
---|
80 | " }" + |
---|
81 | " Event noise3 {}" + |
---|
82 | " Event noise4 {}" + |
---|
83 | " Event noise5 {}" + |
---|
84 | " Event noise6 {}" + |
---|
85 | " Iteration iteration1 {" + |
---|
86 | " Sequence sequence1 {" + |
---|
87 | " Event action1 {}" + |
---|
88 | " Event action2 {}" + |
---|
89 | " Event action3 {}" + |
---|
90 | " Event action4 {}" + |
---|
91 | " }" + |
---|
92 | " Sequence sequence1 {" + |
---|
93 | " Event action1 {}" + |
---|
94 | " Event action2 {}" + |
---|
95 | " Event action3 {}" + |
---|
96 | " Event action4 {}" + |
---|
97 | " }" + |
---|
98 | " }" + |
---|
99 | " Event noise7 {}" + |
---|
100 | "}"; |
---|
101 | |
---|
102 | applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output); |
---|
103 | } |
---|
104 | |
---|
105 | /** |
---|
106 | * |
---|
107 | */ |
---|
108 | @Test |
---|
109 | public void test_TaskDetection_02() throws Exception { |
---|
110 | String input = |
---|
111 | "UserSession {" + |
---|
112 | " Event noise0 {}" + |
---|
113 | " Event action1 {}" + |
---|
114 | " Event action2 {}" + |
---|
115 | " Event noise1 {}" + |
---|
116 | " Event noise2 {}" + |
---|
117 | " Event action3 {}" + |
---|
118 | " Event action1 {}" + |
---|
119 | " Event action2 {}" + |
---|
120 | " Event action4 {}" + |
---|
121 | " Event noise3 {}" + |
---|
122 | " Event noise4 {}" + |
---|
123 | " Event noise5 {}" + |
---|
124 | " Event noise6 {}" + |
---|
125 | " Event action1 {}" + |
---|
126 | " Event action2 {}" + |
---|
127 | " Event action3 {}" + |
---|
128 | " Event action4 {}" + |
---|
129 | " Event action1 {}" + |
---|
130 | " Event action2 {}" + |
---|
131 | " Event action3 {}" + |
---|
132 | " Event action4 {}" + |
---|
133 | " Event noise7 {}" + |
---|
134 | "}"; |
---|
135 | |
---|
136 | String output = |
---|
137 | "UserSession {" + |
---|
138 | " Event noise0 {}" + |
---|
139 | " Sequence sequence1 {" + |
---|
140 | " Event action1 {}" + |
---|
141 | " Event action2 {}" + |
---|
142 | " }" + |
---|
143 | " Event noise1 {}" + |
---|
144 | " Event noise2 {}" + |
---|
145 | " Event action3 {}" + |
---|
146 | " Sequence sequence1 {" + |
---|
147 | " Event action1 {}" + |
---|
148 | " Event action2 {}" + |
---|
149 | " }" + |
---|
150 | " Event action4 {}" + |
---|
151 | " Event noise3 {}" + |
---|
152 | " Event noise4 {}" + |
---|
153 | " Event noise5 {}" + |
---|
154 | " Event noise6 {}" + |
---|
155 | " Iteration iteration1 {" + |
---|
156 | " Sequence sequence3 {" + |
---|
157 | " Sequence sequence1 {" + |
---|
158 | " Event action1 {}" + |
---|
159 | " Event action2 {}" + |
---|
160 | " }" + |
---|
161 | " Event action3 {}" + |
---|
162 | " Event action4 {}" + |
---|
163 | " }" + |
---|
164 | " Sequence sequence3 {" + |
---|
165 | " Sequence sequence1 {" + |
---|
166 | " Event action1 {}" + |
---|
167 | " Event action2 {}" + |
---|
168 | " }" + |
---|
169 | " Event action3 {}" + |
---|
170 | " Event action4 {}" + |
---|
171 | " }" + |
---|
172 | " }" + |
---|
173 | " Event noise7 {}" + |
---|
174 | "}"; |
---|
175 | |
---|
176 | applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output); |
---|
177 | } |
---|
178 | |
---|
179 | } |
---|