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 |
|
---|
15 | package de.ugoe.cs.autoquest.usability.testutil;
|
---|
16 |
|
---|
17 | import java.util.Collections;
|
---|
18 | import java.util.EnumSet;
|
---|
19 |
|
---|
20 | import com.google.common.base.Optional;
|
---|
21 |
|
---|
22 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
|
---|
23 | import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefectSeverityLevel;
|
---|
24 | import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect;
|
---|
25 | import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefectFactory;
|
---|
26 | import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRule;
|
---|
27 | import de.ugoe.cs.autoquest.usability.evaluation.rule.set.UsabilityRuleset;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * <p>
|
---|
31 | * TODO comment
|
---|
32 | * </p>
|
---|
33 | *
|
---|
34 | * @author Alexander Deicke
|
---|
35 | */
|
---|
36 | public 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 | }
|
---|