source: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java @ 1845

Last change on this file since 1845 was 1845, checked in by pharms, 10 years ago
  • adapted tests to bug fixes
File size: 16.0 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
19/**
20 * @author Patrick Harms
21 */
22public class SequenceForTaskDetectionRuleTest extends AbstractTemporalRelationshipTC {
23
24    /**
25     *
26     */
27    @Test
28    public void test_TaskDetection_01() throws Exception {
29        String input =
30            "UserSession {" +
31            "  Event noise0 {}" +
32            "  Event action1 {}" +
33            "  Event action2 {}" +
34            "  Event action3 {}" +
35            "  Event action4 {}" +
36            "  Event noise1 {}" +
37            "  Event noise2 {}" +
38            "  Event action1 {}" +
39            "  Event action2 {}" +
40            "  Event action3 {}" +
41            "  Event action4 {}" +
42            "  Event noise3 {}" +
43            "  Event noise4 {}" +
44            "  Event noise5 {}" +
45            "  Event noise6 {}" +
46            "  Event action1 {}" +
47            "  Event action2 {}" +
48            "  Event action3 {}" +
49            "  Event action4 {}" +
50            "  Event action1 {}" +
51            "  Event action2 {}" +
52            "  Event action3 {}" +
53            "  Event action4 {}" +
54            "  Event noise7 {}" +
55            "}";
56
57        String output =
58            "UserSession {" +
59            "  Event noise0 {}" +
60            "  Iteration iteration1 {" +
61            "    Sequence sequence1 {" +
62            "      Event action1 {}" +
63            "      Event action2 {}" +
64            "      Event action3 {}" +
65            "      Event action4 {}" +
66            "    }" +
67            "  }" +
68            "  Event noise1 {}" +
69            "  Event noise2 {}" +
70            "  Iteration iteration1 {" +
71            "    Sequence sequence1 {" +
72            "      Event action1 {}" +
73            "      Event action2 {}" +
74            "      Event action3 {}" +
75            "      Event action4 {}" +
76            "    }" +
77            "  }" +
78            "  Event noise3 {}" +
79            "  Event noise4 {}" +
80            "  Event noise5 {}" +
81            "  Event noise6 {}" +
82            "  Iteration iteration1 {" +
83            "    Sequence sequence1 {" +
84            "      Event action1 {}" +
85            "      Event action2 {}" +
86            "      Event action3 {}" +
87            "      Event action4 {}" +
88            "    }" +
89            "    Sequence sequence1 {" +
90            "      Event action1 {}" +
91            "      Event action2 {}" +
92            "      Event action3 {}" +
93            "      Event action4 {}" +
94            "    }" +
95            "  }" +
96            "  Event noise7 {}" +
97            "}";
98
99        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
100    }
101
102    /**
103     *
104     */
105    @Test
106    public void test_TaskDetection_02() throws Exception {
107        String input =
108            "UserSession {" +
109            "  Event noise0 {}" +
110            "  Event action1 {}" +
111            "  Event action2 {}" +
112            "  Event noise1 {}" +
113            "  Event noise2 {}" +
114            "  Event action3 {}" +
115            "  Event action1 {}" +
116            "  Event action2 {}" +
117            "  Event action4 {}" +
118            "  Event noise3 {}" +
119            "  Event noise4 {}" +
120            "  Event noise5 {}" +
121            "  Event noise6 {}" +
122            "  Event action1 {}" +
123            "  Event action2 {}" +
124            "  Event action3 {}" +
125            "  Event action4 {}" +
126            "  Event action1 {}" +
127            "  Event action2 {}" +
128            "  Event action3 {}" +
129            "  Event action4 {}" +
130            "  Event noise7 {}" +
131            "}";
132
133        String output =
134            "UserSession {" +
135            "  Event noise0 {}" +
136            "  Sequence sequence1 {" +
137            "    Event action1 {}" +
138            "    Event action2 {}" +
139            "  }" +
140            "  Event noise1 {}" +
141            "  Event noise2 {}" +
142            "  Event action3 {}" +
143            "  Sequence sequence1 {" +
144            "    Event action1 {}" +
145            "    Event action2 {}" +
146            "  }" +
147            "  Event action4 {}" +
148            "  Event noise3 {}" +
149            "  Event noise4 {}" +
150            "  Event noise5 {}" +
151            "  Event noise6 {}" +
152            "  Iteration iteration1 {" +
153            "    Sequence sequence3 {" +
154            "      Sequence sequence1 {" +
155            "        Event action1 {}" +
156            "        Event action2 {}" +
157            "      }" +
158            "      Event action3 {}" +
159            "      Event action4 {}" +
160            "    }" +
161            "    Sequence sequence3 {" +
162            "      Sequence sequence1 {" +
163            "        Event action1 {}" +
164            "        Event action2 {}" +
165            "      }" +
166            "      Event action3 {}" +
167            "      Event action4 {}" +
168            "    }" +
169            "  }" +
170            "  Event noise7 {}" +
171            "}";
172
173        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
174    }
175
176    /**
177     *
178     */
179    @Test
180    public void test_TaskDetection_03() throws Exception {
181        String input =
182            "UserSession {" +
183            "  Event noise0 {}" +
184            "  Event a {}" +
185            "  Event b {}" +
186            "  Event c {}" +
187            "  Event noise1 {}" +
188            "  Event a {}" +
189            "  Event b {}" +
190            "  Event noise2 {}" +
191            "  Event b {}" +
192            "  Event c {}" +
193            "  Event noise3 {}" +
194            "  Event a {}" +
195            "  Event b {}" +
196            "  Event noise4 {}" +
197            "  Event b {}" +
198            "  Event c {}" +
199            "  Event noise5 {}" +
200            "}";
201
202        String output =
203            "UserSession {" +
204            "  Event noise0 {}" +
205            "  Sequence sequence1 {" +
206            "    Event a {}" +
207            "    Event b {}" +
208            "  }" +
209            "  Event c {}" +
210            "  Event noise1 {}" +
211            "  Sequence sequence1 {" +
212            "    Event a {}" +
213            "    Event b {}" +
214            "  }" +
215            "  Event noise2 {}" +
216            "  Sequence sequence2 {" +
217            "    Event b {}" +
218            "    Event c {}" +
219            "  }" +
220            "  Event noise3 {}" +
221            "  Sequence sequence1 {" +
222            "    Event a {}" +
223            "    Event b {}" +
224            "  }" +
225            "  Event noise4 {}" +
226            "  Sequence sequence2 {" +
227            "    Event b {}" +
228            "    Event c {}" +
229            "  }" +
230            "  Event noise5 {}" +
231            "}";
232
233        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
234    }
235
236    /**
237     *
238     */
239    @Test
240    public void test_TaskDetection_04() throws Exception {
241        String input =
242            "UserSession {" +
243            "  Event noise0 {}" +
244            "  Event a {}" +
245            "  Event b {}" +
246            "  Event a {}" +
247            "  Event noise1 {}" +
248            "  Event a {}" +
249            "  Event b {}" +
250            "  Event noise2 {}" +
251            "  Event b {}" +
252            "  Event a {}" +
253            "  Event noise3 {}" +
254            "  Event a {}" +
255            "  Event b {}" +
256            "  Event noise4 {}" +
257            "  Event b {}" +
258            "  Event a {}" +
259            "  Event noise5 {}" +
260            "}";
261
262        String output =
263            "UserSession {" +
264            "  Event noise0 {}" +
265            "  Sequence sequence1 {" +
266            "    Event a {}" +
267            "    Event b {}" +
268            "  }" +
269            "  Event a {}" +
270            "  Event noise1 {}" +
271            "  Sequence sequence1 {" +
272            "    Event a {}" +
273            "    Event b {}" +
274            "  }" +
275            "  Event noise2 {}" +
276            "  Sequence sequence2 {" +
277            "    Event b {}" +
278            "    Event a {}" +
279            "  }" +
280            "  Event noise3 {}" +
281            "  Sequence sequence1 {" +
282            "    Event a {}" +
283            "    Event b {}" +
284            "  }" +
285            "  Event noise4 {}" +
286            "  Sequence sequence2 {" +
287            "    Event b {}" +
288            "    Event a {}" +
289            "  }" +
290            "  Event noise5 {}" +
291            "}";
292
293        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
294    }
295
296    /**
297     *
298     */
299    @Test
300    public void test_TaskDetection_05() throws Exception {
301        String input =
302            "UserSession {" +
303            "  Event noise0 {}" +
304            "  Event a {}" +
305            "  Event b {}" +
306            "  Event a {}" +
307            "  Event noise1 {}" +
308            "  Event b {}" +
309            "  Event a {}" +
310            "  Event b {}" +
311            "  Event noise2 {}" +
312            "  Event b {}" +
313            "  Event a {}" +
314            "  Event c {}" +
315            "  Event noise2 {}" +
316            "  Event a {}" +
317            "  Event b {}" +
318            "  Event noise3 {}" +
319            "  Event a {}" +
320            "  Event c {}" +
321            "  Event noise4 {}" +
322            "  Event a {}" +
323            "  Event c {}" +
324            "}";
325
326        String output =
327            "UserSession {" +
328            "  Event noise0 {}" +
329            "  Sequence 1 {" +
330            "    Event a {}" +
331            "    Event b {}" +
332            "  }" +
333            "  Event a {}" +
334            "  Event noise1 {}" +
335            "  Event b {}" +
336            "  Sequence 1 {" +
337            "    Event a {}" +
338            "    Event b {}" +
339            "  }" +
340            "  Event noise2 {}" +
341            "  Event b {}" +
342            "  Sequence 2 {" +
343            "    Event a {}" +
344            "    Event c {}" +
345            "  }" +
346            "  Event noise2 {}" +
347            "  Sequence 1 {" +
348            "    Event a {}" +
349            "    Event b {}" +
350            "  }" +
351            "  Event noise3 {}" +
352            "  Sequence 2 {" +
353            "    Event a {}" +
354            "    Event c {}" +
355            "  }" +
356            "  Event noise4 {}" +
357            "  Sequence 2 {" +
358            "    Event a {}" +
359            "    Event c {}" +
360            "  }" +
361            "}";
362
363        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
364    }
365
366    /**
367     *
368     */
369    @Test
370    public void test_TaskDetection_06() throws Exception {
371        String input =
372            "UserSession {" +
373            "  Event noise0 {}" +
374            "  Event a {}" +
375            "  Event b {}" +
376            "  Event a {}" +
377            "  Event noise1 {}" +
378            "  Event b {}" +
379            "  Event a {}" +
380            "  Event b {}" +
381            "  Event noise2 {}" +
382            "  Event a {}" +
383            "  Event b {}" +
384            "  Event a {}" +
385            "}";
386
387        String output =
388            "UserSession {" +
389            "  Event noise0 {}" +
390            "  Sequence 1 {" +
391            "    Sequence 2 {" +
392            "      Event a {}" +
393            "      Event b {}" +
394            "    }" +
395            "    Event a {}" +
396            "  }" +
397            "  Event noise1 {}" +
398            "  Event b {}" +
399            "  Sequence 2 {" +
400            "    Event a {}" +
401            "    Event b {}" +
402            "  }" +
403            "  Event noise2 {}" +
404            "  Sequence 1 {" +
405            "    Sequence 2 {" +
406            "      Event a {}" +
407            "      Event b {}" +
408            "    }" +
409            "    Event a {}" +
410            "  }" +
411            "}";
412
413        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
414    }
415
416    /**
417     *
418     */
419    @Test
420    public void test_TaskDetection_07() throws Exception {
421        String input =
422            "UserSession {" +
423            "  Event noise0 {}" +
424            "  Event a {}" +
425            "  Event b {}" +
426            "  Event c {}" +
427            "  Event noise1 {}" +
428            "  Event b {}" +
429            "  Event c {}" +
430            "  Event a {}" +
431            "  Event noise2 {}" +
432            "  Event c {}" +
433            "  Event a {}" +
434            "  Event b {}" +
435            "}";
436
437        String output =
438            "UserSession {" +
439            "  Event noise0 {}" +
440            "  Event a {}" +
441            "  Sequence 1 {" +
442            "    Event b {}" +
443            "    Event c {}" +
444            "  }" +
445            "  Event noise1 {}" +
446            "  Sequence 1 {" +
447            "    Event b {}" +
448            "    Event c {}" +
449            "  }" +
450            "  Event a {}" +
451            "  Event noise2 {}" +
452            "  Event c {}" +
453            "  Event a {}" +
454            "  Event b {}" +
455            "}";
456
457        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
458    }
459
460    /**
461     *
462     */
463    @Test
464    public void test_TaskDetection_08() throws Exception {
465        String input =
466            "UserSession {" +
467            "  Event noise0 {}" +
468            "  Event a {}" +
469            "  Event b {}" +
470            "  Event c {}" +
471            "  Event noise1 {}" +
472            "  Event a {}" +
473            "  Event b {}" +
474            "  Event d {}" +
475            "  Event noise2 {}" +
476            "  Event a {}" +
477            "  Event b {}" +
478            "  Event e {}" +
479            "  Event noise3 {}" +
480            "  Event b {}" +
481            "  Event c {}" +
482            "  Event d {}" +
483            "  Event noise4 {}" +
484            "  Event b {}" +
485            "  Event d {}" +
486            "  Event e {}" +
487            "  Event noise5 {}" +
488            "  Event b {}" +
489            "  Event d {}" +
490            "  Event f {}" +
491            "  Event noise6 {}" +
492            "  Event a {}" +
493            "  Event b {}" +
494            "  Event noise7 {}" +
495            "  Event b {}" +
496            "  Event c {}" +
497            "  Event noise8 {}" +
498            "  Event b {}" +
499            "  Event d {}" +
500            "  Event noise9 {}" +
501            "}";
502
503        String output =
504            "UserSession {" +
505            "  Event noise0 {}" +
506            "  Sequence 1 {" +
507            "    Event a {}" +
508            "    Event b {}" +
509            "  }" +
510            "  Event c {}" +
511            "  Event noise1 {}" +
512            "  Sequence 1 {" +
513            "    Event a {}" +
514            "    Event b {}" +
515            "  }" +
516            "  Event d {}" +
517            "  Event noise2 {}" +
518            "  Sequence 1 {" +
519            "    Event a {}" +
520            "    Event b {}" +
521            "  }" +
522            "  Event e {}" +
523            "  Event noise3 {}" +
524            "  Sequence 2 {" +
525            "    Event b {}" +
526            "    Event c {}" +
527            "  }" +
528            "  Event d {}" +
529            "  Event noise4 {}" +
530            "  Sequence 3 {" +
531            "    Event b {}" +
532            "    Event d {}" +
533            "  }" +
534            "  Event e {}" +
535            "  Event noise5 {}" +
536            "  Sequence 3 {" +
537            "    Event b {}" +
538            "    Event d {}" +
539            "  }" +
540            "  Event f {}" +
541            "  Event noise6 {}" +
542            "  Sequence 1 {" +
543            "    Event a {}" +
544            "    Event b {}" +
545            "  }" +
546            "  Event noise7 {}" +
547            "  Sequence 2 {" +
548            "    Event b {}" +
549            "    Event c {}" +
550            "  }" +
551            "  Event noise8 {}" +
552            "  Sequence 3 {" +
553            "    Event b {}" +
554            "    Event d {}" +
555            "  }" +
556            "  Event noise9 {}" +
557            "}";
558
559        applySessionScopeRule(SequenceForTaskDetectionRule.class, input, output);
560    }
561}
Note: See TracBrowser for help on using the repository browser.