Commit | Line | Data |
---|---|---|
7076c47b GM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2014 École Polytechnique de Montréal | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Guilliano Molaire - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.tests.stubs.analysis; |
7076c47b | 14 | |
58080002 | 15 | import java.util.Collection; |
7076c47b GM |
16 | import java.util.Set; |
17 | ||
58080002 | 18 | import org.eclipse.jdt.annotation.NonNull; |
66838307 | 19 | import org.eclipse.jdt.annotation.NonNullByDefault; |
58080002 GB |
20 | import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement; |
21 | import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement.PriorityLevel; | |
22 | import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; | |
7076c47b GM |
23 | |
24 | import com.google.common.collect.ImmutableSet; | |
25 | ||
26 | /** | |
27 | * Factory class to facilitate requirement usage across test case | |
28 | */ | |
29 | @SuppressWarnings("javadoc") | |
66838307 | 30 | @NonNullByDefault |
7076c47b GM |
31 | public final class AnalysisRequirementFactory { |
32 | ||
58080002 GB |
33 | private AnalysisRequirementFactory() { |
34 | } | |
7076c47b | 35 | |
7076c47b GM |
36 | public static final String REQUIREMENT_VALUE_1 = "value1"; |
37 | public static final String REQUIREMENT_VALUE_2 = "value2"; | |
38 | public static final String REQUIREMENT_VALUE_3 = "value3"; | |
39 | public static final String REQUIREMENT_VALUE_4 = "value4"; | |
40 | public static final String REQUIREMENT_VALUE_5 = "value5"; | |
41 | ||
42 | public static final Set<String> REQUIREMENT_VALUES_1 = ImmutableSet.of( | |
43 | REQUIREMENT_VALUE_1, | |
44 | REQUIREMENT_VALUE_2, | |
45 | REQUIREMENT_VALUE_3, | |
58080002 | 46 | REQUIREMENT_VALUE_5); |
7076c47b GM |
47 | |
48 | public static final Set<String> REQUIREMENT_VALUES_2 = ImmutableSet.of( | |
49 | REQUIREMENT_VALUE_2, | |
58080002 | 50 | REQUIREMENT_VALUE_3); |
7076c47b GM |
51 | |
52 | public static final Set<String> REQUIREMENT_VALUES_3 = ImmutableSet.of( | |
53 | REQUIREMENT_VALUE_3, | |
54 | REQUIREMENT_VALUE_4, | |
58080002 GB |
55 | REQUIREMENT_VALUE_5); |
56 | ||
57 | public static class TmfRequirementStub extends TmfAbstractAnalysisRequirement { | |
58 | ||
59 | public TmfRequirementStub(Collection<@NonNull String> values, PriorityLevel level) { | |
60 | super(values, level); | |
61 | } | |
62 | ||
63 | @Override | |
64 | @NonNullByDefault({}) | |
65 | public boolean test(ITmfTrace arg0) { | |
66 | return true; | |
67 | } | |
68 | } | |
69 | ||
70 | public static final TmfAbstractAnalysisRequirement REQUIREMENT_1 = new TmfRequirementStub(REQUIREMENT_VALUES_1, PriorityLevel.MANDATORY); | |
71 | public static final TmfAbstractAnalysisRequirement REQUIREMENT_2 = new TmfRequirementStub(REQUIREMENT_VALUES_2, PriorityLevel.MANDATORY); | |
72 | public static final TmfAbstractAnalysisRequirement REQUIREMENT_3 = new TmfRequirementStub(REQUIREMENT_VALUES_3, PriorityLevel.MANDATORY); | |
7076c47b | 73 | |
7076c47b | 74 | } |