source: trunk/autoquest-core-usability-test/src/test/java/de/ugoe/cs/autoquest/usability/UsabilitySmellDescriptionTest.java @ 1918

Last change on this file since 1918 was 1918, checked in by pharms, 9 years ago
  • extension with further smell detections
  • may not fully work. But Hudson is more happy because compile errors should be gone
File size: 2.8 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 org.junit.Assert.assertNotNull;
18import static org.junit.Assert.assertNotSame;
19
20import java.util.HashMap;
21import java.util.LinkedList;
22import java.util.List;
23import java.util.Map;
24
25import org.junit.Test;
26
27import de.ugoe.cs.autoquest.usability.UsabilitySmellDescription;
28
29/**
30 * @author Patrick Harms
31 */
32public class UsabilitySmellDescriptionTest {
33
34    /**
35     *
36     */
37    @Test
38    public void testInitialization() {
39        for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) {
40            assertNotNull(description.toString());
41            assertNotSame("", description.toString());
42            System.err.println(description);
43        }
44    }
45
46    /**
47     *
48     */
49    @Test
50    public void testParameterization_01() {
51        for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) {
52            Map<String, Object> parameters = new HashMap<String, Object>();
53
54            for (String parameter : description.getDescriptionParameters()) {
55                parameters.put(parameter, "<parameter " + parameter + ">");
56            }
57
58            assertNotNull(description.toString(parameters));
59            assertNotSame("", description.toString(parameters));
60            System.err.println(description.toString(parameters));
61        }
62    }
63
64
65    /**
66     *
67     */
68    @Test
69    public void testParameterization_02() {
70        for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) {
71            Map<String, Object> parameters = new HashMap<String, Object>();
72
73            for (String parameter : description.getDescriptionParameters()) {
74                List<String> values = new LinkedList<String>();
75                values.add("<parameter " + parameter + " value 1>");
76                values.add("<parameter " + parameter + " value 2>");
77                values.add("<parameter " + parameter + " value 3>");
78                parameters.put(parameter, values);
79            }
80
81            assertNotNull(description.toString(parameters));
82            assertNotSame("", description.toString(parameters));
83            System.err.println(description.toString(parameters));
84        }
85    }
86
87}
Note: See TracBrowser for help on using the repository browser.