d377b158bc4c4fee23acc413d14a9536f1ca7286
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
.events
;
21 import java
.io
.IOException
;
22 import java
.util
.logging
.Handler
;
23 import java
.util
.logging
.Level
;
24 import java
.util
.logging
.Logger
;
26 import org
.junit
.jupiter
.api
.AfterAll
;
27 import org
.junit
.jupiter
.api
.AfterEach
;
28 import org
.junit
.jupiter
.api
.BeforeAll
;
29 import org
.junit
.jupiter
.api
.BeforeEach
;
30 import org
.junit
.jupiter
.api
.Tag
;
31 import org
.lttng
.tools
.ILttngSession
.Domain
;
32 import org
.lttng
.ust
.agent
.jul
.LttngLogHandler
;
33 import org
.lttng
.ust
.agent
.utils
.JulTestUtils
;
36 * JUL tests for multiple concurrent tracing sessions
40 public class JulMultiSessionIT
extends MultiSessionITBase
{
42 private static final Domain DOMAIN
= Domain
.JUL
;
44 private Logger loggerA
;
45 private Logger loggerB
;
46 private Logger loggerC
;
47 private Logger loggerD
;
53 public static void julClassSetup() {
54 JulTestUtils
.testClassSetup();
61 public static void julClassCleanup() {
62 JulTestUtils
.testClassCleanup();
68 * @throws SecurityException
72 public void julSetup() throws SecurityException
, IOException
{
73 loggerA
= Logger
.getLogger(EVENT_NAME_A
);
74 loggerB
= Logger
.getLogger(EVENT_NAME_B
);
75 loggerC
= Logger
.getLogger(EVENT_NAME_C
);
76 loggerD
= Logger
.getLogger(EVENT_NAME_D
);
78 loggerA
.setLevel(Level
.ALL
);
79 loggerB
.setLevel(Level
.ALL
);
80 loggerC
.setLevel(Level
.ALL
);
81 loggerD
.setLevel(Level
.ALL
);
83 handlerA
= new LttngLogHandler();
84 handlerB
= new LttngLogHandler();
85 handlerC
= new LttngLogHandler();
86 handlerD
= new LttngLogHandler();
88 loggerA
.addHandler((Handler
) handlerA
);
89 loggerB
.addHandler((Handler
) handlerB
);
90 loggerC
.addHandler((Handler
) handlerC
);
91 loggerD
.addHandler((Handler
) handlerD
);
98 public void julTeardown() {
99 loggerA
.removeHandler((Handler
) handlerA
);
100 loggerB
.removeHandler((Handler
) handlerB
);
101 loggerC
.removeHandler((Handler
) handlerC
);
102 loggerD
.removeHandler((Handler
) handlerD
);
111 protected Domain
getDomain() {
116 protected boolean closeHandlers()
122 protected void sendEventsToLoggers() {
123 JulTestUtils
.send10EventsTo(loggerA
);
124 JulTestUtils
.send10EventsTo(loggerB
);
125 JulTestUtils
.send10EventsTo(loggerC
);
126 JulTestUtils
.send10EventsTo(loggerD
);
This page took 0.035211 seconds and 4 git commands to generate.