package org.lttng.ust.agent.integration.events;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.LogManager;
import java.util.logging.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.lttng.tools.ILttngSession.Domain;
import org.lttng.ust.agent.LTTngAgent;
import org.lttng.ust.agent.utils.JulTestUtils;
* @author Alexandre Montplaisir
*/
@SuppressWarnings("deprecation")
-@RunWith(Parameterized.class)
+//@RunWith(Parameterized.class)
public class JulLegacyApiLoggerHierarchyListIT extends LoggerHierachyListITBase {
private LTTngAgent agent;
private Logger parentLogger;
private Logger childLogger;
- /**
- * Test constructor
- *
- * @param parentLoggerActive
- * Parent logger has been instantiated
- * @param parentLoggerHasHandler
- * Parent logger has a LTTng handler attached to it
- * @param childLoggerActive
- * Child logger has been instantiated
- * @param childLoggerHasHandler
- * Child logger has a LTTng handler attached to it
- */
- public JulLegacyApiLoggerHierarchyListIT(boolean parentLoggerActive,
- boolean parentLoggerHasHandler,
- boolean childLoggerActive,
- boolean childLoggerHasHandler) {
- /* Set by parameters defined in the base class */
- super(parentLoggerActive,
- parentLoggerHasHandler,
- childLoggerActive,
- childLoggerHasHandler);
- }
-
// ------------------------------------------------------------------------
// Maintenance
// ------------------------------------------------------------------------
/**
* Class setup
*/
- @BeforeClass
+ @BeforeAll
public static void julClassSetup() {
JulTestUtils.testClassSetup();
}
/**
* Class cleanup
*/
- @AfterClass
+ @AfterAll
public static void julClassCleanup() {
JulTestUtils.testClassCleanup();
}
* Test setup
*/
@SuppressWarnings("static-method")
- @Before
+ @BeforeEach
public void setup() {
LogManager.getLogManager().reset();
System.gc();
/**
* Test cleanup
*/
- @After
+ @AfterEach
public void cleanup() {
agent.dispose();
}
@Override
- protected void activateLoggers() throws IOException {
+ protected void activateLoggers(boolean parentLoggerActive,
+ boolean parentLoggerHasHandler,
+ boolean childLoggerActive,
+ boolean childLoggerHasHandler) throws IOException {
agent = LTTngAgent.getLTTngAgent();
/*
* the logger exists, it will be visible in "lttng list" because the single
* log handler is attached to the root logger.
*/
+ @SuppressWarnings("resource")
@Override
- @Test
- public void testList() throws IOException {
- activateLoggers();
+ @ParameterizedTest
+ @MethodSource("provideArguments")
+ public void testList(boolean parentLoggerActive,
+ boolean parentLoggerHasHandler,
+ boolean childLoggerActive,
+ boolean childLoggerHasHandler) throws IOException {
+
+ activateLoggers(parentLoggerActive,
+ parentLoggerHasHandler,
+ childLoggerActive,
+ childLoggerHasHandler);
List<String> enabledEvents = getSession().listEvents();
List<String> expectedEvents = new ArrayList<>();