[927] | 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 | |
---|
[922] | 15 | package de.ugoe.cs.autoquest.usability; |
---|
[474] | 16 | |
---|
[497] | 17 | import static org.junit.Assert.assertNotNull; |
---|
| 18 | import static org.junit.Assert.assertNotSame; |
---|
[474] | 19 | |
---|
[475] | 20 | import java.util.HashMap; |
---|
[1493] | 21 | import java.util.LinkedList; |
---|
| 22 | import java.util.List; |
---|
[475] | 23 | import java.util.Map; |
---|
| 24 | |
---|
[474] | 25 | import org.junit.Test; |
---|
| 26 | |
---|
[1918] | 27 | import de.ugoe.cs.autoquest.usability.UsabilitySmellDescription; |
---|
[922] | 28 | |
---|
[474] | 29 | /** |
---|
[1493] | 30 | * @author Patrick Harms |
---|
[474] | 31 | */ |
---|
[1918] | 32 | public class UsabilitySmellDescriptionTest { |
---|
[474] | 33 | |
---|
[561] | 34 | /** |
---|
| 35 | * |
---|
| 36 | */ |
---|
| 37 | @Test |
---|
| 38 | public void testInitialization() { |
---|
[1918] | 39 | for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { |
---|
[561] | 40 | assertNotNull(description.toString()); |
---|
| 41 | assertNotSame("", description.toString()); |
---|
| 42 | System.err.println(description); |
---|
| 43 | } |
---|
[475] | 44 | } |
---|
[474] | 45 | |
---|
[561] | 46 | /** |
---|
| 47 | * |
---|
| 48 | */ |
---|
| 49 | @Test |
---|
[1493] | 50 | public void testParameterization_01() { |
---|
[1918] | 51 | for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { |
---|
[1493] | 52 | Map<String, Object> parameters = new HashMap<String, Object>(); |
---|
[561] | 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 | } |
---|
[475] | 62 | } |
---|
| 63 | |
---|
[1493] | 64 | |
---|
| 65 | /** |
---|
| 66 | * |
---|
| 67 | */ |
---|
| 68 | @Test |
---|
| 69 | public void testParameterization_02() { |
---|
[1918] | 70 | for (UsabilitySmellDescription description : UsabilitySmellDescription.values()) { |
---|
[1493] | 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 | |
---|
[474] | 87 | } |
---|