Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-usability-test/src/test/java/de/ugoe/cs/quest/usability/UsabilityDefectDescriptionTest.java
r474 r475 9 9 10 10 import static org.junit.Assert.*; 11 12 import java.util.HashMap; 13 import java.util.Map; 11 14 12 15 import org.junit.Test; … … 34 37 public void testInitialization() 35 38 { 36 assertNotNull(UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO.toString()); 37 assertNotSame("", UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO.toString()); 38 System.err.println(UsabilityDefectDescription.TEXT_FIELD_INPUT_RATIO); 39 40 assertNotNull(UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS.toString()); 41 assertNotSame("", UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS.toString()); 42 System.err.println(UsabilityDefectDescription.TEXT_FIELD_INPUT_REPETITIONS); 39 for (UsabilityDefectDescription description : UsabilityDefectDescription.values()) 40 { 41 assertNotNull(description.toString()); 42 assertNotSame("", description.toString()); 43 System.err.println(description); 44 } 45 } 46 47 //----------------------------------------------------------------------------------------------- 48 /** 49 * TODO: comment 50 * 51 */ 52 //----------------------------------------------------------------------------------------------- 53 @Test 54 public void testParameterization() 55 { 56 for (UsabilityDefectDescription description : UsabilityDefectDescription.values()) 57 { 58 Map<String, String> parameters = new HashMap<String, String>(); 59 60 for (String parameter : description.getDescriptionParameters()) 61 { 62 parameters.put(parameter, "<parameter " + parameter + ">"); 63 } 64 65 assertNotNull(description.toString(parameters)); 66 assertNotSame("", description.toString(parameters)); 67 System.err.println(description.toString(parameters)); 68 } 43 69 } 44 70 -
trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefectDescription.java
r453 r475 10 10 import java.io.IOException; 11 11 import java.io.InputStream; 12 import java.util.ArrayList; 13 import java.util.List; 12 14 import java.util.Map; 13 15 … … 117 119 */ 118 120 //----------------------------------------------------------------------------------------------- 121 public String[] getDescriptionParameters() 122 { 123 List<String> parameters = new ArrayList<String>(); 124 125 for (Object fragment : mDefectDescription.getTextFragmentOrParameterFragment()) 126 { 127 if (fragment instanceof ParameterFragment) 128 { 129 parameters.add(((ParameterFragment) fragment).getParameterName()); 130 } 131 } 132 133 return parameters.toArray(new String[parameters.size()]); 134 } 135 136 //----------------------------------------------------------------------------------------------- 137 /** 138 * 139 */ 140 //----------------------------------------------------------------------------------------------- 119 141 public String toString(Map<String, String> parameters) throws IllegalArgumentException 120 142 {
Note: See TracChangeset
for help on using the changeset viewer.