1 /**********************************************************************
2 * Copyright (c) 2012, 2015 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 * Bernd Hufmann - Initial API and implementation
11 * Alexandre Montplaisir - Port to JUnit4
12 * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
13 **********************************************************************/
15 package org
.eclipse
.tracecompass
.lttng2
.control
.ui
.tests
.model
.component
;
17 import static org
.junit
.Assert
.assertEquals
;
18 import static org
.junit
.Assert
.assertNotNull
;
19 import static org
.junit
.Assert
.assertNull
;
20 import static org
.junit
.Assert
.assertTrue
;
24 import java
.util
.ArrayList
;
25 import java
.util
.Arrays
;
26 import java
.util
.List
;
28 import org
.eclipse
.core
.runtime
.FileLocator
;
29 import org
.eclipse
.core
.runtime
.ILogListener
;
30 import org
.eclipse
.core
.runtime
.IStatus
;
31 import org
.eclipse
.core
.runtime
.Path
;
32 import org
.eclipse
.jdt
.annotation
.NonNull
;
33 import org
.eclipse
.remote
.core
.IRemoteConnection
;
34 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.LogLevelType
;
35 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TargetNodeState
;
36 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceChannelOutputType
;
37 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceDomainType
;
38 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceEnablement
;
39 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceEventType
;
40 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceLogLevel
;
41 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceSessionState
;
42 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.impl
.BufferType
;
43 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.impl
.ChannelInfo
;
44 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.dialogs
.AddContextDialogStub
;
45 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.dialogs
.CreateSessionDialogStub
;
46 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.dialogs
.DestroyConfirmDialogStub
;
47 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.dialogs
.EnableChannelDialogStub
;
48 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.dialogs
.EnableEventsDialogStub
;
49 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.dialogs
.GetEventInfoDialogStub
;
50 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.service
.TestRemoteSystemProxy
;
51 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.Activator
;
52 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.dialogs
.TraceControlDialogFactory
;
53 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.ITraceControlComponent
;
54 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TargetNodeComponent
;
55 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TraceChannelComponent
;
56 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TraceDomainComponent
;
57 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TraceEventComponent
;
58 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TraceSessionComponent
;
59 import org
.eclipse
.tracecompass
.tmf
.remote
.core
.proxy
.TmfRemoteConnectionFactory
;
60 import org
.eclipse
.tracecompass
.tmf
.ui
.tests
.shared
.WaitUtils
;
61 import org
.junit
.After
;
62 import org
.junit
.Before
;
63 import org
.junit
.Test
;
64 import org
.osgi
.framework
.FrameworkUtil
;
67 * The class <code>TraceControlUstSessionTests</code> contains UST
68 * session/channel/event handling test cases.
70 public class TraceControlUstSessionTest
{
72 // ------------------------------------------------------------------------
74 // ------------------------------------------------------------------------
76 private static final String TEST_STREAM
= "CreateTreeTest.cfg";
77 private static final String SCEN_SCENARIO4_TEST
= "Scenario4";
79 // ------------------------------------------------------------------------
81 // ------------------------------------------------------------------------
82 private IRemoteConnection fHost
= TmfRemoteConnectionFactory
.getLocalConnection();
83 private TraceControlTestFacility fFacility
;
84 private @NonNull TestRemoteSystemProxy fProxy
= new TestRemoteSystemProxy(fHost
);
85 private String fTestFile
;
87 // ------------------------------------------------------------------------
89 // ------------------------------------------------------------------------
92 * Perform pre-test initialization.
95 * if the initialization fails for some reason
98 public void setUp() throws Exception
{
99 fFacility
= TraceControlTestFacility
.getInstance();
101 URL location
= FileLocator
.find(FrameworkUtil
.getBundle(this.getClass()), new Path(TraceControlTestFacility
.DIRECTORY
+ File
.separator
+ TEST_STREAM
), null);
102 File testfile
= new File(FileLocator
.toFileURL(location
).toURI());
103 fTestFile
= testfile
.getAbsolutePath();
107 * Perform post-test clean-up.
110 public void tearDown() {
115 * Run the TraceControlComponent.
118 * This will fail the test
121 public void testTraceSessionTree() throws Exception
{
123 fProxy
.setTestFile(fTestFile
);
124 fProxy
.setScenario(TraceControlTestFacility
.SCEN_INIT_TEST
);
126 ITraceControlComponent root
= fFacility
.getControlView().getTraceControlRoot();
128 TargetNodeComponent node
= new TargetNodeComponent("myNode", root
, fProxy
);
131 fFacility
.waitForJobs();
133 fFacility
.executeCommand(node
, "connect");
134 WaitUtils
.waitUntil(new TargetNodeConnectedCondition(node
));
136 // Get provider groups
137 ITraceControlComponent
[] groups
= node
.getChildren();
138 assertNotNull(groups
);
139 assertEquals(2, groups
.length
);
141 // Initialize dialog implementations for command execution
142 TraceControlDialogFactory
.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
143 TraceControlDialogFactory
.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
144 TraceControlDialogFactory
.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
146 // Initialize session handling scenario
147 fProxy
.setScenario(TraceControlTestFacility
.SCEN_SCENARIO_SESSION_HANDLING
);
149 // ------------------------------------------------------------------------
151 // ------------------------------------------------------------------------
152 TraceSessionComponent session
= fFacility
.createSession(groups
[1]);
154 // Verify that session was created
155 assertNotNull(session
);
156 assertEquals("mysession", session
.getName());
157 assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session
.getSessionPath());
158 assertEquals(TraceSessionState
.INACTIVE
, session
.getSessionState());
160 // Initialize scenario
161 fProxy
.setScenario(SCEN_SCENARIO4_TEST
);
163 // ------------------------------------------------------------------------
164 // Enable default channel on created session above
165 // ------------------------------------------------------------------------
166 EnableChannelDialogStub channelStub
= new EnableChannelDialogStub();
167 channelStub
.setDomain(TraceDomainType
.UST
);
168 TraceControlDialogFactory
.getInstance().setEnableChannelDialog(channelStub
);
170 fFacility
.executeCommand(session
, "enableChannelOnSession");
172 // Verify that Kernel domain was created
173 ITraceControlComponent
[] domains
= session
.getChildren();
174 assertNotNull(domains
);
175 assertEquals(1, domains
.length
);
177 assertEquals("UST global", domains
[0].getName());
178 assertEquals("Domain buffer Type", BufferType
.BUFFER_TYPE_UNKNOWN
, ((TraceDomainComponent
)domains
[0]).getBufferType());
180 // Verify that channel was created with correct data
181 ITraceControlComponent
[] channels
= domains
[0].getChildren();
182 assertNotNull(channels
);
183 assertEquals(1, channels
.length
);
185 assertTrue(channels
[0] instanceof TraceChannelComponent
);
186 TraceChannelComponent channel
= (TraceChannelComponent
) channels
[0];
187 assertEquals("mychannel", channel
.getName());
188 assertEquals(4, channel
.getNumberOfSubBuffers());
189 assertEquals("mmap()", channel
.getOutputType().getInName());
190 assertEquals(TraceChannelOutputType
.MMAP
, channel
.getOutputType());
191 assertEquals(true, channel
.isOverwriteMode());
192 assertEquals(200, channel
.getReadTimer());
193 assertEquals(TraceEnablement
.ENABLED
, channel
.getState());
194 assertEquals(16384, channel
.getSubBufferSize());
195 assertEquals(100, channel
.getSwitchTimer());
197 // ------------------------------------------------------------------------
198 // Add context on channel
199 // ------------------------------------------------------------------------
200 AddContextDialogStub addContextStub
= new AddContextDialogStub();
201 List
<String
> contexts
= new ArrayList
<>();
202 contexts
.add("procname");
203 contexts
.add("vtid");
204 addContextStub
.setContexts(contexts
);
205 TraceControlDialogFactory
.getInstance().setAddContextDialog(addContextStub
);
208 * Currently there is nothing to verify because the list commands don't
209 * show any context information. However, the execution of the command
210 * makes sure that the correct service command line is built and
213 * There was a bug in the control where the add context command was
214 * called with -k option instead of -u. Sending the -k option would
215 * cause that the command string is not found in the scenario. When a
216 * command string is not found then it is logged in the error log.
218 * Check the error log here to verify that the command was successful.
220 final IStatus
[] statusToCheck
= new IStatus
[1];
221 ILogListener listener
= new ILogListener() {
223 public void logging(IStatus status
, String plugin
) {
224 if (plugin
.contentEquals(Activator
.PLUGIN_ID
) && (!status
.isOK())) {
225 statusToCheck
[0] = status
;
229 Activator
.getDefault().getLog().addLogListener(listener
);
231 fFacility
.executeCommand(channels
[0], "addContextOnChannel");
233 // check that no error status was created
234 assertNull(statusToCheck
[0]);
236 Activator
.getDefault().getLog().removeLogListener(listener
);
238 fFacility
.delay(10000);
240 // Get Kernel domain component instance
241 domains
= session
.getChildren();
242 assertNotNull(domains
);
243 assertEquals(1, domains
.length
);
245 // ------------------------------------------------------------------------
246 // Enable channel on domain
247 // ------------------------------------------------------------------------
248 ChannelInfo info
= (ChannelInfo
)channelStub
.getChannelInfo();
249 info
.setName("mychannel2");
250 info
.setOverwriteMode(false);
251 info
.setSubBufferSize(32768);
252 info
.setNumberOfSubBuffers(2);
253 info
.setSwitchTimer(100);
254 info
.setReadTimer(200);
255 channelStub
.setChannelInfo(info
);
257 fFacility
.executeCommand(domains
[0], "enableChannelOnDomain");
259 // Get Kernel domain component instance
260 domains
= session
.getChildren();
261 assertNotNull(domains
);
262 assertEquals(1, domains
.length
);
264 // Verify that channel was created with correct data
265 channels
= domains
[0].getChildren();
266 assertNotNull(channels
);
267 assertEquals(2, channels
.length
);
269 assertTrue(channels
[1] instanceof TraceChannelComponent
);
270 channel
= (TraceChannelComponent
) channels
[1];
271 assertEquals("mychannel2", channel
.getName());
272 assertEquals(2, channel
.getNumberOfSubBuffers());
273 assertEquals("mmap()", channel
.getOutputType().getInName());
274 assertEquals(TraceChannelOutputType
.MMAP
, channel
.getOutputType());
275 assertEquals(false, channel
.isOverwriteMode());
276 assertEquals(200, channel
.getReadTimer());
277 assertEquals(TraceEnablement
.ENABLED
, channel
.getState());
278 assertEquals(32768, channel
.getSubBufferSize());
279 assertEquals(100, channel
.getSwitchTimer());
281 // ------------------------------------------------------------------------
282 // Enable event (tracepoint) on session and default channel
283 // ------------------------------------------------------------------------
284 EnableEventsDialogStub eventsDialogStub
= new EnableEventsDialogStub();
285 eventsDialogStub
.setIsTracePoints(true);
286 List
<String
> events
= new ArrayList
<>();
287 events
.add("ust_tests_hello:tptest_sighandler");
288 eventsDialogStub
.setNames(events
);
289 eventsDialogStub
.setDomain(TraceDomainType
.UST
);
290 TraceControlDialogFactory
.getInstance().setEnableEventsDialog(eventsDialogStub
);
292 fFacility
.executeCommand(session
, "enableEventOnSession");
294 // Get Kernel domain component instance
295 domains
= session
.getChildren();
296 assertNotNull(domains
);
297 assertEquals(1, domains
.length
);
299 // Verify that channel was created with correct data
300 channels
= domains
[0].getChildren();
301 assertNotNull(channels
);
302 assertEquals(3, channels
.length
);
304 assertTrue(channels
[2] instanceof TraceChannelComponent
);
305 channel
= (TraceChannelComponent
) channels
[2];
306 assertEquals("channel0", channel
.getName());
307 // No need to check parameters of default channel because that has been done in other tests
309 ITraceControlComponent
[] channel0Events
= channel
.getChildren();
310 assertEquals(1, channel0Events
.length
);
312 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
314 TraceEventComponent event
= (TraceEventComponent
) channel0Events
[0];
315 assertEquals("ust_tests_hello:tptest_sighandler", event
.getName());
316 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel()); // TODO
317 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
318 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
320 // ------------------------------------------------------------------------
321 // Enable event (tracepoint) on domain and default channel
322 // ------------------------------------------------------------------------
324 events
.add("ust_tests_hello:tptest");
325 eventsDialogStub
.setNames(events
);
327 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
329 // Get Kernel domain component instance
330 domains
= session
.getChildren();
331 assertNotNull(domains
);
332 assertEquals(1, domains
.length
);
334 // Verify that channel was created with correct data
335 channels
= domains
[0].getChildren();
336 channel
= (TraceChannelComponent
) channels
[2];
337 // No need to check parameters of default channel because that has been done in other tests
339 channel0Events
= channel
.getChildren();
340 assertEquals(2, channel0Events
.length
);
342 assertTrue(channel0Events
[1] instanceof TraceEventComponent
);
344 event
= (TraceEventComponent
) channel0Events
[1];
345 assertEquals("ust_tests_hello:tptest", event
.getName());
346 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel()); // TODO
347 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
348 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
350 // ------------------------------------------------------------------------
351 // Enable event (all tracepoints) on specific channel
352 // ------------------------------------------------------------------------
354 eventsDialogStub
.setNames(events
);
355 eventsDialogStub
.setIsAllTracePoints(true);
357 fFacility
.executeCommand(channels
[1], "enableEventOnChannel");
359 // Get Kernel domain component instance
360 domains
= session
.getChildren();
361 assertNotNull(domains
);
362 assertEquals(1, domains
.length
);
364 // Verify that channel was created with correct data
365 channels
= domains
[0].getChildren();
366 channel
= (TraceChannelComponent
) channels
[1];
367 // No need to check parameters of default channel because that has been done in other tests
369 channel
= (TraceChannelComponent
) channels
[1];
371 channel0Events
= channel
.getChildren();
372 assertEquals(1, channel0Events
.length
);
374 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
376 event
= (TraceEventComponent
) channel0Events
[0];
377 assertEquals("*", event
.getName());
378 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
379 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
380 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
382 // ------------------------------------------------------------------------
383 // Enable event (wildcard) on specific channel
384 // ------------------------------------------------------------------------
386 eventsDialogStub
.setIsTracePoints(false);
387 eventsDialogStub
.setIsAllTracePoints(false);
388 eventsDialogStub
.setIsWildcard(true);
389 eventsDialogStub
.setWildcard("ust*");
391 fFacility
.executeCommand(channels
[0], "enableEventOnChannel");
393 // Get Kernel domain component instance
394 domains
= session
.getChildren();
395 assertNotNull(domains
);
396 assertEquals(1, domains
.length
);
398 // Verify that channel was created with correct data
399 channels
= domains
[0].getChildren();
400 channel
= (TraceChannelComponent
) channels
[0];
401 // No need to check parameters of default channel because that has been done in other tests
403 channel0Events
= channel
.getChildren();
404 assertEquals(1, channel0Events
.length
);
406 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
408 event
= (TraceEventComponent
) channel0Events
[0];
409 assertEquals("ust*", event
.getName());
410 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
411 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
412 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
414 // ------------------------------------------------------------------------
415 // Enable event (wildcard) on domain
416 // ------------------------------------------------------------------------
418 eventsDialogStub
.setIsTracePoints(false);
419 eventsDialogStub
.setIsAllTracePoints(false);
420 eventsDialogStub
.setIsWildcard(true);
421 eventsDialogStub
.setWildcard("ust*");
423 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
425 // Get Kernel domain component instance
426 domains
= session
.getChildren();
427 assertNotNull(domains
);
428 assertEquals(1, domains
.length
);
430 // Verify that channel was created with correct data
431 channels
= domains
[0].getChildren();
432 channel
= (TraceChannelComponent
) channels
[0];
433 // No need to check parameters of default channel because that has been done in other tests
435 channel0Events
= channel
.getChildren();
436 assertEquals(1, channel0Events
.length
);
438 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
440 event
= (TraceEventComponent
) channel0Events
[0];
441 assertEquals("ust*", event
.getName());
442 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
443 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
444 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
446 // ------------------------------------------------------------------------
447 // Enable event (wildcard) on session
448 // ------------------------------------------------------------------------
450 eventsDialogStub
.setIsTracePoints(false);
451 eventsDialogStub
.setIsAllTracePoints(false);
452 eventsDialogStub
.setIsWildcard(true);
453 eventsDialogStub
.setWildcard("ust*");
455 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
457 // Get Kernel domain component instance
458 domains
= session
.getChildren();
459 assertNotNull(domains
);
460 assertEquals(1, domains
.length
);
462 // Verify that channel was created with correct data
463 channels
= domains
[0].getChildren();
464 channel
= (TraceChannelComponent
) channels
[2];
465 // No need to check parameters of default channel because that has been done in other tests
467 channel0Events
= channel
.getChildren();
468 assertEquals(4, channel0Events
.length
);
470 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
472 event
= (TraceEventComponent
) channel0Events
[0];
473 assertEquals("u*", event
.getName());
474 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
475 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
476 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
478 // ------------------------------------------------------------------------
479 // Enable event (loglevel) on domain
480 // ------------------------------------------------------------------------
482 eventsDialogStub
.setIsWildcard(false);
483 eventsDialogStub
.setIsLogLevel(true);
484 eventsDialogStub
.setNames(Arrays
.asList("myevent1"));
485 eventsDialogStub
.setLogLevelType(LogLevelType
.LOGLEVEL
);
486 eventsDialogStub
.setLogLevel(TraceLogLevel
.TRACE_WARNING
);
488 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
490 // Get Kernel domain component instance
491 domains
= session
.getChildren();
492 assertNotNull(domains
);
493 assertEquals(1, domains
.length
);
495 // Verify that channel was created with correct data
496 channels
= domains
[0].getChildren();
497 channel
= (TraceChannelComponent
) channels
[2];
498 // No need to check parameters of default channel because that has been done in other tests
500 channel0Events
= channel
.getChildren();
501 assertEquals(5, channel0Events
.length
);
503 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
505 event
= (TraceEventComponent
) channel0Events
[0];
506 assertEquals("myevent1", event
.getName());
507 assertEquals(TraceLogLevel
.TRACE_WARNING
, event
.getLogLevel());
508 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
509 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
511 // ------------------------------------------------------------------------
512 // Enable event (loglevel) on session
513 // ------------------------------------------------------------------------
514 eventsDialogStub
.setNames(Arrays
.asList("myevent2"));
515 eventsDialogStub
.setLogLevelType(LogLevelType
.LOGLEVEL_ONLY
);
516 eventsDialogStub
.setLogLevel(TraceLogLevel
.TRACE_DEBUG_FUNCTION
);
518 fFacility
.executeCommand(session
, "enableEventOnSession");
520 // Get Kernel domain component instance
521 domains
= session
.getChildren();
522 assertNotNull(domains
);
523 assertEquals(1, domains
.length
);
525 // Verify that channel was created with correct data
526 channels
= domains
[0].getChildren();
527 channel
= (TraceChannelComponent
) channels
[2];
528 // No need to check parameters of default channel because that has been done in other tests
530 channel0Events
= channel
.getChildren();
531 assertEquals(6, channel0Events
.length
);
533 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
535 event
= (TraceEventComponent
) channel0Events
[0];
536 assertEquals("myevent2", event
.getName());
537 assertEquals(TraceLogLevel
.TRACE_DEBUG_FUNCTION
, event
.getLogLevel());
538 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
539 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
541 // ------------------------------------------------------------------------
542 // Enable event (loglevel) on channel
543 // ------------------------------------------------------------------------
544 eventsDialogStub
.setNames(Arrays
.asList("myevent0"));
545 eventsDialogStub
.setLogLevelType(LogLevelType
.LOGLEVEL_ONLY
);
546 eventsDialogStub
.setLogLevel(TraceLogLevel
.TRACE_DEBUG_FUNCTION
);
548 fFacility
.executeCommand(channels
[0], "enableEventOnChannel");
550 // Get Kernel domain component instance
551 domains
= session
.getChildren();
552 assertNotNull(domains
);
553 assertEquals(1, domains
.length
);
555 // Verify that channel was created with correct data
556 channels
= domains
[0].getChildren();
557 channel
= (TraceChannelComponent
) channels
[0];
558 // No need to check parameters of default channel because that has been done in other tests
560 channel0Events
= channel
.getChildren();
561 assertEquals(2, channel0Events
.length
);
563 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
565 event
= (TraceEventComponent
) channel0Events
[0];
566 assertEquals("myevent0", event
.getName());
567 assertEquals(TraceLogLevel
.TRACE_DEBUG_FUNCTION
, event
.getLogLevel());
568 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
569 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
571 // ------------------------------------------------------------------------
573 // ------------------------------------------------------------------------
574 // Initialize session handling scenario
575 fProxy
.setScenario(TraceControlTestFacility
.SCEN_SCENARIO_SESSION_HANDLING
);
577 fFacility
.destroySession(session
);
579 // Verify that no more session components exist
580 assertEquals("Session components still exist.", 0, groups
[1].getChildren().length
);
582 //-------------------------------------------------------------------------
584 //-------------------------------------------------------------------------
585 fFacility
.executeCommand(node
, "disconnect");
586 assertEquals(TargetNodeState
.DISCONNECTED
, node
.getTargetNodeState());
588 //-------------------------------------------------------------------------
590 //-------------------------------------------------------------------------
592 fFacility
.executeCommand(node
, "delete");
593 assertEquals("Node not deleted.", 0, fFacility
.getControlView().getTraceControlRoot().getChildren().length
);