Changeset 1040 for trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil
- Timestamp:
- 01/16/13 17:51:51 (11 years ago)
- Location:
- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/DummyUsabilityGuidlineDescriptionResolver.java
r1030 r1040 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 1 15 package de.ugoe.cs.autoquest.usability.testutil; 2 16 … … 5 19 import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule; 6 20 7 public class DummyUsabilityGuidlineDescriptionResolver implements UsabilityDefectDescriptionResolver { 21 /** 22 * <p> 23 * TODO comment 24 * </p> 25 * 26 * @author Alexander Deicke 27 */ 28 public class DummyUsabilityGuidlineDescriptionResolver implements 29 UsabilityDefectDescriptionResolver 30 { 8 31 9 32 public DefectDescription descriptionFor(UsabilityRule usabilityRule) { -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/DummyUsabilityRuleset.java
r1034 r1040 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 1 15 package de.ugoe.cs.autoquest.usability.testutil; 2 16 … … 13 27 import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRuleset; 14 28 29 /** 30 * <p> 31 * TODO comment 32 * </p> 33 * 34 * @author Alexander Deicke 35 */ 15 36 public class DummyUsabilityRuleset implements UsabilityRuleset { 16 37 17 38 private enum DummyUsabilityRule implements UsabilityRule { 18 39 19 40 DUMMY_RULE_WITH_RECOMMENDATION { 20 41 21 42 @Override 22 43 public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) { 23 return Optional.of(new UsabilityDefectFactory(new DummyUsabilityGuidlineDescriptionResolver()). 24 createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO, this, Collections.<String, String> emptyMap())); 44 return Optional 45 .of(new UsabilityDefectFactory(new DummyUsabilityGuidlineDescriptionResolver()) 46 .createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO, 47 this, Collections 48 .<String, String> emptyMap())); 25 49 } 26 50 … … 28 52 return this.name(); 29 53 } 30 54 31 55 }, 32 56 33 57 DUMMY_RULE_WITHOUT_RECOMMENDATION { 34 58 35 59 @Override 36 60 public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) { … … 46 70 47 71 } 48 49 private final EnumSet<DummyUsabilityRule> DUMMY_USABILITY_RULESET = 50 EnumSet.allOf(DummyUsabilityRule.class);72 73 private final EnumSet<DummyUsabilityRule> DUMMY_USABILITY_RULESET = EnumSet 74 .allOf(DummyUsabilityRule.class); 51 75 52 76 public EnumSet<? extends UsabilityRule> evaluationRules() { -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/FestConditionUtil.java
r1034 r1040 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 1 15 package de.ugoe.cs.autoquest.usability.testutil; 2 16 … … 10 24 import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRuleset; 11 25 26 /** 27 * <p> 28 * TODO comment 29 * </p> 30 * 31 * @author Alexander Deicke 32 */ 12 33 public class FestConditionUtil { 13 34 … … 15 36 // no good idea 16 37 } 17 38 18 39 public static Condition<UsabilityEvaluationReport> noUsabilityGuidlineRecommendations() { 19 40 return new Condition<UsabilityEvaluationReport>() { 20 41 21 42 @Override 22 43 public boolean matches(UsabilityEvaluationReport usabilityEvaluationReport) { … … 25 46 }; 26 47 } 27 48 28 49 public static Condition<UsabilityEvaluationReport> usabilityGuidlineRecommendations() { 29 50 return new Condition<UsabilityEvaluationReport>() { 30 51 31 52 @Override 32 53 public boolean matches(UsabilityEvaluationReport usabilityEvaluationReport) { … … 35 56 }; 36 57 } 37 58 38 59 public static Condition<UsabilityRuleset> noUsabilityRules() { 39 60 return new Condition<UsabilityRuleset>() { … … 43 64 return usabilityRuleset.evaluationRules().isEmpty(); 44 65 } 45 46 66 47 67 }; 48 68 } 49 69 50 70 public static Condition<UsabilityRuleset> usabilityRules() { 51 71 return new Condition<UsabilityRuleset>() { … … 55 75 return !usabilityRuleset.evaluationRules().isEmpty(); 56 76 } 57 58 77 59 78 }; 60 79 } 61 80 62 81 public static Condition<Optional<UsabilityDefect>> present() { 63 82 return new Condition<Optional<UsabilityDefect>>() { … … 67 86 return usabilityGuidlineRecommendation.isPresent(); 68 87 } 69 88 70 89 }; 71 90 } 72 91 73 92 public static Condition<Optional<UsabilityDefect>> absent() { 74 93 return new Condition<Optional<UsabilityDefect>>() { … … 78 97 return !usabilityGuidlineRecommendation.isPresent(); 79 98 } 80 99 81 100 }; 82 101 } 83 102 84 103 public static Condition<Optional<UsabilityDefect>> infoRecommendationSeverityLevel() { 85 104 return new Condition<Optional<UsabilityDefect>>() { … … 87 106 @Override 88 107 public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 89 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.INFO); 108 return usabilityGuidlineRecommendation.get().getSeverityLevel() 109 .equals(UsabilityDefectSeverityLevel.INFO); 90 110 } 91 111 92 112 }; 93 113 } 94 114 95 115 public static Condition<Optional<UsabilityDefect>> lowRecommendationSeverityLevel() { 96 116 return new Condition<Optional<UsabilityDefect>>() { … … 98 118 @Override 99 119 public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 100 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.LOW); 120 return usabilityGuidlineRecommendation.get().getSeverityLevel() 121 .equals(UsabilityDefectSeverityLevel.LOW); 101 122 } 102 123 103 124 }; 104 125 } 105 126 106 127 public static Condition<Optional<UsabilityDefect>> mediumRecommendationSeverityLevel() { 107 128 return new Condition<Optional<UsabilityDefect>>() { … … 109 130 @Override 110 131 public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 111 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.MEDIUM); 132 return usabilityGuidlineRecommendation.get().getSeverityLevel() 133 .equals(UsabilityDefectSeverityLevel.MEDIUM); 112 134 } 113 135 114 136 }; 115 137 } 116 138 117 139 public static Condition<Optional<UsabilityDefect>> highRecommendationSeverityLevel() { 118 140 return new Condition<Optional<UsabilityDefect>>() { … … 120 142 @Override 121 143 public boolean matches(Optional<UsabilityDefect> usabilityGuidlineRecommendation) { 122 return usabilityGuidlineRecommendation.get().getSeverityLevel().equals(UsabilityDefectSeverityLevel.HIGH); 144 return usabilityGuidlineRecommendation.get().getSeverityLevel() 145 .equals(UsabilityDefectSeverityLevel.HIGH); 123 146 } 124 147 125 148 }; 126 149 } 127 150 128 151 } -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/GenerateTaskTreeUtil.java
r1030 r1040 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. 1 14 2 15 package de.ugoe.cs.autoquest.usability.testutil; … … 17 30 import de.ugoe.cs.util.console.TextConsole; 18 31 32 /** 33 * <p> 34 * TODO comment 35 * </p> 36 * 37 * @author Alexander Deicke 38 */ 19 39 public class GenerateTaskTreeUtil { 20 40 21 41 private static final String seqName = "sequences"; 22 42 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/TaskTreeBuilder.java
r1030 r1040 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 1 15 package de.ugoe.cs.autoquest.usability.testutil; 2 16 … … 6 20 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeNodeFactory; 7 21 22 /** 23 * <p> 24 * TODO comment 25 * </p> 26 * 27 * @author Alexander Deicke 28 */ 8 29 public class TaskTreeBuilder { 9 30 10 31 public static CreateRootNodeStep builder() { 11 32 return new CreateRootNodeStep(); 12 33 } 13 34 14 35 public static class CreateRootNodeStep { 15 36 16 37 public AddChildrenStep root(String name) { 17 38 return new AddChildrenStep(new TaskTreeNode(name)); 18 39 } 19 40 20 41 } 21 42 22 43 public static class AddChildrenStep { 23 44 24 45 private TaskTreeNode rootNode; 25 46 26 47 public AddChildrenStep(TaskTreeNode taskTreeRootNode) { 27 48 this.rootNode = taskTreeRootNode; … … 32 53 return this; 33 54 } 34 55 35 56 public ITaskTree creatTaskTree() { 36 57 return new TaskTreeNodeFactory().createTaskTree(rootNode); 37 58 } 38 59 39 60 } 40 41 // private Employee employee; 42 // 43 // public EmployeeBuilder() { 44 // employee = new Employee(); 45 // } 46 // 47 // public static EmployeeBuilder defaultValues() { 48 // return new EmployeeBuilder(); 49 // } 50 // 51 // public static EmployeeBuilder clone(Employee toClone) { 52 // EmployeeBuilder builder = defaultValues(); 53 // builder.setId(toClone.getId()); 54 // builder.setName(toClone.getName()); 55 // builder.setDepartment(toClone.getDepartment()); 56 // return builder; 57 // } 58 // 59 // public static EmployeeBuilder random() { 60 // EmployeeBuilder builder = defaultValues(); 61 // builder.setId(getRandomInteger(0, 1000)); 62 // builder.setName(getRandomString(20)); 63 // builder.setDepartment(Department.values()[getRandomInteger(0, Department.values().length - 1)]); 64 // return builder; 65 // } 66 // 67 // public EmployeeBuilder setId(int id) { 68 // employee.setId(id); 69 // return this; 70 // } 71 // 72 // public EmployeeBuilder setName(String name) { 73 // employee.setName(name); 74 // return this; 75 // } 76 // 77 // public EmployeeBuilder setDepartment(Department dept) { 78 // employee.setDepartment(dept); 79 // return this; 80 // } 81 // 82 // public Employee build() { 83 // return employee; 84 // } 85 // } 61 62 // private Employee employee; 63 // 64 // public EmployeeBuilder() { 65 // employee = new Employee(); 66 // } 67 // 68 // public static EmployeeBuilder defaultValues() { 69 // return new EmployeeBuilder(); 70 // } 71 // 72 // public static EmployeeBuilder clone(Employee toClone) { 73 // EmployeeBuilder builder = defaultValues(); 74 // builder.setId(toClone.getId()); 75 // builder.setName(toClone.getName()); 76 // builder.setDepartment(toClone.getDepartment()); 77 // return builder; 78 // } 79 // 80 // public static EmployeeBuilder random() { 81 // EmployeeBuilder builder = defaultValues(); 82 // builder.setId(getRandomInteger(0, 1000)); 83 // builder.setName(getRandomString(20)); 84 // builder.setDepartment(Department.values()[getRandomInteger(0, Department.values().length - 85 // 1)]); 86 // return builder; 87 // } 88 // 89 // public EmployeeBuilder setId(int id) { 90 // employee.setId(id); 91 // return this; 92 // } 93 // 94 // public EmployeeBuilder setName(String name) { 95 // employee.setName(name); 96 // return this; 97 // } 98 // 99 // public EmployeeBuilder setDepartment(Department dept) { 100 // employee.setDepartment(dept); 101 // return this; 102 // } 103 // 104 // public Employee build() { 105 // return employee; 106 // } 107 // } 86 108 87 109 }
Note: See TracChangeset
for help on using the changeset viewer.