From: Alexandre Montplaisir Date: Tue, 12 Apr 2016 00:33:13 +0000 (-0400) Subject: Update for new LTTngAgent.dispose() method X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3e1f7ff43ebe1f56208caafd7aab07c49ab49c5e;p=lttng-ust-java-tests.git Update for new LTTngAgent.dispose() method The method was changed back to being non-static (to not break the ABI with the old 2.7 class), so update our test code accordingly. Signed-off-by: Alexandre Montplaisir --- diff --git a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java index 112b0f0..49a7c83 100644 --- a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java +++ b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingDisabledBenchmark.java @@ -35,13 +35,14 @@ import org.lttng.ust.agent.benchmarks.jul.handler.JulHandlerBenchmarkBase; public class OldLttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchmarkBase { private ILttngSession session; + private LTTngAgent agent; /** * Test setup */ @Before public void testSetup() { - LTTngAgent.getLTTngAgent(); + agent = LTTngAgent.getLTTngAgent(); session = ILttngSession.createSession(null, Domain.JUL); assertTrue(session.enableEvents("non-event")); @@ -56,6 +57,6 @@ public class OldLttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchm assertTrue(session.stop()); session.close(); - LTTngAgent.dispose(); + agent.dispose(); } } diff --git a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java index ddca5e9..e18efdc 100644 --- a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java +++ b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/benchmarks/jul/handler/lttng/old/OldLttngJulHandlerTracingEnabledBenchmark.java @@ -39,6 +39,7 @@ import org.lttng.ust.agent.jul.LttngLogHandler; public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchmarkBase { private ILttngSession session; + private LTTngAgent agent; private LttngLogHandler agentHandler; @@ -47,7 +48,7 @@ public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchma */ @Before public void testSetup() { - LTTngAgent agentInstance = LTTngAgent.getLTTngAgent(); + agent = LTTngAgent.getLTTngAgent(); /* * The "old API" works by attaching a handler managed by the agent to @@ -61,7 +62,7 @@ public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchma try { Field julHandlerField = LTTngAgent.class.getDeclaredField("julHandler"); julHandlerField.setAccessible(true); - agentHandler = (LttngLogHandler) julHandlerField.get(agentInstance); + agentHandler = (LttngLogHandler) julHandlerField.get(agent); logger.addHandler(agentHandler); @@ -83,6 +84,6 @@ public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchma session.close(); logger.removeHandler(agentHandler); - LTTngAgent.dispose(); + agent.dispose(); } } diff --git a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLegacyApiIT.java b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLegacyApiIT.java index f7c130a..e8bcb9d 100644 --- a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLegacyApiIT.java +++ b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLegacyApiIT.java @@ -54,6 +54,7 @@ public class JulLegacyApiIT { private static final String EVENT_NAME_B = "EventB"; private ILttngSession session; + private LTTngAgent agent; private Logger loggerA; private Logger loggerB; @@ -80,7 +81,7 @@ public class JulLegacyApiIT { @Before public void setup() { loggerA = Logger.getLogger(EVENT_NAME_A); - LTTngAgent.getLTTngAgent(); + agent = LTTngAgent.getLTTngAgent(); loggerB = Logger.getLogger(EVENT_NAME_B); loggerA.setLevel(Level.ALL); @@ -96,7 +97,7 @@ public class JulLegacyApiIT { public void tearDown() { session.close(); - LTTngAgent.dispose(); + agent.dispose(); loggerA = null; loggerB = null; diff --git a/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jLegacyApiIT.java b/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jLegacyApiIT.java index 4cfff7b..56a3d23 100644 --- a/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jLegacyApiIT.java +++ b/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jLegacyApiIT.java @@ -55,6 +55,7 @@ public class Log4jLegacyApiIT { private static final String EVENT_NAME_B = "EventB"; private ILttngSession session; + private LTTngAgent agent; private Logger loggerA; private Logger loggerB; @@ -81,7 +82,7 @@ public class Log4jLegacyApiIT { @Before public void setup() { loggerA = Logger.getLogger(EVENT_NAME_A); - LTTngAgent.getLTTngAgent(); + agent = LTTngAgent.getLTTngAgent(); loggerB = Logger.getLogger(EVENT_NAME_B); loggerA.setLevel(Level.ALL); @@ -97,7 +98,7 @@ public class Log4jLegacyApiIT { public void tearDown() { session.close(); - LTTngAgent.dispose(); + agent.dispose(); loggerA = null; loggerB = null;