Commit | Line | Data |
---|---|---|
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 | ||
13 | package org.eclipse.linuxtools.lttng.tests.state; | |
14 | ||
15 | import junit.framework.TestCase; | |
16 | ||
e31e01e8 | 17 | import org.eclipse.linuxtools.lttng.event.LttngEvent; |
8827c197 | 18 | import org.eclipse.linuxtools.lttng.state.trace.IStateTraceManager; |
03c71d1e | 19 | import org.eclipse.linuxtools.lttng.trace.LTTngTrace; |
e31e01e8 | 20 | import org.eclipse.linuxtools.tmf.experiment.TmfExperiment; |
8827c197 | 21 | import org.eclipse.linuxtools.tmf.signal.TmfExperimentUpdatedSignal; |
03c71d1e ASL |
22 | |
23 | /** | |
24 | * @author alvaro | |
25 | * | |
26 | */ | |
27 | public class TestStateManager extends TestCase { | |
86de1b08 | 28 | |
03c71d1e ASL |
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; | |
e31e01e8 | 42 | TmfExperiment<LttngEvent> newExp = new TmfExperiment<LttngEvent>(LttngEvent.class, logName, streamList); |
03c71d1e ASL |
43 | |
44 | //Get the Test StateManager | |
8827c197 FC |
45 | IStateTraceManager manager = StateManagerFactoryTestSupport |
46 | .getManager(testStream); | |
03c71d1e | 47 | //Start execution. |
8827c197 | 48 | manager.experimentUpdated(new TmfExperimentUpdatedSignal(this, newExp, null), true); |
03c71d1e ASL |
49 | |
50 | //Print events not handled. | |
8827c197 FC |
51 | // Set<String> notHandledEvents = manager.getEventsNotHandled(); |
52 | // StringBuilder sb = new StringBuilder(); | |
53 | // for (String event : notHandledEvents) { | |
54 | // sb.append("\n" + event); | |
55 | // } | |
56 | // TraceDebug.debug("Events not Handled: " + sb.toString()); | |
03c71d1e ASL |
57 | } |
58 | } | |
59 | } |