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