tmf.xml: Add mapping group to XML description
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.analysis.xml.core.tests / stubs / org / eclipse / tracecompass / tmf / analysis / xml / core / tests / stubs / PatternSegmentFactoryStub.java
1 /*******************************************************************************
2 * Copyright (c) 2016 Ericsson
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 package org.eclipse.tracecompass.tmf.analysis.xml.core.tests.stubs;
10
11 import java.util.Collections;
12 import java.util.Map;
13
14 import org.eclipse.jdt.annotation.NonNull;
15 import org.eclipse.tracecompass.internal.tmf.analysis.xml.core.segment.TmfXmlPatternSegment;
16 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
17 import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
18 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
19 import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
20 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
21 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
22 import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
23
24 import com.google.common.collect.ImmutableMap;
25
26 /**
27 * Factory generating various pattern segments and data used for tests
28 *
29 * @author Jean-Christian Kouame
30 *
31 */
32 public class PatternSegmentFactoryStub {
33
34 private static final @NonNull String NAME_FIELD_1 = "field1";
35 private static final @NonNull String NAME_FIELD_2 = "field2";
36 private static final @NonNull String NAME_FIELD_3 = "field3";
37 /**
38 * The content for the segment TEST_2
39 */
40 private static final @NonNull Map<@NonNull String, @NonNull ITmfStateValue> TEST_2_CONTENT = ImmutableMap
41 .of(NAME_FIELD_1, TmfStateValue.newValueLong(5l),
42 NAME_FIELD_2, TmfStateValue.newValueString("test"),
43 NAME_FIELD_3, TmfStateValue.newValueInt(1));
44
45 /**
46 * Start event for pattern segment TEST_2
47 */
48 public static final @NonNull ITmfEvent TEST_2_START_EVENT = new TmfEvent(null, ITmfContext.UNKNOWN_RANK, TmfTimestamp.fromNanos(1), null, null);
49 /**
50 * end event for pattern segment TEST_2
51 */
52 public static final @NonNull ITmfEvent TEST_2_END_EVENT = new TmfEvent(null, ITmfContext.UNKNOWN_RANK, TmfTimestamp.fromNanos(10), null, null);
53 private static final String PATTERN_SEGMENT_PREFIX = "seg_";
54
55 /**
56 * The pattern segment TEST_2
57 */
58 public static final @NonNull TmfXmlPatternSegment TEST_2 = new TmfXmlPatternSegment(TEST_2_START_EVENT.getTimestamp().getValue(), TEST_2_END_EVENT.getTimestamp().getValue(), ITmfTimestamp.NANOSECOND_SCALE, PATTERN_SEGMENT_PREFIX + "test2", TEST_2_CONTENT);
59
60 /**
61 * The pattern segment TEST_3
62 */
63 public static final @NonNull TmfXmlPatternSegment TEST_3 = new TmfXmlPatternSegment(TEST_2_START_EVENT.getTimestamp().getValue(), TEST_2_START_EVENT.getTimestamp().getValue(), ITmfTimestamp.NANOSECOND_SCALE, PATTERN_SEGMENT_PREFIX + "open", Collections.EMPTY_MAP);
64 }
This page took 0.051052 seconds and 5 git commands to generate.