[Bug 303523] LTTng/TMF udpates:
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.tests / src / org / eclipse / linuxtools / lttng / tests / state / TestStateManager.java
CommitLineData
03c71d1e
ASL
1/*******************************************************************************
2 * Copyright (c) 2009 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 * Contributors:
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12
13package org.eclipse.linuxtools.lttng.tests.state;
14
86de1b08
ASL
15import java.util.Set;
16
03c71d1e
ASL
17import junit.framework.TestCase;
18
86de1b08 19import org.eclipse.linuxtools.lttng.TraceDebug;
e31e01e8 20import org.eclipse.linuxtools.lttng.event.LttngEvent;
86de1b08 21import org.eclipse.linuxtools.lttng.state.StateManager;
03c71d1e 22import org.eclipse.linuxtools.lttng.trace.LTTngTrace;
e31e01e8 23import org.eclipse.linuxtools.tmf.experiment.TmfExperiment;
03c71d1e
ASL
24
25/**
26 * @author alvaro
27 *
28 */
29public class TestStateManager extends TestCase {
86de1b08 30
03c71d1e
ASL
31 public void testSetTraceSelection() {
32 String logName = "traceset/trace1";
33
34 LTTngTrace testStream = null;
35 try {
36 testStream = new LTTngTrace(logName);
37 } catch (Exception e) {
38 e.printStackTrace();
39 }
40
41 if (testStream != null) {
42 LTTngTrace[] streamList = new LTTngTrace[1];
43 streamList[0] = testStream;
e31e01e8 44 TmfExperiment<LttngEvent> newExp = new TmfExperiment<LttngEvent>(LttngEvent.class, logName, streamList);
03c71d1e
ASL
45
46 //Get the Test StateManager
86de1b08 47 StateManager manager = StateManagerFactoryTestSupport.getManager(newExp.getExperimentId());
03c71d1e 48 //Start execution.
86de1b08 49 manager.setTraceSelection(newExp, false);
03c71d1e
ASL
50
51 //Print events not handled.
86de1b08
ASL
52 Set<String> notHandledEvents = manager.getEventsNotHandled();
53 StringBuilder sb = new StringBuilder();
54 for (String event : notHandledEvents) {
55 sb.append("\n" + event);
56 }
57 TraceDebug.debug("Events not Handled: " + sb.toString());
03c71d1e
ASL
58 }
59 }
60}
This page took 0.026979 seconds and 5 git commands to generate.