2 * Copyright (C) 2015, EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 package org
.lttng
.ust
.agent
.integration
.client
;
21 import static org
.junit
.Assert
.assertEquals
;
22 import static org
.junit
.Assert
.assertTrue
;
24 import java
.util
.ArrayList
;
25 import java
.util
.Arrays
;
26 import java
.util
.Collections
;
27 import java
.util
.List
;
29 import org
.junit
.After
;
30 import org
.junit
.AfterClass
;
31 import org
.junit
.Before
;
32 import org
.junit
.BeforeClass
;
33 import org
.junit
.Test
;
34 import org
.junit
.runner
.RunWith
;
35 import org
.lttng
.tools
.ILttngSession
;
36 import org
.lttng
.tools
.LttngToolsHelper
;
37 import org
.lttng
.ust
.agent
.ILttngAgent
;
38 import org
.lttng
.ust
.agent
.client
.LttngTcpSessiondClient
;
39 import org
.lttng
.ust
.agent
.session
.EventRule
;
40 import org
.lttng
.ust
.agent
.session
.LogLevelSelector
;
41 import org
.lttng
.ust
.agent
.session
.LogLevelSelector
.LogLevelType
;
42 import org
.lttng
.ust
.agent
.utils
.EventRuleFactory
;
43 import org
.lttng
.ust
.agent
.utils
.ILogLevelStrings
;
44 import org
.lttng
.ust
.agent
.utils
.TestPrintRunner
;
47 * Tests for the TCP client only, without using an agent.
49 * This test suite requires that a *root* session daemon is running on the
50 * system. Since we have to explicitly tell the TCP client which sessiond to
51 * connect to, we have to hard-code it in here.
53 * @author Alexandre Montplaisir
55 @RunWith(TestPrintRunner
.class)
56 public class TcpClientIT
{
58 // ------------------------------------------------------------------------
60 // ------------------------------------------------------------------------
62 private static final String EVENT_NAME_A
= "eventA";
63 private static final String EVENT_NAME_B
= "eventB";
64 private static final String EVENT_NAME_C
= "eventC";
66 private static final String CONTEXT_RETRIEVER_NAME_A
= "retrieverA";
67 private static final String CONTEXT_RETRIEVER_NAME_B
= "retrieverB";
68 private static final String CONTEXT_NAME_A
= "contextA";
69 private static final String CONTEXT_NAME_B
= "contextB";
71 /* Test configuration */
72 private static final int DOMAIN_VALUE
= ILttngAgent
.Domain
.JUL
.value();
73 private static final ILttngSession
.Domain SESSION_DOMAIN
= ILttngSession
.Domain
.JUL
;
74 private static final boolean ROOT_SESSIOND
= true;
76 private static TcpClientDebugListener clientListener
;
77 private static LttngTcpSessiondClient client
;
78 private static Thread clientThread
;
80 private ILttngSession session
;
82 // ------------------------------------------------------------------------
84 // ------------------------------------------------------------------------
90 public static void setupClass() {
91 LttngToolsHelper
.destroyAllSessions();
93 clientListener
= new TcpClientDebugListener();
94 client
= new LttngTcpSessiondClient(clientListener
, DOMAIN_VALUE
, ROOT_SESSIOND
);
96 clientThread
= new Thread(client
);
99 assertTrue("Timed out waiting for root sessiond", client
.waitForConnection(5));
106 public static void teardownClass() {
107 if (client
!= null) {
110 if (clientThread
!= null) {
113 } catch (InterruptedException e
) {
122 public void setup() {
123 session
= ILttngSession
.createSession(null, SESSION_DOMAIN
);
124 clientListener
.clearAllCommands();
131 public void teardown() {
136 private static ILogLevelStrings
getLogLevelStrings() {
137 return ILogLevelStrings
.JUL_LOGLEVEL_STRINGS
;
141 * Check that two lists contain the exact same element (including
142 * duplicates), but their order does not matter.
144 private static <T
extends Comparable
<T
>> boolean containSameElements(List
<T
> list1
, List
<T
> list2
) {
145 List
<T
> newlist1
= new ArrayList
<>(list1
);
146 List
<T
> newlist2
= new ArrayList
<>(list2
);
147 Collections
.sort(newlist1
);
148 Collections
.sort(newlist2
);
149 return (newlist1
.equals(newlist2
));
153 // ------------------------------------------------------------------------
154 // Event enabling/disabling test cases
155 // ------------------------------------------------------------------------
158 * Test enabling one event.
161 public void testEnableEvent() {
162 session
.enableEvent(EVENT_NAME_A
, null, false, null);
164 List
<EventRule
> expectedCommands
= Collections
.singletonList(
165 EventRuleFactory
.createRule(EVENT_NAME_A
));
167 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
168 assertEquals(expectedCommands
, actualCommands
);
172 * Test an "enable-event -a" command.
175 public void testEnableAllEvents() {
176 session
.enableAllEvents();
178 List
<EventRule
> expectedCommands
= Collections
.singletonList(
179 EventRuleFactory
.createRuleAllEvents());
180 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
182 assertEquals(expectedCommands
, actualCommands
);
186 * Test enabling then disabling one event.
189 public void testEnableThenDisableOneEvent() {
190 session
.enableEvent(EVENT_NAME_A
, null, false, null);
191 session
.disableEvents(EVENT_NAME_A
);
193 List
<EventRule
> expectedEnableCommands
= Collections
.singletonList(
194 EventRuleFactory
.createRule(EVENT_NAME_A
));
195 List
<String
> expectedDisableCommands
= Collections
.singletonList(EVENT_NAME_A
);
197 assertEquals(expectedEnableCommands
, clientListener
.getEnabledEventCommands());
198 assertTrue(containSameElements(expectedDisableCommands
, clientListener
.getDisabledEventCommands()));
202 * Test enabling some events manually, then disabling all events (-a).
205 public void testEnableSomeThenDisableAll() {
206 session
.enableEvent(EVENT_NAME_A
, null, false, null);
207 session
.enableEvent(EVENT_NAME_B
, null, false, null);
208 session
.enableEvent(EVENT_NAME_C
, null, false, null);
209 session
.disableAllEvents();
211 List
<EventRule
> expectedEnableCommands
= Arrays
.asList(
212 EventRuleFactory
.createRule(EVENT_NAME_A
),
213 EventRuleFactory
.createRule(EVENT_NAME_B
),
214 EventRuleFactory
.createRule(EVENT_NAME_C
));
216 * A "disable-event -a" will send one command for each enabled event.
217 * The order may be different though.
219 List
<String
> expectedDisableCommands
= Arrays
.asList(
220 EVENT_NAME_A
, EVENT_NAME_B
, EVENT_NAME_C
);
222 assertEquals(expectedEnableCommands
, clientListener
.getEnabledEventCommands());
223 assertTrue(containSameElements(expectedDisableCommands
, clientListener
.getDisabledEventCommands()));
227 * Test enabling then (enable-event -a) then disabling all (disable-event -a) events.
230 public void testEnableAllThenDisableAll() {
231 session
.enableAllEvents();
232 session
.disableAllEvents();
234 List
<EventRule
> expectedEnableCommands
= Arrays
.asList(EventRuleFactory
.createRuleAllEvents());
235 List
<String
> expectedDisableCommands
= Arrays
.asList(EventRuleFactory
.EVENT_NAME_ALL
);
237 assertEquals(expectedEnableCommands
, clientListener
.getEnabledEventCommands());
238 assertTrue(containSameElements(expectedDisableCommands
, clientListener
.getDisabledEventCommands()));
242 * Test enabling then destroying the session (should send corresponding
243 * disable event messages).
245 @SuppressWarnings("static-method")
247 public void testEnableEventThenDestroy() {
248 try (ILttngSession session2
= ILttngSession
.createSession(null, SESSION_DOMAIN
);) {
249 session2
.enableEvent(EVENT_NAME_A
, null, false, null);
250 session2
.enableEvent(EVENT_NAME_B
, null, false, null);
251 } // close(), aka destroy the session, sending "disable event" messages
253 List
<EventRule
> expectedEnabledCommands
= Arrays
.asList(EventRuleFactory
.createRule(EVENT_NAME_A
), EventRuleFactory
.createRule(EVENT_NAME_B
));
254 List
<String
> expectedDisabledCommands
= Arrays
.asList(EVENT_NAME_A
, EVENT_NAME_B
);
256 assertEquals(expectedEnabledCommands
, clientListener
.getEnabledEventCommands());
257 assertTrue(clientListener
.getDisabledEventCommands().containsAll(expectedDisabledCommands
));
261 * Test specifying an event with a --loglevel option.
264 public void testEnableEventLogLevelRange() {
265 LogLevelSelector lls
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_RANGE
);
267 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), false, null);
269 List
<EventRule
> expectedCommands
= Collections
.singletonList(
270 EventRuleFactory
.createRule(EVENT_NAME_A
, lls
));
271 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
273 assertEquals(expectedCommands
, actualCommands
);
277 * Test enabling an event with a --loglevel-only option.
280 public void testEnableEventLogLevelSingle() {
281 LogLevelSelector lls
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_SINGLE
);
283 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), true, null);
285 List
<EventRule
> expectedCommands
= Collections
.singletonList(
286 EventRuleFactory
.createRule(EVENT_NAME_A
, lls
));
287 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
289 assertEquals(expectedCommands
, actualCommands
);
293 * Test enabling an event twice, for the same loglevel, with --loglevel followed by --loglevel-only.
296 public void testEnableEventsLogLevelRangeAndSingle() {
297 LogLevelSelector lls1
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_RANGE
);
298 LogLevelSelector lls2
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_SINGLE
);
300 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), false, null);
301 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), true, null);
303 List
<EventRule
> expectedCommands
= Arrays
.asList(
304 EventRuleFactory
.createRule(EVENT_NAME_A
, lls1
),
305 EventRuleFactory
.createRule(EVENT_NAME_A
, lls2
)
307 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
309 assertEquals(expectedCommands
, actualCommands
);
313 * Test enabling an event twice, for the same loglevel, with --loglevel-only followed by --loglevel.
316 public void testEnableEventsLogLevelSingleAndRange() {
317 LogLevelSelector lls1
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_SINGLE
);
318 LogLevelSelector lls2
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_RANGE
);
320 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), true, null);
321 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), false, null);
323 List
<EventRule
> expectedCommands
= Arrays
.asList(
324 EventRuleFactory
.createRule(EVENT_NAME_A
, lls1
),
325 EventRuleFactory
.createRule(EVENT_NAME_A
, lls2
)
327 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
329 assertEquals(expectedCommands
, actualCommands
);
333 * Test enabling the same event, same loglevel, but different loglevel types
334 * (--loglevel vs --loglevel-only) in two separate sessions.
337 public void testEnableEventsLogLevelRangeAndSingleDiffSessions() {
338 try (ILttngSession session2
= ILttngSession
.createSession(null, SESSION_DOMAIN
);) {
340 LogLevelSelector lls1
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_RANGE
);
341 LogLevelSelector lls2
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_SINGLE
);
343 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), false, null);
344 session2
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), true, null);
346 List
<EventRule
> expectedCommands
= Arrays
.asList(
347 EventRuleFactory
.createRule(EVENT_NAME_A
, lls1
),
348 EventRuleFactory
.createRule(EVENT_NAME_A
, lls2
));
349 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
351 assertEquals(expectedCommands
, actualCommands
);
356 * Enable the same event multiple times with different filter strings.
359 public void testEnableEventsDiffFilters() {
360 final String filter1
= "filter1";
361 final String filter2
= "filter2";
363 session
.enableEvent(EVENT_NAME_A
, null, false, null);
364 session
.enableEvent(EVENT_NAME_A
, null, false, filter1
);
365 session
.enableEvent(EVENT_NAME_A
, null, false, filter2
);
367 List
<EventRule
> expectedCommands
= Arrays
.asList(
368 EventRuleFactory
.createRule(EVENT_NAME_A
),
369 EventRuleFactory
.createRule(EVENT_NAME_A
, EventRuleFactory
.LOG_LEVEL_UNSPECIFIED
, filter1
),
370 EventRuleFactory
.createRule(EVENT_NAME_A
, EventRuleFactory
.LOG_LEVEL_UNSPECIFIED
, filter2
));
371 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
373 assertEquals(expectedCommands
, actualCommands
);
377 * Enable the same event multiple times with different log levels and
381 public void testEnableEventsLogLevelAndFilters() {
382 final LogLevelSelector lls
= new LogLevelSelector(getLogLevelStrings().warningInt(), LogLevelType
.LTTNG_EVENT_LOGLEVEL_RANGE
);
383 final String filter
= "filter1";
385 session
.enableEvent(EVENT_NAME_A
, null, false, null);
386 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), false, null);
387 session
.enableEvent(EVENT_NAME_A
, null, false, filter
);
388 session
.enableEvent(EVENT_NAME_A
, getLogLevelStrings().warningName(), false, filter
);
390 List
<EventRule
> expectedCommands
= Arrays
.asList(
391 EventRuleFactory
.createRule(EVENT_NAME_A
),
392 EventRuleFactory
.createRule(EVENT_NAME_A
, lls
),
393 EventRuleFactory
.createRule(EVENT_NAME_A
, EventRuleFactory
.LOG_LEVEL_UNSPECIFIED
, filter
),
394 EventRuleFactory
.createRule(EVENT_NAME_A
, lls
, filter
));
395 List
<EventRule
> actualCommands
= clientListener
.getEnabledEventCommands();
397 assertEquals(expectedCommands
, actualCommands
);
400 // ------------------------------------------------------------------------
401 // Application context enabling/disabling test cases
402 // ------------------------------------------------------------------------
405 * Test enabling one application context.
408 public void testEnableAppContext() {
409 session
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
411 List
<String
> expectedCommands
= Collections
.singletonList(
412 CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
414 List
<String
> actualCommands
= clientListener
.getEnabledAppContextCommands();
415 assertEquals(expectedCommands
, actualCommands
);
419 * Test enabling two application contexts sharing the same retriever name.
422 public void testEnableAppContextsSameRetriever() {
423 session
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
424 session
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_B
);
426 List
<String
> expectedCommands
= Arrays
.asList(
427 CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
,
428 CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_B
);
430 List
<String
> actualCommands
= clientListener
.getEnabledAppContextCommands();
431 assertEquals(expectedCommands
, actualCommands
);
435 * Test enabling two application contexts sharing the same context name, but
436 * with different retrievers. Unusual, but they should still be recognized
440 public void testEnableAppContextsSameContext() {
441 session
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
442 session
.enableAppContext(CONTEXT_RETRIEVER_NAME_B
, CONTEXT_NAME_A
);
444 List
<String
> expectedCommands
= Arrays
.asList(
445 CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
,
446 CONTEXT_RETRIEVER_NAME_B
+ ':' + CONTEXT_NAME_A
);
448 List
<String
> actualCommands
= clientListener
.getEnabledAppContextCommands();
449 assertEquals(expectedCommands
, actualCommands
);
453 * Test enabling one application context, then destroying the session. We
454 * should receive the corresponding "context removed" message.
457 @SuppressWarnings("static-method")
458 public void testEnableAppContextThenDestroy() {
459 try (ILttngSession session2
= ILttngSession
.createSession(null, SESSION_DOMAIN
);) {
460 session2
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
461 } // close(), aka destroy the session, sending "disable context" messages
463 List
<String
> expectedEnabledCommands
= Collections
.singletonList(CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
464 List
<String
> expectedDisabledCommands
= Collections
.singletonList(CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
465 List
<String
> actualEnabledCommands
= clientListener
.getEnabledAppContextCommands();
466 List
<String
> actualDisabledCommands
= clientListener
.getDisabledAppContextCommands();
468 assertEquals(expectedEnabledCommands
, actualEnabledCommands
);
469 assertEquals(expectedDisabledCommands
, actualDisabledCommands
);
473 * Test enabling the same application context in two different sessions.
474 * Upon destroying one, we should only receive one "destroyed" message.
477 public void testEnableSameAppContextTwoSessions() {
478 List
<String
> expectedEnabledCommands
= Arrays
.asList(
479 CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
,
480 CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
481 List
<String
> actualEnabledCommands
;
483 try (ILttngSession session2
= ILttngSession
.createSession(null, SESSION_DOMAIN
);) {
484 session
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
485 session2
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
487 actualEnabledCommands
= clientListener
.getEnabledAppContextCommands();
488 assertEquals(expectedEnabledCommands
, actualEnabledCommands
);
489 } // close/destroy session2
491 actualEnabledCommands
= clientListener
.getEnabledAppContextCommands();
492 assertEquals(expectedEnabledCommands
, actualEnabledCommands
);
494 List
<String
> expectedDisabledCommands
= Collections
.singletonList(CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
495 List
<String
> actualDisabledCommands
= clientListener
.getDisabledAppContextCommands();
497 assertEquals(expectedDisabledCommands
, actualDisabledCommands
);
501 * Test enabling two different application context in two different
502 * sessions. Upon destroying one, we should receive the correct "destroyed"
506 public void testEnableDiffAppContextTwoSessions() {
507 List
<String
> expectedEnabledCommands
= Arrays
.asList(
508 CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
,
509 CONTEXT_RETRIEVER_NAME_B
+ ':' + CONTEXT_NAME_B
);
510 List
<String
> actualEnabledCommands
;
512 try (ILttngSession session2
= ILttngSession
.createSession(null, SESSION_DOMAIN
);) {
513 session
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
514 session2
.enableAppContext(CONTEXT_RETRIEVER_NAME_B
, CONTEXT_NAME_B
);
516 actualEnabledCommands
= clientListener
.getEnabledAppContextCommands();
517 assertEquals(expectedEnabledCommands
, actualEnabledCommands
);
518 } // close/destroy session2
520 actualEnabledCommands
= clientListener
.getEnabledAppContextCommands();
521 assertEquals(expectedEnabledCommands
, actualEnabledCommands
);
523 List
<String
> expectedDisabledCommands
= Collections
.singletonList(CONTEXT_RETRIEVER_NAME_B
+ ':' + CONTEXT_NAME_B
);
524 List
<String
> actualDisabledCommands
= clientListener
.getDisabledAppContextCommands();
526 assertEquals(expectedDisabledCommands
, actualDisabledCommands
);
529 // ------------------------------------------------------------------------
530 // Application context filtering
531 // ------------------------------------------------------------------------
534 * Test that enabling an event with a filter string referring to a context
535 * should send an agent message about this context now being "enabled".
537 * This is because we will pass the context information to UST for the
538 * filtering step, even if the actual context won't be present in the trace.
540 @SuppressWarnings("static-method")
542 public void testContextInFilterString() {
543 try (ILttngSession session2
= ILttngSession
.createSession(null, SESSION_DOMAIN
);) {
544 session2
.enableEvent(EVENT_NAME_A
, null, false, "$app." + CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
+ "==\"bozo\"");
546 List
<String
> expectedEnabledCommands
= Collections
.singletonList(CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
547 assertEquals(expectedEnabledCommands
, clientListener
.getEnabledAppContextCommands());
548 } // close(), aka destroy the session, sending "disable context" messages
550 List
<String
> expectedDisabledCommands
= Collections
.singletonList(CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
551 assertEquals(expectedDisabledCommands
, clientListener
.getDisabledAppContextCommands());
555 * Test that if we the context is both referred to by a filter string *and*
556 * enabled directly, we receive *2* messages about this context being
557 * enabled (and disabled on session teardown).
559 @SuppressWarnings("static-method")
561 public void testContextEnabledAndInFilterString() {
562 try (ILttngSession session2
= ILttngSession
.createSession(null, SESSION_DOMAIN
);) {
563 session2
.enableEvent(EVENT_NAME_A
, null, false, "$app." + CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
+ "==\"bozo\"");
564 session2
.enableAppContext(CONTEXT_RETRIEVER_NAME_A
, CONTEXT_NAME_A
);
566 List
<String
> expectedEnabledCommands
= Collections
.nCopies(2, CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
567 assertEquals(expectedEnabledCommands
, clientListener
.getEnabledAppContextCommands());
568 } // close(), aka destroy the session, sending "disable context" messages
570 List
<String
> expectedDisabledCommands
= Collections
.nCopies(2, CONTEXT_RETRIEVER_NAME_A
+ ':' + CONTEXT_NAME_A
);
571 assertEquals(expectedDisabledCommands
, clientListener
.getDisabledAppContextCommands());