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

Last change on this file since 1954 was 1954, checked in by pharms, 9 years ago
  • fixed a bug in the detection of overlapping iterations before merging them.
  • now iterations are ignored, if they cause no repetitions in a task to be merged
  • the same applies for optionals making hopefully the merge more intuitive and cause less large selections
File size: 110.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 CondenseSimilarTasksRuleTest extends AbstractTemporalRelationshipTC {
23
24    /**
25     *
26     */
27    @Test
28    public void test_SelectionDetection_01() throws Exception {
29        String input =
30            "UserSession {" +
31            "  Sequence sequence1 {" +
32            "    Iteration it1 {" +
33            "      Event action1 {}" +
34            "    }" +
35            "    Event selAction1 {}" +
36            "    Event action3 {}" +
37            "  }" +
38            "  Sequence sequence2 {" +
39            "    Iteration it1 {" +
40            "      Event action1 {}" +
41            "      Event action1 {}" +
42            "    }" +
43            "    Event selAction2 {}" +
44            "    Event action3 {}" +
45            "  }" +
46            "}";
47
48        String output =
49            "UserSession {" +
50            "  Sequence sequence3 {" +
51            "    Iteration it1 {" +
52            "      Event action1 {}" +
53            "    }" +
54            "    Selection sel1 {" +
55            "      Event selAction1 {}" +
56            "    }" +
57            "    Event action3 {}" +
58            "  }" +
59            "  Sequence sequence3 {" +
60            "    Iteration it1 {" +
61            "      Event action1 {}" +
62            "      Event action1 {}" +
63            "    }" +
64            "    Selection sel1 {" +
65            "      Event selAction2 {}" +
66            "    }" +
67            "    Event action3 {}" +
68            "  }" +
69            "}";
70
71        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
72    }
73
74    /**
75     *
76     */
77    @Test
78    public void test_SelectionDetection_02() throws Exception {
79        String input =
80            "UserSession {" +
81            "  Sequence sequence1 {" +
82            "    Iteration iter1 {" +
83            "      Event action1 {}" +
84            "      Event action1 {}" +
85            "    }" +
86            "    Event selAction1 {}" +
87            "    Event action3 {}" +
88            "  }" +
89            "  Sequence sequence2 {" +
90            "    Iteration iter1 {" +
91            "      Event action1 {}" +
92            "    }" +
93            "    Event selAction2 {}" +
94            "    Event action3 {}" +
95            "  }" +
96            "}";
97
98        String output =
99            "UserSession {" +
100            "  Sequence sequence3 {" +
101            "    Iteration iter1 {" +
102            "      Event action1 {}" +
103            "      Event action1 {}" +
104            "    }" +
105            "    Selection sel1 {" +
106            "      Event selAction1 {}" +
107            "    }" +
108            "    Event action3 {}" +
109            "  }" +
110            "  Sequence sequence3 {" +
111            "    Iteration iter1 {" +
112            "      Event action1 {}" +
113            "    }" +
114            "    Selection sel1 {" +
115            "      Event selAction2 {}" +
116            "    }" +
117            "    Event action3 {}" +
118            "  }" +
119            "}";
120
121        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
122    }
123
124    /**
125     *
126     */
127    @Test
128    public void test_SelectionDetection_03() throws Exception {
129        String input =
130            "UserSession {" +
131            "  Sequence sequence1 {" +
132            "    Iteration iter1 {" +
133            "      Sequence sequence2 {" +
134            "        Iteration iter2 {" +
135            "          Event action1 {}" +
136            "        }" +
137            "        Event selAction1 {}" +
138            "        Event action2 {}" +
139            "      }" +
140            "      Sequence sequence2 {" +
141            "        Iteration iter2 {" +
142            "          Event action1 {}" +
143            "        }" +
144            "        Event selAction1 {}" +
145            "        Event action2 {}" +
146            "      }" +
147            "    }" +
148            "    Event action3 {}" +
149            "  }" +
150            "  Sequence sequence3 {" +
151            "    Iteration iter2 {" +
152            "      Event action1 {}" +
153            "      Event action1 {}" +
154            "    }" +
155            "    Event selAction2 {}" +
156            "    Event action2 {}" +
157            "    Event action3 {}" +
158            "  }" +
159            "}";
160
161        String output =
162            "UserSession {" +
163            "  Sequence sequence4 {" +
164            "    Iteration iter3 {" +
165            "      Sequence sequence5 {" +
166            "        Iteration iter2 {" +
167            "          Event action1 {}" +
168            "        }" +
169            "        Selection sel1 {" +
170            "          Event selAction1 {}" +
171            "        }" +
172            "        Event action2 {}" +
173            "      }" +
174            "      Sequence sequence5 {" +
175            "        Iteration iter2 {" +
176            "          Event action1 {}" +
177            "        }" +
178            "        Selection sel1 {" +
179            "          Event selAction1 {}" +
180            "        }" +
181            "        Event action2 {}" +
182            "      }" +
183            "    }" +
184            "    Event action3 {}" +
185            "  }" +
186            "  Sequence sequence4 {" +
187            "    Iteration iter3 {" +
188            "      Sequence sequence5 {" +
189            "        Iteration iter2 {" +
190            "          Event action1 {}" +
191            "          Event action1 {}" +
192            "        }" +
193            "        Selection sel1 {" +
194            "          Event selAction2 {}" +
195            "        }" +
196            "        Event action2 {}" +
197            "      }" +
198            "    }" +
199            "    Event action3 {}" +
200            "  }" +
201           "}";
202
203        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
204    }
205
206    /**
207     *
208     */
209    @Test
210    public void test_SelectionDetection_04() throws Exception {
211        String input =
212            "UserSession {" +
213            "  Sequence sequence1 {" +
214            "    Sequence sequence2 {" +
215            "      Iteration iter1 {" +
216            "        Event action1 {}" +
217            "        Event action1 {}" +
218            "      }" +
219            "      Event selAction1 {}" +
220            "      Event action2 {}" +
221            "    }" +
222            "    Sequence sequence3 {" +
223            "      Sequence sequence4 {" +
224            "        Iteration iter1 {" +
225            "          Event action1 {}" +
226            "        }" +
227            "      Event selAction2 {}" +
228            "      }" +
229            "      Event action2 {}" +
230            "    }" +
231            "  }" +
232            "}";
233
234        String output =
235            "UserSession {" +
236            "  Sequence sequence5 {" +
237            "    Sequence sequence6 {" +
238            "      Iteration iter1 {" +
239            "        Event action1 {}" +
240            "        Event action1 {}" +
241            "      }" +
242            "      Selection sel1 {" +
243            "        Event selAction1 {}" +
244            "      }" +
245            "      Event action2 {}" +
246            "    }" +
247            "    Sequence sequence6 {" +
248            "      Iteration iter1 {" +
249            "        Event action1 {}" +
250            "      }" +
251            "      Selection sel1 {" +
252            "        Event selAction2 {}" +
253            "      }" +
254            "      Event action2 {}" +
255            "    }" +
256            "  }" +
257           "}";
258
259        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
260    }
261
262    /**
263     *
264     */
265    @Test
266    public void test_OptionalDetection_01() throws Exception {
267        String input =
268            "UserSession {" +
269            "  Sequence sequence1 {" +
270            "    Event action1 {}" +
271            "    Event optAction1 {}" +
272            "    Event action2 {}" +
273            "  }" +
274            "  Sequence sequence2 {" +
275            "    Event action1 {}" +
276            "    Event action2 {}" +
277            "  }" +
278            "}";
279
280        String output =
281            "UserSession {" +
282            "  Sequence sequence3 {" +
283            "    Event action1 {}" +
284            "    Optional opt1 {" +
285            "      Event optAction1 {}" +
286            "    }" +
287            "    Event action2 {}" +
288            "  }" +
289            "  Sequence sequence3 {" +
290            "    Event action1 {}" +
291            "    Optional opt1 {}" +
292            "    Event action2 {}" +
293            "  }" +
294            "}";
295
296        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
297    }
298
299    /**
300     *
301     */
302    @Test
303    public void test_OptionalDetection_02() throws Exception {
304        String input =
305            "UserSession {" +
306            "  Sequence sequence1 {" +
307            "    Event action1 {}" +
308            "    Event action2 {}" +
309            "  }" +
310            "  Sequence sequence2 {" +
311            "    Event action1 {}" +
312            "    Event optAction1 {}" +
313            "    Event action2 {}" +
314            "  }" +
315            "}";
316
317        String output =
318            "UserSession {" +
319            "  Sequence sequence3 {" +
320            "    Event action1 {}" +
321            "    Optional opt1 {}" +
322            "    Event action2 {}" +
323            "  }" +
324            "  Sequence sequence3 {" +
325            "    Event action1 {}" +
326            "    Optional opt1 {" +
327            "      Event optAction1 {}" +
328            "    }" +
329            "    Event action2 {}" +
330            "  }" +
331           "}";
332
333        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
334    }
335
336    /**
337     *
338     */
339    @Test
340    public void test_OptionalDetection_03() throws Exception {
341        String input =
342            "UserSession {" +
343            "  Sequence sequence1 {" +
344            "    Iteration iter1 {" +
345            "      Event action1 {}" +
346            "      Event action1 {}" +
347            "      Event action1 {}" +
348            "    }" +
349            "    Event action2 {}" +
350            "  }" +
351            "  Sequence sequence3 {" +
352            "    Iteration iter1 {" +
353            "      Event action1 {}" +
354            "    }" +
355            "    Event optAction1 {}" +
356            "    Event action2 {}" +
357            "  }" +
358            "}";
359
360        String output =
361            "UserSession {" +
362            "  Sequence sequence4 {" +
363            "    Iteration iter1 {" +
364            "      Event action1 {}" +
365            "      Event action1 {}" +
366            "      Event action1 {}" +
367            "    }" +
368            "    Optional opt1 {}" +
369            "    Event action2 {}" +
370            "  }" +
371            "  Sequence sequence4 {" +
372            "    Iteration iter1 {" +
373            "      Event action1 {}" +
374            "    }" +
375            "    Optional opt1 {" +
376            "      Event optAction1 {}" +
377            "    }" +
378            "    Event action2 {}" +
379            "  }" +
380           "}";
381
382        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
383    }
384
385    /**
386     *
387     */
388    @Test
389    public void test_OptionalDetection_04() throws Exception {
390        String input =
391            "UserSession {" +
392            "  Sequence sequence1 {" +
393            "    Iteration iter1 {" +
394            "      Sequence sequence2 {" +
395            "        Iteration iter2 {" +
396            "          Event action1 {}" +
397            "        }" +
398            "        Event action2 {}" +
399            "      }" +
400            "      Sequence sequence2 {" +
401            "        Iteration iter2 {" +
402            "          Event action1 {}" +
403            "        }" +
404            "        Event action2 {}" +
405            "      }" +
406            "    }" +
407            "    Event action3 {}" +
408            "  }" +
409            "  Sequence sequence3 {" +
410            "    Iteration iter2 {" +
411            "      Event action1 {}" +
412            "      Event action1 {}" +
413            "    }" +
414            "    Event optAction1 {}" +
415            "    Event action2 {}" +
416            "    Event action3 {}" +
417            "  }" +
418            "}";
419
420        String output =
421            "UserSession {" +
422            "  Sequence sequence4 {" +
423            "    Iteration iter3 {" +
424            "      Sequence sequence5 {" +
425            "        Iteration iter2 {" +
426            "          Event action1 {}" +
427            "        }" +
428            "        Optional opt1 {}" +
429            "        Event action2 {}" +
430            "      }" +
431            "      Sequence sequence5 {" +
432            "        Iteration iter2 {" +
433            "          Event action1 {}" +
434            "        }" +
435            "        Optional opt1 {}" +
436            "        Event action2 {}" +
437            "      }" +
438            "    }" +
439            "    Event action3 {}" +
440            "  }" +
441            "  Sequence sequence4 {" +
442            "    Iteration iter3 {" +
443            "      Sequence sequence5 {" +
444            "        Iteration iter2 {" +
445            "          Event action1 {}" +
446            "          Event action1 {}" +
447            "        }" +
448            "        Optional opt1 {" +
449            "          Event optAction1 {}" +
450            "        }" +
451            "        Event action2 {}" +
452            "      }" +
453            "    }" +
454            "    Event action3 {}" +
455            "  }" +
456           "}";
457
458        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
459    }
460
461    /**
462     *
463     */
464    @Test
465    public void test_OptionalDetection_05() throws Exception {
466        String input =
467            "UserSession {" +
468            "  Sequence sequence1 {" +
469            "    Sequence sequence2 {" +
470            "      Iteration iter1 {" +
471            "        Event action1 {}" +
472            "        Event action1 {}" +
473            "      }" +
474            "      Event action2 {}" +
475            "    }" +
476            "    Sequence sequence3 {" +
477            "      Sequence sequence4 {" +
478            "        Iteration iter1 {" +
479            "          Event action1 {}" +
480            "        }" +
481            "        Event optAction1 {}" +
482            "      }" +
483            "      Event action2 {}" +
484            "    }" +
485            "  }" +
486            "}";
487
488        String output =
489            "UserSession {" +
490            "  Sequence sequence5 {" +
491            "    Sequence sequence6 {" +
492            "      Iteration iter1 {" +
493            "        Event action1 {}" +
494            "        Event action1 {}" +
495            "      }" +
496            "      Optional opt1 {}" +
497            "      Event action2 {}" +
498            "    }" +
499            "    Sequence sequence6 {" +
500            "      Iteration iter1 {" +
501            "        Event action1 {}" +
502            "      }" +
503            "      Optional opt1 {" +
504            "        Event optAction1 {}" +
505            "      }" +
506            "      Event action2 {}" +
507            "    }" +
508            "  }" +
509           "}";
510
511        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
512    }
513
514    /**
515     *
516     */
517    @Test
518    public void test_OptionalDetection_06() throws Exception {
519        String input =
520            "UserSession {" +
521            "  Sequence sequence1 {" +
522            "    Event action1 {}" +
523            "    Iteration it1 {" +
524            "      Event optAction1 {}" +
525            "    }" +
526            "    Event action2 {}" +
527            "  }" +
528            "  Sequence sequence2 {" +
529            "    Event action1 {}" +
530            "    Event action2 {}" +
531            "  }" +
532            "}";
533
534        String output =
535            "UserSession {" +
536            "  Sequence sequence3 {" +
537            "    Event action1 {}" +
538            "    Optional opt1 {" +
539            "      Iteration it1 {" +
540            "        Event optAction1 {}" +
541            "      }" +
542            "    }" +
543            "    Event action2 {}" +
544            "  }" +
545            "  Sequence sequence3 {" +
546            "    Event action1 {}" +
547            "    Optional opt1 {}" +
548            "    Event action2 {}" +
549            "  }" +
550            "}";
551
552        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
553    }
554
555    /**
556     *
557     */
558    @Test
559    public void test_OptionalDetection_07() throws Exception {
560        String input =
561            "UserSession {" +
562            "  Sequence sequence1 {" +
563            "    Event action1 {}" +
564            "    Optional op1 {" +
565            "      Event optAction1 {}" +
566            "    }" +
567            "    Event action2 {}" +
568            "  }" +
569            "  Sequence sequence2 {" +
570            "    Event action1 {}" +
571            "    Event action2 {}" +
572            "  }" +
573            "}";
574
575        String output =
576            "UserSession {" +
577            "  Sequence sequence3 {" +
578            "    Event action1 {}" +
579            "    Optional opt1 {" +
580            "      Event optAction1 {}" +
581            "    }" +
582            "    Event action2 {}" +
583            "  }" +
584            "  Sequence sequence3 {" +
585            "    Event action1 {}" +
586            "    Optional opt1 {}" +
587            "    Event action2 {}" +
588            "  }" +
589            "}";
590
591        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
592    }
593
594    /**
595     *
596     */
597    @Test
598    public void test_IterationPreservation_01() throws Exception {
599        String input =
600            "UserSession {" +
601            "  Iteration itSequence1 {" +
602            "    Sequence sequence1 {" +
603            "      Event action1 {}" +
604            "      Event optAction1 {}" +
605            "      Event action2 {}" +
606            "    }" +
607            "  }" +
608            "  Sequence sequence2 {" +
609            "    Event action1 {}" +
610            "    Event action2 {}" +
611            "  }" +
612            "}";
613
614        String output =
615            "UserSession {" +
616            "  Iteration itSequence3 {" +
617            "    Sequence sequence3 {" +
618            "      Event action1 {}" +
619            "      Optional opt1 {" +
620            "        Event optAction1 {}" +
621            "      }" +
622            "      Event action2 {}" +
623            "    }" +
624            "  }" +
625            "  Sequence sequence3 {" +
626            "    Event action1 {}" +
627            "    Optional opt1 {}" +
628            "    Event action2 {}" +
629            "  }" +
630            "}";
631
632        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
633    }
634
635    /**
636     *
637     */
638    @Test
639    public void test_IterationPreservation_02() throws Exception {
640        String input =
641            "UserSession {" +
642            "  Sequence sequence1 {" +
643            "    Iteration itSequence2 {" +
644            "      Sequence sequence2 {" +
645            "        Event action1 {}" +
646            "        Event action2 {}" +
647            "      }" +
648            "      Sequence sequence2 {" +
649            "        Event action1 {}" +
650            "        Event action2 {}" +
651            "      }" +
652            "    }" +
653            "    Event action3 {}" +
654            "  }" +
655            "  Sequence sequence3 {" +
656            "    Event action1 {}" +
657            "    Iteration itSequence4 {" +
658            "      Sequence sequence4 {" +
659            "        Event action4 {}" +
660            "        Event action3 {}" +
661            "      }" +
662            "    }" +
663            "  }" +
664            "}";
665
666        String output =
667            "UserSession {" +
668            "  Sequence sequence5 {" +
669            "    Iteration itSequence6 {" +
670            "      Sequence sequence6 {" +
671            "        Event action1 {}" +
672            "        Selection 1 {" +
673            "          Event action2 {}" +
674            "        }" +
675            "      }" +
676            "      Sequence sequence6 {" +
677            "        Event action1 {}" +
678            "        Selection 1 {" +
679            "          Event action2 {}" +
680            "        }" +
681            "      }" +
682            "    }" +
683            "    Event action3 {}" +
684            "  }" +
685            "  Sequence sequence5 {" +
686            "    Iteration itSequence6 {" +
687            "      Sequence sequence6 {" +
688            "        Event action1 {}" +
689            "        Selection 1 {" +
690            "          Event action4 {}" +
691            "        }" +
692            "      }" +
693            "    }" +
694            "    Event action3 {}" +
695            "  }" +
696            "}";
697
698        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
699    }
700
701    /**
702     *
703     */
704    @Test
705    public void test_IterationPreservation_03() throws Exception {
706        String input =
707            "UserSession {" +
708            "  Sequence sequence1 {" +
709            "    Iteration itSequence2 {" +
710            "      Sequence sequence2 {" +
711            "        Event action1 {}" +
712            "        Event action2 {}" +
713            "      }" +
714            "      Sequence sequence2 {" +
715            "        Event action1 {}" +
716            "        Event action2 {}" +
717            "      }" +
718            "    }" +
719            "    Event action3 {}" +
720            "  }" +
721            "  Sequence sequence3 {" +
722            "    Event action1 {}" +
723            "    Iteration itSequence4 {" +
724            "      Sequence sequence4 {" +
725            "        Event action4 {}" +
726            "        Event action3 {}" +
727            "      }" +
728            "      Sequence sequence4 {" +
729            "        Event action4 {}" +
730            "        Event action3 {}" +
731            "      }" +
732            "      Sequence sequence4 {" +
733            "        Event action4 {}" +
734            "        Event action3 {}" +
735            "      }" +
736            "    }" +
737            "  }" +
738            "}";
739
740        String output =
741            "UserSession {" +
742            "  Selection selection1 {" +
743            "    Sequence sequence1 {" +
744            "      Iteration itSequence2 {" +
745            "        Sequence sequence2 {" +
746            "          Event action1 {}" +
747            "          Event action2 {}" +
748            "        }" +
749            "        Sequence sequence2 {" +
750            "          Event action1 {}" +
751            "          Event action2 {}" +
752            "        }" +
753            "      }" +
754            "      Event action3 {}" +
755            "    }" +
756            "  }" +
757            "  Selection selection1 {" +
758            "    Sequence sequence3 {" +
759            "      Event action1 {}" +
760            "      Iteration itSequence4 {" +
761            "        Sequence sequence4 {" +
762            "          Event action4 {}" +
763            "          Event action3 {}" +
764            "        }" +
765            "        Sequence sequence4 {" +
766            "          Event action4 {}" +
767            "          Event action3 {}" +
768            "        }" +
769            "        Sequence sequence4 {" +
770            "          Event action4 {}" +
771            "          Event action3 {}" +
772            "        }" +
773            "      }" +
774            "    }" +
775            "  }" +
776            "}";
777
778        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
779    }
780
781    /**
782     *
783     */
784    @Test
785    public void test_IterationPreservation_04() throws Exception {
786        String input =
787            "UserSession {" +
788            "  Iteration itSequence1 {" +
789            "    Sequence sequence1 {" +
790            "      Iteration itSequence2 {" +
791            "        Sequence sequence2 {" +
792            "          Event action1 {}" +
793            "          Event action2 {}" +
794            "        }" +
795            "        Sequence sequence2 {" +
796            "          Event action1 {}" +
797            "          Event action2 {}" +
798            "        }" +
799            "      }" +
800            "      Event action3 {}" +
801            "    }" +
802            "  }" +
803            "  Iteration itSequence3 {" +
804            "    Sequence sequence3 {" +
805            "      Event action1 {}" +
806            "      Iteration itSequence4 {" +
807            "        Sequence sequence4 {" +
808            "          Event action4 {}" +
809            "          Event action3 {}" +
810            "        }" +
811            "      }" +
812            "    }" +
813            "  }" +
814            "}";
815
816        String output =
817            "UserSession {" +
818            "  Iteration itSequence5 {" +
819            "    Sequence sequence5 {" +
820            "      Iteration itSequence6 {" +
821            "        Sequence sequence6 {" +
822            "          Event action1 {}" +
823            "          Selection 1 {" +
824            "            Event action2 {}" +
825            "          }" +
826            "        }" +
827            "        Sequence sequence6 {" +
828            "          Event action1 {}" +
829            "          Selection 1 {" +
830            "            Event action2 {}" +
831            "          }" +
832            "        }" +
833            "      }" +
834            "      Event action3 {}" +
835            "    }" +
836            "    Sequence sequence5 {" +
837            "      Iteration itSequence6 {" +
838            "        Sequence sequence6 {" +
839            "          Event action1 {}" +
840            "          Selection 1 {" +
841            "            Event action4 {}" +
842            "          }" +
843            "        }" +
844            "      }" +
845            "      Event action3 {}" +
846            "    }" +
847            "  }" +
848            "}";
849
850        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
851    }
852
853    /**
854     *
855     */
856    @Test
857    public void test_IterationPreservation_05() throws Exception {
858        String input =
859            "UserSession {" +
860            "  Iteration itSequence1 {" +
861            "    Sequence sequence1 {" +
862            "      Iteration itSequence2 {" +
863            "        Sequence sequence2 {" +
864            "          Event action1 {}" +
865            "          Event action2 {}" +
866            "        }" +
867            "        Sequence sequence2 {" +
868            "          Event action1 {}" +
869            "          Event action2 {}" +
870            "        }" +
871            "      }" +
872            "      Event action3 {}" +
873            "    }" +
874            "  }" +
875            "  Iteration itSequence3 {" +
876            "    Sequence sequence3 {" +
877            "      Event action1 {}" +
878            "      Iteration itSequence4 {" +
879            "        Sequence sequence4 {" +
880            "          Event action4 {}" +
881            "          Event action3 {}" +
882            "        }" +
883            "        Sequence sequence4 {" +
884            "          Event action4 {}" +
885            "          Event action3 {}" +
886            "        }" +
887            "        Sequence sequence4 {" +
888            "          Event action4 {}" +
889            "          Event action3 {}" +
890            "        }" +
891            "      }" +
892            "    }" +
893            "  }" +
894            "}";
895
896        String output =
897            "UserSession {" +
898            "  Iteration itSelection1 {" +
899            "    Selection selection1 {" +
900            "      Sequence sequence1 {" +
901            "        Iteration itSequence2 {" +
902            "          Sequence sequence2 {" +
903            "            Event action1 {}" +
904            "            Event action2 {}" +
905            "          }" +
906            "          Sequence sequence2 {" +
907            "            Event action1 {}" +
908            "            Event action2 {}" +
909            "          }" +
910            "        }" +
911            "        Event action3 {}" +
912            "      }" +
913            "    }" +
914            "    Selection selection1 {" +
915            "      Sequence sequence3 {" +
916            "        Event action1 {}" +
917            "        Iteration itSequence4 {" +
918            "          Sequence sequence4 {" +
919            "            Event action4 {}" +
920            "            Event action3 {}" +
921            "          }" +
922            "          Sequence sequence4 {" +
923            "            Event action4 {}" +
924            "            Event action3 {}" +
925            "          }" +
926            "          Sequence sequence4 {" +
927            "            Event action4 {}" +
928            "            Event action3 {}" +
929            "          }" +
930            "        }" +
931            "      }" +
932            "    }" +
933            "  }" +
934            "}";
935
936        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
937    }
938
939    /**
940     *
941     */
942    @Test
943    public void test_IterationPreservation_06() throws Exception {
944        String input =
945            "UserSession {" +
946            "  Sequence sequence1 {" +
947            "    Iteration itSequence2 {" +
948            "      Sequence sequence2 {" +
949            "        Event action1 {}" +
950            "        Iteration itSequence3 {" +
951            "          Sequence sequence3 {" +
952            "            Event action2 {}" +
953            "            Event action3 {}" +
954            "          }" +
955            "          Sequence sequence3 {" +
956            "            Event action2 {}" +
957            "            Event action3 {}" +
958            "          }" +
959            "        }" +
960            "      }" +
961            "    }" +
962            "    Event action4 {}" +
963            "  }" +
964            "  Sequence sequence4 {" +
965            "    Event action1 {}" +
966            "    Iteration itSequence5 {" +
967            "      Sequence sequence5 {" +
968            "        Iteration itSequence6 {" +
969            "          Sequence sequence6 {" +
970            "            Event action2 {}" +
971            "            Event action5 {}" +
972            "          }" +
973            "        }" +
974            "        Event action4 {}" +
975            "      }" +
976            "    }" +
977            "  }" +
978            "}";
979
980        String output =
981            "UserSession {" +
982            "  Sequence sequence7 {" +
983            "    Event action1 {}" +
984            "    Iteration itSequence8 {" +
985            "      Sequence sequence8 {" +
986            "        Event action2 {}" +
987            "        Selection selection1 {" +
988            "          Event action3 {}" +
989            "        }" +
990            "      }" +
991            "      Sequence sequence8 {" +
992            "        Event action2 {}" +
993            "        Selection selection1 {" +
994            "          Event action3 {}" +
995            "        }" +
996            "      }" +
997            "    }" +
998            "    Event action4 {}" +
999            "  }" +
1000            "  Sequence sequence7 {" +
1001            "    Event action1 {}" +
1002            "    Iteration itSequence8 {" +
1003            "      Sequence sequence8 {" +
1004            "        Event action2 {}" +
1005            "        Selection selection1 {" +
1006            "          Event action5 {}" +
1007            "        }" +
1008            "      }" +
1009            "    }" +
1010            "    Event action4 {}" +
1011            "  }" +
1012            "}";
1013
1014        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1015    }
1016
1017    /**
1018     *
1019     */
1020    @Test
1021    public void test_IterationPreservation_07() throws Exception {
1022        String input =
1023            "UserSession {" +
1024            "  Sequence sequence1 {" +
1025            "    Iteration itSequence2 {" +
1026            "      Sequence sequence2 {" +
1027            "        Event action1 {}" +
1028            "        Iteration itSequence3 {" +
1029            "          Sequence sequence3 {" +
1030            "            Event action2 {}" +
1031            "            Event action3 {}" +
1032            "          }" +
1033            "          Sequence sequence3 {" +
1034            "            Event action2 {}" +
1035            "            Event action3 {}" +
1036            "          }" +
1037            "        }" +
1038            "      }" +
1039            "    }" +
1040            "    Event action4 {}" +
1041            "  }" +
1042            "  Sequence sequence4 {" +
1043            "    Event action1 {}" +
1044            "    Iteration itSequence5 {" +
1045            "      Sequence sequence5 {" +
1046            "        Iteration itSequence6 {" +
1047            "          Sequence sequence6 {" +
1048            "            Event action2 {}" +
1049            "            Event action5 {}" +
1050            "          }" +
1051            "          Sequence sequence6 {" +
1052            "            Event action2 {}" +
1053            "            Event action5 {}" +
1054            "          }" +
1055            "          Sequence sequence6 {" +
1056            "            Event action2 {}" +
1057            "            Event action5 {}" +
1058            "          }" +
1059            "        }" +
1060            "        Event action4 {}" +
1061            "      }" +
1062            "    }" +
1063            "  }" +
1064            "}";
1065
1066        String output =
1067            "UserSession {" +
1068            "  Sequence sequence7 {" +
1069            "    Event action1 {}" +
1070            "    Iteration itSequence8 {" +
1071            "      Sequence sequence8 {" +
1072            "        Event action2 {}" +
1073            "        Selection selection1 {" +
1074            "          Event action3 {}" +
1075            "        }" +
1076            "      }" +
1077            "      Sequence sequence8 {" +
1078            "        Event action2 {}" +
1079            "        Selection selection1 {" +
1080            "          Event action3 {}" +
1081            "        }" +
1082            "      }" +
1083            "    }" +
1084            "    Event action4 {}" +
1085            "  }" +
1086            "  Sequence sequence7 {" +
1087            "    Event action1 {}" +
1088            "    Iteration itSequence8 {" +
1089            "      Sequence sequence8 {" +
1090            "        Event action2 {}" +
1091            "        Selection selection1 {" +
1092            "          Event action5 {}" +
1093            "        }" +
1094            "      }" +
1095            "      Sequence sequence8 {" +
1096            "        Event action2 {}" +
1097            "        Selection selection1 {" +
1098            "          Event action5 {}" +
1099            "        }" +
1100            "      }" +
1101            "      Sequence sequence8 {" +
1102            "        Event action2 {}" +
1103            "        Selection selection1 {" +
1104            "          Event action5 {}" +
1105            "        }" +
1106            "      }" +
1107            "    }" +
1108            "    Event action4 {}" +
1109            "  }" +
1110            "}";
1111
1112        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1113    }
1114
1115    /**
1116     *
1117     */
1118    @Test
1119    public void test_IterationPreservation_08() throws Exception {
1120        String input =
1121            "UserSession {" +
1122            "  Sequence sequence1 {" +
1123            "    Iteration itSequence2 {" +
1124            "      Sequence sequence2 {" +
1125            "        Event action1 {}" +
1126            "        Iteration itSequence3 {" +
1127            "          Sequence sequence3 {" +
1128            "            Event action2 {}" +
1129            "            Event action3 {}" +
1130            "          }" +
1131            "          Sequence sequence3 {" +
1132            "            Event action2 {}" +
1133            "            Event action3 {}" +
1134            "          }" +
1135            "        }" +
1136            "      }" +
1137            "    }" +
1138            "    Event action4 {}" +
1139            "  }" +
1140            "  Sequence sequence4 {" +
1141            "    Event action1 {}" +
1142            "    Iteration itSequence5 {" +
1143            "      Sequence sequence5 {" +
1144            "        Iteration itSequence6 {" +
1145            "          Sequence sequence6 {" +
1146            "            Event action2 {}" +
1147            "            Event action5 {}" +
1148            "          }" +
1149            "        }" +
1150            "        Event action4 {}" +
1151            "      }" +
1152            "      Sequence sequence5 {" +
1153            "        Iteration itSequence6 {" +
1154            "          Sequence sequence6 {" +
1155            "            Event action2 {}" +
1156            "            Event action5 {}" +
1157            "          }" +
1158            "        }" +
1159            "        Event action4 {}" +
1160            "      }" +
1161            "    }" +
1162            "  }" +
1163            "}";
1164
1165        String output =
1166            "UserSession {" +
1167            "  Sequence sequence7 {" +
1168            "    Event action1 {}" +
1169            "    Iteration itSequence8 {" +
1170            "      Sequence sequence8 {" +
1171            "        Iteration itSequence9 {" +
1172            "          Sequence sequence9 {" +
1173            "            Event action2 {}" +
1174            "            Selection selection1 {" +
1175            "              Event action3 {}" +
1176            "            }" +
1177            "          }" +
1178            "          Sequence sequence9 {" +
1179            "            Event action2 {}" +
1180            "            Selection selection1 {" +
1181            "              Event action3 {}" +
1182            "            }" +
1183            "          }" +
1184            "        }" +
1185            "        Event action4 {}" +
1186            "      }" +
1187            "    }" +
1188            "  }" +
1189            "  Sequence sequence7 {" +
1190            "    Event action1 {}" +
1191            "    Iteration itSequence8 {" +
1192            "      Sequence sequence8 {" +
1193            "        Iteration itSequence9 {" +
1194            "          Sequence sequence9 {" +
1195            "            Event action2 {}" +
1196            "            Selection selection1 {" +
1197            "              Event action3 {}" +
1198            "            }" +
1199            "          }" +
1200            "        }" +
1201            "        Event action4 {}" +
1202            "      }" +
1203            "      Sequence sequence8 {" +
1204            "        Iteration itSequence9 {" +
1205            "          Sequence sequence9 {" +
1206            "            Event action2 {}" +
1207            "            Selection selection1 {" +
1208            "              Event action3 {}" +
1209            "            }" +
1210            "          }" +
1211            "        }" +
1212            "        Event action4 {}" +
1213            "      }" +
1214            "    }" +
1215            "  }" +
1216            "}";
1217
1218        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1219    }
1220
1221    /**
1222     *
1223     */
1224    @Test
1225    public void test_IterationPreservation_09() throws Exception {
1226        String input =
1227            "UserSession {" +
1228            "  Sequence sequence1 {" +
1229            "    Event noiseAction1 {}" +
1230            "    Iteration itSequence2 {" +
1231            "      Sequence sequence2 {" +
1232            "        Iteration itSequence3 {" +
1233            "          Sequence sequence3 {" +
1234            "            Event action1 {}" +
1235            "            Iteration itSequence4 {" +
1236            "              Sequence sequence4 {" +
1237            "                Event action2 {}" +
1238            "                Event action3 {}" +
1239            "              }" +
1240            "            }" +
1241            "          }" +
1242            "        }" +
1243            "        Event action4 {}" +
1244            "      }" +
1245            "      Sequence sequence2 {" +
1246            "        Iteration itSequence3 {" +
1247            "          Sequence sequence3 {" +
1248            "            Event action1 {}" +
1249            "            Iteration itSequence4 {" +
1250            "              Sequence sequence4 {" +
1251            "                Event action2 {}" +
1252            "                Event action3 {}" +
1253            "              }" +
1254            "            }" +
1255            "          }" +
1256            "        }" +
1257            "        Event action4 {}" +
1258            "      }" +
1259            "    }" +
1260            "    Event noiseAction2 {}" +
1261            "  }" +
1262            "  Sequence sequence5 {" +
1263            "    Event noiseAction1 {}" +
1264            "    Iteration itSequence6 {" +
1265            "      Sequence sequence6 {" +
1266            "        Event action1 {}" +
1267            "        Iteration itSequence7 {" +
1268            "          Sequence sequence7 {" +
1269            "            Iteration itSequence8 {" +
1270            "              Sequence sequence8 {" +
1271            "                Event action5 {}" +
1272            "                Event action3 {}" +
1273            "              }" +
1274            "            }" +
1275            "            Event action4 {}" +
1276            "          }" +
1277            "        }" +
1278            "      }" +
1279            "    }" +
1280            "    Event noiseAction2 {}" +
1281            "  }" +
1282            "}";
1283
1284        String output =
1285            "UserSession {" +
1286            "  Sequence sequence9 {" +
1287            "    Event noiseAction1 {}" +
1288            "    Iteration itSelection1 {" +
1289            "      Sequence sequence10 {" +
1290            "        Event action1 {}" +
1291            "        Selection selection1 {" +
1292            "          Event action2 {}" +
1293            "        }" +
1294            "        Event action3 {}" +
1295            "        Event action4 {}" +
1296            "      }" +
1297            "      Sequence sequence10 {" +
1298            "        Event action1 {}" +
1299            "        Selection selection1 {" +
1300            "          Event action2 {}" +
1301            "        }" +
1302            "        Event action3 {}" +
1303            "        Event action4 {}" +
1304            "      }" +
1305            "    }" +
1306            "    Event noiseAction2 {}" +
1307            "  }" +
1308            "  Sequence sequence9 {" +
1309            "    Event noiseAction1 {}" +
1310            "    Iteration itSelection1 {" +
1311            "      Sequence sequence10 {" +
1312            "        Event action1 {}" +
1313            "        Selection selection1 {" +
1314            "          Event action5 {}" +
1315            "        }" +
1316            "        Event action3 {}" +
1317            "        Event action4 {}" +
1318            "      }" +
1319            "    }" +
1320            "    Event noiseAction2 {}" +
1321            "  }" +
1322            "}";
1323
1324        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1325    }
1326
1327    /**
1328     *
1329     */
1330    @Test
1331    public void test_IterationPreservation_10() throws Exception {
1332        String input =
1333            "UserSession {" +
1334            "  Sequence sequence1 {" +
1335            "    Iteration itSequence2 {" +
1336            "      Sequence sequence2 {" +
1337            "        Event action1 {}" +
1338            "        Event action2 {}" +
1339            "        Event action3 {}" +
1340            "      }" +
1341            "    }" +
1342            "    Iteration itSequence3 {" +
1343            "      Sequence sequence3 {" +
1344            "        Event action4 {}" +
1345            "        Event action5 {}" +
1346            "        Event action6 {}" +
1347            "      }" +
1348            "      Sequence sequence3 {" +
1349            "        Event action4 {}" +
1350            "        Event action5 {}" +
1351            "        Event action6 {}" +
1352            "      }" +
1353            "    }" +
1354            "  }" +
1355            "  Sequence sequence4 {" +
1356            "    Event action1 {}" +
1357            "    Event action2 {}" +
1358            "    Event action5 {}" +
1359            "    Event action6 {}" +
1360            "  }" +
1361            "}";
1362
1363        String output =
1364            "UserSession {" +
1365            "  Selection sel1 {" +
1366            "    Sequence sequence1 {" +
1367            "      Iteration itSequence2 {" +
1368            "        Sequence sequence2 {" +
1369            "          Event action1 {}" +
1370            "          Event action2 {}" +
1371            "          Event action3 {}" +
1372            "        }" +
1373            "      }" +
1374            "      Iteration itSequence3 {" +
1375            "        Sequence sequence3 {" +
1376            "          Event action4 {}" +
1377            "          Event action5 {}" +
1378            "          Event action6 {}" +
1379            "        }" +
1380            "        Sequence sequence3 {" +
1381            "          Event action4 {}" +
1382            "          Event action5 {}" +
1383            "          Event action6 {}" +
1384            "        }" +
1385            "      }" +
1386            "    }" +
1387            "  }" +
1388            "  Selection sel1 {" +
1389            "    Sequence sequence4 {" +
1390            "      Event action1 {}" +
1391            "      Event action2 {}" +
1392            "      Event action5 {}" +
1393            "      Event action6 {}" +
1394            "    }" +
1395            "  }" +
1396            "}";
1397
1398        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1399    }
1400
1401    /**
1402     * TODO: correct to let it run through
1403     */
1404    /*@Test
1405    public void test_IterationPreservation_07() throws Exception {
1406        String input =
1407            "UserSession {" +
1408            "  Sequence sequence1 {" +
1409            "    Sequence sequence2 {" +
1410            "      Event action1 {}" +
1411            "      Event action2 {}" +
1412            "    }" +
1413            "    Event action3 {}" +
1414            "  }" +
1415            "  Sequence sequence3 {" +
1416            "    Sequence sequence4 {" +
1417            "      Sequence sequence2 {" +
1418            "        Event action1 {}" +
1419            "        Event action2 {}" +
1420            "      }" +
1421            "      Iteration it1 {" +
1422            "        Event inserted1 {}" +
1423            "      }" +
1424            "    }" +
1425            "    Iteration it2 {" +
1426            "      Sequence sequence5 {" +
1427            "        Event inserted2 {}" +
1428            "        Event action3 {}" +
1429            "      }" +
1430            "      Sequence sequence5 {" +
1431            "        Event inserted2 {}" +
1432            "        Event action3 {}" +
1433            "      }" +
1434            "    }" +
1435            "  }" +
1436            "}";
1437
1438        String output =
1439            "UserSession {" +
1440            "  Selection sel1 {" +
1441            "    Sequence sequence1 {" +
1442            "      Sequence sequence2 {" +
1443            "        Event action1 {}" +
1444            "        Event action2 {}" +
1445            "      }" +
1446            "      Event action3 {}" +
1447            "    }" +
1448            "  }" +
1449            "  Selection sel1 {" +
1450            "    Sequence sequence3 {" +
1451            "      Sequence sequence4 {" +
1452            "        Sequence sequence2 {" +
1453            "          Event action1 {}" +
1454            "          Event action2 {}" +
1455            "        }" +
1456            "        Iteration it1 {" +
1457            "          Event inserted1 {}" +
1458            "        }" +
1459            "      }" +
1460            "      Iteration it2 {" +
1461            "        Sequence sequence5 {" +
1462            "          Event inserted2 {}" +
1463            "          Event action3 {}" +
1464            "        }" +
1465            "        Sequence sequence5 {" +
1466            "          Event inserted2 {}" +
1467            "          Event action3 {}" +
1468            "        }" +
1469            "      }" +
1470            "    }" +
1471            "  }" +
1472            "}";
1473
1474        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1475    }
1476
1477    /**
1478     *
1479     */
1480    @Test
1481    public void test_NoSimilarityDetection_01() throws Exception {
1482        String input =
1483            "UserSession {" +
1484            "  Sequence sequence1 {" +
1485            "    Event selAction1 {}" +
1486            "    Event action2 {}" +
1487            "    Event action3 {}" +
1488            "  }" +
1489            "  Sequence sequence2 {" +
1490            "    Event selAction2 {}" +
1491            "    Event action2 {}" +
1492            "    Event action3 {}" +
1493            "  }" +
1494            "}";
1495
1496        String output =
1497            "UserSession {" +
1498            "  Sequence sequence1 {" +
1499            "    Event selAction1 {}" +
1500            "    Event action2 {}" +
1501            "    Event action3 {}" +
1502            "  }" +
1503            "  Sequence sequence2 {" +
1504            "    Event selAction2 {}" +
1505            "    Event action2 {}" +
1506            "    Event action3 {}" +
1507            "  }" +
1508            "}";
1509
1510        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1511    }
1512
1513    /**
1514     *
1515     */
1516    @Test
1517    public void test_NoSimilarityDetection_02() throws Exception {
1518        String input =
1519            "UserSession {" +
1520            "  Sequence sequence1 {" +
1521            "    Event action1 {}" +
1522            "    Event action2 {}" +
1523            "    Event selAction1 {}" +
1524            "  }" +
1525            "  Sequence sequence2 {" +
1526            "    Event action1 {}" +
1527            "    Event action2 {}" +
1528            "    Event selAction2 {}" +
1529            "  }" +
1530            "}";
1531
1532        String output =
1533            "UserSession {" +
1534            "  Sequence sequence1 {" +
1535            "    Event action1 {}" +
1536            "    Event action2 {}" +
1537            "    Event selAction1 {}" +
1538            "  }" +
1539            "  Sequence sequence2 {" +
1540            "    Event action1 {}" +
1541            "    Event action2 {}" +
1542            "    Event selAction2 {}" +
1543            "  }" +
1544            "}";
1545
1546        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1547    }
1548
1549    /**
1550     *
1551     */
1552    @Test
1553    public void test_UniquenessOfReplacements_01() throws Exception {
1554        // situation where the same optional task is identified for two different sets of similar
1555        // tasks. However, the replacements must have the same optional task as child although
1556        // the parents are different.
1557        String input =
1558            "UserSession {" +
1559            "  Sequence sequence1 {" +
1560            "    Event action1 {}" +
1561            "    Event optAction1 {}" +
1562            "    Event action2 {}" +
1563            "  }" +
1564            "  Sequence sequence2 {" +
1565            "    Event action1 {}" +
1566            "    Event action2 {}" +
1567            "  }" +
1568            "  Sequence sequence3 {" +
1569            "    Event action3 {}" +
1570            "    Event optAction1 {}" +
1571            "    Event action4 {}" +
1572            "  }" +
1573            "  Sequence sequence4 {" +
1574            "    Event action3 {}" +
1575            "    Event action4 {}" +
1576            "  }" +
1577            "}";
1578
1579        String output =
1580            "UserSession {" +
1581            "  Sequence sequence5 {" +
1582            "    Event action1 {}" +
1583            "    Optional opt1 {" +
1584            "      Event optAction1 {}" +
1585            "    }" +
1586            "    Event action2 {}" +
1587            "  }" +
1588            "  Sequence sequence5 {" +
1589            "    Event action1 {}" +
1590            "    Optional opt1 {}" +
1591            "    Event action2 {}" +
1592            "  }" +
1593            "  Sequence sequence6 {" +
1594            "    Event action3 {}" +
1595            "    Optional opt1 {" +
1596            "      Event optAction1 {}" +
1597            "    }" +
1598            "    Event action4 {}" +
1599            "  }" +
1600            "  Sequence sequence6 {" +
1601            "    Event action3 {}" +
1602            "    Optional opt1 {}" +
1603            "    Event action4 {}" +
1604            "  }" +
1605            "}";
1606
1607        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1608    }
1609
1610    /**
1611     *
1612     */
1613    @Test
1614    public void test_UniquenessOfReplacements_02() throws Exception {
1615        // situation where the same selection task is identified for two different sets of similar
1616        // tasks. However, the replacements must have the same selection task as child although
1617        // the parents are different.
1618        String input =
1619            "UserSession {" +
1620            "  Sequence sequence1 {" +
1621            "    Iteration it1 {" +
1622            "      Event action1 {}" +
1623            "    }" +
1624            "    Event selAction1 {}" +
1625            "    Event action2 {}" +
1626            "  }" +
1627            "  Sequence sequence2 {" +
1628            "    Iteration it1 {" +
1629            "      Event action1 {}" +
1630            "      Event action1 {}" +
1631            "    }" +
1632            "    Event selAction2 {}" +
1633            "    Event action2 {}" +
1634            "  }" +
1635            "  Sequence sequence3 {" +
1636            "    Iteration it2 {" +
1637            "      Event action3 {}" +
1638            "      Event action3 {}" +
1639            "    }" +
1640            "    Event selAction1 {}" +
1641            "    Event action4 {}" +
1642            "  }" +
1643            "  Sequence sequence4 {" +
1644            "    Iteration it2 {" +
1645            "      Event action3 {}" +
1646            "    }" +
1647            "    Event selAction2 {}" +
1648            "    Event action4 {}" +
1649            "  }" +
1650            "}";
1651
1652        String output =
1653            "UserSession {" +
1654            "  Sequence sequence5 {" +
1655            "    Iteration it1 {" +
1656            "      Event action1 {}" +
1657            "    }" +
1658            "    Selection sel1 {" +
1659            "      Event selAction1 {}" +
1660            "    }" +
1661            "    Event action2 {}" +
1662            "  }" +
1663            "  Sequence sequence5 {" +
1664            "    Iteration it1 {" +
1665            "      Event action1 {}" +
1666            "      Event action1 {}" +
1667            "    }" +
1668            "    Selection sel1 {" +
1669            "      Event selAction2 {}" +
1670            "    }" +
1671            "    Event action2 {}" +
1672            "  }" +
1673            "  Sequence sequence6 {" +
1674            "    Iteration it2 {" +
1675            "      Event action3 {}" +
1676            "      Event action3 {}" +
1677            "    }" +
1678            "    Selection sel1 {" +
1679            "      Event selAction1 {}" +
1680            "    }" +
1681            "    Event action4 {}" +
1682            "  }" +
1683            "  Sequence sequence6 {" +
1684            "    Iteration it2 {" +
1685            "      Event action3 {}" +
1686            "    }" +
1687            "    Selection sel1 {" +
1688            "      Event selAction2 {}" +
1689            "    }" +
1690            "    Event action4 {}" +
1691            "  }" +
1692            "}";
1693
1694        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1695    }
1696
1697    /**
1698     *
1699     */
1700    @Test
1701    public void test_SpecificIntermediateSituations_01() throws Exception {
1702        String input =
1703            "UserSession {" +
1704            "  Sequence sequence1 {" +
1705            "    Event action1 {}" +
1706            "    Optional op1 {" +
1707            "      Event optAction1 {}" +
1708            "    }" +
1709            "    Event action2 {}" +
1710            "  }" +
1711            "  Sequence sequence2 {" +
1712            "    Event action1 {}" +
1713            "    Event optAction1 {}" +
1714            "    Event action2 {}" +
1715            "  }" +
1716            "}";
1717
1718        String output =
1719            "UserSession {" +
1720            "  Sequence sequence3 {" +
1721            "    Event action1 {}" +
1722            "    Optional opt1 {" +
1723            "      Event optAction1 {}" +
1724            "    }" +
1725            "    Event action2 {}" +
1726            "  }" +
1727            "  Sequence sequence3 {" +
1728            "    Event action1 {}" +
1729            "    Optional opt1 {" +
1730            "      Event optAction1 {}" +
1731            "    }" +
1732            "    Event action2 {}" +
1733            "  }" +
1734            "}";
1735
1736        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1737    }
1738
1739    /**
1740     *
1741     */
1742    @Test
1743    public void test_SpecificIntermediateSituations_02() throws Exception {
1744        String input =
1745            "UserSession {" +
1746            "  Sequence sequence1 {" +
1747            "    Event action1 {}" +
1748            "    Iteration itSeq2 {" +
1749            "      Sequence sequence2 {" +
1750            "        Event optAction1 {}" +
1751            "        Event optAction2 {}" +
1752            "      }" +
1753            "      Sequence sequence2 {" +
1754            "        Event optAction1 {}" +
1755            "        Event optAction2 {}" +
1756            "      }" +
1757            "    }" +
1758            "    Event action2 {}" +
1759            "    Event action3 {}" +
1760            "    Event action4 {}" +
1761            "  }" +
1762            "  Sequence sequence3 {" +
1763            "    Event action1 {}" +
1764            "    Event action2 {}" +
1765            "    Event action3 {}" +
1766            "    Event action4 {}" +
1767            "  }" +
1768            "}";
1769
1770        String output =
1771            "UserSession {" +
1772            "  Sequence sequence4 {" +
1773            "    Event action1 {}" +
1774            "    Optional opt1 {" +
1775            "      Iteration itSeq2 {" +
1776            "        Sequence sequence2 {" +
1777            "          Event optAction1 {}" +
1778            "          Event optAction2 {}" +
1779            "        }" +
1780            "        Sequence sequence2 {" +
1781            "          Event optAction1 {}" +
1782            "          Event optAction2 {}" +
1783            "        }" +
1784            "      }" +
1785            "    }" +
1786            "    Event action2 {}" +
1787            "    Event action3 {}" +
1788            "    Event action4 {}" +
1789            "  }" +
1790            "  Sequence sequence4 {" +
1791            "    Event action1 {}" +
1792            "    Optional opt1 {}" +
1793            "    Event action2 {}" +
1794            "    Event action3 {}" +
1795            "    Event action4 {}" +
1796            "  }" +
1797            "}";
1798
1799        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1800    }
1801
1802    /**
1803     *
1804     */
1805    @Test
1806    public void test_SpecificIntermediateSituations_03() throws Exception {
1807        String input =
1808            "UserSession {" +
1809            "  Sequence 6635 {" +
1810            "    Sequence 6464 {" +
1811            "      Iteration 6108 {" +
1812            "        Event action1 {}" +
1813            "      }" +
1814            "      Sequence 6305 {" +
1815            "        Sequence 6284 {" +
1816            "          Sequence 6198 {" +
1817            "            Iteration 6111 {" +
1818            "              Event action2 {}" +
1819            "            }" +
1820            "            Event action3 {}" +
1821            "          }" +
1822            "          Iteration 6089 {" +
1823            "            Event action8 {}" +
1824            "          }" +
1825            "        }" +
1826            "        Event action4 {}" +
1827            "      }" +
1828            "      Sequence 6211 {" +
1829            "        Event action5 {}" +
1830            "        Event action6 {}" +
1831            "      }" +
1832            "    }" +
1833            "    Sequence 6350 {" +
1834            "      Iteration 6089 {" +
1835            "        Event action8 {}" +
1836            "      }" +
1837            "      Iteration 6189 {" +
1838            "        Event action7 {}" +
1839            "      }" +
1840            "    }" +
1841            "  }" +
1842            "  Sequence 6381 {" +
1843            "    Iteration 6108 {" +
1844            "      Event action1 {}" +
1845            "    }" +
1846            "    Sequence 6258 {" +
1847            "      Sequence 6218 {" +
1848            "        Sequence 6199 {" +
1849            "          Sequence 6198 {" +
1850            "            Iteration 6111 {" +
1851            "              Event action2 {}" +
1852            "            }" +
1853            "            Event action3 {}" +
1854            "          }" +
1855            "          Event action4 {}" +
1856            "        }" +
1857            "        Sequence 6211 {" +
1858            "          Event action5 {}" +
1859            "          Event action6 {}" +
1860            "        }" +
1861            "      }" +
1862            "      Iteration 6189 {" +
1863            "        Event action7 {}" +
1864            "      }" +
1865            "    }" +
1866            "  }" +
1867            "}";
1868
1869        String output =
1870            "UserSession {" +
1871            "  Sequence sequence4 {" +
1872            "    Iteration 6108 {" +
1873            "      Event action1 {}" +
1874            "    }" +
1875            "    Sequence 6198 {" +
1876            "      Iteration 6111 {" +
1877            "        Event action2 {}" +
1878            "      }" +
1879            "      Event action3 {}" +
1880            "    }" +
1881            "    Optional opt1 {" +
1882            "      Iteration 6089 {" +
1883            "        Event action8 {}" +
1884            "      }" +
1885            "    }" +
1886            "    Event action4 {}" +
1887            "    Sequence 6211 {" +
1888            "      Event action5 {}" +
1889            "      Event action6 {}" +
1890            "    }" +
1891            "    Optional opt1 {" +
1892            "      Iteration 6089 {" +
1893            "        Event action8 {}" +
1894            "      }" +
1895            "    }" +
1896            "    Iteration 6189 {" +
1897            "      Event action7 {}" +
1898            "    }" +
1899            "  }" +
1900            "  Sequence sequence4 {" +
1901            "    Iteration 6108 {" +
1902            "      Event action1 {}" +
1903            "    }" +
1904            "    Sequence 6198 {" +
1905            "      Iteration 6111 {" +
1906            "        Event action2 {}" +
1907            "      }" +
1908            "      Event action3 {}" +
1909            "    }" +
1910            "    Optional opt1 { }" +
1911            "    Event action4 {}" +
1912            "    Sequence 6211 {" +
1913            "      Event action5 {}" +
1914            "      Event action6 {}" +
1915            "    }" +
1916            "    Optional opt1 { }" +
1917            "    Iteration 6189 {" +
1918            "      Event action7 {}" +
1919            "    }" +
1920            "  }" +
1921            "}";
1922
1923        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
1924    }
1925
1926    /**
1927     *
1928     */
1929    @Test
1930    public void test_SpecificIntermediateSituations_04() throws Exception {
1931        String input =
1932            "UserSession {" +
1933            "  Sequence seq1 {" +
1934            "    Event action1 {}" +
1935            "    Sequence seq2 {" +
1936            "      Event action2 {}" +
1937            "      Optional 221221 {" +
1938            "        Event action9 {}" +
1939            "      }" +
1940            "      Event action4 {}" +
1941            "      Optional 221221 {" +
1942            "        Event action9 {}" +
1943            "      }" +
1944            "      Event action5 {}" +
1945            "    }" +
1946            "    Sequence seq3 {" +
1947            "      Sequence seq4 {" +
1948            "        Event action6 {}" +
1949            "        Event action7 {}" +
1950            "      }" +
1951            "      Event action9 {}" +
1952            "    }" +
1953            "  }" +
1954            "  Sequence seq5 {" +
1955            "    Iteration 211092 {" +
1956            "      Sequence seq6 {" +
1957            "        Event action1 {}" +
1958            "        Sequence seq7 {" +
1959            "          Sequence seq8 {" +
1960            "            Event action2 {}" +
1961            "            Optional 221296 {" +
1962            "              Event action3 {}" +
1963            "            }" +
1964            "            Event action4 {}" +
1965            "            Event action5 {}" +
1966            "          }" +
1967            "          Sequence seq4 {" +
1968            "            Event action6 {}" +
1969            "            Event action7 {}" +
1970            "          }" +
1971            "        }" +
1972            "      }" +
1973            "    }" +
1974            "    Iteration #210928 {" +
1975            "      Sequence seq9 {" +
1976            "        Event action8 {}" +
1977            "        Event action9 {}" +
1978            "      }" +
1979            "      Sequence seq9 {" +
1980            "        Event action8 {}" +
1981            "        Event action9 {}" +
1982            "      }" +
1983            "    }" +
1984            "  }" +
1985            "}";
1986
1987        String output =
1988            "UserSession {" +
1989            "  Sequence seq10 {" +
1990            "    Event action1 {}" +
1991            "    Event action2 {}" +
1992            "    Selection 24 {" +
1993            "      Optional 4 {" +
1994            "        Event action9{}" +
1995            "      }" +
1996            "    }" +
1997            "    Event action5{}" +
1998            "    Optional 4 {" +
1999            "      Event action9{}" +
2000            "    }" +
2001            "    Event action5{}" +
2002            "    Sequence seq4 {" +
2003            "      Event action6 {}" +
2004            "      Event action7 {}" +
2005            "    }" +
2006            "    Iteration 27 {" +
2007            "      Sequence seq12 {" +
2008            "        Optional 25 {" +
2009            "        }" +
2010            "        Event action9{}" +
2011            "      }" +
2012            "    }" +
2013            "  }" +
2014            "  Sequence seq10 {" +
2015            "    Event action1 {}" +
2016            "    Event action2 {}" +
2017            "    Selection 24 {" +
2018            "      Optional 14 {" +
2019            "        Event action3 {}" +
2020            "      }" +
2021            "    }" +
2022            "    Event action5{}" +
2023            "    Optional 4 {" +
2024            "    }" +
2025            "    Event action5{}" +
2026            "    Sequence seq4 {" +
2027            "      Event action6 {}" +
2028            "      Event action7 {}" +
2029            "    }" +
2030            "    Iteration 27 {" +
2031            "      Sequence seq12 {" +
2032            "        Optional 25 {" +
2033            "          Event action8 {}" +
2034            "        }" +
2035            "        Event action9{}" +
2036            "      }" +
2037            "      Sequence seq12 {" +
2038            "        Optional 25 {" +
2039            "          Event action8 {}" +
2040            "        }" +
2041            "        Event action9{}" +
2042            "      }" +
2043            "    }" +
2044            "  }" +
2045            "}";
2046
2047        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
2048    }
2049
2050    /**
2051     * TODO: correct to let it run through
2052     */
2053    /*@Test
2054    public void test_SpecificIntermediateSituations_05() throws Exception {
2055        String input =
2056            "UserSession {" +
2057            "  Sequence 1 {" +
2058            "    Iteration 211092 {" +
2059            "      Sequence 2 {" +
2060            "        Iteration 210420 {" +
2061            "          Event action1 {}" +
2062            "        }" +
2063            "        Sequence 3 {" +
2064            "          Sequence 4 {" +
2065            "            Iteration 210339 {" +
2066            "              Event action2 {}" +
2067            "            }" +
2068            "            Optional 221296 {" +
2069            "              Iteration 210776 {" +
2070            "                Event action3 {}" +
2071            "              }" +
2072            "            }" +
2073            "            Iteration 210452 {" +
2074            "              Event action4 {}" +
2075            "            }" +
2076            "            Iteration 210453 {" +
2077            "              Event action5 {}" +
2078            "            }" +
2079            "          }" +
2080            "          Sequence 5 {" +
2081            "            Iteration 210422 {" +
2082            "              Event action6 {}" +
2083            "            }" +
2084            "            Iteration 210456 {" +
2085            "              Event action7 {}" +
2086            "            }" +
2087            "          }" +
2088            "        }" +
2089            "      }" +
2090            "    }" +
2091            "    Iteration #210928 {" +
2092            "      Sequence 6 {" +
2093            "        Iteration 210369 {" +
2094            "          Event action8 {}" +
2095            "        }" +
2096            "        Iteration 210337 {" +
2097            "          Event action9 {}" +
2098            "        }" +
2099            "      }" +
2100            "      Sequence 6 {" +
2101            "        Iteration 210369 {" +
2102            "          Event action8 {}" +
2103            "        }" +
2104            "        Iteration 210337 {" +
2105            "          Event action9 {}" +
2106            "        }" +
2107            "      }" +
2108            "    }" +
2109            "  }" +
2110            "  Sequence 7 {" +
2111            "    Iteration 210420 {" +
2112            "      Event action1 {}" +
2113            "    }" +
2114            "    Sequence 8 {" +
2115            "      Sequence 9 {" +
2116            "        Iteration 210339 {" +
2117            "          Event action2 {}" +
2118            "        }" +
2119            "      }" +
2120            "      Optional 221221 {" +
2121            "        Iteration 210337 {" +
2122            "          Event action9 {}" +
2123            "        }" +
2124            "      }" +
2125            "      Iteration 210452 {" +
2126            "        Event action4 {}" +
2127            "      }" +
2128            "      Optional 221221 {" +
2129            "        Iteration 210337 {" +
2130            "          Event action9 {}" +
2131            "        }" +
2132            "      }" +
2133            "      Iteration 210453 {" +
2134            "        Event action5 {}" +
2135            "      }" +
2136            "    }" +
2137            "    Sequence 10 {" +
2138            "      Sequence 11 {" +
2139            "        Iteration 210422 {" +
2140            "          Event action6 {}" +
2141            "        }" +
2142            "        Iteration 210456 {" +
2143            "          Event action7 {}" +
2144            "        }" +
2145            "      }" +
2146            "      Iteration 210337 {" +
2147            "        Event action9 {}" +
2148            "      }" +
2149            "    }" +
2150            "  }" +
2151            "}";
2152
2153        String output =
2154            "UserSession {" +
2155            "  Sequence sequence12 {" +
2156            "    Iteration 211092 {" +
2157            "      Sequence 2 {" +
2158            "        Iteration 210420 {" +
2159            "          Event action1 {}" +
2160            "        }" +
2161            "        Sequence 3 {" +
2162            "          Sequence 4 {" +
2163            "            Iteration 210339 {" +
2164            "              Event action2 {}" +
2165            "            }" +
2166            "            Optional 221296 {" +
2167            "              Iteration 210776 {" +
2168            "                Event action3 {}" +
2169            "              }" +
2170            "            }" +
2171            "            Iteration 210452 {" +
2172            "              Event action4 {}" +
2173            "            }" +
2174            "            Iteration 210453 {" +
2175            "              Event action5 {}" +
2176            "            }" +
2177            "          }" +
2178            "          Sequence 5 {" +
2179            "            Iteration 210422 {" +
2180            "              Event action6 {}" +
2181            "            }" +
2182            "            Iteration 210456 {" +
2183            "              Event action7 {}" +
2184            "            }" +
2185            "          }" +
2186            "        }" +
2187            "      }" +
2188            "    }" +
2189            "    Iteration #210928 {" +
2190            "      Sequence 6 {" +
2191            "        Iteration 210369 {" +
2192            "          Event action8 {}" +
2193            "        }" +
2194            "        Iteration 210337 {" +
2195            "          Event action9 {}" +
2196            "        }" +
2197            "      }" +
2198            "      Sequence 6 {" +
2199            "        Iteration 210369 {" +
2200            "          Event action8 {}" +
2201            "        }" +
2202            "        Iteration 210337 {" +
2203            "          Event action9 {}" +
2204            "        }" +
2205            "      }" +
2206            "    }" +
2207            "  }" +
2208            "  Sequence 7 {" +
2209            "    Iteration 210420 {" +
2210            "      Event action1 {}" +
2211            "    }" +
2212            "    Sequence 8 {" +
2213            "      Sequence 9 {" +
2214            "        Iteration 210339 {" +
2215            "          Event action2 {}" +
2216            "        }" +
2217            "      }" +
2218            "      Optional 221221 {" +
2219            "        Iteration 210337 {" +
2220            "          Event action9 {}" +
2221            "        }" +
2222            "      }" +
2223            "      Iteration 210452 {" +
2224            "        Event action4 {}" +
2225            "      }" +
2226            "      Optional 221221 {" +
2227            "        Iteration 210337 {" +
2228            "          Event action9 {}" +
2229            "        }" +
2230            "      }" +
2231            "      Iteration 210453 {" +
2232            "        Event action5 {}" +
2233            "      }" +
2234            "    }" +
2235            "    Sequence 10 {" +
2236            "      Sequence 11 {" +
2237            "        Iteration 210422 {" +
2238            "          Event action6 {}" +
2239            "        }" +
2240            "        Iteration 210456 {" +
2241            "          Event action7 {}" +
2242            "        }" +
2243            "      }" +
2244            "      Iteration 210337 {" +
2245            "        Event action9 {}" +
2246            "      }" +
2247            "    }" +
2248            "  }" +
2249            "}";
2250
2251        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
2252    }
2253
2254    /**
2255     * TODO: correct to let it run through
2256     */
2257    /*@Test
2258    public void test_SpecificIntermediateSituations_06() throws Exception {
2259        String input =
2260            "UserSession {" +
2261            "  Sequence seq1 {" +
2262            "    Event action1 {}" +
2263            "    Event action2 {}" +
2264            "    Event action3 {}" +
2265            "  }" +
2266            "  Sequence seq2 {" +
2267            "    Event action1 {}" +
2268            "    Event action2 {}" +
2269            "    Selection sel3 {" +
2270            "      Event action3 {}" +
2271            "    }" +
2272            "  }" +
2273            "}";
2274
2275        String output =
2276            "UserSession {" +
2277            "  Sequence seq3 {" +
2278            "    Event action1 {}" +
2279            "    Event action2 {}" +
2280            "    Selection sel3 {" +
2281            "      Event action3 {}" +
2282            "    }" +
2283            "  }" +
2284            "  Sequence seq3 {" +
2285            "    Event action1 {}" +
2286            "    Event action2 {}" +
2287            "    Selection sel3 {" +
2288            "      Event action3 {}" +
2289            "    }" +
2290            "  }" +
2291            "}";
2292
2293        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
2294    }
2295
2296    /**
2297     *
2298     */
2299    @Test
2300    public void test_SpecificIntermediateSituations_07() throws Exception {
2301        String input =
2302            "UserSession {" +
2303            "  Sequence seq1 {" +
2304            "    Event action1 {}" +
2305            "    Iteration it1 {" +
2306            "      Event action2 {}" +
2307            "      Event action2 {}" +
2308            "    }" +
2309            "    Selection sel1 {" +
2310            "      Event action3 {}" +
2311            "    }" +
2312            "    Event action5 {}" +
2313            "  }" +
2314            "  Sequence seq2 {" +
2315            "    Event action1 {}" +
2316            "    Iteration it1 {" +
2317            "      Event action2 {}" +
2318            "    }" +
2319            "    Selection sel2 {" +
2320            "      Event action4 {}" +
2321            "    }" +
2322            "    Event action5 {}" +
2323            "  }" +
2324            "}";
2325
2326        String output =
2327            "UserSession {" +
2328            "  Sequence seq3 {" +
2329            "    Event action1 {}" +
2330            "    Iteration it1 {" +
2331            "      Event action2 {}" +
2332            "      Event action2 {}" +
2333            "    }" +
2334            "    Selection sel3 {" +
2335            "      Event action3 {}" +
2336            "    }" +
2337            "    Event action5 {}" +
2338            "  }" +
2339            "  Sequence seq3 {" +
2340            "    Event action1 {}" +
2341            "    Iteration it1 {" +
2342            "      Event action2 {}" +
2343            "    }" +
2344            "    Selection sel3 {" +
2345            "      Event action4 {}" +
2346            "    }" +
2347            "    Event action5 {}" +
2348            "  }" +
2349            "}";
2350
2351        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
2352    }
2353
2354    /**
2355     * TODO: correct to let it run through
2356     */
2357    /*@Test
2358    public void test_SpecificIntermediateSituations_08() throws Exception {
2359        String input =
2360            "UserSession {" +
2361            "  Sequence seq1 {" +
2362            "    Event action1 {}" +
2363            "    Event action2 {}" +
2364            "    Optional opt2 {" +
2365            "      Sequence seq2 {" +
2366            "        Event action5 {}" +
2367            "        Event action6 {}" +
2368            "      }" +
2369            "    }" +
2370            "  }" +
2371            "  Sequence seq1 {" +
2372            "    Event action1 {}" +
2373            "    Event action2 {}" +
2374            "    Optional opt2 {}" +
2375            "  }" +
2376            "  Sequence seq3 {" +
2377            "    Event action1 {}" +
2378            "    Event action2 {}" +
2379            "    Optional opt1 {" +
2380            "      Event action4 {}" +
2381            "    }" +
2382            "    Sequence seq2 {" +
2383            "      Event action5 {}" +
2384            "      Event action6 {}" +
2385            "    }" +
2386            "  }" +
2387            "}";
2388
2389        String output =
2390            "UserSession {" +
2391            "  Sequence seq4 {" +
2392            "    Event action1 {}" +
2393            "    Event action2 {}" +
2394            "    Optional opt1 {}" +
2395            "    Optional opt2 {" +
2396            "      Sequence seq2 {" +
2397            "        Event action5 {}" +
2398            "        Event action6 {}" +
2399            "      }" +
2400            "    }" +
2401            "  }" +
2402            "  Sequence seq4 {" +
2403            "    Event action1 {}" +
2404            "    Event action2 {}" +
2405            "    Optional opt1 {}" +
2406            "    Optional opt2 {}" +
2407            "  }" +
2408            "  Sequence seq4 {" +
2409            "    Event action1 {}" +
2410            "    Event action2 {}" +
2411            "    Optional opt1 {" +
2412            "      Event action4 {}" +
2413            "    }" +
2414            "    Optional opt2 {" +
2415            "      Sequence seq2 {" +
2416            "        Event action5 {}" +
2417            "        Event action6 {}" +
2418            "      }" +
2419            "    }" +
2420            "  }" +
2421            "}";
2422
2423        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
2424    }
2425
2426    /**
2427     *
2428     */
2429    @Test
2430    public void test_SpecificIntermediateSituations_09() throws Exception {
2431        String input =
2432            "UserSession {" +
2433            "  Sequence seq1 {" +
2434            "    Sequence seq2 {" +
2435            "      Event action0 {}" +
2436            "      Event action1 {}" +
2437            "      Event action2 {}" +
2438            "      Event action3 {}" +
2439            "    }" +
2440            "    Event action4 {}" +
2441            "    Event action5 {}" +
2442            "  }" +
2443            "  Sequence seq3 {" +
2444            "    Sequence seq4 {" +
2445            "      Event action0 {}" +
2446            "      Event action1 {}" +
2447            "      Event action3 {}" +
2448            "    }" +
2449            "    Event action4 {}" +
2450            "    Event action5 {}" +
2451            "  }" +
2452            "  Sequence seq5 {" +
2453            "    Sequence seq2 {" +
2454            "      Event action0 {}" +
2455            "      Event action1 {}" +
2456            "      Event action2 {}" +
2457            "      Event action3 {}" +
2458            "    }" +
2459            "    Event action5 {}" +
2460            "  }" +
2461            "}";
2462
2463        String output =
2464            "UserSession {" +
2465            "  Sequence seq6 {" +
2466            "    Sequence seq7 {" +
2467            "      Event action0 {}" +
2468            "      Event action1 {}" +
2469            "      Optional opt1 {" +
2470            "        Event action2 {}" +
2471            "      }" +
2472            "      Event action3 {}" +
2473            "    }" +
2474            "    Optional opt2 {" +
2475            "      Event action4 {}" +
2476            "    }" +
2477            "    Event action5 {}" +
2478            "  }" +
2479            "  Sequence seq6 {" +
2480            "    Sequence seq7 {" +
2481            "      Event action0 {}" +
2482            "      Event action1 {}" +
2483            "      Optional opt1 {}" +
2484            "      Event action3 {}" +
2485            "    }" +
2486            "    Optional opt2 {" +
2487            "      Event action4 {}" +
2488            "    }" +
2489            "    Event action5 {}" +
2490            "  }" +
2491            "  Sequence seq6 {" +
2492            "    Sequence seq7 {" +
2493            "      Event action0 {}" +
2494            "      Event action1 {}" +
2495            "      Optional opt1 {" +
2496            "        Event action2 {}" +
2497            "      }" +
2498            "      Event action3 {}" +
2499            "    }" +
2500            "    Optional opt2 {}" +
2501            "    Event action5 {}" +
2502            "  }" +
2503            "}";
2504
2505        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
2506    }
2507
2508    /**
2509     * TODO: correct to let it run through
2510     */
2511    /*@Test
2512    public void test_RealLifeScenario_01() throws Exception {
2513        // situation where the same selection task is identified for two different sets of similar
2514        // tasks. However, the replacements must have the same selection task as child although
2515        // the parents are different.
2516        String input =
2517            "UserSession {" +
2518            "  Sequence seq1 {" +
2519            "    Iteration itSeq2 {" +
2520            "      Sequence seq2 {" +
2521            "        Iteration itSeq3 {" +
2522            "          Sequence seq3 {" +
2523            "            Iteration itSeq4 {" +
2524            "              Sequence seq4 {" +
2525            "                Iteration itClickTf1 {" +
2526            "                  Event clickTf1 {}" +
2527            "                }" +
2528            "                Iteration itEnterTf1 {" +
2529            "                  Event enterTf1 {}" +
2530            "                }" +
2531            "              }" +
2532            "            }" +
2533            "            Event tabPress {}" +
2534            "          }" +
2535            "        }" +
2536            "        Iteration itEnterTf2 {" +
2537            "          Event enterTf2 {}" +
2538            "        }" +
2539            "      }" +
2540            "    }" +
2541            "    Iteration itSeqConfirm {" +
2542            "      Sequence seqConfirm {" +
2543            "        Iteration itClickBtn {" +
2544            "          Event clickBtn {}" +
2545            "        }" +
2546            "        Iteration itScroll {" +
2547            "          Event scroll {}" +
2548            "        }" +
2549            "      }" +
2550            "    }" +
2551            "  }" +
2552            "  Sequence seq5 {" +
2553            "    Iteration itSeq4 {" +
2554            "      Sequence seq4 {" +
2555            "        Iteration itClickTf1 {" +
2556            "          Event clickTf1 {}" +
2557            "        }" +
2558            "        Iteration itEnterTf1 {" +
2559            "          Event enterTf1 {}" +
2560            "        }" +
2561            "      }" +
2562            "    }" +
2563            "    Sequence seq6 {" +
2564            "      Iteration itSeq7 {" +
2565            "        Sequence seq7 {" +
2566            "          Iteration itClickTf2 {" +
2567            "            Event clickTf2 {}" +
2568            "          }" +
2569            "          Iteration itEnterTf2 {" +
2570            "            Event enterTf2 {}" +
2571            "          }" +
2572            "        }" +
2573            "      }" +
2574            "      Iteration itSeqConfirm {" +
2575            "        Sequence seqConfirm {" +
2576            "          Iteration itClickBtn {" +
2577            "            Event clickBtn {}" +
2578            "          }" +
2579            "          Iteration itScroll {" +
2580            "            Event scroll {}" +
2581            "          }" +
2582            "        }" +
2583            "      }" +
2584            "    }" +
2585            "  }" +
2586            "}";
2587
2588        String output =
2589            "UserSession {" +
2590            "  Selection sel1 {" +
2591            "    Sequence seq8 {" +
2592            "      Iteration itSeq2 {" +
2593            "        Sequence seq2 {" +
2594            "          Iteration itSeq3 {" +
2595            "            Sequence seq3 {" +
2596            "              Iteration itSeq4 {" +
2597            "                Sequence seq4 {" +
2598            "                  Iteration itClickTf1 {" +
2599            "                    Event clickTf1 {}" +
2600            "                  }" +
2601            "                  Iteration itEnterTf1 {" +
2602            "                    Event enterTf1 {}" +
2603            "                  }" +
2604            "                }" +
2605            "              }" +
2606            "              Event tabPress {}" +
2607            "            }" +
2608            "          }" +
2609            "          Iteration itEnterTf2 {" +
2610            "            Event enterTf2 {}" +
2611            "          }" +
2612            "        }" +
2613            "      }" +
2614            "      Iteration itSeqConfirm {" +
2615            "        Sequence seqConfirm {" +
2616            "          Iteration itClickBtn {" +
2617            "            Event clickBtn {}" +
2618            "          }" +
2619            "          Iteration itScroll {" +
2620            "            Event scroll {}" +
2621            "          }" +
2622            "        }" +
2623            "      }" +
2624            "    }" +
2625            "  }" +
2626            "  Selection sel1 {" +
2627            "    Sequence seq9 {" +
2628            "      Iteration itSeq4 {" +
2629            "        Sequence seq4 {" +
2630            "          Iteration itClickTf1 {" +
2631            "            Event clickTf1 {}" +
2632            "          }" +
2633            "          Iteration itEnterTf1 {" +
2634            "            Event enterTf1 {}" +
2635            "          }" +
2636            "        }" +
2637            "      }" +
2638            "      Sequence seq6 {" +
2639            "        Iteration itSeq7 {" +
2640            "          Sequence seq7 {" +
2641            "            Iteration itClickTf2 {" +
2642            "              Event clickTf2 {}" +
2643            "            }" +
2644            "            Iteration itEnterTf2 {" +
2645            "              Event enterTf2 {}" +
2646            "            }" +
2647            "          }" +
2648            "        }" +
2649            "        Iteration itSeqConfirm {" +
2650            "          Sequence seqConfirm {" +
2651            "            Iteration itClickBtn {" +
2652            "              Event clickBtn {}" +
2653            "            }" +
2654            "            Iteration itScroll {" +
2655            "              Event scroll {}" +
2656            "            }" +
2657            "          }" +
2658            "        }" +
2659            "      }" +
2660            "    }" +
2661            "  }" +
2662            "}";
2663
2664        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
2665    }
2666
2667    /**
2668     * TODO: correct to let it run through
2669     */
2670    /*@Test
2671    public void test_RealLifeScenario_02() throws Exception {
2672        // situation where the same selection task is identified for two different sets of similar
2673        // tasks. However, the replacements must have the same selection task as child although
2674        // the parents are different.
2675        String input =
2676            "UserSession {" +
2677            "  Sequence seq1 {" +
2678            "    Iteration itSeq2 {" +
2679            "      Sequence seq2 {" +
2680            "        Iteration itSeq3 {" +
2681            "          Sequence seq3 {" +
2682            "            Iteration itSeq4 {" +
2683            "              Sequence seq4 {" +
2684            "                Iteration itClickTf1 {" +
2685            "                  Event clickTf1 {}" +
2686            "                }" +
2687            "                Iteration itEnterTf1 {" +
2688            "                  Event enterTf1 {}" +
2689            "                }" +
2690            "              }" +
2691            "              Sequence seq4 {" +
2692            "                Iteration itClickTf1 {" +
2693            "                  Event clickTf1 {}" +
2694            "                }" +
2695            "                Iteration itEnterTf1 {" +
2696            "                  Event enterTf1 {}" +
2697            "                }" +
2698            "              }" +
2699            "            }" +
2700            "            Event tabPress {}" +
2701            "          }" +
2702            "          Sequence seq3 {" +
2703            "            Iteration itSeq4 {" +
2704            "              Sequence seq4 {" +
2705            "                Iteration itClickTf1 {" +
2706            "                  Event clickTf1 {}" +
2707            "                }" +
2708            "                Iteration itEnterTf1 {" +
2709            "                  Event enterTf1 {}" +
2710            "                }" +
2711            "              }" +
2712            "              Sequence seq4 {" +
2713            "                Iteration itClickTf1 {" +
2714            "                  Event clickTf1 {}" +
2715            "                }" +
2716            "                Iteration itEnterTf1 {" +
2717            "                  Event enterTf1 {}" +
2718            "                }" +
2719            "              }" +
2720            "            }" +
2721            "            Event tabPress {}" +
2722            "          }" +
2723            "        }" +
2724            "        Iteration itEnterTf2 {" +
2725            "          Event enterTf2 {}" +
2726            "        }" +
2727            "      }" +
2728            "      Sequence seq2 {" +
2729            "        Iteration itSeq3 {" +
2730            "          Sequence seq3 {" +
2731            "            Iteration itSeq4 {" +
2732            "              Sequence seq4 {" +
2733            "                Iteration itClickTf1 {" +
2734            "                  Event clickTf1 {}" +
2735            "                }" +
2736            "                Iteration itEnterTf1 {" +
2737            "                  Event enterTf1 {}" +
2738            "                }" +
2739            "              }" +
2740            "              Sequence seq4 {" +
2741            "                Iteration itClickTf1 {" +
2742            "                  Event clickTf1 {}" +
2743            "                }" +
2744            "                Iteration itEnterTf1 {" +
2745            "                  Event enterTf1 {}" +
2746            "                }" +
2747            "              }" +
2748            "            }" +
2749            "            Event tabPress {}" +
2750            "          }" +
2751            "          Sequence seq3 {" +
2752            "            Iteration itSeq4 {" +
2753            "              Sequence seq4 {" +
2754            "                Iteration itClickTf1 {" +
2755            "                  Event clickTf1 {}" +
2756            "                }" +
2757            "                Iteration itEnterTf1 {" +
2758            "                  Event enterTf1 {}" +
2759            "                }" +
2760            "              }" +
2761            "              Sequence seq4 {" +
2762            "                Iteration itClickTf1 {" +
2763            "                  Event clickTf1 {}" +
2764            "                }" +
2765            "                Iteration itEnterTf1 {" +
2766            "                  Event enterTf1 {}" +
2767            "                }" +
2768            "              }" +
2769            "            }" +
2770            "            Event tabPress {}" +
2771            "          }" +
2772            "        }" +
2773            "        Iteration itEnterTf2 {" +
2774            "          Event enterTf2 {}" +
2775            "        }" +
2776            "      }" +
2777            "    }" +
2778            "    Iteration itSeqConfirm {" +
2779            "      Sequence seqConfirm {" +
2780            "        Iteration itClickBtn {" +
2781            "          Event clickBtn {}" +
2782            "        }" +
2783            "        Iteration itScroll {" +
2784            "          Event scroll {}" +
2785            "        }" +
2786            "      }" +
2787            "      Sequence seqConfirm {" +
2788            "        Iteration itClickBtn {" +
2789            "          Event clickBtn {}" +
2790            "        }" +
2791            "        Iteration itScroll {" +
2792            "          Event scroll {}" +
2793            "        }" +
2794            "      }" +
2795            "    }" +
2796            "  }" +
2797            "  Sequence seq5 {" +
2798            "    Iteration itSeq4 {" +
2799            "      Sequence seq4 {" +
2800            "        Iteration itClickTf1 {" +
2801            "          Event clickTf1 {}" +
2802            "        }" +
2803            "        Iteration itEnterTf1 {" +
2804            "          Event enterTf1 {}" +
2805            "        }" +
2806            "      }" +
2807            "      Sequence seq4 {" +
2808            "        Iteration itClickTf1 {" +
2809            "          Event clickTf1 {}" +
2810            "        }" +
2811            "        Iteration itEnterTf1 {" +
2812            "          Event enterTf1 {}" +
2813            "        }" +
2814            "      }" +
2815            "    }" +
2816            "    Sequence seq6 {" +
2817            "      Iteration itSeq7 {" +
2818            "        Sequence seq7 {" +
2819            "          Iteration itClickTf2 {" +
2820            "            Event clickTf2 {}" +
2821            "          }" +
2822            "          Iteration itEnterTf2 {" +
2823            "            Event enterTf2 {}" +
2824            "          }" +
2825            "        }" +
2826            "        Sequence seq7 {" +
2827            "          Iteration itClickTf2 {" +
2828            "            Event clickTf2 {}" +
2829            "          }" +
2830            "          Iteration itEnterTf2 {" +
2831            "            Event enterTf2 {}" +
2832            "          }" +
2833            "        }" +
2834            "      }" +
2835            "      Iteration itSeqConfirm {" +
2836            "        Sequence seqConfirm {" +
2837            "          Iteration itClickBtn {" +
2838            "            Event clickBtn {}" +
2839            "          }" +
2840            "          Iteration itScroll {" +
2841            "            Event scroll {}" +
2842            "          }" +
2843            "        }" +
2844            "        Sequence seqConfirm {" +
2845            "          Iteration itClickBtn {" +
2846            "            Event clickBtn {}" +
2847            "          }" +
2848            "          Iteration itScroll {" +
2849            "            Event scroll {}" +
2850            "          }" +
2851            "        }" +
2852            "      }" +
2853            "    }" +
2854            "  }" +
2855            "}";
2856
2857        String output =
2858            "UserSession {" +
2859            "  Sequence seq8 {" +
2860            "    Iteration itSeq2 {" +
2861            "      Sequence seq2 {" +
2862            "        Iteration itSeq3 {" +
2863            "          Sequence seq3 {" +
2864            "            Iteration itSeq4 {" +
2865            "              Sequence seq4 {" +
2866            "                Iteration itClickTf1 {" +
2867            "                  Event clickTf1 {}" +
2868            "                }" +
2869            "                Iteration itEnterTf1 {" +
2870            "                  Event enterTf1 {}" +
2871            "                }" +
2872            "              }" +
2873            "              Sequence seq4 {" +
2874            "                Iteration itClickTf1 {" +
2875            "                  Event clickTf1 {}" +
2876            "                }" +
2877            "                Iteration itEnterTf1 {" +
2878            "                  Event enterTf1 {}" +
2879            "                }" +
2880            "              }" +
2881            "            }" +
2882            "            Event tabPress {}" +
2883            "          }" +
2884            "          Sequence seq3 {" +
2885            "            Iteration itSeq4 {" +
2886            "              Sequence seq4 {" +
2887            "                Iteration itClickTf1 {" +
2888            "                  Event clickTf1 {}" +
2889            "                }" +
2890            "                Iteration itEnterTf1 {" +
2891            "                  Event enterTf1 {}" +
2892            "                }" +
2893            "              }" +
2894            "              Sequence seq4 {" +
2895            "                Iteration itClickTf1 {" +
2896            "                  Event clickTf1 {}" +
2897            "                }" +
2898            "                Iteration itEnterTf1 {" +
2899            "                  Event enterTf1 {}" +
2900            "                }" +
2901            "              }" +
2902            "            }" +
2903            "            Event tabPress {}" +
2904            "          }" +
2905            "        }" +
2906            "        Iteration itEnterTf2 {" +
2907            "          Event enterTf2 {}" +
2908            "        }" +
2909            "      }" +
2910            "      Sequence seq2 {" +
2911            "        Iteration itSeq3 {" +
2912            "          Sequence seq3 {" +
2913            "            Iteration itSeq4 {" +
2914            "              Sequence seq4 {" +
2915            "                Iteration itClickTf1 {" +
2916            "                  Event clickTf1 {}" +
2917            "                }" +
2918            "                Iteration itEnterTf1 {" +
2919            "                  Event enterTf1 {}" +
2920            "                }" +
2921            "              }" +
2922            "              Sequence seq4 {" +
2923            "                Iteration itClickTf1 {" +
2924            "                  Event clickTf1 {}" +
2925            "                }" +
2926            "                Iteration itEnterTf1 {" +
2927            "                  Event enterTf1 {}" +
2928            "                }" +
2929            "              }" +
2930            "            }" +
2931            "            Event tabPress {}" +
2932            "          }" +
2933            "          Sequence seq3 {" +
2934            "            Iteration itSeq4 {" +
2935            "              Sequence seq4 {" +
2936            "                Iteration itClickTf1 {" +
2937            "                  Event clickTf1 {}" +
2938            "                }" +
2939            "                Iteration itEnterTf1 {" +
2940            "                  Event enterTf1 {}" +
2941            "                }" +
2942            "              }" +
2943            "              Sequence seq4 {" +
2944            "                Iteration itClickTf1 {" +
2945            "                  Event clickTf1 {}" +
2946            "                }" +
2947            "                Iteration itEnterTf1 {" +
2948            "                  Event enterTf1 {}" +
2949            "                }" +
2950            "              }" +
2951            "            }" +
2952            "            Event tabPress {}" +
2953            "          }" +
2954            "        }" +
2955            "        Iteration itEnterTf2 {" +
2956            "          Event enterTf2 {}" +
2957            "        }" +
2958            "      }" +
2959            "    }" +
2960            "    Iteration itSeqConfirm {" +
2961            "      Sequence seqConfirm {" +
2962            "        Iteration itClickBtn {" +
2963            "          Event clickBtn {}" +
2964            "        }" +
2965            "        Iteration itScroll {" +
2966            "          Event scroll {}" +
2967            "        }" +
2968            "      }" +
2969            "      Sequence seqConfirm {" +
2970            "        Iteration itClickBtn {" +
2971            "          Event clickBtn {}" +
2972            "        }" +
2973            "        Iteration itScroll {" +
2974            "          Event scroll {}" +
2975            "        }" +
2976            "      }" +
2977            "    }" +
2978            "  }" +
2979            "  Sequence seq5 {" +
2980            "    Iteration itSeq4 {" +
2981            "      Sequence seq4 {" +
2982            "        Iteration itClickTf1 {" +
2983            "          Event clickTf1 {}" +
2984            "        }" +
2985            "        Iteration itEnterTf1 {" +
2986            "          Event enterTf1 {}" +
2987            "        }" +
2988            "      }" +
2989            "      Sequence seq4 {" +
2990            "        Iteration itClickTf1 {" +
2991            "          Event clickTf1 {}" +
2992            "        }" +
2993            "        Iteration itEnterTf1 {" +
2994            "          Event enterTf1 {}" +
2995            "        }" +
2996            "      }" +
2997            "    }" +
2998            "    Sequence seq6 {" +
2999            "      Iteration itSeq7 {" +
3000            "        Sequence seq7 {" +
3001            "          Iteration itClickTf2 {" +
3002            "            Event clickTf2 {}" +
3003            "          }" +
3004            "          Iteration itEnterTf2 {" +
3005            "            Event enterTf2 {}" +
3006            "          }" +
3007            "        }" +
3008            "        Sequence seq7 {" +
3009            "          Iteration itClickTf2 {" +
3010            "            Event clickTf2 {}" +
3011            "          }" +
3012            "          Iteration itEnterTf2 {" +
3013            "            Event enterTf2 {}" +
3014            "          }" +
3015            "        }" +
3016            "      }" +
3017            "      Iteration itSeqConfirm {" +
3018            "        Sequence seqConfirm {" +
3019            "          Iteration itClickBtn {" +
3020            "            Event clickBtn {}" +
3021            "          }" +
3022            "          Iteration itScroll {" +
3023            "            Event scroll {}" +
3024            "          }" +
3025            "        }" +
3026            "        Sequence seqConfirm {" +
3027            "          Iteration itClickBtn {" +
3028            "            Event clickBtn {}" +
3029            "          }" +
3030            "          Iteration itScroll {" +
3031            "            Event scroll {}" +
3032            "          }" +
3033            "        }" +
3034            "      }" +
3035            "    }" +
3036            "  }" +
3037            "}";
3038
3039        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
3040    }
3041
3042    /**
3043     * TODO: correct to let it run through
3044     */
3045    /*@Test
3046    public void test_RealLifeScenario_03() throws Exception {
3047        // situation where the same selection task is identified for two different sets of similar
3048        // tasks. However, the replacements must have the same selection task as child although
3049        // the parents are different.
3050        String input =
3051            "UserSession {" +
3052            "  Sequence sequence1 {" +
3053            "    Iteration itSeqUtilizeTextField1 {" +
3054            "      Sequence seqUtilizeTextField1 {" +
3055            "        Iteration itClickTextField1 {" +
3056            "          Event clickTextField1 {}" +
3057            "          Event clickTextField1 {}" +
3058            "        }" +
3059            "        Iteration itEnterTextTextField1 {" +
3060            "          Event enterTextTextField1 {}" +
3061            "        }" +
3062            "      }" +
3063            "      Sequence seqUtilizeTextField1 {" +
3064            "        Iteration itClickTextField1 {" +
3065            "          Event clickTextField1 {}" +
3066            "        }" +
3067            "        Iteration itEnterTextTextField1 {" +
3068            "          Event enterTextTextField1 {}" +
3069            "        }" +
3070            "      }" +
3071            "    }" +
3072            "    Sequence sequence2 {" +
3073            "      Iteration itSeqUtilizeTextField2 {" +
3074            "        Sequence seqUtilizeTextField2 {" +
3075            "          Iteration itClickTextField2 {" +
3076            "            Event clickTextField2 {}" +
3077            "          }" +
3078            "          Iteration itEnterTextTextField2 {" +
3079            "            Event enterTextTextField2 {}" +
3080            "            Event enterTextTextField2 {}" +
3081            "          }" +
3082            "        }" +
3083            "        Sequence seqUtilizeTextField2 {" +
3084            "          Iteration itClickTextField2 {" +
3085            "            Event clickTextField2 {}" +
3086            "            Event clickTextField2 {}" +
3087            "          }" +
3088            "          Iteration itEnterTextTextField2 {" +
3089            "            Event enterTextTextField2 {}" +
3090            "          }" +
3091            "        }" +
3092            "      }" +
3093            "      Iteration itClickButton1 {" +
3094            "        Event clickButton1 {}" +
3095            "        Event clickButton1 {}" +
3096            "      }" +
3097            "    }" +
3098            "  }" +
3099            "  Sequence sequence3 {" +
3100            "    Iteration itSequence4 {" +
3101            "      Sequence sequence4 {" +
3102            "        Iteration itSequence5 {" +
3103            "          Sequence sequence5 {" +
3104            "            Iteration itSeqUtilizeTextField1 {" +
3105            "              Sequence seqUtilizeTextField1 {" +
3106            "                Iteration itClickTextField1 {" +
3107            "                  Event clickTextField1 {}" +
3108            "                }" +
3109            "                Iteration itEnterTextTextField1 {" +
3110            "                  Event enterTextTextField1 {}" +
3111            "                }" +
3112            "              }" +
3113            "            }" +
3114            "            Event pressTabTextField2 {}" +
3115            "          }" +
3116            "          Sequence sequence5 {" +
3117            "            Iteration itSeqUtilizeTextField1 {" +
3118            "              Sequence seqUtilizeTextField1 {" +
3119            "                Iteration itClickTextField1 {" +
3120            "                  Event clickTextField1 {}" +
3121            "                }" +
3122            "                Iteration itEnterTextTextField1 {" +
3123            "                  Event enterTextTextField1 {}" +
3124            "                }" +
3125            "              }" +
3126            "            }" +
3127            "            Event pressTabTextField2 {}" +
3128            "          }" +
3129            "        }" +
3130            "        Iteration itEnterTextTextField2 {" +
3131            "          Event enterTextTextField2 {}" +
3132            "          Event enterTextTextField2 {}" +
3133            "        }" +
3134            "      }" +
3135            "      Sequence sequence4 {" +
3136            "        Iteration itSequence5 {" +
3137            "          Sequence sequence5 {" +
3138            "            Iteration itSeqUtilizeTextField1 {" +
3139            "              Sequence seqUtilizeTextField1 {" +
3140            "                Iteration itClickTextField1 {" +
3141            "                  Event clickTextField1 {}" +
3142            "                }" +
3143            "                Iteration itEnterTextTextField1 {" +
3144            "                  Event enterTextTextField1 {}" +
3145            "                  Event enterTextTextField1 {}" +
3146            "                }" +
3147            "              }" +
3148            "              Sequence seqUtilizeTextField1 {" +
3149            "                Iteration itClickTextField1 {" +
3150            "                  Event clickTextField1 {}" +
3151            "                  Event clickTextField1 {}" +
3152            "                }" +
3153            "                Iteration itEnterTextTextField1 {" +
3154            "                  Event enterTextTextField1 {}" +
3155            "                }" +
3156            "              }" +
3157            "            }" +
3158            "            Event pressTabTextField2 {}" +
3159            "          }" +
3160            "        }" +
3161            "        Iteration itEnterTextTextField2 {" +
3162            "          Event enterTextTextField2 {}" +
3163            "        }" +
3164            "      }" +
3165            "    }" +
3166            "    Iteration itClickButton1 {" +
3167            "      Event clickButton1 {}" +
3168            "    }" +
3169            "  }" +
3170            "}";
3171
3172        String output =
3173            "UserSession {" +
3174            "  Sequence sequence6 {" +
3175            "    Selection selection1 {" +
3176            "      Sequence sequence7 {" +
3177            "        Iteration itSeqUtilizeTextField1 {" +
3178            "          Sequence seqUtilizeTextField1 {" +
3179            "            Iteration itClickTextField1 {" +
3180            "              Event clickTextField1 {}" +
3181            "              Event clickTextField1 {}" +
3182            "            }" +
3183            "            Iteration itEnterTextTextField1 {" +
3184            "              Event enterTextTextField1 {}" +
3185            "            }" +
3186            "          }" +
3187            "          Sequence seqUtilizeTextField1 {" +
3188            "            Iteration itClickTextField1 {" +
3189            "              Event clickTextField1 {}" +
3190            "            }" +
3191            "            Iteration itEnterTextTextField1 {" +
3192            "              Event enterTextTextField1 {}" +
3193            "            }" +
3194            "          }" +
3195            "        }" +
3196            "        Iteration itSeqUtilizeTextField2 {" +
3197            "          Sequence seqUtilizeTextField2 {" +
3198            "            Iteration itClickTextField2 {" +
3199            "              Event clickTextField2 {}" +
3200            "            }" +
3201            "            Iteration itEnterTextTextField2 {" +
3202            "              Event enterTextTextField2 {}" +
3203            "              Event enterTextTextField2 {}" +
3204            "            }" +
3205            "          }" +
3206            "          Sequence seqUtilizeTextField2 {" +
3207            "            Iteration itClickTextField2 {" +
3208            "              Event clickTextField2 {}" +
3209            "              Event clickTextField2 {}" +
3210            "            }" +
3211            "            Iteration itEnterTextTextField2 {" +
3212            "              Event enterTextTextField2 {}" +
3213            "            }" +
3214            "          }" +
3215            "        }" +
3216            "      }" +
3217            "    }" +
3218            "    Iteration itClickButton1 {" +
3219            "      Event clickButton1 {}" +
3220            "      Event clickButton1 {}" +
3221            "    }" +
3222            "  }" +
3223            "  Sequence sequence6 {" +
3224            "    Selection selection1 {" +
3225            "      Iteration itSeq4 {" +
3226            "        Sequence sequence4 {" +
3227            "          Iteration itSequence5 {" +
3228            "            Sequence sequence5 {" +
3229            "              Iteration itSeqUtilizeTextField1 {" +
3230            "                Sequence seqUtilizeTextField1 {" +
3231            "                  Iteration itClickTextField1 {" +
3232            "                    Event clickTextField1 {}" +
3233            "                  }" +
3234            "                  Iteration itEnterTextTextField1 {" +
3235            "                    Event enterTextTextField1 {}" +
3236            "                  }" +
3237            "                }" +
3238            "              }" +
3239            "              Event pressTabTextField2 {}" +
3240            "            }" +
3241            "            Sequence sequence5 {" +
3242            "              Iteration itSeqUtilizeTextField1 {" +
3243            "                Sequence seqUtilizeTextField1 {" +
3244            "                  Iteration itClickTextField1 {" +
3245            "                    Event clickTextField1 {}" +
3246            "                  }" +
3247            "                  Iteration itEnterTextTextField1 {" +
3248            "                    Event enterTextTextField1 {}" +
3249            "                  }" +
3250            "                }" +
3251            "              }" +
3252            "              Event pressTabTextField2 {}" +
3253            "            }" +
3254            "          }" +
3255            "          Iteration itEnterTextTextField2 {" +
3256            "            Event enterTextTextField2 {}" +
3257            "            Event enterTextTextField2 {}" +
3258            "          }" +
3259            "        }" +
3260            "        Sequence sequence4 {" +
3261            "          Iteration itSequence5 {" +
3262            "            Sequence sequence5 {" +
3263            "              Iteration itSeqUtilizeTextField1 {" +
3264            "                Sequence seqUtilizeTextField1 {" +
3265            "                  Iteration itClickTextField1 {" +
3266            "                    Event clickTextField1 {}" +
3267            "                  }" +
3268            "                  Iteration itEnterTextTextField1 {" +
3269            "                    Event enterTextTextField1 {}" +
3270            "                    Event enterTextTextField1 {}" +
3271            "                  }" +
3272            "                }" +
3273            "                Sequence seqUtilizeTextField1 {" +
3274            "                  Iteration itClickTextField1 {" +
3275            "                    Event clickTextField1 {}" +
3276            "                    Event clickTextField1 {}" +
3277            "                  }" +
3278            "                  Iteration itEnterTextTextField1 {" +
3279            "                    Event enterTextTextField1 {}" +
3280            "                  }" +
3281            "                }" +
3282            "              }" +
3283            "              Event pressTabTextField2 {}" +
3284            "            }" +
3285            "          }" +
3286            "          Iteration itEnterTextTextField2 {" +
3287            "            Event enterTextTextField2 {}" +
3288            "          }" +
3289            "        }" +
3290            "      }" +
3291            "    }" +
3292            "    Iteration itClickButton1 {" +
3293            "      Event clickButton1 {}" +
3294            "    }" +
3295            "  }" +
3296            "}";
3297
3298        applySessionScopeRule(CondenseSimilarTasksRule.class, input, output);
3299    }*/
3300}
Note: See TracBrowser for help on using the repository browser.