Monster fix: TMF model update + corresponding LTTng adaptations + JUnits
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.tests / src / org / eclipse / linuxtools / lttng / 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.state;
14
15 import java.util.Set;
16
17 import org.eclipse.linuxtools.lttng.ActivateDebugging;
18 import org.eclipse.linuxtools.lttng.TraceDebug;
19 import org.eclipse.linuxtools.lttng.trace.LTTngTrace;
20 import org.eclipse.linuxtools.tmf.trace.TmfExperiment;
21 import junit.framework.TestCase;
22
23 /**
24 * @author alvaro
25 *
26 */
27 public class TestStateManager extends TestCase {
28
29 public void testSetTraceSelection() {
30 String logName = "traceset/trace1";
31
32 LTTngTrace testStream = null;
33 try {
34 testStream = new LTTngTrace(logName);
35 } catch (Exception e) {
36 e.printStackTrace();
37 }
38
39 if (testStream != null) {
40 LTTngTrace[] streamList = new LTTngTrace[1];
41 streamList[0] = testStream;
42 TmfExperiment newExp = new TmfExperiment(logName, streamList);
43
44 //Get the Test StateManager
45 StateManager manager = StateManagerFactoryTestSupport.getManager(newExp.getExperimentId());
46 //Start execution.
47 manager.setTraceSelection(newExp, false);
48
49 //Print events not handled.
50 Set<String> notHandledEvents = manager.getEventsNotHandled();
51 StringBuilder sb = new StringBuilder();
52 for (String event : notHandledEvents) {
53 sb.append("\n" + event);
54 }
55 TraceDebug.debug("Events not Handled: " + sb.toString());
56 }
57 }
58 }
This page took 0.031971 seconds and 5 git commands to generate.