[Bug 303523] LTTng/TMF udpates:
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.tests / src / org / eclipse / linuxtools / lttng / tests / state / TestStateManager.java
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
13 package org.eclipse.linuxtools.lttng.tests.state;
14
15 import java.util.Set;
16
17 import junit.framework.TestCase;
18
19 import org.eclipse.linuxtools.lttng.TraceDebug;
20 import org.eclipse.linuxtools.lttng.event.LttngEvent;
21 import org.eclipse.linuxtools.lttng.state.StateManager;
22 import org.eclipse.linuxtools.lttng.trace.LTTngTrace;
23 import org.eclipse.linuxtools.tmf.experiment.TmfExperiment;
24
25 /**
26 * @author alvaro
27 *
28 */
29 public class TestStateManager extends TestCase {
30
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;
44 TmfExperiment<LttngEvent> newExp = new TmfExperiment<LttngEvent>(LttngEvent.class, logName, streamList);
45
46 //Get the Test StateManager
47 StateManager manager = StateManagerFactoryTestSupport.getManager(newExp.getExperimentId());
48 //Start execution.
49 manager.setTraceSelection(newExp, false);
50
51 //Print events not handled.
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());
58 }
59 }
60 }
This page took 0.032702 seconds and 5 git commands to generate.