X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=lttng-ust-java-tests-log4j2%2Fsrc%2Fmain%2Fjava%2Forg%2Flttng%2Fust%2Fagent%2Fintegration%2Ffilter%2FLog4j2FilterListenerOrderingITBase.java;fp=lttng-ust-java-tests-log4j2%2Fsrc%2Fmain%2Fjava%2Forg%2Flttng%2Fust%2Fagent%2Fintegration%2Ffilter%2FLog4j2FilterListenerOrderingITBase.java;h=caa2dbf5a9f8ae71a7c49e598e7112875ea59989;hb=9db2c69aaa0ba078f044266dae8e0b92a6e98357;hp=0000000000000000000000000000000000000000;hpb=7a4f0255e3d52ad76b194fb2e83bcdc6f641549e;p=lttng-ust-java-tests.git diff --git a/lttng-ust-java-tests-log4j2/src/main/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerOrderingITBase.java b/lttng-ust-java-tests-log4j2/src/main/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerOrderingITBase.java new file mode 100644 index 0000000..caa2dbf --- /dev/null +++ b/lttng-ust-java-tests-log4j2/src/main/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerOrderingITBase.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022, EfficiOS Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.lttng.ust.agent.integration.filter; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestInstance.Lifecycle; +import org.lttng.ust.agent.utils.Log4j2TestContext; +import org.lttng.ust.agent.utils.Log4j2TestUtils; + +/** + * Implementation of {@link FilterListenerOrderingITBase} for the log4j API. + */ +@TestInstance(Lifecycle.PER_CLASS) +public abstract class Log4j2FilterListenerOrderingITBase extends FilterListenerOrderingITBase { + + private Log4j2TestContext testContext; + + /** + * Class setup + */ + @BeforeAll + public void log4j2ClassSetup() { + Log4j2TestUtils.testClassSetup(getDomain()); + } + + /** + * Class cleanup + */ + @AfterAll + public static void log4j2ClassCleanup() { + Log4j2TestUtils.testClassCleanup(); + } + + @Override + protected void registerAgent() { + testContext = new Log4j2TestContext("log4j2." + this.getClass().getSimpleName() + ".xml"); + testContext.beforeTest(); + } + + @Override + protected void deregisterAgent() { + testContext.afterTest(); + } +}