af8e8a1495ec5d4bdd5128260d3b0948b82309c6
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui.tests / src / org / eclipse / tracecompass / lttng2 / control / ui / tests / model / component / TraceControlUstSessionTest.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2015 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 * 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 **********************************************************************/
14
15 package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
16
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;
21
22 import java.io.File;
23 import java.net.URL;
24 import java.util.ArrayList;
25 import java.util.Arrays;
26 import java.util.List;
27
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;
64
65 /**
66 * The class <code>TraceControlUstSessionTests</code> contains UST
67 * session/channel/event handling test cases.
68 */
69 public class TraceControlUstSessionTest {
70
71 // ------------------------------------------------------------------------
72 // Constants
73 // ------------------------------------------------------------------------
74
75 private static final String TEST_STREAM = "CreateTreeTest.cfg";
76 private static final String SCEN_SCENARIO4_TEST = "Scenario4";
77
78 // ------------------------------------------------------------------------
79 // Test data
80 // ------------------------------------------------------------------------
81 private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
82 private TraceControlTestFacility fFacility;
83 private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
84 private String fTestFile;
85
86 // ------------------------------------------------------------------------
87 // Housekeeping
88 // ------------------------------------------------------------------------
89
90 /**
91 * Perform pre-test initialization.
92 *
93 * @throws Exception
94 * if the initialization fails for some reason
95 */
96 @Before
97 public void setUp() throws Exception {
98 fFacility = TraceControlTestFacility.getInstance();
99 fFacility.init();
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();
103 }
104
105 /**
106 * Perform post-test clean-up.
107 */
108 @After
109 public void tearDown() {
110 fFacility.dispose();
111 }
112
113 /**
114 * Run the TraceControlComponent.
115 *
116 * @throws Exception
117 * This will fail the test
118 */
119 @Test
120 public void testTraceSessionTree() throws Exception {
121
122 fProxy.setTestFile(fTestFile);
123 fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
124
125 ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
126
127 TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
128
129 root.addChild(node);
130 fFacility.waitForJobs();
131
132 fFacility.executeCommand(node, "connect");
133 int i = 0;
134 while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
135 i++;
136 fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
137 }
138
139 // Get provider groups
140 ITraceControlComponent[] groups = node.getChildren();
141 assertNotNull(groups);
142 assertEquals(2, groups.length);
143
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());
148
149 // Initialize session handling scenario
150 fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
151
152 // ------------------------------------------------------------------------
153 // Create session
154 // ------------------------------------------------------------------------
155 TraceSessionComponent session = fFacility.createSession(groups[1]);
156
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());
162
163 // Initialize scenario
164 fProxy.setScenario(SCEN_SCENARIO4_TEST);
165
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);
172
173 fFacility.executeCommand(session, "enableChannelOnSession");
174
175 // Verify that Kernel domain was created
176 ITraceControlComponent[] domains = session.getChildren();
177 assertNotNull(domains);
178 assertEquals(1, domains.length);
179
180 assertEquals("UST global", domains[0].getName());
181 assertEquals("Domain buffer Type", BufferType.BUFFER_TYPE_UNKNOWN, ((TraceDomainComponent)domains[0]).getBufferType());
182
183 // Verify that channel was created with correct data
184 ITraceControlComponent[] channels = domains[0].getChildren();
185 assertNotNull(channels);
186 assertEquals(1, channels.length);
187
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());
199
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);
209
210 /*
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
214 * executed.
215 *
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.
220 *
221 * Check the error log here to verify that the command was successful.
222 */
223 final IStatus[] statusToCheck = new IStatus[1];
224 ILogListener listener = new ILogListener() {
225 @Override
226 public void logging(IStatus status, String plugin) {
227 if (plugin.contentEquals(Activator.PLUGIN_ID) && (!status.isOK())) {
228 statusToCheck[0] = status;
229 }
230 }
231 };
232 Activator.getDefault().getLog().addLogListener(listener);
233
234 fFacility.executeCommand(channels[0], "addContextOnChannel");
235
236 // check that no error status was created
237 assertNull(statusToCheck[0]);
238
239 Activator.getDefault().getLog().removeLogListener(listener);
240
241 fFacility.delay(10000);
242
243 // Get Kernel domain component instance
244 domains = session.getChildren();
245 assertNotNull(domains);
246 assertEquals(1, domains.length);
247
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);
259
260 fFacility.executeCommand(domains[0], "enableChannelOnDomain");
261
262 // Get Kernel domain component instance
263 domains = session.getChildren();
264 assertNotNull(domains);
265 assertEquals(1, domains.length);
266
267 // Verify that channel was created with correct data
268 channels = domains[0].getChildren();
269 assertNotNull(channels);
270 assertEquals(2, channels.length);
271
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());
283
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);
294
295 fFacility.executeCommand(session, "enableEventOnSession");
296
297 // Get Kernel domain component instance
298 domains = session.getChildren();
299 assertNotNull(domains);
300 assertEquals(1, domains.length);
301
302 // Verify that channel was created with correct data
303 channels = domains[0].getChildren();
304 assertNotNull(channels);
305 assertEquals(3, channels.length);
306
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
311
312 ITraceControlComponent[] channel0Events = channel.getChildren();
313 assertEquals(1, channel0Events.length);
314
315 assertTrue(channel0Events[0] instanceof TraceEventComponent);
316
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());
322
323 // ------------------------------------------------------------------------
324 // Enable event (tracepoint) on domain and default channel
325 // ------------------------------------------------------------------------
326 events.clear();
327 events.add("ust_tests_hello:tptest");
328 eventsDialogStub.setNames(events);
329
330 fFacility.executeCommand(domains[0], "enableEventOnDomain");
331
332 // Get Kernel domain component instance
333 domains = session.getChildren();
334 assertNotNull(domains);
335 assertEquals(1, domains.length);
336
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
341
342 channel0Events = channel.getChildren();
343 assertEquals(2, channel0Events.length);
344
345 assertTrue(channel0Events[1] instanceof TraceEventComponent);
346
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());
352
353 // ------------------------------------------------------------------------
354 // Enable event (all tracepoints) on specific channel
355 // ------------------------------------------------------------------------
356 events.clear();
357 eventsDialogStub.setNames(events);
358 eventsDialogStub.setIsAllTracePoints(true);
359
360 fFacility.executeCommand(channels[1], "enableEventOnChannel");
361
362 // Get Kernel domain component instance
363 domains = session.getChildren();
364 assertNotNull(domains);
365 assertEquals(1, domains.length);
366
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
371
372 channel = (TraceChannelComponent) channels[1];
373
374 channel0Events = channel.getChildren();
375 assertEquals(1, channel0Events.length);
376
377 assertTrue(channel0Events[0] instanceof TraceEventComponent);
378
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());
384
385 // ------------------------------------------------------------------------
386 // Enable event (wildcard) on specific channel
387 // ------------------------------------------------------------------------
388 events.clear();
389 eventsDialogStub.setIsTracePoints(false);
390 eventsDialogStub.setIsAllTracePoints(false);
391 eventsDialogStub.setIsWildcard(true);
392 eventsDialogStub.setWildcard("ust*");
393
394 fFacility.executeCommand(channels[0], "enableEventOnChannel");
395
396 // Get Kernel domain component instance
397 domains = session.getChildren();
398 assertNotNull(domains);
399 assertEquals(1, domains.length);
400
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
405
406 channel0Events = channel.getChildren();
407 assertEquals(1, channel0Events.length);
408
409 assertTrue(channel0Events[0] instanceof TraceEventComponent);
410
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());
416
417 // ------------------------------------------------------------------------
418 // Enable event (wildcard) on domain
419 // ------------------------------------------------------------------------
420 events.clear();
421 eventsDialogStub.setIsTracePoints(false);
422 eventsDialogStub.setIsAllTracePoints(false);
423 eventsDialogStub.setIsWildcard(true);
424 eventsDialogStub.setWildcard("ust*");
425
426 fFacility.executeCommand(domains[0], "enableEventOnDomain");
427
428 // Get Kernel domain component instance
429 domains = session.getChildren();
430 assertNotNull(domains);
431 assertEquals(1, domains.length);
432
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
437
438 channel0Events = channel.getChildren();
439 assertEquals(1, channel0Events.length);
440
441 assertTrue(channel0Events[0] instanceof TraceEventComponent);
442
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());
448
449 // ------------------------------------------------------------------------
450 // Enable event (wildcard) on session
451 // ------------------------------------------------------------------------
452 events.clear();
453 eventsDialogStub.setIsTracePoints(false);
454 eventsDialogStub.setIsAllTracePoints(false);
455 eventsDialogStub.setIsWildcard(true);
456 eventsDialogStub.setWildcard("ust*");
457
458 fFacility.executeCommand(domains[0], "enableEventOnDomain");
459
460 // Get Kernel domain component instance
461 domains = session.getChildren();
462 assertNotNull(domains);
463 assertEquals(1, domains.length);
464
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
469
470 channel0Events = channel.getChildren();
471 assertEquals(4, channel0Events.length);
472
473 assertTrue(channel0Events[0] instanceof TraceEventComponent);
474
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());
480
481 // ------------------------------------------------------------------------
482 // Enable event (loglevel) on domain
483 // ------------------------------------------------------------------------
484 events.clear();
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);
490
491 fFacility.executeCommand(domains[0], "enableEventOnDomain");
492
493 // Get Kernel domain component instance
494 domains = session.getChildren();
495 assertNotNull(domains);
496 assertEquals(1, domains.length);
497
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
502
503 channel0Events = channel.getChildren();
504 assertEquals(5, channel0Events.length);
505
506 assertTrue(channel0Events[0] instanceof TraceEventComponent);
507
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());
513
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);
520
521 fFacility.executeCommand(session, "enableEventOnSession");
522
523 // Get Kernel domain component instance
524 domains = session.getChildren();
525 assertNotNull(domains);
526 assertEquals(1, domains.length);
527
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
532
533 channel0Events = channel.getChildren();
534 assertEquals(6, channel0Events.length);
535
536 assertTrue(channel0Events[0] instanceof TraceEventComponent);
537
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());
543
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);
550
551 fFacility.executeCommand(channels[0], "enableEventOnChannel");
552
553 // Get Kernel domain component instance
554 domains = session.getChildren();
555 assertNotNull(domains);
556 assertEquals(1, domains.length);
557
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
562
563 channel0Events = channel.getChildren();
564 assertEquals(2, channel0Events.length);
565
566 assertTrue(channel0Events[0] instanceof TraceEventComponent);
567
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());
573
574 // ------------------------------------------------------------------------
575 // Destroy session
576 // ------------------------------------------------------------------------
577 // Initialize session handling scenario
578 fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
579
580 fFacility.destroySession(session);
581
582 // Verify that no more session components exist
583 assertEquals("Session components still exist.", 0, groups[1].getChildren().length);
584
585 //-------------------------------------------------------------------------
586 // Disconnect node
587 //-------------------------------------------------------------------------
588 fFacility.executeCommand(node, "disconnect");
589 assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
590
591 //-------------------------------------------------------------------------
592 // Delete node
593 //-------------------------------------------------------------------------
594
595 fFacility.executeCommand(node, "delete");
596 assertEquals("Node not deleted.", 0, fFacility.getControlView().getTraceControlRoot().getChildren().length);
597 }
598 }
This page took 0.055755 seconds and 4 git commands to generate.