Changeset 1040 for trunk/autoquest-core-usability-evaluation-test
- Timestamp:
- 01/16/13 17:51:51 (12 years ago)
- Location:
- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/AllTests.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; … … 12 25 import de.ugoe.cs.autoquest.usability.evaluation.rule.set.RulesetFactoryTest; 13 26 27 /** 28 * <p> 29 * TODO comment 30 * </p> 31 * 32 * @author Alexander Deicke 33 */ 14 34 @RunWith(Suite.class) 15 35 @SuiteClasses( -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationFacadeTest.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; 2 16 … … 11 25 import de.ugoe.cs.autoquest.usability.testutil.TaskTreeBuilder; 12 26 27 /** 28 * <p> 29 * TODO comment 30 * </p> 31 * 32 * @author Alexander Deicke 33 */ 13 34 public class UsabilityEvaluationFacadeTest { 14 35 … … 17 38 UsabilityEvaluationFacade.applyUsabilityRuleset(null); 18 39 } 19 40 20 41 @Test 21 42 public void apply_empty_ruleset_should_return_execute_usability_evaluation_step() { 22 ExecuteUsabilityEvaluationStep executeUsabilityEvaluationStep = 23 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()); 24 assertThat(executeUsabilityEvaluationStep).isInstanceOf(ExecuteUsabilityEvaluationStep.class); 43 ExecuteUsabilityEvaluationStep executeUsabilityEvaluationStep = 44 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()); 45 assertThat(executeUsabilityEvaluationStep) 46 .isInstanceOf(ExecuteUsabilityEvaluationStep.class); 25 47 } 26 48 27 49 @Test(expected = NullPointerException.class) 28 50 public void evaluate_usability_of_null_should_throw_exception() { 29 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()).evaluateUsabilityOf(null); 51 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()) 52 .evaluateUsabilityOf(null); 30 53 } 31 54 32 55 @Test 33 public void evaluate_usability_of_task_tree_against_empty_ruleset_should_return_empty_evaluation_report() { 34 ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 35 UsabilityEvaluationReport evaluationReport = 36 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()).evaluateUsabilityOf(taskTree); 37 assertThat(evaluationReport).isNotNull(); 56 public void evaluate_usability_of_task_tree_against_empty_ruleset_should_return_empty_evaluation_report() 57 { 58 ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 59 UsabilityEvaluationReport evaluationReport = 60 UsabilityEvaluationFacade.applyUsabilityRuleset(emptyUsabilityRuleset()) 61 .evaluateUsabilityOf(taskTree); 62 assertThat(evaluationReport).isNotNull(); 38 63 } 39 64 40 65 @Test 41 public void evaluate_usability_of_task_tree_against_dummy_ruleset_should_return_non_empty_evaluation_report() { 42 ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 43 UsabilityEvaluationReport evaluationReport = 44 UsabilityEvaluationFacade.applyUsabilityRuleset(new DummyUsabilityRuleset()).evaluateUsabilityOf(taskTree); 66 public void evaluate_usability_of_task_tree_against_dummy_ruleset_should_return_non_empty_evaluation_report() 67 { 68 ITaskTree taskTree = TaskTreeBuilder.builder().root("Ich bin eine Wurzel").creatTaskTree(); 69 UsabilityEvaluationReport evaluationReport = 70 UsabilityEvaluationFacade.applyUsabilityRuleset(new DummyUsabilityRuleset()) 71 .evaluateUsabilityOf(taskTree); 45 72 assertThat(evaluationReport).isNotNull(); 46 73 } -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationReportTest.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. 1 14 2 15 package de.ugoe.cs.autoquest.usability; … … 18 31 import de.ugoe.cs.autoquest.usability.testutil.DummyUsabilityRuleset; 19 32 33 /** 34 * <p> 35 * TODO comment 36 * </p> 37 * 38 * @author Alexander Deicke 39 */ 20 40 public class UsabilityEvaluationReportTest { 21 41 … … 28 48 public void usability_report_from_empty_list_has_no_recommendations() { 29 49 UsabilityEvaluationReport evaluationReport = 30 UsabilityEvaluationReport.from(Collections 31 .<UsabilityDefect> emptyList()); 50 UsabilityEvaluationReport.from(Collections.<UsabilityDefect> emptyList()); 32 51 assertThat(evaluationReport).isNotNull().has(noUsabilityGuidlineRecommendations()); 33 52 } … … 36 55 public void usability_report_from_non_empty_list_has_recommendations() { 37 56 List<UsabilityDefect> guidlineRecommendations = 38 Lists.newArrayList(new UsabilityDefectFactory(new DummyUsabilityGuidlineDescriptionResolver()) 57 Lists 58 .newArrayList(new UsabilityDefectFactory( 59 new DummyUsabilityGuidlineDescriptionResolver()) 39 60 .createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO, 40 61 new DummyUsabilityRuleset() 41 .evaluationRules() 42 .iterator().next(), 62 .evaluationRules().iterator().next(), 43 63 Collections.<String, String> emptyMap())); 44 64 UsabilityEvaluationReport evaluationReport = -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/AbstractUsabilityEvaluationTC.java
r1030 r1040 88 88 * @param evaluateUsability 89 89 */ 90 protected void assertUsabilityEvaluationResult(UsabilityDefect[] 90 protected void assertUsabilityEvaluationResult(UsabilityDefect[] expectedDefects, 91 91 UsabilityEvaluationResult evaluationResult) 92 92 { 93 93 assertEquals(expectedDefects.length, evaluationResult.getAllDefects().size()); 94 94 95 EXPECTED_DEFECT_ITERATION: 96 for (UsabilityDefect expectedDefect : expectedDefects) { 95 EXPECTED_DEFECT_ITERATION: for (UsabilityDefect expectedDefect : expectedDefects) { 97 96 for (UsabilityDefect defect : evaluationResult.getAllDefects()) { 98 97 if (expectedDefect.equals(defect)) { … … 167 166 168 167 if ("Interaction".equals(type)) { 169 return taskTreeNodeFactory.createNewEventTask 170 (new DummyInteraction("dummy", typeNumbers[0]++), new DummyGUIElement("dummy")); 168 return taskTreeNodeFactory.createNewEventTask(new DummyInteraction("dummy", 169 typeNumbers[0]++), 170 new DummyGUIElement("dummy")); 171 171 } 172 172 else if ("Sequence".equals(type)) { … … 185 185 186 186 TextInput textInput = new TextInput(additionalInfo, new ArrayList<Event>()); 187 188 IEventTask task = taskTreeNodeFactory.createNewEventTask 189 (textInput, new DummyTextField(additionalInfo)); 187 188 IEventTask task = 189 taskTreeNodeFactory.createNewEventTask(textInput, 190 new DummyTextField(additionalInfo)); 190 191 191 192 return task; … … 220 221 else { 221 222 fail("can not add children to parent task tree node of type " + 222 223 parent.getClass().getName()); 223 224 } 224 225 } -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/NoLetterOrDigitTextInputsEvaluatorTest.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. 1 14 2 15 package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; … … 26 39 import de.ugoe.cs.autoquest.usability.tasktree.filter.FilterStatisticCache; 27 40 41 /** 42 * <p> 43 * TODO comment 44 * </p> 45 * 46 * @author Alexander Deicke 47 */ 28 48 public class NoLetterOrDigitTextInputsEvaluatorTest extends AbstractUsabilityEvaluationTC { 29 49 … … 32 52 @Before 33 53 public void initRuleUnderTest() { 34 EnumSet<? extends UsabilityRule> ruleset = 35 textInputUsabiliyRuleset().evaluationRules(); 54 EnumSet<? extends UsabilityRule> ruleset = textInputUsabiliyRuleset().evaluationRules(); 36 55 this.ruleUnderTest = Iterables.find(ruleset, new Predicate<UsabilityRule>() { 37 56 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/TextInputEntryRepetitionsEvaluatorTest.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. 1 14 2 15 package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; … … 26 39 import de.ugoe.cs.autoquest.usability.tasktree.filter.FilterStatisticCache; 27 40 41 /** 42 * <p> 43 * TODO comment 44 * </p> 45 * 46 * @author Alexander Deicke 47 */ 28 48 public class TextInputEntryRepetitionsEvaluatorTest extends AbstractUsabilityEvaluationTC { 29 49 … … 32 52 @Before 33 53 public void initRuleUnderTest() { 34 EnumSet<? extends UsabilityRule> ruleset = 35 textInputUsabiliyRuleset().evaluationRules(); 54 EnumSet<? extends UsabilityRule> ruleset = textInputUsabiliyRuleset().evaluationRules(); 36 55 this.ruleUnderTest = Iterables.find(ruleset, new Predicate<UsabilityRule>() { 37 56 … … 85 104 new TextInputEntryRepetitionsEvaluator(this.ruleUnderTest, taskTree).evaluationResult(); 86 105 // Then 87 assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel()); } 106 assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel()); 107 } 88 108 89 109 @Test -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/evaluator/TextInputRatioEvaluatorTest.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. 1 14 2 15 package de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator; … … 26 39 import de.ugoe.cs.autoquest.usability.tasktree.filter.FilterStatisticCache; 27 40 41 /** 42 * <p> 43 * TODO comment 44 * </p> 45 * 46 * @author Alexander Deicke 47 */ 28 48 public class TextInputRatioEvaluatorTest extends AbstractUsabilityEvaluationTC { 29 49 … … 32 52 @Before 33 53 public void initRuleUnderTest() { 34 EnumSet<? extends UsabilityRule> ruleset = 35 textInputUsabiliyRuleset().evaluationRules(); 54 EnumSet<? extends UsabilityRule> ruleset = textInputUsabiliyRuleset().evaluationRules(); 36 55 this.ruleUnderTest = Iterables.find(ruleset, new Predicate<UsabilityRule>() { 37 56 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/EmptyUsabilityRulesetTest.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.evaluation.rule.set; 2 16 … … 6 20 import org.junit.Test; 7 21 22 /** 23 * <p> 24 * TODO comment 25 * </p> 26 * 27 * @author Alexander Deicke 28 */ 8 29 public class EmptyUsabilityRulesetTest { 9 30 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/RulesetFactoryTest.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.evaluation.rule.set; 2 16 … … 10 24 import org.junit.Test; 11 25 26 /** 27 * <p> 28 * TODO comment 29 * </p> 30 * 31 * @author Alexander Deicke 32 */ 12 33 public class RulesetFactoryTest { 13 34 14 35 @Test 15 36 public void empty_ruleset_factory_method_should_return_empty_ruleset() { 16 17 37 UsabilityRuleset ruleset = emptyUsabilityRuleset(); 38 assertThat(ruleset).isInstanceOf(EmptyUsabilityRuleset.class).has(noUsabilityRules()); 18 39 } 19 40 20 41 @Test 21 42 public void text_input_ruleset_factory_method_should_return_text_input_ruleset() { 22 23 43 UsabilityRuleset ruleset = textInputUsabiliyRuleset(); 44 assertThat(ruleset).isInstanceOf(TextInputUsabiliyRuleset.class).has(usabilityRules()); 24 45 } 25 46 26 47 @Test 27 48 public void mouse_interaction_ruleset_factory_method_should_return_mouse_interaction_ruleset() { 28 49 UsabilityRuleset ruleset = mouseInteractionUsabiliyRuleset(); 29 assertThat(ruleset).isInstanceOf(MouseInteractionUsabilityRuleset.class).has(usabilityRules()); 50 assertThat(ruleset).isInstanceOf(MouseInteractionUsabilityRuleset.class) 51 .has(usabilityRules()); 30 52 } 31 53 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/CreateClickstreamImageFromTaskTreeDemoApp.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.sandboxapp; 2 16 … … 21 35 import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil; 22 36 37 /** 38 * <p> 39 * TODO comment 40 * </p> 41 * 42 * @author Alexander Deicke 43 */ 23 44 public class CreateClickstreamImageFromTaskTreeDemoApp { 24 45 25 46 private static final String fileToParse = "javatrace.xml"; 26 47 27 48 private static final String clickstreamFilename = "clickstream.png"; 28 49 29 50 /** 30 51 * <p> 31 52 * TODO: comment 32 53 * </p> 33 * 54 * 34 55 * @param args 35 * @throws IOException 56 * @throws IOException 36 57 */ 37 58 public static void main(String[] args) throws IOException { 38 59 ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromFile(fileToParse); 39 60 FilterStatistic mouseInteractions = filterMouseInteractions(taskTree); 40 61 41 62 BufferedImage clickstreamImage = new BufferedImage(1024, 768, BufferedImage.TYPE_INT_ARGB); 42 63 Graphics2D drawArea = clickstreamImage.createGraphics(); 43 64 drawArea.setColor(Color.BLACK); 44 drawArea.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 45 65 drawArea.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 66 RenderingHints.VALUE_ANTIALIAS_ON); 67 46 68 drawClickstream(mouseInteractions, drawArea); 47 69 … … 52 74 int xb = -1; 53 75 int yb = -1; 54 55 for(ITaskTreeNode node : mouseInteractions.nodesMatchedFilter()) { 56 MouseButtonInteraction interaction = (MouseButtonInteraction) ((IEventTask) node).getEventType(); 76 77 for (ITaskTreeNode node : mouseInteractions.nodesMatchedFilter()) { 78 MouseButtonInteraction interaction = 79 (MouseButtonInteraction) ((IEventTask) node).getEventType(); 57 80 int x = interaction.getX(); 58 81 int y = interaction.getY(); 59 g2.fillOval(x,y,1,1); 60 if(xb != -1 && y != -1) g2.drawLine(x, y, xb, yb); 82 g2.fillOval(x, y, 1, 1); 83 if (xb != -1 && y != -1) 84 g2.drawLine(x, y, xb, yb); 61 85 xb = x; 62 86 yb = y; 63 87 } 64 88 } 65 89 66 90 private static FilterStatistic filterMouseInteractions(ITaskTree taskTree) { 67 91 return new TaskTreeFilter(new IterativeDFSFilterStrategy()) -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/CreateHeatmapImageFromTaskTreeDemoApp.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.sandboxapp; … … 18 31 import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil; 19 32 33 /** 34 * <p> 35 * TODO comment 36 * </p> 37 * 38 * @author Alexander Deicke 39 */ 20 40 public class CreateHeatmapImageFromTaskTreeDemoApp { 21 41 22 42 private static final String fileToParse = "javatrace.xml"; 23 43 24 44 private static final String heatmapFilename = "click-heatmap.png"; 25 45 -
trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/sandboxapp/TaskTreeVisualizerDemoApp.java
r1030 r1040 145 145 RadialTreeLayout<String, Integer> radialLayout; 146 146 147 @SuppressWarnings({ "unchecked", "rawtypes" }) 147 @SuppressWarnings( 148 { "unchecked", "rawtypes" }) 148 149 public TaskTreeVisualizerDemoApp(String filetoparse) { 149 150 ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromFile(filetoparse); 151 150 151 ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromFile(filetoparse); 152 152 153 // create a simple graph for the demo 153 154 graph = new DelegateForest<String, Integer>(); … … 274 275 content.add(controls, BorderLayout.SOUTH); 275 276 } 276 277 277 278 class Rings implements VisualizationServer.Paintable { 278 279 -
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.