diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AuditLoggerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AuditLoggerTest.java index 10a6f4a113..41b6026a3c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AuditLoggerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AuditLoggerTest.java @@ -42,11 +42,13 @@ import org.junit.Test; import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; +import java.net.URI; import java.util.HashSet; import java.util.UUID; import java.util.logging.LogManager; @@ -97,6 +99,23 @@ public class AuditLoggerTest extends ManagementTestBase { @Override public void tearDown() throws Exception { super.tearDown(); + + String originalLoggingConfig = System.getProperty("logging.configuration"); + + if (originalLoggingConfig != null) { + File file = new File(new URI(originalLoggingConfig)); + InputStream inputStream = new FileInputStream(file); + + LogManager logManager = LogManager.getLogManager(); + try { + logManager.readConfiguration(inputStream); + } catch (IOException e) { + System.out.println("error loading logging conifg"); + e.printStackTrace(); + } + + inputStream.close(); + } } private void emptyLogFile() throws Exception { @@ -155,10 +174,12 @@ public class AuditLoggerTest extends ManagementTestBase { LogManager logManager = LogManager.getLogManager(); try { logManager.readConfiguration(inputStream); + inputStream.close(); } catch (IOException e) { System.out.println("error loading logging conifg"); e.printStackTrace(); } + } @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java index 2384de92cd..e50f40505d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java @@ -38,7 +38,6 @@ import java.util.regex.Pattern; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.protocol.stomp.Stomp; -import org.apache.activemq.artemis.core.protocol.stomp.StompConnection; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.stomp.StompTestBase; @@ -1466,7 +1465,6 @@ public class StompV12Test extends StompTestBase { @Test public void testMultipleDurableSubscribers() throws Exception { - org.jboss.logmanager.Logger.getLogger(StompConnection.class.getName()).setLevel(org.jboss.logmanager.Level.TRACE); conn.connect(defUser, defPass, "myClientID"); StompClientConnectionV12 conn2 = (StompClientConnectionV12) StompClientConnectionFactory.createClientConnection(uri); conn2.connect(defUser, defPass, "myClientID"); @@ -1482,8 +1480,6 @@ public class StompV12Test extends StompTestBase { @Test public void testMultipleConcurrentDurableSubscribers() throws Exception { - org.jboss.logmanager.Logger.getLogger(StompConnection.class.getName()).setLevel(org.jboss.logmanager.Level.TRACE); - int NUMBER_OF_THREADS = 25; SubscriberThread[] threads = new SubscriberThread[NUMBER_OF_THREADS]; final CountDownLatch startFlag = new CountDownLatch(1);