diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java index 6579e843df..1760544754 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java @@ -83,6 +83,7 @@ import org.apache.activemq.artemis.utils.Wait; import org.apache.commons.configuration2.PropertiesConfiguration; import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder; import org.apache.commons.configuration2.builder.fluent.Configurations; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -101,6 +102,7 @@ import static org.junit.Assert.fail; * Test to validate that the CLI doesn't throw improper exceptions when invoked. */ public class ArtemisTest extends CliTestBase { + private static final Logger log = Logger.getLogger(ArtemisTest.class); @Before @Override @@ -135,10 +137,9 @@ public class ArtemisTest extends CliTestBase { int writes = 2; int tries = 5; long totalAvg = SyncCalculation.syncTest(temporaryFolder.getRoot(), 4096, writes, tries, true, true, true, "file.tmp", 1, JournalType.NIO); - System.out.println(); - System.out.println("TotalAvg = " + totalAvg); + log.debug("TotalAvg = " + totalAvg); long nanoTime = SyncCalculation.toNanos(totalAvg, writes, false); - System.out.println("nanoTime avg = " + nanoTime); + log.debug("nanoTime avg = " + nanoTime); assertEquals(0, LibaioContext.getTotalMaxIO()); } @@ -222,7 +223,7 @@ public class ArtemisTest extends CliTestBase { byte[] contents = Files.readAllBytes(bootstrapFile.toPath()); String cfgText = new String(contents); - System.out.println("confg: " + cfgText); + log.debug("confg: " + cfgText); config = parseXml(bootstrapFile); webElem = (Element) config.getElementsByTagName("web").item(0); @@ -353,7 +354,7 @@ public class ArtemisTest extends CliTestBase { listCmd.execute(context); String result = context.getStdout(); - System.out.println("output1:\n" + result); + log.debug("output1:\n" + result); //default only one user admin with role amq assertTrue(result.contains("\"admin\"(amq)")); @@ -370,7 +371,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output2:\n" + result); + log.debug("output2:\n" + result); assertTrue(result.contains("\"admin\"(amq)")); assertTrue(result.contains("\"guest\"(admin)")); @@ -389,7 +390,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output3:\n" + result); + log.debug("output3:\n" + result); assertTrue(result.contains("\"admin\"(amq)")); assertTrue(result.contains("\"guest\"(admin)")); @@ -413,7 +414,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output4:\n" + result); + log.debug("output4:\n" + result); assertTrue(result.contains("\"admin\"(amq)")); assertTrue(result.contains("\"guest\"(admin)")); @@ -428,7 +429,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output5:\n" + result); + log.debug("output5:\n" + result); assertTrue(result.contains("\"admin\"(amq)")); assertFalse(result.contains("\"guest\"(admin)")); @@ -444,7 +445,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output6:\n" + result); + log.debug("output6:\n" + result); assertTrue(result.contains("\"admin\"(amq)")); assertFalse(result.contains("\"guest\"(admin)")); @@ -464,7 +465,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output7:\n" + result); + log.debug("output7:\n" + result); assertTrue(result.contains("\"admin\"(amq)")); assertTrue(result.contains("Total: 1")); @@ -477,7 +478,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output8:\n" + result); + log.debug("output8:\n" + result); assertTrue(result.contains("Total: 0")); } @@ -695,7 +696,7 @@ public class ArtemisTest extends CliTestBase { listCmd.execute(context); String result = context.getStdout(); - System.out.println("output1:\n" + result); + log.debug("output1:\n" + result); //default only one user admin with role amq assertTrue(result.contains("\"admin\"(amq)")); @@ -709,7 +710,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output8:\n" + result); + log.debug("output8:\n" + result); assertTrue(result.contains("Total: 0")); @@ -740,7 +741,7 @@ public class ArtemisTest extends CliTestBase { context = new TestActionContext(); listCmd.execute(context); result = context.getStdout(); - System.out.println("output2:\n" + result); + log.debug("output2:\n" + result); assertTrue(result.contains("Total: 4")); assertTrue(result.contains("\"guest\"(admin)")); @@ -871,7 +872,7 @@ public class ArtemisTest extends CliTestBase { mask.setPassword(password1); String result = (String) mask.execute(context); - System.out.println(context.getStdout()); + log.debug(context.getStdout()); assertEquals(encrypt1, result); context = new TestActionContext(); @@ -879,7 +880,7 @@ public class ArtemisTest extends CliTestBase { mask.setPassword(password1); mask.setHash(true); result = (String) mask.execute(context); - System.out.println(context.getStdout()); + log.debug(context.getStdout()); DefaultSensitiveStringCodec codec = mask.getCodec(); codec.verify(password1.toCharArray(), result); @@ -888,7 +889,7 @@ public class ArtemisTest extends CliTestBase { mask.setPassword(password1); mask.setKey(newKey); result = (String) mask.execute(context); - System.out.println(context.getStdout()); + log.debug(context.getStdout()); assertEquals(encrypt2, result); } @@ -1541,7 +1542,7 @@ public class ArtemisTest extends CliTestBase { for (String r : roles) { String storedUsers = (String) roleConfig.getProperty(r); - System.out.println("users in role: " + r + " ; " + storedUsers); + log.debug("users in role: " + r + " ; " + storedUsers); List userList = StringUtil.splitStringList(storedUsers, ","); assertTrue(userList.contains(user)); } diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java index 09a5208223..6394d72c22 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/HashUtilTest.java @@ -18,19 +18,21 @@ package org.apache.activemq.cli.test; import org.apache.activemq.artemis.cli.commands.util.HashUtil; import org.apache.activemq.artemis.utils.PasswordMaskingUtil; +import org.jboss.logging.Logger; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class HashUtilTest { + private static final Logger log = Logger.getLogger(HashUtilTest.class); @Test public void testDefaultHashFormat() throws Exception { final String password = "helloworld"; String hash = HashUtil.tryHash(new TestActionContext(), password); String hashStr = PasswordMaskingUtil.unwrap(hash); - System.out.println("hashString: " + hashStr); + log.debug("hashString: " + hashStr); String[] parts = hashStr.split(":"); assertEquals(3, parts.length); //first part should be able to convert to an int diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java index e0b8a10ca6..86cdf81a31 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorSanityTest.java @@ -26,10 +26,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class OrderedExecutorSanityTest { + private static final Logger log = Logger.getLogger(OrderedExecutorSanityTest.class); @Test public void shouldExecuteTasksInOrder() throws InterruptedException { @@ -175,7 +177,7 @@ public class OrderedExecutorSanityTest { long elapsed = (end - start); - System.out.println("execution " + i + " in " + TimeUnit.NANOSECONDS.toMillis(elapsed) + " milliseconds"); + log.info("execution " + i + " in " + TimeUnit.NANOSECONDS.toMillis(elapsed) + " milliseconds"); } } finally { executorService.shutdown(); diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/ClientThreadPoolsTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/ClientThreadPoolsTest.java index 77271f464f..76516323cb 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/ClientThreadPoolsTest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/ClientThreadPoolsTest.java @@ -82,7 +82,6 @@ public class ClientThreadPoolsTest { ActiveMQClient.getGlobalThreadPool().execute(new Runnable() { @Override public void run() { - System.err.println("Hello!"); try { inUse.countDown(); neverLeave.await(); @@ -114,7 +113,6 @@ public class ClientThreadPoolsTest { ActiveMQClient.getGlobalThreadPool().execute(new Runnable() { @Override public void run() { - System.err.println("Hello!"); try { inUse.countDown(); neverLeave.await(); diff --git a/artemis-jms-client/pom.xml b/artemis-jms-client/pom.xml index c27f9221a8..e22038abc9 100644 --- a/artemis-jms-client/pom.xml +++ b/artemis-jms-client/pom.xml @@ -70,6 +70,11 @@ junit test + + org.jboss.logmanager + jboss-logmanager + test + diff --git a/artemis-selector/pom.xml b/artemis-selector/pom.xml index dcd7c795f3..0f74c529e7 100644 --- a/artemis-selector/pom.xml +++ b/artemis-selector/pom.xml @@ -52,6 +52,11 @@ junit test + + org.jboss.logmanager + jboss-logmanager + test + diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java index e4fff54fcc..fb8d2d9dea 100755 --- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java +++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorParserTest.java @@ -27,9 +27,6 @@ import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; -/** - * @version $Revision: 1.2 $ - */ public class SelectorParserTest { private static final Logger log = Logger.getLogger(SelectorParserTest.class); diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java index 1be9d475a2..7e6a9a6631 100755 --- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java +++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java @@ -26,9 +26,6 @@ import org.apache.activemq.artemis.selector.impl.SelectorParser; import org.junit.Assert; import org.junit.Test; -/** - * @version $Revision: 1.7 $ - */ public class SelectorTest { class MockMessage implements Filterable { diff --git a/tests/config/logging.properties b/tests/config/logging.properties index 6ec83e9fc0..6a4583545d 100644 --- a/tests/config/logging.properties +++ b/tests/config/logging.properties @@ -17,7 +17,7 @@ # Additional logger names to configure (root logger is always configured) # Root logger option -loggers=org.jboss.logging,org.apache.activemq.artemis.core.server,org.apache.activemq.artemis.utils,org.apache.activemq.artemis.journal,org.apache.activemq.artemis.jms,org.apache.activemq.artemis.ra,org.apache.activemq.artemis.tests.unit,org.apache.activemq.artemis.tests.integration,org.apache.activemq.artemis.jms.tests,org.apache.activemq.audit +loggers=org.jboss.logging,org.apache.activemq.artemis.core.server,org.apache.activemq.artemis.utils,org.apache.activemq.artemis.journal,org.apache.activemq.artemis.jms,org.apache.activemq.artemis.ra,org.apache.activemq.artemis.tests.unit,org.apache.activemq.artemis.tests.integration,org.apache.activemq.artemis.jms.tests,org.apache.activemq.cli.test,org.apache.activemq.audit # Root logger level logger.level=INFO @@ -28,6 +28,7 @@ logger.org.apache.activemq.artemis.utils.level=INFO logger.org.apache.activemq.artemis.jms.level=INFO logger.org.apache.activemq.artemis.ra.level=INFO +logger.org.apache.activemq.cli.test.level=DEBUG logger.org.apache.activemq.artemis.tests.integration.level=DEBUG logger.org.apache.activemq.artemis.tests.level=DEBUG logger.org.apache.activemq.artemis.tests.unit.level=DEBUG diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java index 2dcca826b2..1786a36113 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/util/RandomUtilDistributionTest.java @@ -55,7 +55,7 @@ public class RandomUtilDistributionTest { @Test public void testDistribution() throws Exception { int numberOfStarts = 50; - int iterations = 10; + int iterations = 1; int value = 0; for (int i = 0; i < iterations; i++) { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java index 64ca352f4f..591ce1fec5 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/MemorySizeTest.java @@ -18,7 +18,6 @@ package org.apache.activemq.artemis.tests.unit.util; import org.apache.activemq.artemis.core.message.impl.CoreMessage; import org.apache.activemq.artemis.core.server.impl.MessageReferenceImpl; -import org.apache.activemq.artemis.tests.unit.UnitTestLogger; import org.apache.activemq.artemis.utils.MemorySize; import org.jboss.logging.Logger; import org.junit.Assert; diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java index ebceca1126..7171c24585 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java @@ -44,12 +44,10 @@ import org.apache.activemq.artemis.tests.unit.util.deserialization.pkg1.TestClas import org.apache.activemq.artemis.tests.unit.util.deserialization.pkg1.TestClass2; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ObjectInputStreamWithClassLoader; -import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class ObjectInputStreamWithClassLoaderTest extends ActiveMQTestBase { - private static final Logger log = Logger.getLogger(ObjectInputStreamWithClassLoaderTest.class); // Constants ----------------------------------------------------- @@ -509,7 +507,8 @@ public class ObjectInputStreamWithClassLoaderTest extends ActiveMQTestBase { try { Object deserializedObj = ois.readObject(); - log.debug("Deserialized Object " + deserializedObj); + // cannot use logging here, as this test is playing with classLoading here. + System.out.println("Deserialized Object " + deserializedObj); myAssertNotSame(originalProxy, deserializedObj); myAssertNotSame(originalProxy.getClass(), deserializedObj.getClass());