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