source: trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/DataEntryMethodChangeRuleTest.java

Last change on this file was 2067, checked in by pharms, 8 years ago

corrected unrunning test cases

File size: 8.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.usability;
16
17import static de.ugoe.cs.autoquest.usability.UsabilitySmellDescription.DATA_ENTRY_METHOD_CHANGE;
18
19import org.junit.Before;
20import org.junit.Test;
21
22import de.ugoe.cs.autoquest.usability.UsabilitySmell;
23
24/**
25 *
26 */
27public class DataEntryMethodChangeRuleTest extends AbstractUsabilityEvaluationTC {
28
29    /**
30     *
31     */
32    @Before
33    public void setUp() {
34        //UsabilitySmellIntensity.defaultCoverageQuantile = 0;
35    }
36   
37    /**
38     *
39     */
40    @Test
41    public void testNoEntryMethodChange_01() {
42        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
43
44        // ===== check =====
45        String spec =
46            "UserSession {" +
47            "  Interaction elem1 {}" +
48            "  Interaction elem1 {}" +
49            "}";
50       
51        // no smell expected, as there are no changes between mouse and keyboard
52        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  };
53
54        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
55    }
56   
57    /**
58     *
59     */
60    @Test
61    public void testNoEntryMethodChange_02() {
62        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
63
64        // ===== check =====
65        String spec =
66            "UserSession {" +
67            "  Sequence {" +
68            "    Interaction elem1 {}" +
69            "    Interaction elem2 {}" +
70            "  }" +
71            "}";
72       
73        // no smell expected, as there are no changes between mouse and keyboard
74        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  };
75
76        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
77    }
78   
79    /**
80     *
81     */
82    @Test
83    public void testNoEntryMethodChange_03() {
84        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
85
86        // ===== check =====
87        String spec =
88            "UserSession {" +
89            "  Sequence {" +
90            "    MouseClick elem1 {}" +
91            "    MouseClick elem2 {}" +
92            "  }" +
93            "}";
94       
95        // no smell expected, as there are no changes between mouse and keyboard
96        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  };
97
98        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
99    }
100   
101    /**
102     *
103     */
104    @Test
105    public void testNoEntryMethodChange_04() {
106        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
107
108        // ===== check =====
109        String spec =
110            "UserSession {" +
111            "  Sequence {" +
112            "    TextInput elem1 {}" +
113            "    TextInput elem2 {}" +
114            "  }" +
115            "}";
116       
117        // no smell expected, as there are no changes between mouse and keyboard
118        UsabilitySmell[] expectedSmells = new UsabilitySmell[] {  };
119
120        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
121    }
122
123    /**
124     *
125     */
126    @Test
127    public void testEntryMethodChange_01() {
128        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
129
130        // ===== check =====
131        String spec =
132            "UserSession {" +
133            "  Sequence {" +
134            "    MouseClick elem1 {}" +
135            "    TextInput elem2 {}" +
136            "    MouseClick elem1 {}" +
137            "  }" +
138            "}";
139       
140        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
141            { new UsabilitySmell(UsabilitySmellIntensity.getIntensity(0),
142                                  DATA_ENTRY_METHOD_CHANGE) };
143
144        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
145    }
146
147    /**
148     *
149     */
150    @Test
151    public void testEntryMethodChange_02() {
152        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
153
154        // ===== check =====
155        String spec =
156            "UserSession {" +
157            "  Sequence {" +
158            "    TextInput elem1 {}" +
159            "    MouseClick elem2 {}" +
160            "    TextInput elem1 {}" +
161            "  }" +
162            "}";
163       
164        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
165            { new UsabilitySmell(UsabilitySmellIntensity.getIntensity(0),
166                                  DATA_ENTRY_METHOD_CHANGE) };
167
168        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
169    }
170
171    /**
172     *
173     */
174    @Test
175    public void testEntryMethodChange_03() {
176        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
177
178        // ===== check =====
179        String spec =
180            "UserSession {" +
181            "  Sequence seq1 {" +
182            "    Selection sel1 {" +
183            "      TextInput elem2 {}" +
184            "    }" +
185            "    MouseClick elem1 {}" +
186            "  }" +
187            "  Sequence seq1 {" +
188            "    Selection sel1 {" +
189            "      MouseClick elem2 {}" +
190            "    }" +
191            "    MouseClick elem1 {}" +
192            "  }" +
193            "}";
194       
195        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
196            { new UsabilitySmell(UsabilitySmellIntensity.getIntensity(0),
197                                  DATA_ENTRY_METHOD_CHANGE) };
198
199        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
200    }
201
202    /**
203     *
204     */
205    @Test
206    public void testEntryMethodChange_04() {
207        DataEntryMethodChangeRule rule = new DataEntryMethodChangeRule();
208
209        // ===== check =====
210        String spec =
211            "UserSession {" +
212            "  Sequence seq1 {" +
213            "    MouseClick elem1 {}" +
214            "    Selection sel1 {" +
215            "      TextInput elem2 {}" +
216            "    }" +
217            "  }" +
218            "  Sequence seq1 {" +
219            "    MouseClick elem1 {}" +
220            "    Selection sel1 {" +
221            "      MouseClick elem2 {}" +
222            "    }" +
223            "  }" +
224            "  Sequence seq1 {" +
225            "    MouseClick elem1 {}" +
226            "    Selection sel1 {" +
227            "      MouseClick elem2 {}" +
228            "    }" +
229            "  }" +
230            "  Sequence seq1 {" +
231            "    MouseClick elem1 {}" +
232            "    Selection sel1 {" +
233            "      MouseClick elem2 {}" +
234            "    }" +
235            "  }" +
236            "  Sequence seq1 {" +
237            "    MouseClick elem1 {}" +
238            "    Selection sel1 {" +
239            "      MouseClick elem2 {}" +
240            "    }" +
241            "  }" +
242            "  Sequence seq1 {" +
243            "    MouseClick elem1 {}" +
244            "    Selection sel1 {" +
245            "      MouseClick elem2 {}" +
246            "    }" +
247            "  }" +
248            "  Sequence seq1 {" +
249            "    MouseClick elem1 {}" +
250            "    Selection sel1 {" +
251            "      MouseClick elem2 {}" +
252            "    }" +
253            "  }" +
254            "  Sequence seq1 {" +
255            "    MouseClick elem1 {}" +
256            "    Selection sel1 {" +
257            "      MouseClick elem2 {}" +
258            "    }" +
259            "  }" +
260            "}";
261       
262        UsabilitySmell[] expectedSmells = new UsabilitySmell[]
263            { new UsabilitySmell(UsabilitySmellIntensity.getIntensity(0),
264                                  DATA_ENTRY_METHOD_CHANGE) };
265
266        assertUsabilityEvaluationResult(expectedSmells, rule.evaluate(createTaskModel(spec)));
267    }
268}
Note: See TracBrowser for help on using the repository browser.