source: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/testutil/DummyUsabilityRuleset.java @ 1040

Last change on this file since 1040 was 1040, checked in by adeicke, 11 years ago
  • Removed lombok related annotations and util class
  • Added comments and formating due to match project defaults
  • Property svn:mime-type set to text/plain
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.testutil;
16
17import java.util.Collections;
18import java.util.EnumSet;
19
20import com.google.common.base.Optional;
21
22import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
23import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefectSeverityLevel;
24import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect;
25import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefectFactory;
26import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule;
27import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRuleset;
28
29/**
30 * <p>
31 * TODO comment
32 * </p>
33 *
34 * @author Alexander Deicke
35 */
36public class DummyUsabilityRuleset implements UsabilityRuleset {
37
38    private enum DummyUsabilityRule implements UsabilityRule {
39
40        DUMMY_RULE_WITH_RECOMMENDATION {
41
42            @Override
43            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) {
44                return Optional
45                    .of(new UsabilityDefectFactory(new DummyUsabilityGuidlineDescriptionResolver())
46                        .createUsabilityGuidlineRecommendation(UsabilityDefectSeverityLevel.INFO,
47                                                               this, Collections
48                                                                   .<String, String> emptyMap()));
49            }
50
51            public String ruleIdentifier() {
52                return this.name();
53            }
54
55        },
56
57        DUMMY_RULE_WITHOUT_RECOMMENDATION {
58
59            @Override
60            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) {
61                return Optional.absent();
62            }
63
64            public String ruleIdentifier() {
65                return this.name();
66            }
67        };
68
69        public abstract Optional<UsabilityDefect> evaluate(ITaskTree taskTree);
70
71    }
72
73    private final EnumSet<DummyUsabilityRule> DUMMY_USABILITY_RULESET = EnumSet
74        .allOf(DummyUsabilityRule.class);
75
76    public EnumSet<? extends UsabilityRule> evaluationRules() {
77        return DUMMY_USABILITY_RULESET;
78    }
79
80}
Note: See TracBrowser for help on using the repository browser.