1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
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
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.tests
.state
;
17 import junit
.framework
.TestCase
;
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
;
29 public class TestStateManager
extends TestCase
{
31 public void testSetTraceSelection() {
32 String logName
= "traceset/trace1";
34 LTTngTrace testStream
= null;
36 testStream
= new LTTngTrace(logName
);
37 } catch (Exception e
) {
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
);
46 //Get the Test StateManager
47 StateManager manager
= StateManagerFactoryTestSupport
.getManager(newExp
.getExperimentId());
49 manager
.setTraceSelection(newExp
, false);
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
);
57 TraceDebug
.debug("Events not Handled: " + sb
.toString());