NO-JIRA Removing non used UnitTestLogger

This commit is contained in:
Clebert Suconic 2021-08-14 18:04:49 -04:00 committed by clebertsuconic
parent 2418ea0312
commit 62cf93dd61
19 changed files with 63 additions and 91 deletions

View File

@ -23,16 +23,16 @@ import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
import org.apache.activemq.artemis.core.journal.RecordInfo;
import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestBase;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
import org.jboss.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
public abstract class JournalImplTestUnit extends JournalImplTestBase {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(JournalImplTestBase.class);
@Override
@After

View File

@ -20,13 +20,13 @@ import java.io.File;
import org.apache.activemq.artemis.core.io.SequentialFileFactory;
import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.jboss.logging.Logger;
import org.junit.Before;
import org.junit.BeforeClass;
public class RealJournalImplAIOTest extends JournalImplTestUnit {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(RealJournalImplAIOTest.class);
@BeforeClass
public static void hasAIO() {

View File

@ -20,11 +20,11 @@ import java.io.File;
import org.apache.activemq.artemis.core.io.SequentialFileFactory;
import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.jboss.logging.Logger;
public class RealJournalImplNIOTest extends JournalImplTestUnit {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(RealJournalImplNIOTest.class);
@Override
protected SequentialFileFactory getFileFactory() throws Exception {

View File

@ -22,8 +22,8 @@ import javax.transaction.xa.Xid;
import org.apache.activemq.artemis.api.core.client.ClientSession;
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.utils.UUIDGenerator;
import org.jboss.logging.Logger;
/**
* WARNING: This is not a sample on how you should handle XA. You are supposed to use a
@ -37,7 +37,7 @@ import org.apache.activemq.artemis.utils.UUIDGenerator;
public abstract class ClientAbstract extends Thread {
// Constants -----------------------------------------------------
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(ClientAbstract.class);
// Attributes ----------------------------------------------------

View File

@ -33,15 +33,15 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.core.server.impl.QueueImpl;
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class MultipleConsumersPageStressTest extends ActiveMQTestBase {
private final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(MultipleConsumersPageStressTest.class);
// Constants -----------------------------------------------------

View File

@ -28,15 +28,15 @@ import org.apache.activemq.artemis.core.protocol.core.Packet;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.utils.RandomUtil;
import org.jboss.logging.Logger;
import org.junit.Before;
import org.junit.Test;
public class PingStressTest extends ActiveMQTestBase {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(PingStressTest.class);
private static final long PING_INTERVAL = 500;

View File

@ -21,15 +21,15 @@ import java.util.ArrayList;
import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
import org.apache.activemq.artemis.core.journal.RecordInfo;
import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestBase;
import org.jboss.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
public abstract class JournalImplTestUnit extends JournalImplTestBase {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(JournalImplTestBase.class);
@Override
@After
@ -149,9 +149,9 @@ public abstract class JournalImplTestUnit extends JournalImplTestBase {
double rate = 1000 * (double) NUMBER_OF_RECORDS / (end - start);
JournalImplTestUnit.log.debug("Rate of " + rate + " adds/removes per sec");
log.debug("Rate of " + rate + " adds/removes per sec");
JournalImplTestUnit.log.debug("Reclaim status = " + debugJournal());
log.debug("Reclaim status = " + debugJournal());
stopJournal();
createJournal();

View File

@ -20,12 +20,9 @@ import java.io.File;
import org.apache.activemq.artemis.core.io.SequentialFileFactory;
import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
public class NIOJournalImplTest extends JournalImplTestUnit {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
@Override
protected SequentialFileFactory getFileFactory() throws Exception {
File file = new File(getTemporaryDir());

View File

@ -26,10 +26,10 @@ import org.apache.activemq.artemis.core.server.MessageReference;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.server.QueueConfig;
import org.apache.activemq.artemis.core.server.impl.QueueImpl;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeConsumer;
import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeQueueFactory;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.jboss.logging.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@ -41,7 +41,7 @@ import org.junit.Test;
*/
public class QueueConcurrentTest extends ActiveMQTestBase {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static final Logger log = Logger.getLogger(QueueConcurrentTest.class);
private FakeQueueFactory queueFactory = new FakeQueueFactory();
@ -99,9 +99,9 @@ public class QueueConcurrentTest extends ActiveMQTestBase {
assertRefListsIdenticalRefs(sender.getReferences(), consumer.getReferences());
QueueConcurrentTest.log.info("num refs: " + sender.getReferences().size());
log.info("num refs: " + sender.getReferences().size());
QueueConcurrentTest.log.info("num toggles: " + toggler.getNumToggles());
log.info("num toggles: " + toggler.getNumToggles());
}

View File

@ -62,9 +62,9 @@ import org.apache.activemq.artemis.jms.bridge.DestinationFactory;
import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode;
import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl;
import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.utils.RandomUtil;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
@ -72,9 +72,10 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
public class JMSBridgeImplTest extends ActiveMQTestBase {
// Constants -----------------------------------------------------
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
private static Logger log = Logger.getLogger(JMSBridgeImplTest.class);
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------

View File

@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
import org.junit.Assert;
@ -28,8 +27,6 @@ import org.junit.Test;
public class TokenBucketLimiterImplTest extends ActiveMQTestBase {
private static final UnitTestLogger log = UnitTestLogger.LOGGER;
@Test
public void testRateWithSpin1() throws Exception {
testRate(1, true);

View File

@ -1,31 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.tests.unit;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.MessageLogger;
@MessageLogger(projectCode = "AMQTEST")
public interface UnitTestLogger extends BasicLogger {
/**
* The unit test logger.
*/
UnitTestLogger LOGGER = Logger.getMessageLogger(UnitTestLogger.class, UnitTestLogger.class.getPackage().getName());
}

View File

@ -28,9 +28,9 @@ import org.apache.activemq.artemis.core.io.IOCallback;
import org.apache.activemq.artemis.core.io.aio.AIOSequentialFile;
import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory;
import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
import org.jboss.logging.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
@ -45,6 +45,8 @@ import org.junit.Test;
*/
public class MultiThreadAsynchronousFileTest extends AIOTestBase {
private static final Logger log = Logger.getLogger(MultiThreadAsynchronousFileTest.class);
@BeforeClass
public static void hasAIO() {
org.junit.Assume.assumeTrue("Test case needs AIO to run", AIOSequentialFileFactory.isSupported());
@ -63,7 +65,7 @@ public class MultiThreadAsynchronousFileTest extends AIOTestBase {
ExecutorService pollerExecutor;
private static void debug(final String msg) {
UnitTestLogger.LOGGER.info(msg);
log.info(msg);
}
@Override

View File

@ -33,7 +33,6 @@ import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
import org.apache.activemq.artemis.core.journal.RecordInfo;
import org.apache.activemq.artemis.core.journal.TransactionFailureCallback;
import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
@ -264,9 +263,9 @@ public class AlignedJournalImplTest extends ActiveMQTestBase {
Assert.assertEquals(2, factory.listFiles("tt").size());
UnitTestLogger.LOGGER.debug("Initial:--> " + journalImpl.debug());
log.debug("Initial:--> " + journalImpl.debug());
UnitTestLogger.LOGGER.debug("_______________________________");
log.debug("_______________________________");
for (int i = 0; i < 50; i++) {
journalImpl.appendAddRecord(i, (byte) 1, new SimpleEncoding(1, (byte) 'x'), false);
@ -308,9 +307,9 @@ public class AlignedJournalImplTest extends ActiveMQTestBase {
Assert.assertEquals(2, factory.listFiles("tt").size());
UnitTestLogger.LOGGER.debug("Initial:--> " + journalImpl.debug());
log.debug("Initial:--> " + journalImpl.debug());
UnitTestLogger.LOGGER.debug("_______________________________");
log.debug("_______________________________");
for (int i = 0; i < 50; i++) {
journalImpl.appendAddRecord(i, (byte) 1, new SimpleEncoding(1, (byte) 'x'), false);
@ -342,15 +341,15 @@ public class AlignedJournalImplTest extends ActiveMQTestBase {
journalImpl.checkReclaimStatus();
UnitTestLogger.LOGGER.debug(journalImpl.debug());
log.debug(journalImpl.debug());
journalImpl.debugWait();
UnitTestLogger.LOGGER.debug("Final:--> " + journalImpl.debug());
log.debug("Final:--> " + journalImpl.debug());
UnitTestLogger.LOGGER.debug("_______________________________");
log.debug("_______________________________");
UnitTestLogger.LOGGER.debug("Files bufferSize:" + factory.listFiles("tt").size());
log.debug("Files bufferSize:" + factory.listFiles("tt").size());
Assert.assertEquals(2, factory.listFiles("tt").size());
@ -378,7 +377,7 @@ public class AlignedJournalImplTest extends ActiveMQTestBase {
// forgotten (interrupted by a reload).
Assert.fail("Supposed to throw exception");
} catch (Exception e) {
UnitTestLogger.LOGGER.warn(e);
log.warn(e);
}
setupAndLoadJournal(JOURNAL_SIZE, 100);
@ -426,7 +425,7 @@ public class AlignedJournalImplTest extends ActiveMQTestBase {
// forgotten (interrupted by a reload).
Assert.fail("Supposed to throw exception");
} catch (Exception e) {
UnitTestLogger.LOGGER.debug("Expected exception " + e, e);
log.debug("Expected exception " + e, e);
}
setupAndLoadJournal(JOURNAL_SIZE, 100);

View File

@ -30,7 +30,6 @@ import org.apache.activemq.artemis.core.journal.RecordInfo;
import org.apache.activemq.artemis.core.journal.TestableJournal;
import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
import org.apache.activemq.artemis.logs.AssertionLoggerHandler;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
import org.apache.activemq.artemis.utils.RandomUtil;
import org.jboss.logging.Logger;
@ -1109,8 +1108,8 @@ public abstract class JournalImplTestUnit extends JournalImplTestBase {
Assert.assertEquals(4, files3.size());
Assert.assertEquals(1, journal.getOpenedFilesCount());
UnitTestLogger.LOGGER.debug("data files count " + journal.getDataFilesCount());
UnitTestLogger.LOGGER.debug("free files count " + journal.getFreeFilesCount());
log.debug("data files count " + journal.getDataFilesCount());
log.debug("free files count " + journal.getFreeFilesCount());
Assert.assertEquals(2, journal.getDataFilesCount());
Assert.assertEquals(0, journal.getFreeFilesCount());
@ -2019,7 +2018,7 @@ public abstract class JournalImplTestUnit extends JournalImplTestBase {
addWithSize(1024 - JournalImpl.SIZE_ADD_RECORD, 6);
UnitTestLogger.LOGGER.debug("Debug journal on testPrepareReclaim ->\n" + debugJournal());
log.debug("Debug journal on testPrepareReclaim ->\n" + debugJournal());
Assert.assertEquals(1, journal.getOpenedFilesCount());
Assert.assertEquals(0, journal.getFreeFilesCount());
@ -3059,7 +3058,7 @@ public abstract class JournalImplTestUnit extends JournalImplTestBase {
addTx(4, 31);
commit(3);
UnitTestLogger.LOGGER.debug("Debug on Journal before stopJournal - \n" + debugJournal());
log.debug("Debug on Journal before stopJournal - \n" + debugJournal());
stopJournal();
createJournal();

View File

@ -26,12 +26,14 @@ import java.util.jar.Manifest;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.ActiveMQServers;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionMetaData;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Test;
public class ManifestTest extends ActiveMQTestBase {
private static final Logger log = Logger.getLogger(ManifestTest.class);
// Constants -----------------------------------------------------
// Static --------------------------------------------------------
@ -47,7 +49,7 @@ public class ManifestTest extends ActiveMQTestBase {
Properties props = System.getProperties();
String userDir = props.getProperty("build.lib");
UnitTestLogger.LOGGER.trace("userDir is " + userDir);
log.trace("userDir is " + userDir);
// The jar must be there
File file = new File("build/jars", "activemq-core.jar");

View File

@ -36,9 +36,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.jboss.logging.Logger;
public class InVMContext implements Context, Serializable {
private static final Logger log = Logger.getLogger(InVMContext.class);
// Constants -----------------------------------------------------
private static final long serialVersionUID = 385743957345L;
@ -292,7 +294,7 @@ public class InVMContext implements Context, Serializable {
}
private void internalBind(String name, final Object obj, final boolean rebind) throws NamingException {
UnitTestLogger.LOGGER.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
log.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
name = trimSlashes(name);
int i = name.lastIndexOf("/");
InVMContext c = this;

View File

@ -36,9 +36,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.jboss.logging.Logger;
public class InVMNamingContext implements Context, Serializable {
private static final Logger log = Logger.getLogger(InVMNamingContext.class);
// Constants -----------------------------------------------------
private static final long serialVersionUID = 385743957345L;
@ -292,7 +294,7 @@ public class InVMNamingContext implements Context, Serializable {
}
private void internalBind(String name, final Object obj, final boolean rebind) throws NamingException {
UnitTestLogger.LOGGER.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
log.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
name = trimSlashes(name);
int i = name.lastIndexOf("/");
InVMNamingContext c = this;

View File

@ -18,14 +18,16 @@ package org.apache.activemq.artemis.tests.unit.util;
import java.util.concurrent.CountDownLatch;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.utils.ReusableLatch;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Test;
public class ReusableLatchTest extends ActiveMQTestBase {
private static final Logger log = Logger.getLogger(ReusableLatchTest.class);
@Test
public void testLatchWithParameterizedDown() throws Exception {
ReusableLatch latch = new ReusableLatch(1000);
@ -82,10 +84,10 @@ public class ReusableLatchTest extends ActiveMQTestBase {
public void run() {
try {
if (!latch.await(5000)) {
UnitTestLogger.LOGGER.error("Latch timed out");
log.error("Latch timed out");
}
} catch (Exception e) {
UnitTestLogger.LOGGER.error(e);
log.error(e);
}
waiting = false;
}
@ -113,7 +115,7 @@ public class ReusableLatchTest extends ActiveMQTestBase {
latch.countUp();
}
} catch (Exception e) {
UnitTestLogger.LOGGER.error(e.getMessage(), e);
log.error(e.getMessage(), e);
}
}
}
@ -166,7 +168,7 @@ public class ReusableLatchTest extends ActiveMQTestBase {
latch.countDown();
}
} catch (Exception e) {
UnitTestLogger.LOGGER.error(e.getMessage(), e);
log.error(e.getMessage(), e);
}
}
}
@ -230,10 +232,10 @@ public class ReusableLatchTest extends ActiveMQTestBase {
readyLatch.countDown();
try {
if (!latch.await(1000)) {
UnitTestLogger.LOGGER.error("Latch timed out!", new Exception("trace"));
log.error("Latch timed out!", new Exception("trace"));
}
} catch (Exception e) {
UnitTestLogger.LOGGER.error(e);
log.error(e);
this.e = e;
}
waiting = false;