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
.TraceDomainType
;
35 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.LogLevelType
;
36 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TargetNodeState
;
37 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.core
.model
.TraceChannelOutputType
;
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
.junit
.After
;
61 import org
.junit
.Before
;
62 import org
.junit
.Test
;
63 import org
.osgi
.framework
.FrameworkUtil
;
66 * The class <code>TraceControlUstSessionTests</code> contains UST
67 * session/channel/event handling test cases.
69 public class TraceControlUstSessionTest
{
71 // ------------------------------------------------------------------------
73 // ------------------------------------------------------------------------
75 private static final String TEST_STREAM
= "CreateTreeTest.cfg";
76 private static final String SCEN_SCENARIO4_TEST
= "Scenario4";
78 // ------------------------------------------------------------------------
80 // ------------------------------------------------------------------------
81 private IRemoteConnection fHost
= TmfRemoteConnectionFactory
.getLocalConnection();
82 private TraceControlTestFacility fFacility
;
83 private @NonNull TestRemoteSystemProxy fProxy
= new TestRemoteSystemProxy(fHost
);
84 private String fTestFile
;
86 // ------------------------------------------------------------------------
88 // ------------------------------------------------------------------------
91 * Perform pre-test initialization.
94 * if the initialization fails for some reason
97 public void setUp() throws Exception
{
98 fFacility
= TraceControlTestFacility
.getInstance();
100 URL location
= FileLocator
.find(FrameworkUtil
.getBundle(this.getClass()), new Path(TraceControlTestFacility
.DIRECTORY
+ File
.separator
+ TEST_STREAM
), null);
101 File testfile
= new File(FileLocator
.toFileURL(location
).toURI());
102 fTestFile
= testfile
.getAbsolutePath();
106 * Perform post-test clean-up.
109 public void tearDown() {
114 * Run the TraceControlComponent.
117 * This will fail the test
120 public void testTraceSessionTree() throws Exception
{
122 fProxy
.setTestFile(fTestFile
);
123 fProxy
.setScenario(TraceControlTestFacility
.SCEN_INIT_TEST
);
125 ITraceControlComponent root
= fFacility
.getControlView().getTraceControlRoot();
127 TargetNodeComponent node
= new TargetNodeComponent("myNode", root
, fProxy
);
130 fFacility
.waitForJobs();
132 fFacility
.executeCommand(node
, "connect");
134 while ((i
< 10) && (node
.getTargetNodeState() != TargetNodeState
.CONNECTED
)) {
136 fFacility
.delay(TraceControlTestFacility
.GUI_REFESH_DELAY
);
139 // Get provider groups
140 ITraceControlComponent
[] groups
= node
.getChildren();
141 assertNotNull(groups
);
142 assertEquals(2, groups
.length
);
144 // Initialize dialog implementations for command execution
145 TraceControlDialogFactory
.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
146 TraceControlDialogFactory
.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
147 TraceControlDialogFactory
.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
149 // Initialize session handling scenario
150 fProxy
.setScenario(TraceControlTestFacility
.SCEN_SCENARIO_SESSION_HANDLING
);
152 // ------------------------------------------------------------------------
154 // ------------------------------------------------------------------------
155 TraceSessionComponent session
= fFacility
.createSession(groups
[1]);
157 // Verify that session was created
158 assertNotNull(session
);
159 assertEquals("mysession", session
.getName());
160 assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session
.getSessionPath());
161 assertEquals(TraceSessionState
.INACTIVE
, session
.getSessionState());
163 // Initialize scenario
164 fProxy
.setScenario(SCEN_SCENARIO4_TEST
);
166 // ------------------------------------------------------------------------
167 // Enable default channel on created session above
168 // ------------------------------------------------------------------------
169 EnableChannelDialogStub channelStub
= new EnableChannelDialogStub();
170 channelStub
.setDomain(TraceDomainType
.UST
);
171 TraceControlDialogFactory
.getInstance().setEnableChannelDialog(channelStub
);
173 fFacility
.executeCommand(session
, "enableChannelOnSession");
175 // Verify that Kernel domain was created
176 ITraceControlComponent
[] domains
= session
.getChildren();
177 assertNotNull(domains
);
178 assertEquals(1, domains
.length
);
180 assertEquals("UST global", domains
[0].getName());
181 assertEquals("Domain buffer Type", BufferType
.BUFFER_TYPE_UNKNOWN
, ((TraceDomainComponent
)domains
[0]).getBufferType());
183 // Verify that channel was created with correct data
184 ITraceControlComponent
[] channels
= domains
[0].getChildren();
185 assertNotNull(channels
);
186 assertEquals(1, channels
.length
);
188 assertTrue(channels
[0] instanceof TraceChannelComponent
);
189 TraceChannelComponent channel
= (TraceChannelComponent
) channels
[0];
190 assertEquals("mychannel", channel
.getName());
191 assertEquals(4, channel
.getNumberOfSubBuffers());
192 assertEquals("mmap()", channel
.getOutputType().getInName());
193 assertEquals(TraceChannelOutputType
.MMAP
, channel
.getOutputType());
194 assertEquals(true, channel
.isOverwriteMode());
195 assertEquals(200, channel
.getReadTimer());
196 assertEquals(TraceEnablement
.ENABLED
, channel
.getState());
197 assertEquals(16384, channel
.getSubBufferSize());
198 assertEquals(100, channel
.getSwitchTimer());
200 // ------------------------------------------------------------------------
201 // Add context on channel
202 // ------------------------------------------------------------------------
203 AddContextDialogStub addContextStub
= new AddContextDialogStub();
204 List
<String
> contexts
= new ArrayList
<>();
205 contexts
.add("procname");
206 contexts
.add("vtid");
207 addContextStub
.setContexts(contexts
);
208 TraceControlDialogFactory
.getInstance().setAddContextDialog(addContextStub
);
211 * Currently there is nothing to verify because the list commands don't
212 * show any context information. However, the execution of the command
213 * makes sure that the correct service command line is built and
216 * There was a bug in the control where the add context command was
217 * called with -k option instead of -u. Sending the -k option would
218 * cause that the command string is not found in the scenario. When a
219 * command string is not found then it is logged in the error log.
221 * Check the error log here to verify that the command was successful.
223 final IStatus
[] statusToCheck
= new IStatus
[1];
224 ILogListener listener
= new ILogListener() {
226 public void logging(IStatus status
, String plugin
) {
227 if (plugin
.contentEquals(Activator
.PLUGIN_ID
) && (!status
.isOK())) {
228 statusToCheck
[0] = status
;
232 Activator
.getDefault().getLog().addLogListener(listener
);
234 fFacility
.executeCommand(channels
[0], "addContextOnChannel");
236 // check that no error status was created
237 assertNull(statusToCheck
[0]);
239 Activator
.getDefault().getLog().removeLogListener(listener
);
241 fFacility
.delay(10000);
243 // Get Kernel domain component instance
244 domains
= session
.getChildren();
245 assertNotNull(domains
);
246 assertEquals(1, domains
.length
);
248 // ------------------------------------------------------------------------
249 // Enable channel on domain
250 // ------------------------------------------------------------------------
251 ChannelInfo info
= (ChannelInfo
)channelStub
.getChannelInfo();
252 info
.setName("mychannel2");
253 info
.setOverwriteMode(false);
254 info
.setSubBufferSize(32768);
255 info
.setNumberOfSubBuffers(2);
256 info
.setSwitchTimer(100);
257 info
.setReadTimer(200);
258 channelStub
.setChannelInfo(info
);
260 fFacility
.executeCommand(domains
[0], "enableChannelOnDomain");
262 // Get Kernel domain component instance
263 domains
= session
.getChildren();
264 assertNotNull(domains
);
265 assertEquals(1, domains
.length
);
267 // Verify that channel was created with correct data
268 channels
= domains
[0].getChildren();
269 assertNotNull(channels
);
270 assertEquals(2, channels
.length
);
272 assertTrue(channels
[1] instanceof TraceChannelComponent
);
273 channel
= (TraceChannelComponent
) channels
[1];
274 assertEquals("mychannel2", channel
.getName());
275 assertEquals(2, channel
.getNumberOfSubBuffers());
276 assertEquals("mmap()", channel
.getOutputType().getInName());
277 assertEquals(TraceChannelOutputType
.MMAP
, channel
.getOutputType());
278 assertEquals(false, channel
.isOverwriteMode());
279 assertEquals(200, channel
.getReadTimer());
280 assertEquals(TraceEnablement
.ENABLED
, channel
.getState());
281 assertEquals(32768, channel
.getSubBufferSize());
282 assertEquals(100, channel
.getSwitchTimer());
284 // ------------------------------------------------------------------------
285 // Enable event (tracepoint) on session and default channel
286 // ------------------------------------------------------------------------
287 EnableEventsDialogStub eventsDialogStub
= new EnableEventsDialogStub();
288 eventsDialogStub
.setIsTracePoints(true);
289 List
<String
> events
= new ArrayList
<>();
290 events
.add("ust_tests_hello:tptest_sighandler");
291 eventsDialogStub
.setNames(events
);
292 eventsDialogStub
.setDomain(TraceDomainType
.UST
);
293 TraceControlDialogFactory
.getInstance().setEnableEventsDialog(eventsDialogStub
);
295 fFacility
.executeCommand(session
, "enableEventOnSession");
297 // Get Kernel domain component instance
298 domains
= session
.getChildren();
299 assertNotNull(domains
);
300 assertEquals(1, domains
.length
);
302 // Verify that channel was created with correct data
303 channels
= domains
[0].getChildren();
304 assertNotNull(channels
);
305 assertEquals(3, channels
.length
);
307 assertTrue(channels
[2] instanceof TraceChannelComponent
);
308 channel
= (TraceChannelComponent
) channels
[2];
309 assertEquals("channel0", channel
.getName());
310 // No need to check parameters of default channel because that has been done in other tests
312 ITraceControlComponent
[] channel0Events
= channel
.getChildren();
313 assertEquals(1, channel0Events
.length
);
315 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
317 TraceEventComponent event
= (TraceEventComponent
) channel0Events
[0];
318 assertEquals("ust_tests_hello:tptest_sighandler", event
.getName());
319 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel()); // TODO
320 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
321 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
323 // ------------------------------------------------------------------------
324 // Enable event (tracepoint) on domain and default channel
325 // ------------------------------------------------------------------------
327 events
.add("ust_tests_hello:tptest");
328 eventsDialogStub
.setNames(events
);
330 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
332 // Get Kernel domain component instance
333 domains
= session
.getChildren();
334 assertNotNull(domains
);
335 assertEquals(1, domains
.length
);
337 // Verify that channel was created with correct data
338 channels
= domains
[0].getChildren();
339 channel
= (TraceChannelComponent
) channels
[2];
340 // No need to check parameters of default channel because that has been done in other tests
342 channel0Events
= channel
.getChildren();
343 assertEquals(2, channel0Events
.length
);
345 assertTrue(channel0Events
[1] instanceof TraceEventComponent
);
347 event
= (TraceEventComponent
) channel0Events
[1];
348 assertEquals("ust_tests_hello:tptest", event
.getName());
349 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel()); // TODO
350 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
351 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
353 // ------------------------------------------------------------------------
354 // Enable event (all tracepoints) on specific channel
355 // ------------------------------------------------------------------------
357 eventsDialogStub
.setNames(events
);
358 eventsDialogStub
.setIsAllTracePoints(true);
360 fFacility
.executeCommand(channels
[1], "enableEventOnChannel");
362 // Get Kernel domain component instance
363 domains
= session
.getChildren();
364 assertNotNull(domains
);
365 assertEquals(1, domains
.length
);
367 // Verify that channel was created with correct data
368 channels
= domains
[0].getChildren();
369 channel
= (TraceChannelComponent
) channels
[1];
370 // No need to check parameters of default channel because that has been done in other tests
372 channel
= (TraceChannelComponent
) channels
[1];
374 channel0Events
= channel
.getChildren();
375 assertEquals(1, channel0Events
.length
);
377 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
379 event
= (TraceEventComponent
) channel0Events
[0];
380 assertEquals("*", event
.getName());
381 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
382 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
383 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
385 // ------------------------------------------------------------------------
386 // Enable event (wildcard) on specific channel
387 // ------------------------------------------------------------------------
389 eventsDialogStub
.setIsTracePoints(false);
390 eventsDialogStub
.setIsAllTracePoints(false);
391 eventsDialogStub
.setIsWildcard(true);
392 eventsDialogStub
.setWildcard("ust*");
394 fFacility
.executeCommand(channels
[0], "enableEventOnChannel");
396 // Get Kernel domain component instance
397 domains
= session
.getChildren();
398 assertNotNull(domains
);
399 assertEquals(1, domains
.length
);
401 // Verify that channel was created with correct data
402 channels
= domains
[0].getChildren();
403 channel
= (TraceChannelComponent
) channels
[0];
404 // No need to check parameters of default channel because that has been done in other tests
406 channel0Events
= channel
.getChildren();
407 assertEquals(1, channel0Events
.length
);
409 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
411 event
= (TraceEventComponent
) channel0Events
[0];
412 assertEquals("ust*", event
.getName());
413 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
414 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
415 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
417 // ------------------------------------------------------------------------
418 // Enable event (wildcard) on domain
419 // ------------------------------------------------------------------------
421 eventsDialogStub
.setIsTracePoints(false);
422 eventsDialogStub
.setIsAllTracePoints(false);
423 eventsDialogStub
.setIsWildcard(true);
424 eventsDialogStub
.setWildcard("ust*");
426 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
428 // Get Kernel domain component instance
429 domains
= session
.getChildren();
430 assertNotNull(domains
);
431 assertEquals(1, domains
.length
);
433 // Verify that channel was created with correct data
434 channels
= domains
[0].getChildren();
435 channel
= (TraceChannelComponent
) channels
[0];
436 // No need to check parameters of default channel because that has been done in other tests
438 channel0Events
= channel
.getChildren();
439 assertEquals(1, channel0Events
.length
);
441 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
443 event
= (TraceEventComponent
) channel0Events
[0];
444 assertEquals("ust*", event
.getName());
445 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
446 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
447 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
449 // ------------------------------------------------------------------------
450 // Enable event (wildcard) on session
451 // ------------------------------------------------------------------------
453 eventsDialogStub
.setIsTracePoints(false);
454 eventsDialogStub
.setIsAllTracePoints(false);
455 eventsDialogStub
.setIsWildcard(true);
456 eventsDialogStub
.setWildcard("ust*");
458 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
460 // Get Kernel domain component instance
461 domains
= session
.getChildren();
462 assertNotNull(domains
);
463 assertEquals(1, domains
.length
);
465 // Verify that channel was created with correct data
466 channels
= domains
[0].getChildren();
467 channel
= (TraceChannelComponent
) channels
[2];
468 // No need to check parameters of default channel because that has been done in other tests
470 channel0Events
= channel
.getChildren();
471 assertEquals(4, channel0Events
.length
);
473 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
475 event
= (TraceEventComponent
) channel0Events
[0];
476 assertEquals("u*", event
.getName());
477 assertEquals(TraceLogLevel
.LEVEL_UNKNOWN
, event
.getLogLevel());
478 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
479 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
481 // ------------------------------------------------------------------------
482 // Enable event (loglevel) on domain
483 // ------------------------------------------------------------------------
485 eventsDialogStub
.setIsWildcard(false);
486 eventsDialogStub
.setIsLogLevel(true);
487 eventsDialogStub
.setNames(Arrays
.asList("myevent1"));
488 eventsDialogStub
.setLogLevelType(LogLevelType
.LOGLEVEL
);
489 eventsDialogStub
.setLogLevel(TraceLogLevel
.TRACE_WARNING
);
491 fFacility
.executeCommand(domains
[0], "enableEventOnDomain");
493 // Get Kernel domain component instance
494 domains
= session
.getChildren();
495 assertNotNull(domains
);
496 assertEquals(1, domains
.length
);
498 // Verify that channel was created with correct data
499 channels
= domains
[0].getChildren();
500 channel
= (TraceChannelComponent
) channels
[2];
501 // No need to check parameters of default channel because that has been done in other tests
503 channel0Events
= channel
.getChildren();
504 assertEquals(5, channel0Events
.length
);
506 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
508 event
= (TraceEventComponent
) channel0Events
[0];
509 assertEquals("myevent1", event
.getName());
510 assertEquals(TraceLogLevel
.TRACE_WARNING
, event
.getLogLevel());
511 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
512 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
514 // ------------------------------------------------------------------------
515 // Enable event (loglevel) on session
516 // ------------------------------------------------------------------------
517 eventsDialogStub
.setNames(Arrays
.asList("myevent2"));
518 eventsDialogStub
.setLogLevelType(LogLevelType
.LOGLEVEL_ONLY
);
519 eventsDialogStub
.setLogLevel(TraceLogLevel
.TRACE_DEBUG_FUNCTION
);
521 fFacility
.executeCommand(session
, "enableEventOnSession");
523 // Get Kernel domain component instance
524 domains
= session
.getChildren();
525 assertNotNull(domains
);
526 assertEquals(1, domains
.length
);
528 // Verify that channel was created with correct data
529 channels
= domains
[0].getChildren();
530 channel
= (TraceChannelComponent
) channels
[2];
531 // No need to check parameters of default channel because that has been done in other tests
533 channel0Events
= channel
.getChildren();
534 assertEquals(6, channel0Events
.length
);
536 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
538 event
= (TraceEventComponent
) channel0Events
[0];
539 assertEquals("myevent2", event
.getName());
540 assertEquals(TraceLogLevel
.TRACE_DEBUG_FUNCTION
, event
.getLogLevel());
541 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
542 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
544 // ------------------------------------------------------------------------
545 // Enable event (loglevel) on channel
546 // ------------------------------------------------------------------------
547 eventsDialogStub
.setNames(Arrays
.asList("myevent0"));
548 eventsDialogStub
.setLogLevelType(LogLevelType
.LOGLEVEL_ONLY
);
549 eventsDialogStub
.setLogLevel(TraceLogLevel
.TRACE_DEBUG_FUNCTION
);
551 fFacility
.executeCommand(channels
[0], "enableEventOnChannel");
553 // Get Kernel domain component instance
554 domains
= session
.getChildren();
555 assertNotNull(domains
);
556 assertEquals(1, domains
.length
);
558 // Verify that channel was created with correct data
559 channels
= domains
[0].getChildren();
560 channel
= (TraceChannelComponent
) channels
[0];
561 // No need to check parameters of default channel because that has been done in other tests
563 channel0Events
= channel
.getChildren();
564 assertEquals(2, channel0Events
.length
);
566 assertTrue(channel0Events
[0] instanceof TraceEventComponent
);
568 event
= (TraceEventComponent
) channel0Events
[0];
569 assertEquals("myevent0", event
.getName());
570 assertEquals(TraceLogLevel
.TRACE_DEBUG_FUNCTION
, event
.getLogLevel());
571 assertEquals(TraceEventType
.TRACEPOINT
, event
.getEventType());
572 assertEquals(TraceEnablement
.ENABLED
, event
.getState());
574 // ------------------------------------------------------------------------
576 // ------------------------------------------------------------------------
577 // Initialize session handling scenario
578 fProxy
.setScenario(TraceControlTestFacility
.SCEN_SCENARIO_SESSION_HANDLING
);
580 fFacility
.destroySession(session
);
582 // Verify that no more session components exist
583 assertEquals("Session components still exist.", 0, groups
[1].getChildren().length
);
585 //-------------------------------------------------------------------------
587 //-------------------------------------------------------------------------
588 fFacility
.executeCommand(node
, "disconnect");
589 assertEquals(TargetNodeState
.DISCONNECTED
, node
.getTargetNodeState());
591 //-------------------------------------------------------------------------
593 //-------------------------------------------------------------------------
595 fFacility
.executeCommand(node
, "delete");
596 assertEquals("Node not deleted.", 0, fFacility
.getControlView().getTraceControlRoot().getChildren().length
);