From 3541ebf2181aa8383942d039564fc8332b639cdc Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 21 Apr 2020 17:24:14 -0400 Subject: [PATCH] ARTEMIS-2732 Cleanup on testsuite logging --- .travis.yml | 2 +- .../activemq/artemis/utils/ByteUtilTest.java | 8 +- .../DefaultSensitiveStringCodecTest.java | 9 +- .../utils/MaskPasswordResolvingTest.java | 1 - .../artemis/utils/NetworkHealthTest.java | 1 - .../activemq/artemis/utils/RetryRule.java | 4 +- .../activemq/artemis/utils/URIParserTest.java | 5 - .../utils/critical/CriticalAnalyzerTest.java | 4 - .../api/core/TransportConfigurationTest.java | 2 - .../artemis/message/CoreMessageTest.java | 7 +- .../util/TimeAndCounterIDGeneratorTest.java | 4 - .../artemis/core/io/aio/FileIOUtilTest.java | 3 - .../EmbeddedRestActiveMQJMSTest.java | 8 +- .../artemis/rest/test/AutoAckQueueTest.java | 22 +-- .../artemis/rest/test/AutoAckTopicTest.java | 10 +- .../artemis/rest/test/ClientAckQueueTest.java | 94 ++++++------ .../artemis/rest/test/ClientAckTopicTest.java | 79 +++++----- .../rest/test/CreateDestinationTest.java | 22 +-- .../artemis/rest/test/DupQueueTest.java | 32 ++-- .../activemq/artemis/rest/test/Embedded.java | 8 +- .../artemis/rest/test/EmbeddedTest.java | 8 +- .../artemis/rest/test/EmbeddedTestServer.java | 8 +- .../rest/test/FindDestinationTest.java | 12 +- .../activemq/artemis/rest/test/JMSTest.java | 18 ++- .../rest/test/MessagePropertiesTest.java | 5 +- .../artemis/rest/test/MessageTestBase.java | 2 +- .../test/PersistentPushQueueConsumerTest.java | 15 +- .../test/PersistentPushTopicConsumerTest.java | 14 +- .../rest/test/PushQueueConsumerTest.java | 12 +- .../rest/test/PushTopicConsumerTest.java | 23 +-- .../artemis/rest/test/RawAckTest.java | 4 +- .../artemis/rest/test/RepostingQueueTest.java | 122 +++++++-------- .../artemis/rest/test/RepostingTopicTest.java | 140 +++++++++--------- .../artemis/rest/test/RoundtripTimeTest.java | 10 +- .../artemis/rest/test/SelectorTest.java | 14 +- .../artemis/rest/test/SessionTest.java | 26 ++-- .../artemis/rest/test/TransformTest.java | 16 +- .../activemq/artemis/rest/test/XmlTest.java | 4 +- .../rest/topic/RepostingTopicTest.java | 140 +++++++++--------- .../artemis/selector/SelectorParserTest.java | 5 +- .../config/impl/ConfigurationImplTest.java | 7 +- .../LoggingConfigurationFileReloaderTest.java | 95 ++++++------ .../jaas/JAASSecurityManagerTest.java | 4 +- .../server/files/FileStoreMonitorTest.java | 11 +- .../impl/ScheduledDeliveryHandlerTest.java | 5 +- .../transaction/impl/TransactionImplTest.java | 10 +- .../artemis/tests/util/ActiveMQTestBase.java | 34 +++-- .../artemis/uri/AcceptorParserTest.java | 8 +- pom.xml | 11 +- .../verifyTopologyChangeMessage.groovy | 2 - .../resources/hqsoak/receiveMessages.groovy | 2 - .../main/resources/hqsoak/sendMessages.groovy | 3 - .../jmsReplyToQueue/receiveMessages.groovy | 2 - .../sendMessagesAddress.groovy | 3 - .../receiveMessages.groovy | 2 - .../sendMessagesAddress.groovy | 3 - .../receiveMessages.groovy | 2 - .../sendMessagesAddress.groovy | 5 - .../jmsReplyToTopic/receiveMessages.groovy | 2 - .../sendMessagesAddress.groovy | 3 - .../tests/compatibility/HornetQSoakTest.java | 1 - tests/config/logging-CI.properties | 72 +++++++++ tests/config/logging.properties | 25 +--- .../tests/extras/byteman/BMFailoverTest.java | 6 +- .../byteman/ConcurrentDeliveryCancelTest.java | 24 +-- .../byteman/FileLockNodeManagerTest.java | 4 +- .../tests/extras/byteman/GroupingTest.java | 6 +- .../byteman/LargeMessageReplicationTest.java | 5 +- .../tests/extras/byteman/LatencyTest.java | 2 +- ...ggingActiveMQServerPluginOpenWireTest.java | 6 +- .../ManagementExceptionHandlingTest.java | 4 +- .../extras/byteman/OrphanedConsumerTest.java | 4 +- .../tests/extras/byteman/PagingLeakTest.java | 10 +- ...nSyncLargeMessageOverReplication2Test.java | 6 +- ...OnSyncLargeMessageOverReplicationTest.java | 6 +- .../extras/byteman/ScaleDownFailoverTest.java | 4 +- .../extras/byteman/StartStopDeadlockTest.java | 6 +- .../analyzer/FileSystemSyncBlockedTest.java | 4 +- .../extras/jms/bridge/BridgeTestBase.java | 5 - .../jms/bridge/FailingTransactionManager.java | 4 - .../jms/bridge/JMSBridgeClusteredTest.java | 4 +- .../jms/bridge/JMSBridgeReconnectionTest.java | 40 +++-- .../extras/jms/bridge/JMSBridgeTest.java | 52 +++---- ...BMultipleHandlersServerDisconnectTest.java | 19 ++- .../integration/DuplicateDetectionTest.java | 29 ++-- .../integration/IntegrationTestLogger.java | 30 ---- .../SimpleNotificationService.java | 1 - .../integration/addressing/AnycastTest.java | 6 +- .../integration/addressing/MulticastTest.java | 6 +- .../integration/amqp/AmqpDLQReceiverTest.java | 16 +- .../amqp/AmqpDurableReceiverTest.java | 2 +- .../integration/amqp/AmqpFlowControlTest.java | 1 - .../amqp/AmqpFullyQualifiedNameTest.java | 4 +- .../amqp/AmqpInboundConnectionTest.java | 2 +- .../amqp/AmqpLargeMessageTest.java | 12 +- .../amqp/AmqpPresettledReceiverTest.java | 12 +- .../amqp/AmqpProtocolHeaderHandlingTest.java | 3 - .../amqp/AmqpReceiverDrainTest.java | 3 +- .../integration/amqp/AmqpReceiverTest.java | 3 - .../amqp/AmqpReceiverWithFiltersTest.java | 2 +- .../integration/amqp/AmqpSecurityTest.java | 7 +- .../integration/amqp/AmqpSendReceiveTest.java | 40 ++--- .../integration/amqp/AmqpSenderTest.java | 8 - .../integration/amqp/AmqpSessionTest.java | 3 +- .../amqp/AmqpTempDestinationTest.java | 4 +- .../integration/amqp/AmqpTransactionTest.java | 24 +-- .../amqp/JMSConnectionWithSecurityTest.java | 26 ++-- .../amqp/JMSMessageConsumerTest.java | 16 +- .../integration/amqp/JMSMessageTypesTest.java | 22 +-- .../amqp/JMSTemporaryDestinationTest.java | 4 +- .../integration/amqp/JMSTransactionTest.java | 6 +- .../amqp/QueueAutoCreationTest.java | 8 +- .../amqp/SaslKrb5LDAPSecurityTest.java | 7 +- .../integration/amqp/TopicDurableTests.java | 26 ++-- .../amqp/interop/AmqpCoreTest.java | 6 +- .../InterruptedAMQPLargeMessage.java | 4 +- .../integration/cli/AddressCommandTest.java | 8 +- .../integration/cli/QueueCommandTest.java | 4 +- .../integration/client/AckBatchSizeTest.java | 2 +- .../integration/client/AcknowledgeTest.java | 7 +- .../integration/client/ActiveMQCrashTest.java | 8 +- .../client/AutoCreateJmsDestinationTest.java | 7 +- .../integration/client/AutogroupIdTest.java | 6 - .../integration/client/BlockingSendTest.java | 2 +- .../client/ConsumerFilterTest.java | 12 +- .../client/ConsumerRoundRobinTest.java | 8 +- .../integration/client/ConsumerStuckTest.java | 18 +-- .../integration/client/ConsumerTest.java | 16 +- .../client/ConsumerWindowSizeTest.java | 20 +-- .../integration/client/CoreClientTest.java | 5 - .../client/DeadLetterAddressTest.java | 5 - .../client/ExpireTestOnRestartTest.java | 2 +- .../integration/client/ExpiryAddressTest.java | 5 - .../client/ExpiryLargeMessageTest.java | 10 +- .../client/FailureDeadlockTest.java | 6 +- ...owControlOnIgnoreLargeMessageBodyTest.java | 30 ++-- .../client/FullQualifiedQueueTest.java | 12 +- .../integration/client/HangConsumerTest.java | 6 +- .../integration/client/HeuristicXATest.java | 16 +- .../client/IncompatibleVersionTest.java | 9 +- .../client/InterruptedLargeMessageTest.java | 22 +-- .../client/JMSMessageCounterTest.java | 4 +- .../integration/client/JMSOrderTest.java | 2 - .../client/JMSPagingFileDeleteTest.java | 27 ++-- .../client/JmsNettyNioStressTest.java | 2 - .../client/LargeMessageCompressTest.java | 2 - .../integration/client/LargeMessageTest.java | 11 +- .../client/MessageConcurrencyTest.java | 4 +- .../client/MessageConsumerRollbackTest.java | 1 - .../client/MessageGroupingTest.java | 7 +- .../client/MessageHandlerTest.java | 5 - .../client/MessagePriorityTest.java | 6 +- .../integration/client/MixRoutingTest.java | 4 +- .../client/MultipleThreadFilterOneTest.java | 2 +- .../integration/client/NIOvsOIOTest.java | 8 +- .../client/ProducerFlowControlTest.java | 7 +- .../integration/client/ProducerTest.java | 2 +- .../client/RedeliveryConsumerTest.java | 7 +- .../integration/client/RequestorTest.java | 3 - .../client/SelfExpandingBufferTest.java | 11 +- .../integration/client/SendAckFailTest.java | 8 +- .../client/SessionStopStartTest.java | 10 +- .../client/SimpleSendMultipleQueuesTest.java | 4 +- .../client/TemporaryQueueTest.java | 9 +- .../clientcrash/ClientCrashTest.java | 10 +- .../clientcrash/ClientExitTest.java | 4 +- .../integration/clientcrash/CrashClient.java | 10 +- .../integration/clientcrash/CrashClient2.java | 9 +- .../clientcrash/DummyInterceptor.java | 4 +- .../clientcrash/DummyInterceptorB.java | 4 +- .../clientcrash/GracefulClient.java | 6 +- .../clientcrash/PendingDeliveriesTest.java | 1 - .../cluster/NodeManagerAction.java | 1 - .../cluster/bridge/BridgeReconnectTest.java | 28 ++-- .../cluster/bridge/BridgeStartTest.java | 17 --- .../cluster/bridge/BridgeTest.java | 18 +-- .../ProtocolsMessageLoadBalancingTest.java | 4 +- .../AutoDeleteDistributedTest.java | 13 +- .../ClusterConnectionConfigTest.java | 2 - .../cluster/distribution/ClusterTestBase.java | 42 +++--- .../distribution/ClusterWithBackupTest.java | 49 +++--- .../distribution/ClusteredGroupingTest.java | 41 +++-- .../ClusteredMessageCounterTest.java | 10 -- .../ExclusiveDivertWithClusterTest.java | 3 - .../LargeMessageRedistributionTest.java | 3 - .../MessageRedistributionTest.java | 21 ++- .../NettyFileStorageSymmetricClusterTest.java | 4 - ...rageSymmetricClusterWithDiscoveryTest.java | 3 - .../distribution/OneWayChainClusterTest.java | 37 +++-- .../OnewayTwoNodeClusterTest.java | 10 +- ...RemoteBindingWithoutLoadBalancingTest.java | 3 - .../SimpleSymmetricClusterTest.java | 25 ++-- .../distribution/SymmetricClusterTest.java | 26 ++-- .../SymmetricClusterWithBackupTest.java | 11 -- .../SymmetricClusterWithDiscoveryTest.java | 3 - .../TwoWayTwoNodeClusterTest.java | 16 +- .../distribution/URISimpleClusterTest.java | 3 - .../failover/AsynchronousFailoverTest.java | 40 ++--- .../CheckRetryIntervalBackupManagerTest.java | 4 +- .../ClusterWithBackupFailoverTest.java | 8 +- .../ClusterWithBackupFailoverTestBase.java | 7 +- .../cluster/failover/FailBackAutoTest.java | 19 +-- .../failover/FailoverListenerTest.java | 12 +- .../failover/FailoverOnFlowControlTest.java | 5 +- .../cluster/failover/FailoverTest.java | 34 ++--- .../MultipleBackupsFailoverTestBase.java | 5 +- ...tipleLivesMultipleBackupsFailoverTest.java | 2 +- .../NettyAsynchronousReattachTest.java | 3 - .../failover/NettyReplicationStopTest.java | 4 - .../failover/NetworkFailureFailoverTest.java | 32 ++-- .../cluster/failover/PagingFailoverTest.java | 1 - .../failover/ReplicatedDistributionTest.java | 2 +- .../failover/ReplicatedPagedFailoverTest.java | 2 - .../failover/SharedStoreBackupTest.java | 2 - ...SingleLiveMultipleBackupsFailoverTest.java | 21 +-- .../MultiThreadRandomReattachTestBase.java | 20 +-- .../MultiThreadReattachSupportTestBase.java | 11 +- .../cluster/reattach/OrderReattachTest.java | 5 +- .../cluster/reattach/RandomReattachTest.java | 31 ++-- .../cluster/reattach/ReattachTest.java | 9 +- .../cluster/restart/ClusterRestartTest.java | 22 ++- .../topology/TopologyClusterTestBase.java | 7 +- .../critical/CriticalCrashTest.java | 2 - ...ShutdownOnCriticalIOErrorMoveNextTest.java | 2 - .../crossprotocol/AMQPToJMSCoreTest.java | 1 - .../MessageIDMultiProtocolTest.java | 4 +- .../RequestReplyMultiProtocolTest.java | 4 +- .../discovery/DiscoveryBaseTest.java | 2 - .../integration/discovery/DiscoveryTest.java | 4 +- .../tests/integration/divert/DivertTest.java | 4 +- .../divert/ReplicationWithDivertTest.java | 2 - .../integration/interceptors/Incoming.java | 1 - .../interceptors/InterceptorTest.java | 10 +- .../integration/interceptors/Outgoing.java | 5 +- .../jms/ActiveMQConnectionFactoryTest.java | 6 - .../integration/jms/FloodServerTest.java | 14 +- .../ManualReconnectionToSingleServerTest.java | 12 +- .../jms/client/CreateQueueTest.java | 5 +- .../integration/jms/client/GroupingTest.java | 1 - .../integration/jms/client/MessageTest.java | 15 +- .../jms/client/NewQueueRequestorTest.java | 6 +- .../jms/client/NoLocalSubscriberTest.java | 6 - ...ClosedOnRemotingConnectionFailureTest.java | 3 - .../jms/cluster/JMSFailoverListenerTest.java | 11 +- .../jms/cluster/JMSFailoverTest.java | 15 +- .../cluster/MultipleThreadsOpeningTest.java | 4 +- .../cluster/TemporaryQueueClusterTest.java | 6 - .../jms/cluster/TopicClusterTest.java | 1 - .../jms/consumer/JmsConsumerTest.java | 13 +- .../jms2client/InvalidDestinationTest.java | 1 - .../jms/jms2client/JmsContextTest.java | 3 - .../jms/jms2client/SharedConsumerTest.java | 2 - .../jms/largemessage/JMSLargeMessageTest.java | 8 +- .../jms/server/JMSServerDeployerTest.java | 4 +- .../jms/server/JMSServerStartStopTest.java | 5 +- .../jms/server/management/JMSUtil.java | 1 - .../journal/NIOJournalCompactTest.java | 28 ++-- .../journal/NIOJournalImplTest.java | 5 - .../journal/NIONoBufferJournalImplTest.java | 5 - .../integration/journal/RelativePathTest.java | 4 - .../ValidateTransactionHealthTest.java | 11 +- .../integration/karaf/ArtemisFeatureTest.java | 10 +- .../largemessage/LargeMessageTestBase.java | 5 +- .../management/ActiveMQServerControlTest.java | 18 +-- .../management/AddressControlTest.java | 2 - .../management/DummyLoginModule.java | 1 - .../management/ManagementHelperTest.java | 10 +- .../ManagementWithPagingServerTest.java | 4 - .../management/NotificationTest.java | 14 -- .../management/QueueControlTest.java | 16 +- .../SSLSecurityNotificationTest.java | 10 -- .../management/SecurityNotificationTest.java | 10 -- .../MQTTInterceptorPropertiesTest.java | 3 - .../MQTTRejectingInterceptorTest.java | 1 - .../integration/mqtt/imported/MQTTTest.java | 36 ++--- .../mqtt/imported/MQTTTestSupport.java | 16 +- .../mqtt/imported/PahoMQTTTest.java | 10 +- .../openwire/BasicOpenWireTest.java | 4 - .../openwire/DisableAdvisoryTest.java | 4 - .../openwire/FQQNOpenWireTest.java | 3 +- .../LargeMessageQueueAutoCreationTest.java | 1 - .../openwire/OpenWireDivertExclusiveTest.java | 2 - .../OpenWireDivertNonExclusiveTest.java | 2 - .../openwire/OpenWireTestBase.java | 1 - .../openwire/SecurityOpenWireTest.java | 1 - .../openwire/SimpleOpenWireTest.java | 60 +------- .../openwire/amq/JMSConsumer11Test.java | 9 -- .../openwire/amq/JMSConsumer2Test.java | 5 - .../openwire/amq/JMSConsumer3Test.java | 2 - .../openwire/amq/JMSConsumer5Test.java | 3 - .../openwire/amq/JMSConsumer7Test.java | 3 - .../amq/JMSDurableTopicRedeliverTest.java | 3 - .../openwire/amq/JMSUsecase1Test.java | 1 - .../openwire/amq/JmsAutoAckListenerTest.java | 1 - .../amq/JmsCreateConsumerInOnMessageTest.java | 2 - .../amq/JmsDurableTopicSendReceiveTest.java | 1 - .../openwire/amq/JmsQueueBrowserTest.java | 12 -- .../openwire/amq/JmsResourceProvider.java | 1 - .../amq/JmsSendReceiveTestSupport.java | 10 -- .../openwire/amq/JmsTopicRedeliverTest.java | 15 -- .../amq/JmsTopicRequestReplyTest.java | 16 -- .../openwire/amq/JmsTopicSelectorTest.java | 8 - .../openwire/amq/JmsTopicSendReceiveTest.java | 11 +- .../amq/JmsTransactionTestSupport.java | 32 ---- .../amq/MessageListenerRedeliveryTest.java | 9 -- .../amq/ProducerFlowControlSendFailTest.java | 1 - .../openwire/amq/ProducerFlowControlTest.java | 2 - .../openwire/amq/RedeliveryPolicyTest.java | 4 - .../cluster/MessageRedistributionTest.java | 1 - .../cluster/TemporaryQueueClusterTest.java | 5 - .../openwire/interop/GeneralInteropTest.java | 6 - .../management/OpenWireManagementTest.java | 1 - .../paging/AddressFullLoggingTest.java | 17 ++- .../tests/integration/paging/PagingTest.java | 91 ++++-------- .../PagingWithFailoverAndCountersTest.java | 10 +- .../paging/TestDeadlockOnPurgePagingTest.java | 3 - .../persistence/RestartSMTest.java | 4 +- .../integration/plugin/StompPluginTest.java | 3 - .../ra/ActiveMQMessageHandlerTest.java | 3 +- .../integration/ra/ResourceAdapterTest.java | 1 - .../remoting/NetworkAddressTestBase.java | 3 - .../tests/integration/remoting/PingTest.java | 12 +- .../integration/remoting/ReconnectTest.java | 1 - .../rest/RestDeserializationTest.java | 1 - .../scheduling/DelayedMessageTest.java | 5 - .../MultipliedDelayedMessageTest.java | 8 +- .../scheduling/ScheduledMessageTest.java | 5 - .../security/NettySecurityClientTest.java | 4 - .../integration/security/SecurityTest.java | 3 - .../integration/security/SimpleClient.java | 1 - .../server/AddressQueueDeleteDelayTest.java | 8 +- .../server/FileLockTimeoutTest.java | 3 +- .../tests/integration/server/LVQTest.java | 2 +- .../server/PredefinedQueueTest.java | 9 +- .../RetroactiveAddressFailoverTest.java | 3 - .../server/ScaleDown3NodeTest.java | 24 +-- .../server/ScaleDownDirectTest.java | 2 - .../server/ScaleDownRemoveSFTest.java | 2 +- .../server/SimpleStartStopTest.java | 4 - .../spring/SpringIntegrationTest.java | 5 - .../ssl/CoreClientOverOneWaySSLTest.java | 2 - ...CoreClientOverTwoWayOpenSSLServerTest.java | 1 - .../ssl/CoreClientOverTwoWayOpenSSLTest.java | 1 - .../ssl/CoreClientOverTwoWaySSLTest.java | 1 - .../integration/ssl/SSLProviderTest.java | 2 - .../ssl/SSLProviderTwoWayTest.java | 7 +- .../tests/integration/ssl/SSLTestBase.java | 1 - .../integration/stomp/FQQNStompTest.java | 5 +- .../stomp/StompPropertiesInterceptorTest.java | 1 - .../tests/integration/stomp/StompTest.java | 4 +- .../integration/stomp/StompTestBase.java | 6 +- .../stomp/StompTestMultiThreaded.java | 2 - .../stomp/StompWithLargeMessagesTest.java | 9 +- .../util/AbstractStompClientConnection.java | 4 - .../stomp/util/StompClientConnectionV10.java | 5 +- .../integration/stomp/v11/ExtraStompTest.java | 4 +- .../integration/stomp/v11/StompV11Test.java | 68 ++++----- .../integration/stomp/v12/StompV12Test.java | 55 +++---- .../integration/xa/BasicXaRecoveryTest.java | 14 +- .../tests/integration/xa/BasicXaTest.java | 10 +- .../integration/xa/SessionFailureXATest.java | 3 - .../tests/integration/xa/XaTimeoutTest.java | 2 +- .../tests/util/JMSClusteredTestBase.java | 3 - 363 files changed, 1677 insertions(+), 2354 deletions(-) create mode 100644 tests/config/logging-CI.properties delete mode 100644 tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/IntegrationTestLogger.java diff --git a/.travis.yml b/.travis.yml index 6839d8c4fd..7f9fad6565 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ before_install: # By setting anything to org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED we are disabling libaio loading on the testsuite script: - set -e -- mvn -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Pfast-tests -Pextra-tests -B install -q +- mvn -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Pfast-tests -Pextra-tests -Ptests-CI -B install -q - cd examples - mvn install -Prelease install -B -q diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java index 929ccf8947..f95d22733c 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java @@ -21,6 +21,7 @@ import java.nio.ReadOnlyBufferException; import java.util.Arrays; import io.netty.util.internal.PlatformDependent; +import org.jboss.logging.Logger; import org.junit.Assert; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; @@ -30,6 +31,8 @@ import org.junit.Test; public class ByteUtilTest { + private static Logger log = Logger.getLogger(ByteUtilTest.class); + @Test public void testBytesToString() { byte[] byteArray = new byte[]{0, 1, 2, 3}; @@ -43,14 +46,13 @@ public class ByteUtilTest { public void testNonASCII() { assertEquals("aA", ByteUtil.toSimpleString(new byte[]{97, 0, 65, 0})); assertEquals(ByteUtil.NON_ASCII_STRING, ByteUtil.toSimpleString(new byte[]{0, 97, 0, 65})); - - System.out.println(ByteUtil.toSimpleString(new byte[]{0, 97, 0, 65})); + log.debug(ByteUtil.toSimpleString(new byte[]{0, 97, 0, 65})); } @Test public void testMaxString() { byte[] byteArray = new byte[20 * 1024]; - System.out.println(ByteUtil.maxString(ByteUtil.bytesToHex(byteArray, 2), 150)); + log.debug(ByteUtil.maxString(ByteUtil.bytesToHex(byteArray, 2), 150)); } void testEquals(String string1, String string2) { diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java index 393558d809..9a97454b04 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodecTest.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.utils; +import org.jboss.logging.Logger; import org.junit.Test; import java.util.HashMap; @@ -28,6 +29,8 @@ import static org.junit.Assert.fail; public class DefaultSensitiveStringCodecTest { + private static final Logger log = Logger.getLogger(DefaultSensitiveStringCodecTest.class); + @Test public void testDefaultAlgorithm() throws Exception { SensitiveDataCodec codec = PasswordMaskingUtil.getDefaultCodec(); @@ -43,7 +46,7 @@ public class DefaultSensitiveStringCodecTest { String plainText = "some_password"; String maskedText = codec.encode(plainText); - System.out.println("encoded value: " + maskedText); + log.debug("encoded value: " + maskedText); //one way can't decode try { @@ -67,10 +70,10 @@ public class DefaultSensitiveStringCodecTest { String plainText = "some_password"; String maskedText = codec.encode(plainText); - System.out.println("encoded value: " + maskedText); + log.debug("encoded value: " + maskedText); String decoded = codec.decode(maskedText); - System.out.println("encoded value: " + maskedText); + log.debug("encoded value: " + maskedText); assertEquals("decoded result not match: " + decoded, decoded, plainText); } diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/MaskPasswordResolvingTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/MaskPasswordResolvingTest.java index 5a99ccc689..ba688fcf54 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/MaskPasswordResolvingTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/MaskPasswordResolvingTest.java @@ -61,7 +61,6 @@ public class MaskPasswordResolvingTest { @Test public void testPasswordResolving() throws Exception { String resolved = PasswordMaskingUtil.resolveMask(maskPassword, password, codec); - System.out.println("resolved: " + resolved); checkResult(resolved); } diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java index 221a97ccf7..156eb245a7 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/NetworkHealthTest.java @@ -152,7 +152,6 @@ public class NetworkHealthTest { public void run() { super.run(); latch.countDown(); - System.out.println("Check"); } }); check.addComponent(component); diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/RetryRule.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/RetryRule.java index 6792b5a45e..50c1073af4 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/RetryRule.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/RetryRule.java @@ -79,10 +79,10 @@ public class RetryRule implements MethodRule { currentException = null; try { base.evaluate(); - logger.info("RETRY " + (retryNr + 1) + " of " + retries + " on " + target.getClass() + "::" + method.getName() + " succeeded"); + logger.warn("RETRY " + (retryNr + 1) + " of " + retries + " on " + target.getClass() + "::" + method.getName() + " succeeded"); break; } catch (Throwable t2) { - logger.info("RETRY " + (retryNr + 1) + " of " + retries + " on " + target.getClass() + "::" + method.getName() + " failed ", t2); + logger.warn("RETRY " + (retryNr + 1) + " of " + retries + " on " + target.getClass() + "::" + method.getName() + " failed ", t2); currentException = t2; } } diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java index 74a39fa270..4316c9ed44 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java @@ -94,7 +94,6 @@ public class URIParserTest { FruitParser parser = new FruitParser(); Fruit fruit = (Fruit) parser.newObject(new URI("fruit://some:guy@port?color=green&fluentName=something"), null); - System.out.println("fruit:" + fruit); Assert.assertEquals("fruit", fruit.getName()); Assert.assertEquals("green", fruit.getColor()); Assert.assertEquals("something", fruit.getFluentName()); @@ -104,22 +103,18 @@ public class URIParserTest { public void testQueryConversion() throws Exception { Map query = new HashMap<>(); String queryString = URISupport.createQueryString(query); - System.out.println("queryString1: " + queryString); Assert.assertTrue(queryString.isEmpty()); query.put("key1", "value1"); queryString = URISupport.createQueryString(query); - System.out.println("queryString2: " + queryString); Assert.assertEquals("key1=value1", queryString); query.put("key3", "value3"); queryString = URISupport.createQueryString(query); - System.out.println("queryString3: " + queryString); Assert.assertEquals("key1=value1&key3=value3", queryString); query.put("key2", "value2"); queryString = URISupport.createQueryString(query); - System.out.println("queryString4: " + queryString); Assert.assertEquals("key1=value1&key2=value2&key3=value3", queryString); } diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerTest.java index 96d9f27213..a20f55a4db 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerTest.java @@ -56,7 +56,6 @@ public class CriticalAnalyzerTest { analyzer.start(); analyzer.addAction((CriticalComponent comp) -> { - System.out.println("component " + comp + " received"); latch.countDown(); }); @@ -72,7 +71,6 @@ public class CriticalAnalyzerTest { analyzer = new CriticalAnalyzerImpl().setTimeout(10, TimeUnit.MILLISECONDS).setCheckTime(5, TimeUnit.MILLISECONDS); analyzer.addAction((CriticalComponent comp) -> { - System.out.println("component " + comp + " received"); latch.countDown(); }); @@ -119,7 +117,6 @@ public class CriticalAnalyzerTest { analyzer = new CriticalAnalyzerImpl().setTimeout(10, TimeUnit.MILLISECONDS).setCheckTime(5, TimeUnit.MILLISECONDS); analyzer.addAction((CriticalComponent comp) -> { - System.out.println("component " + comp + " received"); latch.countDown(); }); @@ -143,7 +140,6 @@ public class CriticalAnalyzerTest { analyzer = new CriticalAnalyzerImpl().setTimeout(10, TimeUnit.MILLISECONDS).setCheckTime(5, TimeUnit.MILLISECONDS); analyzer.addAction((CriticalComponent comp) -> { - System.out.println("component " + comp + " received"); latch.countDown(); }); diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/api/core/TransportConfigurationTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/api/core/TransportConfigurationTest.java index 1b7a4793b7..b97cd7dc90 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/api/core/TransportConfigurationTest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/api/core/TransportConfigurationTest.java @@ -41,13 +41,11 @@ public class TransportConfigurationTest { HashMap configMap2 = new HashMap<>(); configMap2.put("host", "localhost"); - System.out.println("Equals::" + configMap1.equals(configMap2)); configuration = new TransportConfiguration("SomeClass", configMap1, null); configuration2 = new TransportConfiguration("SomeClass", configMap2, null); Assert.assertEquals(configuration, configuration2); Assert.assertEquals(configuration.hashCode(), configuration2.hashCode()); - System.out.println("Equals::" + configMap1.equals(configMap2)); configuration = new TransportConfiguration("SomeClass", configMap1, "name1"); configuration2 = new TransportConfiguration("SomeClass", configMap2, "name2"); Assert.assertNotEquals(configuration, configuration2); diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java index 5ba2a5b1e8..0735e1ea0a 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java @@ -31,7 +31,6 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionRec import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionSendMessage; import org.apache.activemq.artemis.reader.TextMessageUtil; import org.apache.activemq.artemis.utils.Base64; -import org.apache.activemq.artemis.utils.ByteUtil; import org.apache.activemq.artemis.utils.UUID; import org.junit.Assert; import org.junit.Before; @@ -104,7 +103,7 @@ public class CoreMessageTest { ActiveMQBuffer buffer = sendMessage.encode(null); byte[] byteArray = buffer.byteBuf().array(); - System.out.println("Sending " + ByteUtil.bytesToHex(buffer.toByteBuffer().array(), 1) + ", bytes = " + byteArray.length); + //System.out.println("Sending " + ByteUtil.bytesToHex(buffer.toByteBuffer().array(), 1) + ", bytes = " + byteArray.length); buffer.readerIndex(5); @@ -215,9 +214,7 @@ public class CoreMessageTest { @Test public void testSaveReceiveLimitedBytes() { CoreMessage empty = new CoreMessage().initBuffer(100); - System.out.println("R " + empty.getBodyBuffer().readerIndex() + " W " + empty.getBodyBuffer().writerIndex()); empty.getBodyBuffer().writeByte((byte)7); - System.out.println("R " + empty.getBodyBuffer().readerIndex() + " W " + empty.getBodyBuffer().writerIndex()); ByteBuf buffer = Unpooled.buffer(200); empty.sendBuffer(buffer, 0); @@ -227,8 +224,6 @@ public class CoreMessageTest { Assert.assertEquals((byte)7, empty2.getBodyBuffer().readByte()); - System.out.println("Readable :: " + empty2.getBodyBuffer().readerIndex() + " writer :" + empty2.getBodyBuffer().writerIndex()); - try { empty2.getBodyBuffer().readByte(); Assert.fail("should throw exception"); diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java index 812cafcd17..cd55e92f96 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/util/TimeAndCounterIDGeneratorTest.java @@ -77,8 +77,6 @@ public class TimeAndCounterIDGeneratorTest extends Assert { final TimeAndCounterIDGenerator seq = new TimeAndCounterIDGenerator(); - System.out.println("Time = " + TimeAndCounterIDGeneratorTest.hex(System.currentTimeMillis()) + ", " + seq); - final int NUMBER_OF_THREADS = 100; final int NUMBER_OF_IDS = 10; @@ -143,8 +141,6 @@ public class TimeAndCounterIDGeneratorTest extends Assert { public void testWrapID() throws Throwable { TimeAndCounterIDGenerator seq = new TimeAndCounterIDGenerator(); - System.out.println("Current Time = " + TimeAndCounterIDGeneratorTest.hex(System.currentTimeMillis()) + " " + seq); - seq.setInternalDate(System.currentTimeMillis() + 10000L); // 10 seconds in the future seq.setInternalID(TimeAndCounterIDGenerator.ID_MASK); // 1 ID about to explode diff --git a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java index 4c8aba4c18..981d119787 100644 --- a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java +++ b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java @@ -42,7 +42,6 @@ public class FileIOUtilTest { @Test public void testCopy() throws Exception { - System.out.println("Data at " + temporaryFolder.getRoot()); SequentialFileFactory factory = new NIOSequentialFileFactory(temporaryFolder.getRoot(), 100); SequentialFile file = factory.createSequentialFile("file1.bin"); file.open(); @@ -78,8 +77,6 @@ public class FileIOUtilTest { file.close(); file2.close(); - System.out.println("Test result::"); - } } diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/integration/EmbeddedRestActiveMQJMSTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/integration/EmbeddedRestActiveMQJMSTest.java index 88ac35ffe2..dfea8b9f35 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/integration/EmbeddedRestActiveMQJMSTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/integration/EmbeddedRestActiveMQJMSTest.java @@ -31,6 +31,7 @@ import org.apache.activemq.artemis.rest.test.TransformTest; import org.apache.activemq.artemis.rest.test.Util; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -43,6 +44,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class EmbeddedRestActiveMQJMSTest { + private static final Logger log = Logger.getLogger(EmbeddedRestActiveMQJMSTest.class); private static EmbeddedRestActiveMQ server; private static ConnectionFactory factory; @@ -67,12 +69,12 @@ public class EmbeddedRestActiveMQJMSTest { response.releaseConnection(); assertEquals(200, response.getStatus()); Link sender = response.getLinkHeader().getLinkByTitle("create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = response.getLinkHeader().getLinkByTitle("pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); consumeNext = response.getLinkHeader().getLinkByTitle("consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); } @AfterClass diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckQueueTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckQueueTest.java index e7ef1fd238..10bbeff3cf 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckQueueTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckQueueTest.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.queue.QueueDeployment; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -26,6 +27,7 @@ import org.junit.Assert; import org.junit.Test; public class AutoAckQueueTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(AutoAckQueueTest.class); @Test public void testSuccessFirst() throws Exception { @@ -42,18 +44,18 @@ public class AutoAckQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); - System.out.println("create-with-id: " + getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create-with-id")); + log.debug("pull: " + consumers); + log.debug("create-with-id: " + getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create-with-id")); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println("create-next: " + getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "create-next")); + log.debug("create-next: " + getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "create-next")); res = sender.request().body("text/plain", Integer.toString(2)).post(); res.releaseConnection(); @@ -64,19 +66,19 @@ public class AutoAckQueueTest extends MessageTestBase { Assert.assertEquals("1", res.getEntity(String.class)); res.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); - System.out.println(consumeNext); + log.debug(consumeNext); res = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, res.getStatus()); Assert.assertEquals("2", res.getEntity(String.class)); res.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = session.request().delete(); res.releaseConnection(); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckTopicTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckTopicTest.java index 1635a449b1..91012b0ff4 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckTopicTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/AutoAckTopicTest.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.topic.TopicDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -25,6 +26,7 @@ import org.junit.Assert; import org.junit.Test; public class AutoAckTopicTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(AutoAckTopicTest.class); @Test public void testSuccessFirst() throws Exception { @@ -50,7 +52,7 @@ public class AutoAckTopicTest extends MessageTestBase { Assert.assertNotNull(sub1); Link consumeNext1 = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next"); Assert.assertNotNull(consumeNext1); - System.out.println("consumeNext1: " + consumeNext1); + log.debug("consumeNext1: " + consumeNext1); res = subscriptions.request().post(); res.releaseConnection(); @@ -59,7 +61,7 @@ public class AutoAckTopicTest extends MessageTestBase { Assert.assertNotNull(sub2); Link consumeNext2 = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next"); Assert.assertNotNull(consumeNext2); - System.out.println("consumeNext2: " + consumeNext2); + log.debug("consumeNext2: " + consumeNext2); res = sender.request().body("text/plain", "1").post(); res.releaseConnection(); @@ -169,11 +171,11 @@ public class AutoAckTopicTest extends MessageTestBase { ClientRequest request = new ClientRequest(url); ClientResponse response = request.post(); response.releaseConnection(); - System.out.println("NPS response: " + response.getStatus()); + log.debug("NPS response: " + response.getStatus()); Assert.assertEquals(201, response.getStatus()); isFinished = true; } catch (Exception e) { - System.out.println("Exception " + e); + log.debug("Exception " + e); failed = true; } } diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckQueueTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckQueueTest.java index 2cccbd1d98..9febf01694 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckQueueTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckQueueTest.java @@ -20,6 +20,7 @@ import org.apache.activemq.artemis.rest.queue.QueueDeployment; import org.apache.activemq.artemis.rest.util.Constants; import org.apache.activemq.artemis.rest.util.CustomHeaderLinkStrategy; import org.apache.activemq.artemis.rest.util.LinkHeaderLinkStrategy; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -30,6 +31,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class ClientAckQueueTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(ClientAckQueueTest.class); @BeforeClass public static void setup() throws Exception { @@ -58,12 +60,12 @@ public class ClientAckQueueTest extends MessageTestBase { ClientResponse response = Util.head(request); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); { ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); @@ -74,12 +76,12 @@ public class ClientAckQueueTest extends MessageTestBase { res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); // test timeout Thread.sleep(2000); @@ -87,25 +89,25 @@ public class ClientAckQueueTest extends MessageTestBase { ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(412, ackRes.getStatus()); - System.out.println("**** Successfully failed ack"); + log.debug("**** Successfully failed ack"); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); } { ClientResponse res = consumeNext.request().header(Constants.WAIT_HEADER, "2").post(String.class); res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); if (ackRes.getStatus() != 204) { - System.out.println(ackRes.getEntity(String.class)); + log.debug(ackRes.getEntity(String.class)); } ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -132,62 +134,62 @@ public class ClientAckQueueTest extends MessageTestBase { ClientResponse response = Util.head(request); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull-consumers: " + consumers); + log.debug("pull-consumers: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("acknowledge-next: " + consumeNext); + log.debug("acknowledge-next: " + consumeNext); String data = Integer.toString(start); - System.out.println("Sending: " + data); + log.debug("Sending: " + data); ClientResponse res = sender.request().body("text/plain", data).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println("call acknowledge-next"); + log.debug("call acknowledge-next"); res = consumeNext.request().post(String.class); Assert.assertEquals(200, res.getStatus()); Assert.assertEquals(Integer.toString(start++), res.getEntity()); res.releaseConnection(); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("sending next..."); + log.debug("sending next..."); String data2 = Integer.toString(start); - System.out.println("Sending: " + data2); + log.debug("Sending: " + data2); res = sender.request().body("text/plain", data2).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println(consumeNext); + log.debug(consumeNext); res = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, res.getStatus()); Assert.assertEquals(Integer.toString(start++), res.getEntity()); res.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = consumeNext.request().post(String.class); res.releaseConnection(); - System.out.println(res.getStatus()); + log.debug(res.getStatus()); Assert.assertEquals(204, session.request().delete().getStatus()); } @@ -210,18 +212,18 @@ public class ClientAckQueueTest extends MessageTestBase { ClientResponse response = Util.head(request); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = consumeNext.request().post(String.class); res.releaseConnection(); Assert.assertEquals(503, res.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println(consumeNext); + log.debug(consumeNext); res = sender.request().body("text/plain", Integer.toString(start)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); @@ -230,7 +232,7 @@ public class ClientAckQueueTest extends MessageTestBase { Assert.assertEquals(Integer.toString(start++), res.getEntity()); res.releaseConnection(); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -249,7 +251,7 @@ public class ClientAckQueueTest extends MessageTestBase { Assert.assertEquals(Integer.toString(start++), res.getEntity()); res.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -259,7 +261,7 @@ public class ClientAckQueueTest extends MessageTestBase { Assert.assertEquals(Integer.toString(start++), res.getEntity()); res.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -268,7 +270,7 @@ public class ClientAckQueueTest extends MessageTestBase { res = consumeNext.request().post(); res.releaseConnection(); Assert.assertEquals(503, res.getStatus()); - System.out.println(session); + log.debug(session); res = session.request().delete(); res.releaseConnection(); Assert.assertEquals(204, res.getStatus()); @@ -292,12 +294,12 @@ public class ClientAckQueueTest extends MessageTestBase { ClientResponse response = Util.head(request); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); @@ -307,17 +309,17 @@ public class ClientAckQueueTest extends MessageTestBase { res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("before close session consumeNext: " + consumeNext); + log.debug("before close session consumeNext: " + consumeNext); // test reconnect with a disconnected acknowledge-next Assert.assertEquals(204, session.request().delete().getStatus()); @@ -330,14 +332,14 @@ public class ClientAckQueueTest extends MessageTestBase { res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), ackRes, "consumer"); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("session: " + session); + log.debug("session: " + session); // test reconnect with disconnected acknowledge @@ -348,7 +350,7 @@ public class ClientAckQueueTest extends MessageTestBase { res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Assert.assertEquals(204, session.request().delete().getStatus()); @@ -361,7 +363,7 @@ public class ClientAckQueueTest extends MessageTestBase { res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckTopicTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckTopicTest.java index 5194c35f18..a84a6d1c21 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckTopicTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/ClientAckTopicTest.java @@ -20,6 +20,7 @@ import org.apache.activemq.artemis.rest.topic.TopicDeployment; import org.apache.activemq.artemis.rest.util.Constants; import org.apache.activemq.artemis.rest.util.CustomHeaderLinkStrategy; import org.apache.activemq.artemis.rest.util.LinkHeaderLinkStrategy; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -30,6 +31,8 @@ import org.junit.Test; public class ClientAckTopicTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(ClientAckTopicTest.class); + @BeforeClass public static void setup() throws Exception { TopicDeployment deployment1 = new TopicDeployment("testQueue", true); @@ -59,7 +62,7 @@ public class ClientAckTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link subscriptions = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "pull-subscriptions"); response = subscriptions.request().formParameter("autoAck", "false").formParameter("durable", "true").post(); response.releaseConnection(); @@ -68,7 +71,7 @@ public class ClientAckTopicTest extends MessageTestBase { Assert.assertNotNull(sub1); Link consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); { ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); @@ -79,39 +82,39 @@ public class ClientAckTopicTest extends MessageTestBase { res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); Link ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Link session = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); // test timeout Thread.sleep(2000); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); if (ackRes.getStatus() == 500) { - System.out.println("Failure: " + ackRes.getEntity(String.class)); + log.debug("Failure: " + ackRes.getEntity(String.class)); } ackRes.releaseConnection(); Assert.assertEquals(412, ackRes.getStatus()); - System.out.println("**** Successfully failed ack"); + log.debug("**** Successfully failed ack"); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); } { ClientResponse res = consumeNext.request().header(Constants.WAIT_HEADER, "2").post(String.class); res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); Link ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); if (ackRes.getStatus() != 204) { - System.out.println(ackRes.getEntity(String.class)); + log.debug(ackRes.getEntity(String.class)); } ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -127,7 +130,7 @@ public class ClientAckTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link subscriptions = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "pull-subscriptions"); response = subscriptions.request().formParameter("autoAck", "false").formParameter("durable", "true").post(); @@ -136,42 +139,42 @@ public class ClientAckTopicTest extends MessageTestBase { Link sub1 = response.getLocationLink(); Assert.assertNotNull(sub1); Link consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println("call ack next"); + log.debug("call ack next"); res = consumeNext.request().post(String.class); res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); Link ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Link session = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("sending next..."); + log.debug("sending next..."); res = sender.request().body("text/plain", Integer.toString(2)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println(consumeNext); + log.debug(consumeNext); res = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -187,7 +190,7 @@ public class ClientAckTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link subscriptions = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "pull-subscriptions"); response = subscriptions.request().formParameter("autoAck", "false").formParameter("durable", "false").post(); @@ -196,42 +199,42 @@ public class ClientAckTopicTest extends MessageTestBase { Link sub1 = response.getLocationLink(); Assert.assertNotNull(sub1); Link consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println("call ack next"); + log.debug("call ack next"); res = consumeNext.request().post(String.class); res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); Link ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); Link session = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), ackRes, "acknowledge-next"); - System.out.println("sending next..."); + log.debug("sending next..."); res = sender.request().body("text/plain", Integer.toString(2)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println(consumeNext); + log.debug(consumeNext); res = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); res.releaseConnection(); Assert.assertEquals(200, res.getStatus()); ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); Assert.assertNotNull(ack); getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -247,7 +250,7 @@ public class ClientAckTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link subscriptions = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "pull-subscriptions"); response = subscriptions.request().formParameter("autoAck", "false").formParameter("durable", "true").post(); response.releaseConnection(); @@ -255,13 +258,13 @@ public class ClientAckTopicTest extends MessageTestBase { Link sub1 = response.getLocationLink(); Assert.assertNotNull(sub1); Link consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = consumeNext.request().post(String.class); res.releaseConnection(); Assert.assertEquals(503, res.getStatus()); consumeNext = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledge-next"); - System.out.println(consumeNext); + log.debug(consumeNext); res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); @@ -270,7 +273,7 @@ public class ClientAckTopicTest extends MessageTestBase { Assert.assertEquals(Integer.toString(1), res.getEntity()); res.releaseConnection(); Link ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); ClientResponse ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -289,7 +292,7 @@ public class ClientAckTopicTest extends MessageTestBase { Assert.assertEquals(Integer.toString(2), res.getEntity()); res.releaseConnection(); ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -299,7 +302,7 @@ public class ClientAckTopicTest extends MessageTestBase { Assert.assertEquals(Integer.toString(3), res.getEntity()); res.releaseConnection(); ack = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); ackRes = ack.request().formParameter("acknowledge", "true").post(); ackRes.releaseConnection(); Assert.assertEquals(204, ackRes.getStatus()); @@ -307,7 +310,7 @@ public class ClientAckTopicTest extends MessageTestBase { res = consumeNext.request().post(); res.releaseConnection(); Assert.assertEquals(503, res.getStatus()); - System.out.println(sub1); + log.debug(sub1); res = sub1.request().delete(); res.releaseConnection(); Assert.assertEquals(204, res.getStatus()); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/CreateDestinationTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/CreateDestinationTest.java index f5dc9f4b7f..ce6449589f 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/CreateDestinationTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/CreateDestinationTest.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -26,6 +27,7 @@ import org.junit.BeforeClass; import org.junit.Test; public class CreateDestinationTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(CreateDestinationTest.class); @BeforeClass public static void reg() { @@ -39,19 +41,19 @@ public class CreateDestinationTest extends MessageTestBase { ClientResponse cRes = create.body("application/activemq.jms.queue+xml", queueConfig).post(); cRes.releaseConnection(); Assert.assertEquals(201, cRes.getStatus()); - System.out.println("Location: " + cRes.getLocationLink()); + log.debug("Location: " + cRes.getLocationLink()); ClientRequest request = cRes.getLocationLink().request(); ClientResponse response = request.head(); response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); @@ -62,23 +64,23 @@ public class CreateDestinationTest extends MessageTestBase { Assert.assertEquals("1", res.getEntity(String.class)); res.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = sender.request().body("text/plain", Integer.toString(2)).post(); res.releaseConnection(); Assert.assertEquals(201, res.getStatus()); - System.out.println(consumeNext); + log.debug(consumeNext); res = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, res.getStatus()); Assert.assertEquals("2", res.getEntity(String.class)); res.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = session.request().delete(); res.releaseConnection(); @@ -108,7 +110,7 @@ public class CreateDestinationTest extends MessageTestBase { Assert.assertNotNull(sub1); Link consumeNext1 = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next"); Assert.assertNotNull(consumeNext1); - System.out.println("consumeNext1: " + consumeNext1); + log.debug("consumeNext1: " + consumeNext1); res = subscriptions.request().post(); res.releaseConnection(); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/DupQueueTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/DupQueueTest.java index fe34d5c607..1167631dad 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/DupQueueTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/DupQueueTest.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.queue.QueueDeployment; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -27,6 +28,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class DupQueueTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(DupQueueTest.class); @Test public void testDup() throws Exception { @@ -42,18 +44,18 @@ public class DupQueueTest extends MessageTestBase { ClientResponse response = request.head(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); Assert.assertEquals(307, res.getStatus()); sender = res.getLocationLink(); res.releaseConnection(); - System.out.println("create-next: " + sender); + log.debug("create-next: " + sender); Assert.assertNotNull(sender); res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); @@ -71,17 +73,17 @@ public class DupQueueTest extends MessageTestBase { Assert.assertEquals("1", res.getEntity(String.class)); res.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, res.getStatus()); res.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = consumeNext.request().post(String.class); res.releaseConnection(); @@ -105,12 +107,12 @@ public class DupQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create-with-id"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().pathParameter("id", "1").body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); @@ -128,18 +130,18 @@ public class DupQueueTest extends MessageTestBase { Assert.assertEquals("1", res.getEntity(String.class)); res.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, res.getStatus()); Assert.assertEquals("2", res.getEntity(String.class)); res.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consume-next"); - System.out.println("consumeNext: " + consumeNext); + log.debug("consumeNext: " + consumeNext); res = consumeNext.request().post(String.class); res.releaseConnection(); Assert.assertEquals(503, res.getStatus()); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/Embedded.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/Embedded.java index 67a7a53110..0346a58739 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/Embedded.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/Embedded.java @@ -24,10 +24,12 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.rest.MessageServiceConfiguration; import org.apache.activemq.artemis.rest.MessageServiceManager; +import org.jboss.logging.Logger; import org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer; import org.jboss.resteasy.test.TestPortProvider; public class Embedded { + private static final Logger log = Logger.getLogger(Embedded.class); protected MessageServiceManager manager = new MessageServiceManager(null); protected MessageServiceConfiguration config = new MessageServiceConfiguration(); @@ -36,7 +38,7 @@ public class Embedded { public Embedded() { int port = TestPortProvider.getPort(); - System.out.println("default port is: " + port); + log.debug("default port is: " + port); tjws.setPort(port); tjws.setRootResourcePath(""); tjws.setSecurityDomain(null); @@ -67,7 +69,7 @@ public class Embedded { } public void start() throws Exception { - System.out.println("\nStarting Embedded"); + log.debug("\nStarting Embedded"); if (activeMQServer == null) { Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())); @@ -83,7 +85,7 @@ public class Embedded { } public void stop() throws Exception { - System.out.println("\nStopping Embedded"); + log.debug("\nStopping Embedded"); manager.stop(); tjws.stop(); activeMQServer.stop(); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTest.java index 07d6980318..9900b17432 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTest.java @@ -30,6 +30,7 @@ import org.apache.activemq.artemis.rest.HttpHeaderProperty; import org.apache.activemq.artemis.rest.integration.EmbeddedRestActiveMQ; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -40,6 +41,7 @@ import org.junit.BeforeClass; import org.junit.Test; public class EmbeddedTest { + private static final Logger log = Logger.getLogger(EmbeddedTest.class); public static EmbeddedRestActiveMQ server; @@ -93,12 +95,12 @@ public class EmbeddedTest { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = response.getLinkHeader().getLinkByTitle("create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = response.getLinkHeader().getLinkByTitle("pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = response.getLinkHeader().getLinkByTitle("consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); // test that Accept header is used to set content-type { diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTestServer.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTestServer.java index e2b4eb1517..68fb062f34 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTestServer.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/EmbeddedTestServer.java @@ -26,10 +26,12 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.rest.MessageServiceConfiguration; import org.apache.activemq.artemis.rest.MessageServiceManager; +import org.jboss.logging.Logger; import org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer; import org.jboss.resteasy.test.TestPortProvider; class EmbeddedTestServer { + private static final Logger log = Logger.getLogger(EmbeddedTestServer.class); protected MessageServiceManager manager = new MessageServiceManager(null); protected MessageServiceConfiguration config = new MessageServiceConfiguration(); @@ -38,7 +40,7 @@ class EmbeddedTestServer { EmbeddedTestServer() { int port = TestPortProvider.getPort(); - System.out.println("default port is: " + port); + log.debug("default port is: " + port); tjws.setPort(port); tjws.setRootResourcePath(""); tjws.setSecurityDomain(null); @@ -65,7 +67,7 @@ class EmbeddedTestServer { } public void start() throws Exception { - System.out.println("\nStarting EmbeddedTestServer"); + log.debug("\nStarting EmbeddedTestServer"); if (activeMQServer == null) { Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())); @@ -84,7 +86,7 @@ class EmbeddedTestServer { } public void stop() throws Exception { - System.out.println("\nStopping EmbeddedTestServer"); + log.debug("\nStopping EmbeddedTestServer"); manager.stop(); tjws.stop(); activeMQServer.stop(); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/FindDestinationTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/FindDestinationTest.java index 7faa5c4d53..ecf8723523 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/FindDestinationTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/FindDestinationTest.java @@ -20,6 +20,7 @@ import org.apache.activemq.artemis.api.core.QueueConfiguration; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.core.server.impl.AddressInfo; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -28,6 +29,7 @@ import org.junit.Assert; import org.junit.Test; public class FindDestinationTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(FindDestinationTest.class); @Test public void testFindQueue() throws Exception { @@ -41,12 +43,12 @@ public class FindDestinationTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post(); res.releaseConnection(); @@ -57,7 +59,7 @@ public class FindDestinationTest extends MessageTestBase { Assert.assertEquals("1", res.getEntity(String.class)); res.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), res, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Assert.assertEquals(204, session.request().delete().getStatus()); } @@ -82,7 +84,7 @@ public class FindDestinationTest extends MessageTestBase { Assert.assertNotNull(sub1); Link consumeNext1 = getLinkByTitle(manager.getTopicManager().getLinkStrategy(), res, "consume-next"); Assert.assertNotNull(consumeNext1); - System.out.println("consumeNext1: " + consumeNext1); + log.debug("consumeNext1: " + consumeNext1); res = subscriptions.request().post(); Assert.assertEquals(201, res.getStatus()); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/JMSTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/JMSTest.java index 77d88d1a2e..8e64a9bbcd 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/JMSTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/JMSTest.java @@ -35,6 +35,7 @@ import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import org.apache.activemq.artemis.rest.HttpHeaderProperty; import org.apache.activemq.artemis.rest.Jms; import org.apache.activemq.artemis.rest.queue.QueueDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -45,6 +46,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class JMSTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(JMSTest.class); public static ConnectionFactory connectionFactory; @@ -107,7 +109,7 @@ public class JMSTest extends MessageTestBase { public static Destination createDestination(String dest) { ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(dest); - System.out.println("SimpleAddress: " + destination.getSimpleAddress()); + log.debug("SimpleAddress: " + destination.getSimpleAddress()); return destination; } @@ -152,7 +154,7 @@ public class JMSTest extends MessageTestBase { public void testJmsConsumer() throws Exception { String queueName = "testQueue2"; String prefixedQueueName = ActiveMQDestination.createQueueAddressFromName(queueName).toString(); - System.out.println("Queue name: " + prefixedQueueName); + log.debug("Queue name: " + prefixedQueueName); QueueDeployment deployment = new QueueDeployment(); deployment.setDuplicatesAllowed(true); deployment.setDurableSend(false); @@ -172,9 +174,9 @@ public class JMSTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); // test that Accept header is used to set content-type { @@ -199,7 +201,7 @@ public class JMSTest extends MessageTestBase { public void testJmsProducer() throws Exception { String queueName = "testQueue"; String prefixedQueueName = ActiveMQDestination.createQueueAddressFromName(queueName).toString(); - System.out.println("Queue name: " + prefixedQueueName); + log.debug("Queue name: " + prefixedQueueName); QueueDeployment deployment = new QueueDeployment(); deployment.setDuplicatesAllowed(true); deployment.setDurableSend(false); @@ -211,12 +213,12 @@ public class JMSTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); // test that Accept header is used to set content-type { diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessagePropertiesTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessagePropertiesTest.java index 21263d6091..2701d5889a 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessagePropertiesTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessagePropertiesTest.java @@ -22,6 +22,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.MessageHandler; import org.apache.activemq.artemis.rest.HttpHeaderProperty; import org.apache.activemq.artemis.rest.queue.QueueDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -38,7 +39,7 @@ import static org.hamcrest.CoreMatchers.not; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class MessagePropertiesTest extends MessageTestBase { - + private static final Logger log = Logger.getLogger(MessagePropertiesTest.class); public static class Listener implements MessageHandler { @@ -76,7 +77,7 @@ public class MessagePropertiesTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); { response = sender.request().body("text/plain", "val") diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessageTestBase.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessageTestBase.java index 9fc817fbd3..832799901a 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessageTestBase.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/MessageTestBase.java @@ -65,7 +65,7 @@ public class MessageTestBase { String href = (String) response.getHeaders().getFirst(headerName); if (href == null) return null; - //System.out.println(headerName + ": " + href); + //log.debug(headerName + ": " + href); Link l = new Link(title, null, href, null, null); try { l.setExecutor((ClientExecutor) executorField.get(response)); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushQueueConsumerTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushQueueConsumerTest.java index 0eb3e2f3bf..7e70703831 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushQueueConsumerTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushQueueConsumerTest.java @@ -26,6 +26,7 @@ import org.apache.activemq.artemis.rest.MessageServiceManager; import org.apache.activemq.artemis.rest.queue.QueueDeployment; import org.apache.activemq.artemis.rest.queue.push.xml.PushRegistration; import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -41,6 +42,8 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL; */ public class PersistentPushQueueConsumerTest { + private static final Logger log = Logger.getLogger(PersistentPushQueueConsumerTest.class); + public static MessageServiceManager manager; protected static ResteasyDeployment deployment; public static ActiveMQServer activeMQServer; @@ -81,19 +84,19 @@ public class PersistentPushQueueConsumerTest { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-consumers"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); request = new ClientRequest(generateURL("/queues/" + testName + "forwardQueue")); response = request.head(); response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("poller: " + consumeNext); + log.debug("poller: " + consumeNext); PushRegistration reg = new PushRegistration(); reg.setDurable(true); @@ -161,9 +164,9 @@ public class PersistentPushQueueConsumerTest { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-consumers"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); PushRegistration reg = new PushRegistration(); reg.setDurable(true); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushTopicConsumerTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushTopicConsumerTest.java index 00dc54efab..8fe1a10c73 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushTopicConsumerTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PersistentPushTopicConsumerTest.java @@ -34,6 +34,7 @@ import org.apache.activemq.artemis.rest.MessageServiceManager; import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink; import org.apache.activemq.artemis.rest.topic.PushTopicRegistration; import org.apache.activemq.artemis.rest.topic.TopicDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -50,6 +51,7 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL; * Test durable queue push consumers */ public class PersistentPushTopicConsumerTest { + private static final Logger log = Logger.getLogger(PersistentPushTopicConsumerTest.class); public static ActiveMQServer server; public static MessageServiceManager manager; @@ -100,9 +102,9 @@ public class PersistentPushTopicConsumerTest { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); PushTopicRegistration reg = new PushTopicRegistration(); reg.setDurable(true); @@ -156,9 +158,9 @@ public class PersistentPushTopicConsumerTest { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = MessageTestBase.getLinkByTitle(manager.getTopicManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); String sub1 = generateURL("/subscribers/1"); String sub2 = generateURL("/subscribers/2"); @@ -211,7 +213,7 @@ public class PersistentPushTopicConsumerTest { @POST @Consumes("text/plain") public void postOne(String msg) { - System.out.println("in subscribers 1!!!!!!!!!! " + msg); + log.debug("in subscribers 1!!!!!!!!!! " + msg); subscriber1 = msg; latch.countDown(); } @@ -220,7 +222,7 @@ public class PersistentPushTopicConsumerTest { @POST @Consumes("text/plain") public void postTwo(String msg) { - System.out.println("in subscribers 2!!!!!!!!!! " + msg); + log.debug("in subscribers 2!!!!!!!!!! " + msg); subscriber2 = msg; latch.countDown(); } diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushQueueConsumerTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushQueueConsumerTest.java index 077e81e79a..42c07f700f 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushQueueConsumerTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushQueueConsumerTest.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.rest.queue.push.ActiveMQPushStrategy; import org.apache.activemq.artemis.rest.queue.push.xml.PushRegistration; import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -34,6 +35,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class PushQueueConsumerTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(PushQueueConsumerTest.class); enum PushRegistrationType { CLASS, BRIDGE, URI, TEMPLATE @@ -50,7 +52,7 @@ public class PushQueueConsumerTest extends MessageTestBase { // The name of the queue used for the test should match the name of the test String queue = "testBridge"; String queueToPushTo = "pushedFrom-" + queue; - System.out.println("\n" + queue); + log.debug("\n" + queue); deployQueue(queue); deployQueue(queueToPushTo); @@ -92,7 +94,7 @@ public class PushQueueConsumerTest extends MessageTestBase { // The name of the queue used for the test should match the name of the test String queue = "testClass"; String queueToPushTo = "pushedFrom-" + queue; - System.out.println("\n" + queue); + log.debug("\n" + queue); deployQueue(queue); deployQueue(queueToPushTo); @@ -127,7 +129,7 @@ public class PushQueueConsumerTest extends MessageTestBase { // The name of the queue used for the test should match the name of the test String queue = "testTemplate"; String queueToPushTo = "pushedFrom-" + queue; - System.out.println("\n" + queue); + log.debug("\n" + queue); deployQueue(queue); deployQueue(queueToPushTo); @@ -197,7 +199,7 @@ public class PushQueueConsumerTest extends MessageTestBase { // The name of the queue used for the test should match the name of the test String queue = "testUri"; String queueToPushTo = "pushedFrom-" + queue; - System.out.println("\n" + queue); + log.debug("\n" + queue); deployQueue(queue); deployQueue(queueToPushTo); @@ -229,7 +231,7 @@ public class PushQueueConsumerTest extends MessageTestBase { // The name of the queue used for the test should match the name of the test String queue = "testUriWithMultipleSessions"; String queueToPushTo = "pushedFrom-" + queue; - System.out.println("\n" + queue); + log.debug("\n" + queue); deployQueue(queue); deployQueue(queueToPushTo); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushTopicConsumerTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushTopicConsumerTest.java index 104189d0f1..4189eac49f 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushTopicConsumerTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/PushTopicConsumerTest.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.rest.queue.push.ActiveMQPushStrategy; import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink; import org.apache.activemq.artemis.rest.topic.PushTopicRegistration; import org.apache.activemq.artemis.rest.topic.TopicDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -36,6 +37,8 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class PushTopicConsumerTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(PushTopicConsumerTest.class); + @BeforeClass public static void setup() throws Exception { // TopicDeployment deployment = new TopicDeployment(); @@ -69,9 +72,9 @@ public class PushTopicConsumerTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); request = new ClientRequest(generateURL("/queues/testBridgeForwardQueue")); response = request.head(); @@ -128,9 +131,9 @@ public class PushTopicConsumerTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); request = new ClientRequest(generateURL("/queues/testClassForwardQueue")); response = request.head(); @@ -187,9 +190,9 @@ public class PushTopicConsumerTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); request = new ClientRequest(generateURL("/queues/testTemplateForwardQueue")); response = request.head(); @@ -279,9 +282,9 @@ public class PushTopicConsumerTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); PushTopicRegistration reg = new PushTopicRegistration(); reg.setDurable(false); @@ -323,9 +326,9 @@ public class PushTopicConsumerTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link pushSubscriptions = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push subscriptions: " + pushSubscriptions); + log.debug("push subscriptions: " + pushSubscriptions); PushTopicRegistration reg = new PushTopicRegistration(); reg.setDurable(false); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java index e9468ffea4..f8ad954a05 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RawAckTest.java @@ -37,6 +37,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.core.server.impl.AddressInfo; +import org.jboss.logging.Logger; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; @@ -46,6 +47,7 @@ import org.junit.Test; * Play with ActiveMQ */ public class RawAckTest { + private static final Logger log = Logger.getLogger(RawAckTest.class); protected static ActiveMQServer activeMQServer; static ServerLocator serverLocator; @@ -99,7 +101,7 @@ public class RawAckTest { byte[] bytes = new byte[size]; message.getBodyBuffer().readBytes(bytes); String str = new String(bytes); - System.out.println(str); + log.debug(str); message.acknowledge(); message = consumer.receive(1); if (message != null) { diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingQueueTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingQueueTest.java index 714ff2d468..1959fac15f 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingQueueTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingQueueTest.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.queue.QueueDeployment; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -41,6 +42,7 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL; * ack with an old ack link */ public class RepostingQueueTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(RepostingQueueTest.class); @BeforeClass public static void setup() throws Exception { @@ -56,12 +58,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -72,9 +74,9 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -98,9 +100,9 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -124,12 +126,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -140,10 +142,10 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); Link firstConsumeNext = consumeNext; - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -154,9 +156,9 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -168,7 +170,7 @@ public class RepostingQueueTest extends MessageTestBase { response = firstConsumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); response = session.request().delete(); @@ -184,12 +186,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -200,18 +202,18 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); // test timeout here response = consumeNext.request().post(String.class); response.releaseConnection(); Assert.assertEquals(503, response.getStatus()); session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -234,12 +236,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -250,9 +252,9 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -263,7 +265,7 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -286,7 +288,7 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -304,12 +306,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -320,9 +322,9 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "false").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -333,7 +335,7 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, response.getStatus()); @@ -352,7 +354,7 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -370,12 +372,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -386,18 +388,18 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "false").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); response = ack.request().formParameter("acknowledge", "true").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, response.getStatus()); @@ -416,7 +418,7 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -434,12 +436,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -450,18 +452,18 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); response = ack.request().formParameter("acknowledge", "false").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -484,7 +486,7 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -502,12 +504,12 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -518,15 +520,15 @@ public class RepostingQueueTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); Link oldAck = ack; - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -536,11 +538,11 @@ public class RepostingQueueTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); ack = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = oldAck.request().formParameter("acknowledge", "true").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); response = ack.request().formParameter("acknowledge", "true").post(); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingTopicTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingTopicTest.java index 28b9132e6a..9dcd8278ed 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingTopicTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RepostingTopicTest.java @@ -18,6 +18,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.topic.TopicDeployment; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -41,6 +42,7 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL; * ack with an old ack link */ public class RepostingTopicTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(RepostingTopicTest.class); @BeforeClass public static void setup() throws Exception { @@ -56,9 +58,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); @@ -74,7 +76,7 @@ public class RepostingTopicTest extends MessageTestBase { response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = consumeNext.request().post(String.class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("1", response.getEntity(String.class)); @@ -99,9 +101,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = consumers.request().formParameter("name", "bill").formParameter("durable", "true").post(); response.releaseConnection(); @@ -119,7 +121,7 @@ public class RepostingTopicTest extends MessageTestBase { response = consumers.request().formParameter("name", "bill").formParameter("durable", "true").post(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = consumeNext.request().header("Accept-Wait", "2").post(String.class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("1", response.getEntity(String.class)); @@ -144,9 +146,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); @@ -164,7 +166,7 @@ public class RepostingTopicTest extends MessageTestBase { response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = consumeNext.request().header("Accept-Wait", "2").post(String.class); response.releaseConnection(); Assert.assertEquals(503, response.getStatus()); @@ -183,12 +185,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -199,9 +201,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -225,9 +227,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -251,12 +253,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -267,10 +269,10 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); Link firstConsumeNext = consumeNext; - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -281,9 +283,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -295,7 +297,7 @@ public class RepostingTopicTest extends MessageTestBase { response = firstConsumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); response = session.request().delete(); @@ -311,12 +313,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -327,18 +329,18 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); // test timeout here response = consumeNext.request().post(String.class); response.releaseConnection(); Assert.assertEquals(503, response.getStatus()); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -361,12 +363,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -377,9 +379,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -390,7 +392,7 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -413,7 +415,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -431,12 +433,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -447,9 +449,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "false").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -460,7 +462,7 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, response.getStatus()); @@ -479,7 +481,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -497,12 +499,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -513,18 +515,18 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "false").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); response = ack.request().formParameter("acknowledge", "true").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, response.getStatus()); @@ -543,7 +545,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -561,12 +563,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -577,18 +579,18 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); response = ack.request().formParameter("acknowledge", "false").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -611,7 +613,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -629,12 +631,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -645,15 +647,15 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); Link oldAck = ack; - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); Link firstConsumeNext = consumeNext; response = sender.request().body("text/plain", Integer.toString(2)).post(); @@ -664,11 +666,11 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = oldAck.request().formParameter("acknowledge", "true").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RoundtripTimeTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RoundtripTimeTest.java index 389a9ead67..d2dffb7adb 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RoundtripTimeTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/RoundtripTimeTest.java @@ -17,6 +17,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.queue.QueueDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -26,6 +27,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class RoundtripTimeTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(RoundtripTimeTest.class); @Test public void testSuccessFirst() throws Exception { @@ -41,12 +43,12 @@ public class RoundtripTimeTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); long start = System.currentTimeMillis(); int num = 100; @@ -55,7 +57,7 @@ public class RoundtripTimeTest extends MessageTestBase { response.releaseConnection(); } long end = System.currentTimeMillis() - start; - System.out.println(num + " iterations took " + end + "ms"); + log.debug(num + " iterations took " + end + "ms"); for (int i = 0; i < num; i++) { response = consumeNext.request().post(String.class); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java index 245d25cf5f..111d26a783 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SelectorTest.java @@ -33,6 +33,7 @@ import org.apache.activemq.artemis.rest.HttpHeaderProperty; import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink; import org.apache.activemq.artemis.rest.topic.PushTopicRegistration; import org.apache.activemq.artemis.rest.topic.TopicDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -43,6 +44,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class SelectorTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(SelectorTest.class); public static ConnectionFactory connectionFactory; public static String topicName = "testTopic"; @@ -51,7 +53,7 @@ public class SelectorTest extends MessageTestBase { @BeforeClass public static void setup() throws Exception { connectionFactory = new ActiveMQJMSConnectionFactory(manager.getQueueManager().getServerLocator()); - System.out.println("Queue name: " + prefixedTopicName); + log.debug("Queue name: " + prefixedTopicName); TopicDeployment deployment = new TopicDeployment(); deployment.setDuplicatesAllowed(true); deployment.setDurableSend(false); @@ -120,7 +122,7 @@ public class SelectorTest extends MessageTestBase { public static Destination createDestination(String dest) { ActiveMQDestination destination = (ActiveMQDestination) ActiveMQDestination.fromPrefixedName(dest); - System.out.println("SimpleAddress: " + destination.getSimpleAddress()); + log.debug("SimpleAddress: " + destination.getSimpleAddress()); return destination; } @@ -175,7 +177,7 @@ public class SelectorTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-subscriptions"); - System.out.println("push: " + consumers); + log.debug("push: " + consumers); PushTopicRegistration oneReg = new PushTopicRegistration(); oneReg.setDurable(false); @@ -247,16 +249,16 @@ public class SelectorTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = consumers.request().formParameter("autoAck", "true").formParameter("selector", "MyTag = '1'").post(); response.releaseConnection(); Link consumeOne = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consumeOne: " + consumeOne); + log.debug("consumeOne: " + consumeOne); response = consumers.request().formParameter("autoAck", "true").formParameter("selector", "MyTag = '2'").post(); response.releaseConnection(); Link consumeTwo = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consumeTwo: " + consumeTwo); + log.debug("consumeTwo: " + consumeTwo); // test that Accept header is used to set content-type { diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SessionTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SessionTest.java index c19288f0b9..a10735171c 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SessionTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/SessionTest.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.rest.test; import org.apache.activemq.artemis.rest.queue.QueueDeployment; import org.apache.activemq.artemis.rest.topic.TopicDeployment; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -29,6 +30,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class SessionTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(SessionTest.class); @BeforeClass public static void setup() throws Exception { @@ -50,15 +52,15 @@ public class SessionTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link session = response.getLocationLink(); response = session.request().head(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -104,15 +106,15 @@ public class SessionTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link session = response.getLocationLink(); response = session.request().head(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -160,15 +162,15 @@ public class SessionTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link session = response.getLocationLink(); response = session.request().head(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); Link ack = null; response = sender.request().body("text/plain", Integer.toString(1)).post(); @@ -236,15 +238,15 @@ public class SessionTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link session = response.getLocationLink(); response = session.request().head(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); Link ack = null; response = sender.request().body("text/plain", Integer.toString(1)).post(); diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/TransformTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/TransformTest.java index dcb67bde04..3ccac8d47e 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/TransformTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/TransformTest.java @@ -28,6 +28,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.MessageHandler; import org.apache.activemq.artemis.rest.ActiveMQ; import org.apache.activemq.artemis.rest.queue.QueueDeployment; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -38,6 +39,7 @@ import org.junit.Test; import static org.jboss.resteasy.test.TestPortProvider.generateURL; public class TransformTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(TransformTest.class); @BeforeClass public static void setup() throws Exception { @@ -122,12 +124,12 @@ public class TransformTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); // test that Accept header is used to set content-type { @@ -188,7 +190,7 @@ public class TransformTest extends MessageTestBase { @Override public void onMessage(ClientMessage clientMessage) { - System.out.println("onMessage!"); + log.debug("onMessage!"); try { order = ActiveMQ.getEntity(clientMessage, Order.class); } catch (Exception e) { @@ -217,12 +219,12 @@ public class TransformTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("consume-next: " + consumeNext); + log.debug("consume-next: " + consumeNext); // test that Accept header is used to set content-type { diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/XmlTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/XmlTest.java index 726e16e812..3fd0e62bcb 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/XmlTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/test/XmlTest.java @@ -20,9 +20,11 @@ import javax.xml.bind.JAXBContext; import java.io.StringReader; import org.apache.activemq.artemis.rest.queue.push.xml.PushRegistration; +import org.jboss.logging.Logger; import org.junit.Test; public class XmlTest { + private static final Logger log = Logger.getLogger(XmlTest.class); @Test public void testPush() throws Exception { @@ -40,6 +42,6 @@ public class XmlTest { JAXBContext ctx = JAXBContext.newInstance(PushRegistration.class); PushRegistration reg = (PushRegistration) ctx.createUnmarshaller().unmarshal(new StringReader(xml)); - System.out.println(reg); + log.debug(reg); } } diff --git a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/topic/RepostingTopicTest.java b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/topic/RepostingTopicTest.java index 504f17a4fe..5a1e1d3111 100644 --- a/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/topic/RepostingTopicTest.java +++ b/artemis-rest/src/test/java/org/apache/activemq/artemis/rest/topic/RepostingTopicTest.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.rest.topic; import org.apache.activemq.artemis.rest.test.MessageTestBase; import org.apache.activemq.artemis.rest.test.Util; import org.apache.activemq.artemis.rest.util.Constants; +import org.jboss.logging.Logger; import org.jboss.resteasy.client.ClientRequest; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.spi.Link; @@ -42,6 +43,7 @@ import static org.jboss.resteasy.test.TestPortProvider.generateURL; * ack with an old ack link */ public class RepostingTopicTest extends MessageTestBase { + private static final Logger log = Logger.getLogger(RepostingTopicTest.class); @BeforeClass public static void setup() throws Exception { @@ -57,9 +59,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); @@ -75,7 +77,7 @@ public class RepostingTopicTest extends MessageTestBase { response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = consumeNext.request().post(String.class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("1", response.getEntity(String.class)); @@ -100,9 +102,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = consumers.request().formParameter("name", "bill").formParameter("durable", "true").post(); response.releaseConnection(); @@ -120,7 +122,7 @@ public class RepostingTopicTest extends MessageTestBase { response = consumers.request().formParameter("name", "bill").formParameter("durable", "true").post(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = consumeNext.request().header("Accept-Wait", "2").post(String.class); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("1", response.getEntity(String.class)); @@ -145,9 +147,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); @@ -165,7 +167,7 @@ public class RepostingTopicTest extends MessageTestBase { response = consumers.request().formParameter("name", "bill").post(); response.releaseConnection(); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = consumeNext.request().header("Accept-Wait", "2").post(String.class); response.releaseConnection(); Assert.assertEquals(503, response.getStatus()); @@ -184,12 +186,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -200,9 +202,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -226,9 +228,9 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -252,12 +254,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -268,10 +270,10 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); Link firstConsumeNext = consumeNext; - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -282,9 +284,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -296,7 +298,7 @@ public class RepostingTopicTest extends MessageTestBase { response = firstConsumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); response = session.request().delete(); @@ -312,12 +314,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, true); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("resource consume-next: " + consumeNext); + log.debug("resource consume-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -328,18 +330,18 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 1st consumeNext: " + consumeNext); + log.debug("session 1st consumeNext: " + consumeNext); // test timeout here response = consumeNext.request().post(String.class); response.releaseConnection(); Assert.assertEquals(503, response.getStatus()); session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next"); - System.out.println("session 2nd consumeNext: " + consumeNext); + log.debug("session 2nd consumeNext: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(3)).post(); response.releaseConnection(); @@ -362,12 +364,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -378,9 +380,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -391,7 +393,7 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -414,7 +416,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -432,12 +434,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -448,9 +450,9 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "false").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -461,7 +463,7 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, response.getStatus()); @@ -480,7 +482,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -498,12 +500,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -514,18 +516,18 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "false").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); response = ack.request().formParameter("acknowledge", "true").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = consumeNext.request().header(Constants.WAIT_HEADER, "10").post(String.class); Assert.assertEquals(200, response.getStatus()); @@ -544,7 +546,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -562,12 +564,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -578,18 +580,18 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); response = ack.request().formParameter("acknowledge", "false").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(2)).post(); response.releaseConnection(); @@ -612,7 +614,7 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("2", response.getEntity(String.class)); response.releaseConnection(); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); @@ -630,12 +632,12 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); Link sender = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create"); - System.out.println("create: " + sender); + log.debug("create: " + sender); Link consumers = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-subscriptions"); - System.out.println("pull: " + consumers); + log.debug("pull: " + consumers); response = Util.setAutoAck(consumers, false); Link consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("resource acknowledge-next: " + consumeNext); + log.debug("resource acknowledge-next: " + consumeNext); response = sender.request().body("text/plain", Integer.toString(1)).post(); response.releaseConnection(); @@ -646,15 +648,15 @@ public class RepostingTopicTest extends MessageTestBase { Assert.assertEquals("1", response.getEntity(String.class)); response.releaseConnection(); Link session = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consumer"); - System.out.println("session: " + session); + log.debug("session: " + session); Link ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); Link oldAck = ack; - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = ack.request().formParameter("acknowledge", "true").post(); response.releaseConnection(); Assert.assertEquals(204, response.getStatus()); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); - System.out.println("session 1st acknowledge-next: " + consumeNext); + log.debug("session 1st acknowledge-next: " + consumeNext); Link firstConsumeNext = consumeNext; response = sender.request().body("text/plain", Integer.toString(2)).post(); @@ -665,11 +667,11 @@ public class RepostingTopicTest extends MessageTestBase { response.releaseConnection(); Assert.assertEquals(200, response.getStatus()); ack = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledgement"); - System.out.println("ack: " + ack); + log.debug("ack: " + ack); response = oldAck.request().formParameter("acknowledge", "true").post(); Assert.assertEquals(412, response.getStatus()); - System.out.println(response.getEntity(String.class)); + log.debug(response.getEntity(String.class)); response.releaseConnection(); consumeNext = getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "acknowledge-next"); 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 d234ae1fe1..e4fff54fcc 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 @@ -23,6 +23,7 @@ import org.apache.activemq.artemis.selector.filter.LogicExpression; import org.apache.activemq.artemis.selector.filter.PropertyExpression; import org.apache.activemq.artemis.selector.filter.XPathExpression; import org.apache.activemq.artemis.selector.impl.SelectorParser; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; @@ -31,8 +32,10 @@ import org.junit.Test; */ public class SelectorParserTest { + private static final Logger log = Logger.getLogger(SelectorParserTest.class); + public void info(String msg) { - System.out.println(msg); + log.debug(msg); } @Test diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java index 9cba923b8f..55f401e4bc 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java @@ -30,12 +30,15 @@ import org.apache.activemq.artemis.core.server.JournalType; import org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin; 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.Test; public class ConfigurationImplTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(ConfigurationImplTest.class); + protected Configuration conf; @Test @@ -532,7 +535,7 @@ public class ConfigurationImplTest extends ActiveMQTestBase { tempFolder = new File(tempFolder.getAbsolutePath()); tempFolder.mkdirs(); - System.out.println("TempFolder = " + tempFolder.getAbsolutePath()); + log.debug("TempFolder = " + tempFolder.getAbsolutePath()); ConfigurationImpl configuration = new ConfigurationImpl(); configuration.setJournalDirectory(tempFolder.getAbsolutePath()); @@ -550,7 +553,7 @@ public class ConfigurationImplTest extends ActiveMQTestBase { tempFolder = new File(tempFolder.getAbsolutePath()); tempFolder.mkdirs(); - System.out.println("TempFolder = " + tempFolder.getAbsolutePath()); + log.debug("TempFolder = " + tempFolder.getAbsolutePath()); configuration.setNodeManagerLockDirectory(tempFolder.getAbsolutePath()); File lockLocation = configuration.getNodeManagerLockLocation(); Assert.assertTrue(lockLocation.exists()); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/reload/LoggingConfigurationFileReloaderTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/reload/LoggingConfigurationFileReloaderTest.java index 9f111c63f8..54ab8d9ab2 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/reload/LoggingConfigurationFileReloaderTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/reload/LoggingConfigurationFileReloaderTest.java @@ -5,9 +5,9 @@ * 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. @@ -17,59 +17,53 @@ package org.apache.activemq.artemis.core.reload; -import java.util.Collections; -import java.util.List; import java.util.logging.LogManager; import org.apache.activemq.artemis.core.server.LoggingConfigurationFileReloader; import org.apache.activemq.artemis.utils.ClassloadingUtil; +import org.apache.activemq.artemis.utils.SpawnedVMSupport; import org.jboss.logging.Logger; +import org.junit.Assert; +import org.junit.FixMethodOrder; import org.junit.Test; +import org.junit.runners.MethodSorters; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class LoggingConfigurationFileReloaderTest { + private static final LogManager logManager = LogManager.getLogManager(); + private static final Logger root = Logger.getLogger(""); + private static final Logger test1 = Logger.getLogger("test1"); + private static final Logger test2 = Logger.getLogger("test2"); + private static final Logger test3 = Logger.getLogger("test3"); + + public static void main(String[] args) { + try { + LoggingConfigurationFileReloaderTest test = new LoggingConfigurationFileReloaderTest(); + test.doTestA(); + System.exit(0); + } catch (Throwable e) { + System.exit(1); + } + } + @Test - public void test() throws Exception { - LogManager logManager = LogManager.getLogManager(); + public void testA() throws Exception { + Process p = SpawnedVMSupport.spawnVM(LoggingConfigurationFileReloaderTest.class.getName()); + Assert.assertEquals(0, p.waitFor()); + } - List loggerNames = Collections.list(logManager.getLoggerNames()); - assertFalse(loggerNames.contains("test1")); - assertFalse(loggerNames.contains("test2")); - assertFalse(loggerNames.contains("test3")); + public void doTestA() throws Exception { - // everything defaults to INFO - final Logger root = Logger.getLogger(""); - assertTrue(root.isEnabled(Logger.Level.ERROR)); - assertTrue(root.isEnabled(Logger.Level.WARN)); - assertTrue(root.isEnabled(Logger.Level.INFO)); - assertFalse(root.isEnabled(Logger.Level.DEBUG)); - assertFalse(root.isEnabled(Logger.Level.TRACE)); - - final Logger test1 = Logger.getLogger("test1"); - assertTrue(test1.isEnabled(Logger.Level.ERROR)); - assertTrue(test1.isEnabled(Logger.Level.WARN)); - assertTrue(test1.isEnabled(Logger.Level.INFO)); - assertFalse(test1.isEnabled(Logger.Level.DEBUG)); - assertFalse(test1.isEnabled(Logger.Level.TRACE)); - - final Logger test2 = Logger.getLogger("test2"); - assertTrue(test2.isEnabled(Logger.Level.ERROR)); - assertTrue(test2.isEnabled(Logger.Level.WARN)); - assertTrue(test2.isEnabled(Logger.Level.INFO)); - assertFalse(test2.isEnabled(Logger.Level.DEBUG)); - assertFalse(test2.isEnabled(Logger.Level.TRACE)); + /** This is making sure we won't mess with the configuration for other tests */ + validateInitialLoggers(); LoggingConfigurationFileReloader loggingConfigurationFileReloader = new LoggingConfigurationFileReloader(); loggingConfigurationFileReloader.reload(ClassloadingUtil.findResource("reload-logging-1.properties")); - loggerNames = Collections.list(logManager.getLoggerNames()); - assertTrue(loggerNames.contains("test1")); - assertTrue(loggerNames.contains("test2")); - assertFalse(loggerNames.contains("test3")); - assertTrue(root.isEnabled(Logger.Level.ERROR)); assertTrue(root.isEnabled(Logger.Level.WARN)); assertFalse(root.isEnabled(Logger.Level.INFO)); @@ -90,11 +84,6 @@ public class LoggingConfigurationFileReloaderTest { loggingConfigurationFileReloader.reload(ClassloadingUtil.findResource("reload-logging-2.properties")); - loggerNames = Collections.list(logManager.getLoggerNames()); - assertTrue(loggerNames.contains("test1")); - assertTrue(loggerNames.contains("test2")); - assertTrue(loggerNames.contains("test3")); - assertTrue(root.isEnabled(Logger.Level.ERROR)); assertFalse(root.isEnabled(Logger.Level.WARN)); assertFalse(root.isEnabled(Logger.Level.INFO)); @@ -107,11 +96,33 @@ public class LoggingConfigurationFileReloaderTest { assertFalse(test1.isEnabled(Logger.Level.DEBUG)); assertFalse(test1.isEnabled(Logger.Level.TRACE)); - final Logger test3 = Logger.getLogger("test3"); assertTrue(test3.isEnabled(Logger.Level.ERROR)); assertTrue(test3.isEnabled(Logger.Level.WARN)); assertTrue(test3.isEnabled(Logger.Level.INFO)); assertTrue(test3.isEnabled(Logger.Level.DEBUG)); assertFalse(test3.isEnabled(Logger.Level.TRACE)); } + + @Test + public void testB() { + validateInitialLoggers(); + } + + public void validateInitialLoggers() { + // everything defaults to INFO + assertTrue(root.isEnabled(Logger.Level.ERROR)); + assertTrue(root.isEnabled(Logger.Level.WARN)); + assertFalse(root.isEnabled(Logger.Level.DEBUG)); + assertFalse(root.isEnabled(Logger.Level.TRACE)); + + assertTrue(test1.isEnabled(Logger.Level.ERROR)); + assertTrue(test1.isEnabled(Logger.Level.WARN)); + assertFalse(test1.isEnabled(Logger.Level.DEBUG)); + assertFalse(test1.isEnabled(Logger.Level.TRACE)); + + assertTrue(test2.isEnabled(Logger.Level.ERROR)); + assertTrue(test2.isEnabled(Logger.Level.WARN)); + assertFalse(test2.isEnabled(Logger.Level.DEBUG)); + assertFalse(test2.isEnabled(Logger.Level.TRACE)); + } } \ No newline at end of file diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java index 6707ad2f51..3b561742d3 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/JAASSecurityManagerTest.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.core.security.jaas; import org.apache.activemq.artemis.core.security.CheckType; import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; +import org.jboss.logging.Logger; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -40,6 +41,7 @@ import static org.junit.Assert.assertNotNull; @RunWith(Parameterized.class) public class JAASSecurityManagerTest { + private static final Logger log = Logger.getLogger(JAASSecurityManagerTest.class); @Parameterized.Parameters(name = "newLoader=({0})") public static Collection data() { @@ -70,7 +72,7 @@ public class JAASSecurityManagerTest { @Test public void testLoginClassloading() throws Exception { ClassLoader existingLoader = Thread.currentThread().getContextClassLoader(); - System.out.println("loader: " + existingLoader); + log.debug("loader: " + existingLoader); try { if (usingNewLoader) { URLClassLoader simulatedLoader = new URLClassLoader(new URL[]{tmpDir.getRoot().toURI().toURL()}, null); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java index ff28e04fff..8936271fd9 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/files/FileStoreMonitorTest.java @@ -30,6 +30,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ReusableLatch; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -37,6 +38,8 @@ import org.junit.Test; public class FileStoreMonitorTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(FileStoreMonitorTest.class); + private ScheduledExecutorService scheduledExecutorService; private ExecutorService executorService; @@ -76,19 +79,19 @@ public class FileStoreMonitorTest extends ActiveMQTestBase { @Override public void tick(long usableSpace, long totalSpace) { tick.incrementAndGet(); - System.out.println("tick:: usableSpace: " + usableSpace + ", totalSpace:" + totalSpace); + log.debug("tick:: usableSpace: " + usableSpace + ", totalSpace:" + totalSpace); } @Override public void over(long usableSpace, long totalSpace) { over.incrementAndGet(); - System.out.println("over:: usableSpace: " + usableSpace + ", totalSpace:" + totalSpace); + log.debug("over:: usableSpace: " + usableSpace + ", totalSpace:" + totalSpace); } @Override public void under(long usableSpace, long totalSpace) { under.incrementAndGet(); - System.out.println("under:: usableSpace: " + usableSpace + ", totalSpace:" + totalSpace); + log.debug("under:: usableSpace: " + usableSpace + ", totalSpace:" + totalSpace); } }; FileStoreMonitor storeMonitor = new FileStoreMonitor(scheduledExecutorService, executorService, 100, TimeUnit.MILLISECONDS, 0.999, null); @@ -120,7 +123,7 @@ public class FileStoreMonitorTest extends ActiveMQTestBase { storeMonitor.addCallback(new FileStoreMonitor.Callback() { @Override public void tick(long usableSpace, long totalSpace) { - System.out.println("Tick"); + log.debug("Tick"); latch.countDown(); } diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java index 988fa490a1..6eda1030a9 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerTest.java @@ -59,11 +59,14 @@ import org.apache.activemq.artemis.utils.UUID; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.apache.activemq.artemis.utils.critical.CriticalComponentImpl; import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class ScheduledDeliveryHandlerTest extends Assert { + private static final Logger log = Logger.getLogger(ScheduledDeliveryHandlerTest.class); + @Test public void testScheduleRandom() throws Exception { ScheduledDeliveryHandlerImpl handler = new ScheduledDeliveryHandlerImpl(null, new FakeQueueForScheduleUnitTest(0)); @@ -279,7 +282,7 @@ public class ScheduledDeliveryHandlerTest extends Assert { assertTrue(ref.getScheduledDeliveryTime() >= lastTime); } else { if (ref.getScheduledDeliveryTime() < lastTime) { - System.out.println("^^^fail at " + ref.getScheduledDeliveryTime()); + log.debug("^^^fail at " + ref.getScheduledDeliveryTime()); } } lastTime = ref.getScheduledDeliveryTime(); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java index defda9daf8..a3ee0e2d02 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImplTest.java @@ -63,10 +63,12 @@ import org.apache.activemq.artemis.core.transaction.ResourceManager; import org.apache.activemq.artemis.core.transaction.Transaction; import org.apache.activemq.artemis.core.transaction.TransactionOperation; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class TransactionImplTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(TransactionImplTest.class); @Test public void testTimeoutAndThenCommitWithARollback() throws Exception { @@ -94,7 +96,7 @@ public class TransactionImplTest extends ActiveMQTestBase { @Override public void afterCommit(Transaction tx) { - System.out.println("commit..."); + log.debug("commit..."); commit.incrementAndGet(); } @@ -105,7 +107,7 @@ public class TransactionImplTest extends ActiveMQTestBase { @Override public void afterRollback(Transaction tx) { - System.out.println("rollback..."); + log.debug("rollback..."); rollback.incrementAndGet(); } @@ -162,7 +164,7 @@ public class TransactionImplTest extends ActiveMQTestBase { @Override public void afterCommit(Transaction tx) { - System.out.println("commit..."); + log.debug("commit..."); commit.incrementAndGet(); } @@ -173,7 +175,7 @@ public class TransactionImplTest extends ActiveMQTestBase { @Override public void afterRollback(Transaction tx) { - System.out.println("rollback..."); + log.debug("rollback..."); rollback.incrementAndGet(); } diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index 91128a0904..8209f0ab88 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -164,6 +164,12 @@ import org.junit.runner.Description; */ public abstract class ActiveMQTestBase extends Assert { + private static final Logger log = Logger.getLogger(ActiveMQTestBase.class); + + private static final Logger baseLog = Logger.getLogger(ActiveMQTestBase.class); + + protected final Logger instanceLog = Logger.getLogger(this.getClass()); + static { Env.setTestEnv(true); } @@ -206,7 +212,6 @@ public abstract class ActiveMQTestBase extends Assert { private static final String SEND_CALL_NUMBER = "sendCallNumber"; private static final String OS_TYPE = System.getProperty("os.name").toLowerCase(); private static final int DEFAULT_UDP_PORT; - private static final ActiveMQServerLogger log = ActiveMQServerLogger.LOGGER; protected static final long WAIT_TIMEOUT = 30000; @@ -240,12 +245,12 @@ public abstract class ActiveMQTestBase extends Assert { public TestRule watcher = new TestWatcher() { @Override protected void starting(Description description) { - log.info(String.format("**** start #test %s() ***", description.getMethodName())); + baseLog.info(String.format("**** start #test %s() ***", description.getMethodName())); } @Override protected void finished(Description description) { - log.info(String.format("**** end #test %s() ***", description.getMethodName())); + baseLog.info(String.format("**** end #test %s() ***", description.getMethodName())); } }; @@ -271,7 +276,7 @@ public abstract class ActiveMQTestBase extends Assert { } protected T serialClone(Object object) throws Exception { - System.out.println("object::" + object); + log.debug("object::" + object); ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream obOut = new ObjectOutputStream(bout); obOut.writeObject(object); @@ -1088,16 +1093,16 @@ public abstract class ActiveMQTestBase extends Assert { } else if (prop.getPropertyType() == Double.class || prop.getPropertyType() == Double.TYPE) { value = RandomUtil.randomDouble(); } else { - System.out.println("Can't validate property of type " + prop.getPropertyType() + " on " + prop.getName()); + log.debug("Can't validate property of type " + prop.getPropertyType() + " on " + prop.getName()); value = null; } if (value != null && prop.getWriteMethod() != null && prop.getReadMethod() == null) { - System.out.println("WriteOnly property " + prop.getName() + " on " + pojo.getClass()); + log.debug("WriteOnly property " + prop.getName() + " on " + pojo.getClass()); } else if (value != null && prop.getWriteMethod() != null && prop.getReadMethod() != null && !ignoreSet.contains(prop.getName())) { - System.out.println("Validating " + prop.getName() + " type = " + prop.getPropertyType()); + log.debug("Validating " + prop.getName() + " type = " + prop.getPropertyType()); prop.getWriteMethod().invoke(pojo, value); Assert.assertEquals("Property " + prop.getName(), value, prop.getReadMethod().invoke(pojo)); @@ -1300,7 +1305,7 @@ public abstract class ActiveMQTestBase extends Assert { } if (!server.isStarted()) { - log.info(threadDump("Server didn't start")); + baseLog.info(threadDump("Server didn't start")); fail("server didn't start: " + server); } @@ -1322,7 +1327,7 @@ public abstract class ActiveMQTestBase extends Assert { } if (server.isStarted()) { - log.info(threadDump("Server didn't start")); + baseLog.info(threadDump("Server didn't start")); fail("Server didn't start: " + server); } } @@ -1821,9 +1826,6 @@ public abstract class ActiveMQTestBase extends Assert { } AtomicInteger getType(byte key) { - if (key == 0) { - System.out.println("huh?"); - } Integer ikey = (int) key; AtomicInteger value = recordsType.get(ikey); if (value == null) { @@ -1939,7 +1941,7 @@ public abstract class ActiveMQTestBase extends Assert { ")" + ")"; - log.error(msg); + baseLog.error(msg); return false; } @@ -2033,7 +2035,7 @@ public abstract class ActiveMQTestBase extends Assert { int invmSize = InVMRegistry.instance.size(); if (invmSize > 0) { InVMRegistry.instance.clear(); - log.info(threadDump("Thread dump")); + baseLog.info(threadDump("Thread dump")); fail("invm registry still had acceptors registered"); } @@ -2050,14 +2052,14 @@ public abstract class ActiveMQTestBase extends Assert { try { ServerLocatorImpl.clearThreadPools(); } catch (Throwable e) { - log.info(threadDump(e.getMessage())); + baseLog.info(threadDump(e.getMessage())); System.err.println(threadDump(e.getMessage())); } try { NettyConnector.clearThreadPools(); } catch (Exception e) { - log.info(threadDump(e.getMessage())); + baseLog.info(threadDump(e.getMessage())); System.err.println(threadDump(e.getMessage())); } } diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java index 0d8e206dfc..84bd0138ea 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/uri/AcceptorParserTest.java @@ -25,17 +25,19 @@ import org.apache.activemq.artemis.core.config.ConfigurationUtils; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.utils.ConfigurationHelper; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class AcceptorParserTest { + private static final Logger log = Logger.getLogger(AcceptorParserTest.class); @Test public void testAcceptor() throws Exception { List configs = ConfigurationUtils.parseAcceptorURI("test", "tcp://localhost:8080?tcpSendBufferSize=1048576&tcpReceiveBufferSize=1048576&protocols=openwire&banana=x"); for (TransportConfiguration config : configs) { - System.out.println("config:" + config); + log.debug("config:" + config); Assert.assertTrue(config.getExtraParams().get("banana").equals("x")); } } @@ -60,8 +62,8 @@ public class AcceptorParserTest { List configs = ConfigurationUtils.parseAcceptorURI("test", "tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;virtualTopicConsumerWildcards=Consumer.*.%3E%3B2"); for (TransportConfiguration config : configs) { - System.out.println("config:" + config); - System.out.println(config.getExtraParams().get("virtualTopicConsumerWildcards")); + log.debug("config:" + config); + log.debug(config.getExtraParams().get("virtualTopicConsumerWildcards")); Assert.assertTrue(config.getExtraParams().get("virtualTopicConsumerWildcards").equals("Consumer.*.>;2")); } } diff --git a/pom.xml b/pom.xml index dfe3afb6a0..bc02240729 100644 --- a/pom.xml +++ b/pom.xml @@ -75,6 +75,7 @@ scp://people.apache.org/x1/www/activemq.apache.org false + logging.properties 1.0.1 4.0.6 @@ -175,7 +176,7 @@ --> -Dorg.apache.activemq.artemis.utils.RetryRule.retry=${retryTests} -Dbrokerconfig.maxDiskUsage=100 -Dorg.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_QUIET_PERIOD=0 -Dorg.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_SHUTDOWN_TIMEOUT=0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager - -Dlogging.configuration="file:${activemq.basedir}/tests/config/logging.properties" + -Dlogging.configuration="file:${activemq.basedir}/tests/config/${logging.config}" -Djava.library.path="${activemq.basedir}/target/bin/lib/linux-x86_64:${activemq.basedir}/target/bin/lib/linux-i686" -Djgroups.bind_addr=localhost -Dorg.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory.localBindAddress=localhost -Djava.net.preferIPv4Stack=true -Dbasedir=${basedir} @@ -1023,6 +1024,14 @@ true + + + tests-CI + + + logging-CI.properties + + diff --git a/tests/compatibility-tests/src/main/resources/hqclienttopologytest/verifyTopologyChangeMessage.groovy b/tests/compatibility-tests/src/main/resources/hqclienttopologytest/verifyTopologyChangeMessage.groovy index 78da87d244..cbb79fa3c3 100644 --- a/tests/compatibility-tests/src/main/resources/hqclienttopologytest/verifyTopologyChangeMessage.groovy +++ b/tests/compatibility-tests/src/main/resources/hqclienttopologytest/verifyTopologyChangeMessage.groovy @@ -45,8 +45,6 @@ Session session = connection.createSession(true, Session.SESSION_TRANSACTED); try { latch.await(5, TimeUnit.SECONDS); - System.out.println("Count is " + latch.getCount()); - System.out.println("Retrieved transport params: " + transportParams); // cluster topology message should arrive immediately after connecting GroovyRun.assertEquals(0, (int) latch.getCount()); diff --git a/tests/compatibility-tests/src/main/resources/hqsoak/receiveMessages.groovy b/tests/compatibility-tests/src/main/resources/hqsoak/receiveMessages.groovy index de2d37ad64..2fe8dd5730 100644 --- a/tests/compatibility-tests/src/main/resources/hqsoak/receiveMessages.groovy +++ b/tests/compatibility-tests/src/main/resources/hqsoak/receiveMessages.groovy @@ -65,7 +65,6 @@ for (int i = 0; i < consumers; i++) { void run() { try { int threadid = running.incrementAndGet(); - System.out.println("Running " + threadid) Connection connection = cf.createConnection(); connection.setClientID(clientType + threadid) Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -100,6 +99,5 @@ if (!latchStarted.await(10, TimeUnit.SECONDS)) { System.err.prntln("Could not start consumers") errorsConsumer.incrementAndGet() } -System.out.println("Running::" + clientType + "::" + running) return running; diff --git a/tests/compatibility-tests/src/main/resources/hqsoak/sendMessages.groovy b/tests/compatibility-tests/src/main/resources/hqsoak/sendMessages.groovy index 08b05a9a42..4d2849c5d5 100644 --- a/tests/compatibility-tests/src/main/resources/hqsoak/sendMessages.groovy +++ b/tests/compatibility-tests/src/main/resources/hqsoak/sendMessages.groovy @@ -43,9 +43,6 @@ if (legacyOption) { topicName = "topic"; } -System.out.println("topicName = " + topicName); - - if (clientType.startsWith("ARTEMIS")) { // Can't depend directly on artemis, otherwise it wouldn't compile in hornetq GroovyRun.evaluate("clients/artemisClient.groovy", "serverArg", "ARTEMIS"); diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/receiveMessages.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/receiveMessages.groovy index 2eb9fc5b17..1f7ce3dece 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/receiveMessages.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/receiveMessages.groovy @@ -38,10 +38,8 @@ connection.start() Message message = queueConsumer.receive(5000); GroovyRun.assertNotNull(message) session.commit(); -System.out.println("Received " + message + " from: " + myQueue); queueConsumer.close(); -System.out.println("Sending message to: " + message.getJMSReplyTo()); MessageProducer producer = session.createProducer(message.getJMSReplyTo()); message = session.createMessage(); producer.send(message); diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/sendMessagesAddress.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/sendMessagesAddress.groovy index fd6baf86e5..e97113b61e 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/sendMessagesAddress.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToQueue/sendMessagesAddress.groovy @@ -41,15 +41,12 @@ MessageProducer queueProducer = session.createProducer(myQueue) queueProducer.setDeliveryMode(DeliveryMode.PERSISTENT); Message message = session.createMessage(); message.setJMSReplyTo(temporaryQueue); -System.out.println("Sending " + message + " to: " + myQueue); queueProducer.send(message); session.commit(); -System.out.println("Receiving message from: " + temporaryQueue); message = consumer.receive(10000); GroovyRun.assertNotNull(message); session.commit(); -System.out.println("Received message: " + message); connection.close(); senderLatch.countDown(); \ No newline at end of file diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/receiveMessages.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/receiveMessages.groovy index a7a115789c..9c2f96f971 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/receiveMessages.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/receiveMessages.groovy @@ -38,10 +38,8 @@ connection.start() Message message = queueConsumer.receive(5000); GroovyRun.assertNotNull(message) session.commit(); -System.out.println("Received " + message + " from: " + myQueue); queueConsumer.close(); -System.out.println("Sending message to: " + message.getJMSReplyTo()); MessageProducer producer = session.createProducer(message.getJMSReplyTo()); message = session.createMessage(); producer.send(message); diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/sendMessagesAddress.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/sendMessagesAddress.groovy index 968b8ad196..df8269392c 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/sendMessagesAddress.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToTempQueue/sendMessagesAddress.groovy @@ -41,15 +41,12 @@ MessageProducer queueProducer = session.createProducer(myQueue) queueProducer.setDeliveryMode(DeliveryMode.PERSISTENT); Message message = session.createMessage(); message.setJMSReplyTo(temporaryQueue); -System.out.println("Sending " + message + " to: " + myQueue); queueProducer.send(message); session.commit(); -System.out.println("Receiving message from: " + temporaryQueue); message = consumer.receive(10000); GroovyRun.assertNotNull(message); session.commit(); -System.out.println("Received message: " + message); connection.close(); senderLatch.countDown(); \ No newline at end of file diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/receiveMessages.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/receiveMessages.groovy index 5c7f300160..e60a654947 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/receiveMessages.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/receiveMessages.groovy @@ -41,11 +41,9 @@ connection.start() for (int i = 0; i < 5; i++) { Message message = queueConsumer.receive(5000); GroovyRun.assertNotNull(message) - System.out.println("Received " + message + " from: " + myQueue); GroovyRun.assertEquals("myQueue", ((Queue)message.getJMSDestination()).getQueueName()); - System.out.println("Sending message to: " + message.getJMSReplyTo()); MessageProducer producer = session.createProducer(message.getJMSReplyTo()); message = session.createMessage(); producer.send(message); diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/sendMessagesAddress.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/sendMessagesAddress.groovy index d54cda2a07..f346668293 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/sendMessagesAddress.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToTempTopic/sendMessagesAddress.groovy @@ -36,11 +36,9 @@ Queue myQueue = session.createQueue("myQueue"); GroovyRun.assertEquals("myQueue", myQueue.getQueueName()); -System.out.println("myQueue::" + myQueue); TemporaryTopic replyTopic = session.createTemporaryTopic(); MessageConsumer consumer = session.createConsumer(replyTopic); -System.out.println("Temporary Topic " + replyTopic); MessageProducer queueProducer = session.createProducer(myQueue) @@ -53,14 +51,12 @@ sendMessage(session.createMessage(), replyTopic, myQueue, queueProducer); session.commit(); -System.out.println("Receiving message from: " + replyTopic); for (int i = 0; i < 5; i++) { message = consumer.receive(10000); GroovyRun.assertNotNull(message); } GroovyRun.assertNull(consumer.receiveNoWait()); session.commit(); -System.out.println("Received message: " + message); connection.close(); senderLatch.countDown(); @@ -68,6 +64,5 @@ senderLatch.countDown(); void sendMessage(Message message, TemporaryTopic replyTopic, Queue myQueue, MessageProducer queueProducer) { message.setJMSReplyTo(replyTopic); - System.out.println("Sending " + message + " to: " + myQueue); queueProducer.send(message); } \ No newline at end of file diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/receiveMessages.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/receiveMessages.groovy index 6883f4e0cc..8c4b131cd0 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/receiveMessages.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/receiveMessages.groovy @@ -38,10 +38,8 @@ connection.start() Message message = queueConsumer.receive(5000); GroovyRun.assertNotNull(message) session.commit(); -System.out.println("Received " + message + " from: " + myQueue); queueConsumer.close(); -System.out.println("Sending message to: " + message.getJMSReplyTo()); MessageProducer producer = session.createProducer(message.getJMSReplyTo()); message = session.createMessage(); producer.send(message); diff --git a/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/sendMessagesAddress.groovy b/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/sendMessagesAddress.groovy index 02f6137502..e851e6386f 100644 --- a/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/sendMessagesAddress.groovy +++ b/tests/compatibility-tests/src/main/resources/jmsReplyToTopic/sendMessagesAddress.groovy @@ -41,15 +41,12 @@ MessageProducer queueProducer = session.createProducer(myQueue) queueProducer.setDeliveryMode(DeliveryMode.PERSISTENT); Message message = session.createMessage(); message.setJMSReplyTo(replyTopic); -System.out.println("Sending " + message + " to: " + myQueue); queueProducer.send(message); session.commit(); -System.out.println("Receiving message from: " + replyTopic); message = consumer.receive(10000); GroovyRun.assertNotNull(message); session.commit(); -System.out.println("Received message: " + message); connection.close(); senderLatch.countDown(); \ No newline at end of file diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HornetQSoakTest.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HornetQSoakTest.java index eefa6a9c61..7467a43c54 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HornetQSoakTest.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HornetQSoakTest.java @@ -99,7 +99,6 @@ public class HornetQSoakTest extends ClasspathBase { AtomicInteger runningConsumer1XArtemis = (AtomicInteger) evaluate(artemis1XClassLoader, "hqsoak/receiveMessages.groovy", "ARTEMIS1X", "" + numberOfConsumersArtemis, "" + totalMessagePerQueue); AtomicInteger runningConsumerHornetQ = (AtomicInteger) evaluate(hornetqClassLoader, "hqsoak/receiveMessages.groovy", "HORNETQ", "" + numberOfConsumersHornetQ, "" + totalMessagePerQueue); - System.out.println("Running producers"); AtomicInteger ranArtemisProducer = (AtomicInteger) evaluate(artemisClassLoader, "hqsoak/sendMessages.groovy", "ARTEMIS", "" + threadsProducerArtemis, "" + numberOfMessagesArtemis); AtomicInteger ranHornetQProducer = (AtomicInteger) evaluate(hornetqClassLoader, "hqsoak/sendMessages.groovy", "HORNETQ", "" + threadsProducerHornetQ, "" + numberOfMessagesHornetQ); diff --git a/tests/config/logging-CI.properties b/tests/config/logging-CI.properties new file mode 100644 index 0000000000..55188df617 --- /dev/null +++ b/tests/config/logging-CI.properties @@ -0,0 +1,72 @@ +# +# 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. +# + + +# This is the logger used only on CI environments + +# 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 + +# Root logger level +logger.level=WARN +# ActiveMQ Artemis logger levels +logger.org.apache.activemq.artemis.core.server.level=WARN +logger.org.apache.activemq.artemis.journal.level=WARN +logger.org.apache.activemq.artemis.utils.level=WARN +logger.org.apache.activemq.artemis.jms.level=WARN +logger.org.apache.activemq.artemis.ra.level=WARN + +logger.org.apache.activemq.artemis.tests.integration.level=INFO +logger.org.apache.activemq.artemis.tests.level=INFO +logger.org.apache.activemq.artemis.tests.unit.level=INFO +logger.org.apache.activemq.artemis.jms.tests.level=INFO + + +# Root logger handlers +logger.handlers=CONSOLE,TEST +#logger.handlers=CONSOLE,FILE + +# to enable audit change the level to INFO +logger.org.apache.activemq.audit.level=ERROR +logger.org.apache.activemq.audit.handlers=CONSOLE,FILE +logger.org.apache.activemq.audit.useParentHandlers=false + +# Console handler configuration +handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler +handler.CONSOLE.properties=autoFlush +handler.CONSOLE.level=FINE +handler.CONSOLE.autoFlush=true +handler.CONSOLE.formatter=PATTERN + +# File handler configuration +handler.FILE=org.jboss.logmanager.handlers.FileHandler +handler.FILE.level=FINE +handler.FILE.properties=autoFlush,fileName +handler.FILE.autoFlush=true +handler.FILE.fileName=target/activemq.log +handler.FILE.formatter=PATTERN + +# Console handler configuration +handler.TEST=org.apache.activemq.artemis.logs.AssertionLoggerHandler +handler.TEST.level=TRACE +handler.TEST.formatter=PATTERN + +# Formatter pattern configuration +formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter +formatter.PATTERN.properties=pattern +formatter.PATTERN.pattern=[%t] %d{HH:mm:ss,SSS} %-5p [%c] %s%E%n diff --git a/tests/config/logging.properties b/tests/config/logging.properties index ba749836b3..6ec83e9fc0 100644 --- a/tests/config/logging.properties +++ b/tests/config/logging.properties @@ -27,9 +27,12 @@ logger.org.apache.activemq.artemis.journal.level=INFO 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.artemis.tests.unit.level=INFO -logger.org.apache.activemq.artemis.tests.integration.level=INFO -logger.org.apache.activemq.artemis.jms.tests.level=INFO + +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 +logger.org.apache.activemq.artemis.jms.tests.level=DEBUG + # Root logger handlers logger.handlers=CONSOLE,TEST @@ -37,7 +40,7 @@ logger.handlers=CONSOLE,TEST # to enable audit change the level to INFO logger.org.apache.activemq.audit.level=ERROR -logger.org.apache.activemq.audit.handlers=AUDIT_FILE +logger.org.apache.activemq.audit.handlers=CONSOLE,FILE logger.org.apache.activemq.audit.useParentHandlers=false # Console handler configuration @@ -64,17 +67,3 @@ handler.TEST.formatter=PATTERN formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter formatter.PATTERN.properties=pattern formatter.PATTERN.pattern=[%t] %d{HH:mm:ss,SSS} %-5p [%c] %s%E%n - -#Audit logger -handler.AUDIT_FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler -handler.AUDIT_FILE.level=INFO -handler.AUDIT_FILE.properties=suffix,append,autoFlush,fileName -handler.AUDIT_FILE.suffix=.yyyy-MM-dd -handler.AUDIT_FILE.append=true -handler.AUDIT_FILE.autoFlush=true -handler.AUDIT_FILE.fileName=target/audit.log -handler.AUDIT_FILE.formatter=AUDIT_PATTERN - -formatter.AUDIT_PATTERN=org.jboss.logmanager.formatters.PatternFormatter -formatter.AUDIT_PATTERN.properties=pattern -formatter.AUDIT_PATTERN.pattern=%d [AUDIT](%t) %s%E%n diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java index e6d29c646f..3e97dfc7bf 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java @@ -46,6 +46,7 @@ import org.apache.activemq.artemis.utils.UUIDGenerator; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -53,6 +54,7 @@ import org.junit.runner.RunWith; @RunWith(BMUnitRunner.class) public class BMFailoverTest extends FailoverTestBase { + private static final Logger log = Logger.getLogger(BMFailoverTest.class); private ServerLocator locator; private ClientSessionFactoryInternal sf; @@ -198,7 +200,7 @@ public class BMFailoverTest extends FailoverTestBase { assertNotNull(m); - System.out.println("********************" + m.getIntProperty("counter")); + log.debug("********************" + m.getIntProperty("counter")); //the mdb would ack the message before calling onMessage() m.acknowledge(); @@ -232,7 +234,7 @@ public class BMFailoverTest extends FailoverTestBase { //the mdb would ack the message before calling onMessage() m.acknowledge(); - System.out.println("********************" + m.getIntProperty("counter")); + log.debug("********************" + m.getIntProperty("counter")); xaSessionRec.getXAResource().end(xidRec, XAResource.TMSUCCESS); xaSessionRec.getXAResource().prepare(xidRec); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java index 44150cb539..548e0a6e76 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ConcurrentDeliveryCancelTest.java @@ -45,6 +45,7 @@ import org.apache.activemq.artemis.utils.ReusableLatch; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -54,6 +55,7 @@ import org.junit.runner.RunWith; */ @RunWith(BMUnitRunner.class) public class ConcurrentDeliveryCancelTest extends JMSTestBase { + private static final Logger log = Logger.getLogger(ConcurrentDeliveryCancelTest.class); // used to wait the thread to align at the same place and create the race private static final ReusableLatch latchEnter = new ReusableLatch(2); @@ -89,7 +91,7 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase { action = "org.apache.activemq.artemis.tests.extras.byteman.ConcurrentDeliveryCancelTest.enterCancel();")}) public void testConcurrentCancels() throws Exception { - System.out.println(server.getConfiguration().getJournalLocation().toString()); + log.debug(server.getConfiguration().getJournalLocation().toString()); server.getAddressSettingsRepository().clear(); AddressSettings settings = new AddressSettings(); settings.setMaxDeliveryAttempts(-1); @@ -98,9 +100,9 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase { cf.setReconnectAttempts(0); cf.setRetryInterval(10); - System.out.println("....."); + log.debug("....."); for (ServerSession srvSess : server.getSessions()) { - System.out.println(srvSess); + log.debug(srvSess); } String queueName = RandomUtil.randomString(); @@ -142,14 +144,14 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase { Assert.assertNotNull(consumer.receiveNoWait()); } - System.out.println("....."); + log.debug("....."); final List serverSessions = new LinkedList<>(); // We will force now the failure simultaneously from several places for (ServerSession srvSess : server.getSessions()) { if (srvSess.getMetaData("theSession") != null) { - System.out.println(srvSess); + log.debug(srvSess); serverSessions.add(srvSess); } } @@ -166,9 +168,9 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase { @Override public void run() { try { - System.out.println(Thread.currentThread().getName() + " closing consumer"); + log.debug(Thread.currentThread().getName() + " closing consumer"); consumer.close(); - System.out.println(Thread.currentThread().getName() + " closed consumer"); + log.debug(Thread.currentThread().getName() + " closed consumer"); } catch (Exception e) { e.printStackTrace(); } @@ -179,7 +181,7 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase { @Override public void run() { for (ServerSession sess : serverSessions) { - System.out.println("Thread " + Thread.currentThread().getName() + " starting"); + log.debug("Thread " + Thread.currentThread().getName() + " starting"); try { // A session.close could sneak in through failover or some other scenarios. // a call to RemotingConnection.fail wasn't replicating the issue. @@ -188,7 +190,7 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase { } catch (Exception e) { e.printStackTrace(); } - System.out.println("Thread " + Thread.currentThread().getName() + " done"); + log.debug("Thread " + Thread.currentThread().getName() + " done"); } } }); @@ -239,10 +241,10 @@ public class ConcurrentDeliveryCancelTest extends JMSTestBase { for (int i = 0; i < numberOfMessages; i++) { AtomicInteger count = mapCount.get(i); if (count == null) { - System.out.println("Message " + i + " not received"); + log.debug("Message " + i + " not received"); failed = true; } else if (count.get() > 1) { - System.out.println("Message " + i + " received " + count.get() + " times"); + log.debug("Message " + i + " received " + count.get() + " times"); failed = true; } } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FileLockNodeManagerTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FileLockNodeManagerTest.java index 16d4bbc76e..519cb63da7 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FileLockNodeManagerTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FileLockNodeManagerTest.java @@ -24,12 +24,14 @@ import org.apache.activemq.artemis.core.server.impl.FileLockNodeManager; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(BMUnitRunner.class) public class FileLockNodeManagerTest { + private static final Logger log = Logger.getLogger(FileLockNodeManagerTest.class); private static final int TIMEOUT_TOLERANCE = 50; @@ -59,7 +61,7 @@ public class FileLockNodeManagerTest { protected void assertMeasuredTimeoutFor(long lockAcquisitionTimeout) throws Exception { long realTimeout = measureLockAcquisisionTimeout(lockAcquisitionTimeout); - System.out.println(String.format("lockAcquisisionTimeout: %d ms, measured timeout: %d ms", lockAcquisitionTimeout, realTimeout)); + log.debug(String.format("lockAcquisisionTimeout: %d ms, measured timeout: %d ms", lockAcquisitionTimeout, realTimeout)); Assert.assertTrue(String.format("Timeout %d ms was larger than expected %d ms", realTimeout, lockAcquisitionTimeout + TIMEOUT_TOLERANCE), lockAcquisitionTimeout + TIMEOUT_TOLERANCE >= realTimeout); Assert.assertTrue(String.format("Timeout %d ms was lower than expected %d ms", realTimeout, lockAcquisitionTimeout), diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java index 137eb824ed..477d5da2d6 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java @@ -32,6 +32,7 @@ import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -41,6 +42,7 @@ import org.junit.runner.RunWith; */ @RunWith(BMUnitRunner.class) public class GroupingTest extends JMSTestBase { + private static final Logger log = Logger.getLogger(GroupingTest.class); private Queue queue; static boolean pause = false; @@ -149,12 +151,12 @@ public class GroupingTest extends JMSTestBase { public static void pause() { if (pause) { try { - System.out.println("pausing after rollback"); + log.debug("pausing after rollback"); Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } - System.out.println("finished pausing after rollback"); + log.debug("finished pausing after rollback"); } } } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageReplicationTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageReplicationTest.java index 9af81b841b..7c7597198f 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageReplicationTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LargeMessageReplicationTest.java @@ -42,13 +42,14 @@ import org.apache.activemq.artemis.tests.integration.cluster.failover.FailoverTe import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(BMUnitRunner.class) public class LargeMessageReplicationTest extends FailoverTestBase { - + private static final Logger log = Logger.getLogger(LargeMessageReplicationTest.class); private static final String DIVERT_ADDRESS = "jms.queue.testQueue"; private static final String DIVERT_FORWARD_ADDRESS = "jms.queue.divertedQueue"; @@ -184,7 +185,7 @@ public class LargeMessageReplicationTest extends FailoverTestBase { } private static void copyThread() { - System.out.println("_************************ " + Thread.currentThread().getId()); + log.debug("_************************ " + Thread.currentThread().getId()); copyThread.set(Thread.currentThread().getId()); } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java index 52578330a7..d855990015 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java @@ -40,7 +40,7 @@ public class LatencyTest extends ActiveMQTestBase { targetClass = "org.jboss.netty.bootstrap.ClientBootstrap", targetMethod = "connect", targetLocation = "ENTRY", - action = "System.out.println(\"netty connecting\")"), @BMRule( + action = "log.debug(\"netty connecting\")"), @BMRule( name = "sleep OioWorker.run", targetClass = "org.jboss.netty.channel.socket.oio.OioWorker", targetMethod = "run", diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LoggingActiveMQServerPluginOpenWireTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LoggingActiveMQServerPluginOpenWireTest.java index b71b0dfd73..a7ffc4c7ca 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LoggingActiveMQServerPluginOpenWireTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LoggingActiveMQServerPluginOpenWireTest.java @@ -26,6 +26,7 @@ import org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServer import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Test; import org.junit.runner.RunWith; @@ -39,6 +40,7 @@ import org.junit.runner.RunWith; */ @RunWith(BMUnitRunner.class) public class LoggingActiveMQServerPluginOpenWireTest extends LoggingActiveMQServerPluginTest { + private static final Logger log = Logger.getLogger(LoggingActiveMQServerPluginOpenWireTest.class); /** * Aim: test queue creation are logged when plugin configured with @@ -157,8 +159,8 @@ public class LoggingActiveMQServerPluginOpenWireTest extends LoggingActiveMQServ Thread.sleep(500); - for (String log : unexpectedLogs) { - System.out.println(" others events logged >>>>" + log); + for (String logline : unexpectedLogs) { + log.debug(" others events logged >>>>" + logline); } assertEquals("created connections", 2, createdConnectionLogs.size()); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ManagementExceptionHandlingTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ManagementExceptionHandlingTest.java index fe1d9d3652..3712f459d2 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ManagementExceptionHandlingTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ManagementExceptionHandlingTest.java @@ -30,6 +30,7 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -37,6 +38,7 @@ import org.junit.runner.RunWith; @RunWith(BMUnitRunner.class) public class ManagementExceptionHandlingTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(ManagementExceptionHandlingTest.class); protected ActiveMQServer server = null; @@ -89,7 +91,7 @@ public class ManagementExceptionHandlingTest extends ActiveMQTestBase { public void testAddressControl() throws Exception { server.getActiveMQServerControl().createAddress("test.address", "ANYCAST"); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); - System.out.println("server is " + mbs); + log.debug("server is " + mbs); ObjectName objectName = new ObjectName("org.apache.activemq.artemis:broker=\"localhost\",component=addresses,address=\"test.address\""); Object[] params = new Object[] {new HashMap(), 3, "aGVsbG8=", true, null, null}; String[] signature = new String[] {"java.util.Map", "int", "java.lang.String", "boolean", "java.lang.String", "java.lang.String"}; diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java index a162570e22..01b6589e6b 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java @@ -109,7 +109,7 @@ public class OrphanedConsumerTest extends ActiveMQTestBase { targetMethod = "close", targetLocation = "AT EXIT", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", - action = "System.out.println(\"throwing stuff\");throw new InterruptedException()"), @BMRule( + action = "log.debug(\"throwing stuff\");throw new InterruptedException()"), @BMRule( name = "closeEnter", targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl", targetMethod = "close", @@ -136,7 +136,7 @@ public class OrphanedConsumerTest extends ActiveMQTestBase { targetMethod = "close", targetLocation = "AT EXIT", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", - action = "System.out.println(\"throwing stuff\");throw new InterruptedException()"), @BMRule( + action = "log.debug(\"throwing stuff\");throw new InterruptedException()"), @BMRule( name = "closeEnter", targetClass = "org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl", targetMethod = "close", diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java index 834b88a941..da3294d414 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java @@ -39,6 +39,7 @@ import org.apache.activemq.artemis.tests.util.Wait; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -46,6 +47,7 @@ import org.junit.runner.RunWith; @RunWith(BMUnitRunner.class) public class PagingLeakTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(PagingLeakTest.class); private static final AtomicInteger pagePosInstances = new AtomicInteger(0); @@ -76,7 +78,7 @@ public class PagingLeakTest extends ActiveMQTestBase { targetLocation = "ENTRY", action = "org.apache.activemq.artemis.tests.extras.byteman.PagingLeakTest.deletePosition()")}) public void testValidateLeak() throws Throwable { - System.out.println("location::" + getBindingsDir()); + log.debug("location::" + getBindingsDir()); List positions = new ArrayList<>(); @@ -166,7 +168,7 @@ public class PagingLeakTest extends ActiveMQTestBase { } if (i % 1000 == 0) { - System.out.println("Consumed " + i + " events in " + (System.currentTimeMillis() - lastTime)); + log.debug("Consumed " + i + " events in " + (System.currentTimeMillis() - lastTime)); lastTime = System.currentTimeMillis(); } } @@ -194,7 +196,7 @@ public class PagingLeakTest extends ActiveMQTestBase { producer.send(msg); if (i == 100) { - System.out.println("Starting consumers!!!"); + log.debug("Starting consumers!!!"); consumer1.start(); consumer2.start(); } @@ -205,7 +207,7 @@ public class PagingLeakTest extends ActiveMQTestBase { } - System.out.println("Sent " + numberOfMessages); + log.debug("Sent " + numberOfMessages); consumer1.join(); consumer2.join(); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java index 3888a3efea..3d3dc71feb 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplication2Test.java @@ -41,6 +41,7 @@ import org.apache.activemq.artemis.utils.ReusableLatch; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -53,6 +54,7 @@ import org.junit.runner.RunWith; */ @RunWith(BMUnitRunner.class) public class RaceOnSyncLargeMessageOverReplication2Test extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(RaceOnSyncLargeMessageOverReplication2Test.class); public static int messageChunkCount = 0; @@ -84,7 +86,7 @@ public class RaceOnSyncLargeMessageOverReplication2Test extends ActiveMQTestBase public void setUp() throws Exception { super.setUp(); - System.out.println("Tmp::" + getTemporaryDir()); + log.debug("Tmp::" + getTemporaryDir()); flagChunkEntered.setCount(1); flagChunkWait.setCount(1); @@ -211,7 +213,7 @@ public class RaceOnSyncLargeMessageOverReplication2Test extends ActiveMQTestBase t.join(5000); - System.out.println("Thread joined"); + log.debug("Thread joined"); Assert.assertFalse(t.isAlive()); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java index 162c4d1898..e5d60b30cb 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/RaceOnSyncLargeMessageOverReplicationTest.java @@ -40,6 +40,7 @@ import org.apache.activemq.artemis.utils.ReusableLatch; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -51,6 +52,7 @@ import org.junit.runner.RunWith; */ @RunWith(BMUnitRunner.class) public class RaceOnSyncLargeMessageOverReplicationTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(RaceOnSyncLargeMessageOverReplicationTest.class); private static ActiveMQServer backupServer; private static ActiveMQServer liveServer; @@ -75,7 +77,7 @@ public class RaceOnSyncLargeMessageOverReplicationTest extends ActiveMQTestBase public void setUp() throws Exception { super.setUp(); - System.out.println("Tmp::" + getTemporaryDir()); + log.debug("Tmp::" + getTemporaryDir()); flagArrived.setCount(1); flagWait.setCount(1); @@ -196,7 +198,7 @@ public class RaceOnSyncLargeMessageOverReplicationTest extends ActiveMQTestBase t.join(5000); - System.out.println("Thread joined"); + log.debug("Thread joined"); Assert.assertFalse(t.isAlive()); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ScaleDownFailoverTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ScaleDownFailoverTest.java index 20b9aab6c3..4ccb6f9310 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ScaleDownFailoverTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/ScaleDownFailoverTest.java @@ -26,6 +26,7 @@ import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancing import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -33,6 +34,7 @@ import org.junit.runner.RunWith; @RunWith(BMUnitRunner.class) public class ScaleDownFailoverTest extends ClusterTestBase { + private static final Logger log = Logger.getLogger(ScaleDownFailoverTest.class); protected static int stopCount = 0; private static ActiveMQServer[] staticServers; @@ -159,7 +161,7 @@ public class ScaleDownFailoverTest extends ClusterTestBase { if (transportConfiguration.getParams().get(TransportConstants.PORT_PROP_NAME).equals(tc.getParams().get(TransportConstants.PORT_PROP_NAME))) { activeMQServer.stop(); stopCount++; - System.out.println("Stopping server listening at: " + tc.getParams().get(TransportConstants.PORT_PROP_NAME)); + log.debug("Stopping server listening at: " + tc.getParams().get(TransportConstants.PORT_PROP_NAME)); } } } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java index 03f3e19140..995e7abf96 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java @@ -31,6 +31,7 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Test; import org.junit.runner.RunWith; @@ -39,6 +40,7 @@ import org.junit.runner.RunWith; */ @RunWith(BMUnitRunner.class) public class StartStopDeadlockTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(StartStopDeadlockTest.class); /* * simple test to make sure connect still works with some network latency built into netty @@ -52,7 +54,7 @@ public class StartStopDeadlockTest extends ActiveMQTestBase { targetMethod = "initialisePart2", targetLocation = "ENTRY", condition = "incrementCounter(\"server-Init\") == 2", - action = "System.out.println(\"server backup init\"), waitFor(\"start-init\")"), @BMRule( + action = "log.debug(\"server backup init\"), waitFor(\"start-init\")"), @BMRule( name = "JMSServer.stop wait-init", targetClass = "org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl", targetMethod = "stop", @@ -91,7 +93,7 @@ public class StartStopDeadlockTest extends ActiveMQTestBase { try { align.countDown(); startLatch.await(); - System.out.println("Crashing...."); + log.debug("Crashing...."); serverLive.fail(true); } catch (Exception e) { errors.incrementAndGet(); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/critical/analyzer/FileSystemSyncBlockedTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/critical/analyzer/FileSystemSyncBlockedTest.java index 5506da68e6..c717f9fd54 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/critical/analyzer/FileSystemSyncBlockedTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/critical/analyzer/FileSystemSyncBlockedTest.java @@ -24,12 +24,14 @@ import javax.jms.Session; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(BMUnitRunner.class) public class FileSystemSyncBlockedTest extends CriticalAnalyzerFaultInjectionTestBase { + private static final Logger log = Logger.getLogger(FileSystemSyncBlockedTest.class); @BMRules(rules = {@BMRule(name = "Simulate Slow Disk Sync", targetClass = "org.apache.activemq.artemis.core.io.nio.NIOSequentialFile", targetMethod = "sync", targetLocation = "ENTRY", condition = "!flagged(\"testSlowDiskSync\")", // Once the server shutdowns we stop applying this rule. action = "waitFor(\"testSlowDiskSync\")"), @BMRule( @@ -57,7 +59,7 @@ public class FileSystemSyncBlockedTest extends CriticalAnalyzerFaultInjectionTes // if you have more than 100 components, then you have a leak! Assert.assertTrue(server.getStorageManager().getJournalSequentialFileFactory().getCriticalAnalyzer().getNumberOfComponents() < 10); - System.out.println("Number of components:" + server.getStorageManager().getJournalSequentialFileFactory().getCriticalAnalyzer().getNumberOfComponents()); + log.debug("Number of components:" + server.getStorageManager().getJournalSequentialFileFactory().getCriticalAnalyzer().getNumberOfComponents()); } } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java index 6b02791ff5..9721f4566c 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java @@ -58,7 +58,6 @@ import org.apache.activemq.artemis.jms.client.ActiveMQDestination; import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQMessage; import org.apache.activemq.artemis.jms.client.ActiveMQXAConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.After; import org.junit.Assert; @@ -66,8 +65,6 @@ import org.junit.Before; public abstract class BridgeTestBase extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected ConnectionFactoryFactory cff0, cff1; protected ConnectionFactoryFactory cff0xa, cff1xa; @@ -396,8 +393,6 @@ public abstract class BridgeTestBase extends ActiveMQTestBase { // but you still might get some depending on how/where the crash occurred } - BridgeTestBase.log.trace("Check complete"); - } finally { if (conn != null) { conn.close(); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/FailingTransactionManager.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/FailingTransactionManager.java index e124b06fff..5e96101d01 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/FailingTransactionManager.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/FailingTransactionManager.java @@ -31,12 +31,9 @@ import javax.transaction.SystemException; import javax.transaction.Transaction; import javax.transaction.TransactionManager; import javax.transaction.xa.XAResource; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; public class FailingTransactionManager implements TransactionManager { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private final TransactionManager tm; private int calls; private final int limit; @@ -126,7 +123,6 @@ public class FailingTransactionManager implements TransactionManager { } else { int fails = failures.incrementAndGet(); RollbackException ex = new RollbackException("Expected rollback for test"); - log.tracef(ex, "We are about to fail commit for %s th time", fails); throw ex; } } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeClusteredTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeClusteredTest.java index fc8b166178..d13f7b7ee2 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeClusteredTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeClusteredTest.java @@ -24,6 +24,7 @@ import org.apache.activemq.artemis.jms.bridge.ConnectionFactoryFactory; 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.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; @@ -33,6 +34,7 @@ import org.junit.Test; * Tests of jms bridge using HA connection factories. */ public class JMSBridgeClusteredTest extends ClusteredBridgeTestBase { + private static final Logger log = Logger.getLogger(JMSBridgeClusteredTest.class); private ServerGroup sourceServer; private ServerGroup targetServer; @@ -103,7 +105,7 @@ public class JMSBridgeClusteredTest extends ClusteredBridgeTestBase { //start the bridge bridge.start(); - System.out.println("started bridge"); + log.debug("started bridge"); final int NUM_MESSAGES = batchSize / 2; diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeReconnectionTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeReconnectionTest.java index 4d101cc808..72f9475a35 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeReconnectionTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeReconnectionTest.java @@ -32,20 +32,16 @@ import org.apache.activemq.artemis.jms.bridge.ConnectionFactoryFactory; import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode; import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl; import org.apache.activemq.artemis.jms.client.ActiveMQXAConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.ra.DummyTransactionManager; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class JMSBridgeReconnectionTest extends BridgeTestBase { + private static final Logger log = Logger.getLogger(JMSBridgeReconnectionTest.class); - /** - * - */ private static final int TIME_WAIT = 5000; - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Crash and reconnect // Once and only once @@ -185,17 +181,17 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase { // Now crash the dest server - JMSBridgeReconnectionTest.log.info("About to crash server"); + instanceLog.debug("About to crash server"); server1.stop(); // Wait a while before starting up to simulate the dest being down for a while - JMSBridgeReconnectionTest.log.info("Waiting 5 secs before bringing server back up"); + instanceLog.debug("Waiting 5 secs before bringing server back up"); Thread.sleep(TIME_WAIT); - JMSBridgeReconnectionTest.log.info("Done wait"); + instanceLog.debug("Done wait"); // Restart the server - JMSBridgeReconnectionTest.log.info("Restarting server"); + instanceLog.debug("Restarting server"); server1.start(); // jmsServer1.createQueue(false, "targetQueue", null, true, "queue/targetQueue"); @@ -206,17 +202,17 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase { // Send some more messages - JMSBridgeReconnectionTest.log.info("Sending more messages"); + instanceLog.debug("Sending more messages"); sendMessages(cf0, sourceQueue, NUM_MESSAGES / 2, NUM_MESSAGES / 2, persistent, largeMessage); - JMSBridgeReconnectionTest.log.info("Sent messages"); + instanceLog.debug("Sent messages"); server1.stop(); bridge.stop(); - System.out.println("JMSBridgeReconnectionTest.performCrashAndReconnectDestBasic"); + log.debug("JMSBridgeReconnectionTest.performCrashAndReconnectDestBasic"); } @Test @@ -246,14 +242,14 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase { checkAllMessageReceivedInOrder(cf1, targetQueue, 0, 1, false); - JMSBridgeReconnectionTest.log.info("About to crash server"); + instanceLog.debug("About to crash server"); server1.stop(); // Wait a while before starting up to simulate the dest being down for a while - JMSBridgeReconnectionTest.log.info("Waiting 5 secs before bringing server back up"); + instanceLog.debug("Waiting 5 secs before bringing server back up"); Thread.sleep(TIME_WAIT); - JMSBridgeReconnectionTest.log.info("Done wait"); + instanceLog.debug("Done wait"); bridge.stop(); @@ -301,7 +297,7 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase { // Now crash the dest server - JMSBridgeReconnectionTest.log.info("About to crash server"); + instanceLog.debug("About to crash server"); server1.stop(); @@ -309,9 +305,9 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase { server1.start(); } // Wait a while before starting up to simulate the dest being down for a while - JMSBridgeReconnectionTest.log.info("Waiting 5 secs before bringing server back up"); + instanceLog.debug("Waiting 5 secs before bringing server back up"); Thread.sleep(TIME_WAIT); - JMSBridgeReconnectionTest.log.info("Done wait"); + instanceLog.debug("Done wait"); bridge.stop(); @@ -394,14 +390,14 @@ public class JMSBridgeReconnectionTest extends BridgeTestBase { // Now crash the dest server - JMSBridgeReconnectionTest.log.info("About to crash server"); + instanceLog.debug("About to crash server"); server1.stop(); // Wait a while before starting up to simulate the dest being down for a while - JMSBridgeReconnectionTest.log.info("Waiting 5 secs before bringing server back up"); + instanceLog.debug("Waiting 5 secs before bringing server back up"); Thread.sleep(TIME_WAIT); - JMSBridgeReconnectionTest.log.info("Done wait"); + instanceLog.debug("Done wait"); // Restart the server server1.start(); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeTest.java index af1f0fb714..e42a8d7841 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/JMSBridgeTest.java @@ -49,9 +49,9 @@ import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl; import org.apache.activemq.artemis.jms.client.ActiveMQMessage; import org.apache.activemq.artemis.jms.client.ActiveMQXAConnectionFactory; import org.apache.activemq.artemis.service.extensions.ServiceUtils; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.ra.DummyTransactionManager; import org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -59,7 +59,7 @@ import org.junit.rules.Timeout; public class JMSBridgeTest extends BridgeTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(JMSBridgeTest.class); @Rule public Timeout timeout = new Timeout(120000); @@ -390,7 +390,7 @@ public class JMSBridgeTest extends BridgeTestBase { } finally { if (bridge != null) { - JMSBridgeTest.log.info("Stopping bridge"); + instanceLog.debug("Stopping bridge"); bridge.stop(); } } @@ -815,7 +815,7 @@ public class JMSBridgeTest extends BridgeTestBase { try { started.rollback(); } catch (Exception e) { - JMSBridgeTest.log.error("Failed to rollback", e); + log.error("Failed to rollback", e); } } @@ -823,7 +823,7 @@ public class JMSBridgeTest extends BridgeTestBase { try { mgr.resume(toResume); } catch (Exception e) { - JMSBridgeTest.log.error("Failed to resume", e); + log.error("Failed to resume", e); } } if (bridge != null) { @@ -972,7 +972,7 @@ public class JMSBridgeTest extends BridgeTestBase { connTarget = cf1.createConnection(); - JMSBridgeTest.log.trace("Sending " + NUM_MESSAGES + " messages"); + log.trace("Sending " + NUM_MESSAGES + " messages"); List ids1 = new ArrayList<>(); @@ -1007,7 +1007,7 @@ public class JMSBridgeTest extends BridgeTestBase { ids1.add(tm.getJMSMessageID()); } - JMSBridgeTest.log.trace("Sent the first messages"); + log.trace("Sent the first messages"); Session sessTarget = connTarget.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -1146,7 +1146,7 @@ public class JMSBridgeTest extends BridgeTestBase { connTarget = cf1.createConnection(); - JMSBridgeTest.log.trace("Sending " + NUM_MESSAGES + " messages"); + log.trace("Sending " + NUM_MESSAGES + " messages"); Session sessSource = connSource.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -1293,7 +1293,7 @@ public class JMSBridgeTest extends BridgeTestBase { connTarget = cf1.createConnection(); - JMSBridgeTest.log.trace("Sending " + NUM_MESSAGES + " messages"); + log.trace("Sending " + NUM_MESSAGES + " messages"); Session sessSource = connSource.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -1375,13 +1375,13 @@ public class JMSBridgeTest extends BridgeTestBase { // Now crash the dest server - JMSBridgeTest.log.info("About to crash server"); + instanceLog.debug("About to crash server"); server1.stop(); // Now stop the bridge while the failover is happening - JMSBridgeTest.log.info("About to stop the bridge"); + instanceLog.debug("About to stop the bridge"); bridge.stop(); @@ -1450,7 +1450,7 @@ public class JMSBridgeTest extends BridgeTestBase { try { connSource.close(); } catch (Exception e) { - JMSBridgeTest.log.error("Failed to close connection", e); + log.error("Failed to close connection", e); } } @@ -1518,7 +1518,7 @@ public class JMSBridgeTest extends BridgeTestBase { try { connSource.close(); } catch (Exception e) { - JMSBridgeTest.log.error("Failed to close connection", e); + log.error("Failed to close connection", e); } } @@ -1584,7 +1584,7 @@ public class JMSBridgeTest extends BridgeTestBase { try { connSource.close(); } catch (Exception e) { - JMSBridgeTest.log.error("Failed to close connection", e); + log.error("Failed to close connection", e); } } @@ -1644,7 +1644,7 @@ public class JMSBridgeTest extends BridgeTestBase { checkAllMessageReceivedInOrder(cf1, targetQueue, 0, NUM_MESSAGES - 1, false); } finally { if (bridge != null) { - JMSBridgeTest.log.info("Stopping bridge"); + instanceLog.debug("Stopping bridge"); bridge.stop(); } } @@ -1831,7 +1831,7 @@ public class JMSBridgeTest extends BridgeTestBase { final List sentMessages = new ArrayList<>(); final List receivedMessages = new ArrayList<>(); - log.info("Starting bridge " + bridge); + instanceLog.debug("Starting bridge " + bridge); bridge.start(); waitForComponent(bridge, 15); @@ -1850,7 +1850,7 @@ public class JMSBridgeTest extends BridgeTestBase { msg.setIntProperty("count", counter); producer.send(msg); sentMessages.add(msg); - log.info("Sent message with property counter: " + counter + ", messageId:" + msg.getJMSMessageID() + instanceLog.debug("Sent message with property counter: " + counter + ", messageId:" + msg.getJMSMessageID() + ((msg.getStringProperty("_AMQ_DUPL_ID") != null) ? ", _AMQ_DUPL_ID=" + msg.getStringProperty("_AMQ_DUPL_ID") : "")); counter++; Thread.sleep(200); @@ -1892,7 +1892,7 @@ public class JMSBridgeTest extends BridgeTestBase { if (msg != null) { msg.acknowledge(); receivedMessages.add(msg); - log.info("Received message with messageId: " + msg.getJMSMessageID() + + instanceLog.debug("Received message with messageId: " + msg.getJMSMessageID() + " and property counter " + msg.getIntProperty("count")); } else { running = false; @@ -1916,16 +1916,16 @@ public class JMSBridgeTest extends BridgeTestBase { } }); - log.info("Starting producer thread..."); + instanceLog.debug("Starting producer thread..."); producerThread.start(); Assert.assertTrue(waitForMessages(server1, targetQueue.getQueueName(), NUM_MESSAGES / 100, 250000)); - log.info("Stopping bridge " + bridge); + instanceLog.debug("Stopping bridge " + bridge); bridge.stop(); Thread.sleep(5000); - log.info("Starting bridge " + bridge + " again"); + instanceLog.debug("Starting bridge " + bridge + " again"); bridge.start(); waitForComponent(bridge, 15); @@ -1933,13 +1933,13 @@ public class JMSBridgeTest extends BridgeTestBase { - log.info("Starting consumer thread..."); + instanceLog.debug("Starting consumer thread..."); consumerThread.start(); - log.info("Waiting for the consumer thread to die..."); + instanceLog.debug("Waiting for the consumer thread to die..."); consumerThread.join(); - log.info("Waiting for the producer thread to die..."); + instanceLog.debug("Waiting for the producer thread to die..."); producerThread.join(); bridge.stop(); @@ -1977,7 +1977,7 @@ public class JMSBridgeTest extends BridgeTestBase { } } } - log.info("Number of messages in queue " + queueName + " on server: " + server + " is: " + count); + log.debug("Number of messages in queue " + queueName + " on server: " + server + " is: " + count); return count; } @@ -1987,7 +1987,7 @@ public class JMSBridgeTest extends BridgeTestBase { long count = 0; while ((count = countMessagesInQueue(server, queueName)) < numberOfMessages) { - log.info("Total number of messages in queue: " + queueName + " on server " + server + " is " + count); + log.debug("Total number of messages in queue: " + queueName + " on server " + server + " is " + count); Thread.sleep(5000); if (System.currentTimeMillis() - startTime > timeout) { log.warn(numberOfMessages + " not on server " + server + " in timeout " + timeout + "ms."); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java index a4b9db0175..66607fd804 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java @@ -58,6 +58,7 @@ import org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.tests.integration.ra.ActiveMQRATestBase; import org.apache.activemq.artemis.utils.RandomUtil; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -67,6 +68,7 @@ import org.junit.Test; * Simulates several messages being received over multiple instances with reconnects during the process. */ public class MDBMultipleHandlersServerDisconnectTest extends ActiveMQRATestBase { + private static final Logger log = Logger.getLogger(MDBMultipleHandlersServerDisconnectTest.class); final ConcurrentHashMap mapCounter = new ConcurrentHashMap<>(); @@ -228,7 +230,7 @@ public class MDBMultipleHandlersServerDisconnectTest extends ActiveMQRATestBase if (playServerClosingSession && serverSessions.size() > 0) { int randomBother = RandomUtil.randomInterval(0, serverSessions.size() - 1); - System.out.println("bugging session " + randomBother); + log.debug("bugging session " + randomBother); ServerSession serverSession = serverSessions.get(randomBother); @@ -278,19 +280,19 @@ public class MDBMultipleHandlersServerDisconnectTest extends ActiveMQRATestBase } if (i == NUMBER_OF_MESSAGES * 0.90) { - System.out.println("Disabled failures at " + i); + log.debug("Disabled failures at " + i); playTXTimeouts = false; playServerClosingSession = false; playServerClosingConsumer = false; } - System.out.println("Received " + i + " messages"); + log.debug("Received " + i + " messages"); doReceiveMessage(message); if (i % 200 == 0) { - System.out.println("received " + i); + log.debug("received " + i); session.commit(); } } @@ -303,7 +305,7 @@ public class MDBMultipleHandlersServerDisconnectTest extends ActiveMQRATestBase break; } - System.out.println("Received extra message " + message); + log.debug("Received extra message " + message); doReceiveMessage(message); } @@ -338,15 +340,12 @@ public class MDBMultipleHandlersServerDisconnectTest extends ActiveMQRATestBase session.close(); if (failed) { - for (int i = 0; i < 10; i++) { - System.out.println("----------------------------------------------------"); - } - System.out.println(writer.toString()); + log.debug(writer.toString()); } Assert.assertFalse(writer.toString(), failed); - System.out.println("Received " + NUMBER_OF_MESSAGES + " messages"); + log.debug("Received " + NUMBER_OF_MESSAGES + " messages"); Assert.assertFalse("There was meta-data failures, some sessions didn't reconnect properly", metaDataFailed.get()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java index 5a8c23e2dc..75bfc7986c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/DuplicateDetectionTest.java @@ -40,13 +40,14 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.transaction.impl.XidImpl; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.UUIDGenerator; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class DuplicateDetectionTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private final Logger log = Logger.getLogger(this.getClass()); private ActiveMQServer server; @@ -390,7 +391,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { Assert.assertEquals(i, message.getObjectProperty(propKey)); } - DuplicateDetectionTest.log.info("Now sending more"); + log.debug("Now sending more"); for (int i = 0; i < cacheSize; i++) { SimpleString dupID = new SimpleString("dupID" + i); @@ -785,13 +786,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - DuplicateDetectionTest.log.info("ending session"); + log.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - DuplicateDetectionTest.log.info("preparing session"); + log.debug("preparing session"); session.prepare(xid3); - DuplicateDetectionTest.log.info("committing session"); + log.debug("committing session"); session.commit(xid3, false); } @@ -856,13 +857,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - DuplicateDetectionTest.log.info("ending session"); + log.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - DuplicateDetectionTest.log.info("preparing session"); + log.debug("preparing session"); session.prepare(xid3); - DuplicateDetectionTest.log.info("committing session"); + log.debug("committing session"); session.commit(xid3, false); } @@ -926,13 +927,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - DuplicateDetectionTest.log.info("ending session"); + log.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - DuplicateDetectionTest.log.info("preparing session"); + log.debug("preparing session"); session.prepare(xid3); - DuplicateDetectionTest.log.info("committing session"); + log.debug("committing session"); session.commit(xid3, false); } @@ -1143,13 +1144,13 @@ public class DuplicateDetectionTest extends ActiveMQTestBase { message = consumer.receiveImmediate(); Assert.assertNull(message); - DuplicateDetectionTest.log.info("ending session"); + log.debug("ending session"); session.end(xid3, XAResource.TMSUCCESS); - DuplicateDetectionTest.log.info("preparing session"); + log.debug("preparing session"); session.prepare(xid3); - DuplicateDetectionTest.log.info("committing session"); + log.debug("committing session"); session.commit(xid3, false); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/IntegrationTestLogger.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/IntegrationTestLogger.java deleted file mode 100644 index 80bd4d9187..0000000000 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/IntegrationTestLogger.java +++ /dev/null @@ -1,30 +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.integration; - -import org.jboss.logging.BasicLogger; -import org.jboss.logging.Logger; -import org.jboss.logging.annotations.MessageLogger; - -@MessageLogger(projectCode = "AMQTEST") -public interface IntegrationTestLogger extends BasicLogger { - - /** - * The integration test logger. - */ - IntegrationTestLogger LOGGER = Logger.getMessageLogger(IntegrationTestLogger.class, IntegrationTestLogger.class.getPackage().getName()); -} diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleNotificationService.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleNotificationService.java index 2e94aa5920..ed03adb2f0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleNotificationService.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleNotificationService.java @@ -74,7 +74,6 @@ public class SimpleNotificationService implements NotificationService { @Override public void onNotification(final Notification notification) { - System.out.println(">>>>>>>>" + notification); notifications.add(notification); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AnycastTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AnycastTest.java index 89246a586a..ecefc2436f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AnycastTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AnycastTest.java @@ -98,7 +98,7 @@ public class AnycastTest extends ActiveMQTestBase { for (int j = 0; j < num / 2; j++) { ClientMessage m = consumers[i].receive(2000); assertNotNull(m); - System.out.println("consumer" + i + " received: " + m.getBodyBuffer().readString()); + instanceLog.debug("consumer" + i + " received: " + m.getBodyBuffer().readString()); } assertNull(consumers[i].receive(200)); @@ -157,7 +157,7 @@ public class AnycastTest extends ActiveMQTestBase { for (int j = 0; j < num / 2; j++) { ClientMessage m = consumers[i].receive(2000); assertNotNull(m); - System.out.println("consumer" + i + " received: " + m.getBodyBuffer().readString()); + instanceLog.debug("consumer" + i + " received: " + m.getBodyBuffer().readString()); } assertNull(consumers[i].receive(200)); @@ -173,7 +173,7 @@ public class AnycastTest extends ActiveMQTestBase { for (int j = 0; j < num / 2; j++) { ClientMessage m = consumers[i].receive(2000); assertNotNull(m); - System.out.println("consumer" + i + " received: " + m.getBodyBuffer().readString()); + instanceLog.debug("consumer" + i + " received: " + m.getBodyBuffer().readString()); } assertNull(consumers[i].receive(200)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/MulticastTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/MulticastTest.java index e5e5187f9e..0c6a953bc2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/MulticastTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/MulticastTest.java @@ -98,7 +98,7 @@ public class MulticastTest extends ActiveMQTestBase { for (int j = 0; j < num; j++) { ClientMessage m = consumers[i].receive(2000); assertNotNull(m); - System.out.println("consumer" + i + " received: " + m.getBodyBuffer().readString()); + instanceLog.debug("consumer" + i + " received: " + m.getBodyBuffer().readString()); } assertNull(consumers[i].receive(200)); @@ -157,7 +157,7 @@ public class MulticastTest extends ActiveMQTestBase { for (int j = 0; j < num; j++) { ClientMessage m = consumers[i].receive(2000); assertNotNull(m); - System.out.println("consumer" + i + " received: " + m.getBodyBuffer().readString()); + instanceLog.debug("consumer" + i + " received: " + m.getBodyBuffer().readString()); } assertNull(consumers[i].receive(200)); @@ -173,7 +173,7 @@ public class MulticastTest extends ActiveMQTestBase { for (int j = 0; j < num; j++) { ClientMessage m = consumers[i].receive(2000); assertNotNull(m); - System.out.println("consumer" + i + " received: " + m.getBodyBuffer().readString()); + instanceLog.debug("consumer" + i + " received: " + m.getBodyBuffer().readString()); } assertNull(consumers[i].receive(200)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java index a95c9084a9..a14fd921d9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDLQReceiverTest.java @@ -45,23 +45,23 @@ public class AmqpDLQReceiverTest extends AmqpClientTestSupport { assertNotNull(queue); receiver.flow(100); for (int i = 0; i < 10; i++) { - System.out.println("i = " + i); + instanceLog.debug("i = " + i); AmqpMessage receive = receiver.receive(5000, TimeUnit.MILLISECONDS); receive.modified(true, false); Queue queueView = getProxyToQueue(getQueueName()); - System.out.println("receive = " + receive.getWrappedMessage().getDeliveryCount()); - System.out.println("queueView.getMessageCount() = " + queueView.getMessageCount()); - System.out.println("queueView.getDeliveringCount() = " + queueView.getDeliveringCount()); - System.out.println("queueView.getPersistentSize() = " + queueView.getPersistentSize()); + instanceLog.debug("receive = " + receive.getWrappedMessage().getDeliveryCount()); + instanceLog.debug("queueView.getMessageCount() = " + queueView.getMessageCount()); + instanceLog.debug("queueView.getDeliveringCount() = " + queueView.getDeliveringCount()); + instanceLog.debug("queueView.getPersistentSize() = " + queueView.getPersistentSize()); } receiver.close(); connection.close(); Thread.sleep(5000); Queue queueView = getProxyToQueue(getQueueName()); - System.out.println("queueView.getMessageCount() = " + queueView.getMessageCount()); - System.out.println("queueView.getDeliveringCount() = " + queueView.getDeliveringCount()); - System.out.println("queueView.getPersistentSize() = " + queueView.getPersistentSize()); + instanceLog.debug("queueView.getMessageCount() = " + queueView.getMessageCount()); + instanceLog.debug("queueView.getDeliveringCount() = " + queueView.getDeliveringCount()); + instanceLog.debug("queueView.getPersistentSize() = " + queueView.getPersistentSize()); Assert.assertEquals(0, queueView.getMessageCount()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java index d6593066c7..ed486c4b51 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDurableReceiverTest.java @@ -341,7 +341,7 @@ public class AmqpDurableReceiverTest extends AmqpClientTestSupport { session.lookupSubscription(getSubscriptionName()); fail("Should throw an exception since there is not subscription"); } catch (Exception e) { - LOG.info("Error on lookup: {}", e.getMessage()); + LOG.debug("Error on lookup: {}", e.getMessage()); } connection.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java index d58ccb38e8..714c113d97 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java @@ -254,7 +254,6 @@ public class AmqpFlowControlTest extends JMSClientTestSupport { try { for (int i = 0; i < maxMessages; i++) { sender.send(message); - System.out.println("Sent " + i); sentMessages.getAndIncrement(); } timeout.countDown(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java index 95c99f1da6..dfdf7f56d5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java @@ -184,7 +184,7 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport { Bindings bindings = server.getPostOffice().getBindingsForAddress(multicastAddress); for (Binding b : bindings.getBindings()) { - System.out.println("checking binidng " + b.getUniqueName() + " " + ((LocalQueueBinding)b).getQueue().getDeliveringMessages()); + instanceLog.debug("checking binidng " + b.getUniqueName() + " " + ((LocalQueueBinding)b).getQueue().getDeliveringMessages()); SimpleString qName = b.getUniqueName(); //do FQQN query QueueQueryResult result = server.queueQuery(CompositeAddress.toFullyQualified(multicastAddress, qName)); @@ -266,7 +266,7 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport { producer3.send(session.createMessage()); assertTrue(Wait.waitFor(() -> server.locateQueue(anycastQ3).getMessageCount() == 5, 2000, 200)); - System.out.println("Queue is: " + q1); + instanceLog.debug("Queue is: " + q1); MessageConsumer consumer1 = session.createConsumer(q1); MessageConsumer consumer2 = session.createConsumer(q2); MessageConsumer consumer3 = session.createConsumer(q3); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java index aca1cdad2c..fef11bff5c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpInboundConnectionTest.java @@ -285,7 +285,7 @@ public class AmqpInboundConnectionTest extends AmqpClientTestSupport { connection2.connect(); fail("Should not be able to connect with same container Id."); } catch (Exception ex) { - LOG.info("Second connection with same container Id failed as expected."); + LOG.debug("Second connection with same container Id failed as expected."); } connection2.getStateInspector().assertValid(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java index 304ce7cdd2..cc94067d8d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpLargeMessageTest.java @@ -236,7 +236,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { if (wrapped.getBody() instanceof Data) { // converters can change this to AmqValue Data data = (Data) wrapped.getBody(); - System.out.println("received : message: " + data.getValue().getLength()); + instanceLog.debug("received : message: " + data.getValue().getLength()); assertEquals(PAYLOAD, data.getValue().getLength()); } message.accept(); @@ -290,7 +290,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { MessageImpl wrapped = (MessageImpl) message.getWrappedMessage(); if (wrapped.getBody() instanceof Data) { Data data = (Data) wrapped.getBody(); - System.out.println("received : message: " + data.getValue().getLength()); + instanceLog.debug("received : message: " + data.getValue().getLength()); assertEquals(PAYLOAD, data.getValue().getLength()); } @@ -397,7 +397,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { } public void doTestSendLargeMessage(int expectedSize) throws Exception { - LOG.info("doTestSendLargeMessage called with expectedSize " + expectedSize); + LOG.debug("doTestSendLargeMessage called with expectedSize " + expectedSize); byte[] payload = createLargePayload(expectedSize); assertEquals(expectedSize, payload.length); @@ -417,12 +417,12 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { producer.send(message); long endTime = System.currentTimeMillis(); - LOG.info("Returned from send after {} ms", endTime - startTime); + LOG.debug("Returned from send after {} ms", endTime - startTime); startTime = System.currentTimeMillis(); MessageConsumer consumer = session.createConsumer(queue); connection.start(); - LOG.info("Calling receive"); + LOG.debug("Calling receive"); Message received = consumer.receive(); assertNotNull(received); assertTrue(received instanceof BytesMessage); @@ -430,7 +430,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport { assertNotNull(bytesMessage); endTime = System.currentTimeMillis(); - LOG.info("Returned from receive after {} ms", endTime - startTime); + LOG.debug("Returned from receive after {} ms", endTime - startTime); byte[] bytesReceived = new byte[expectedSize]; assertEquals(expectedSize, bytesMessage.readBytes(bytesReceived, expectedSize)); assertTrue(Arrays.equals(payload, bytesReceived)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java index 7fb9069e31..f28a2866e2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpPresettledReceiverTest.java @@ -66,7 +66,7 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { receiver1.close(); receiver2.close(); - System.out.println("Message Count after all consumed: " + queueView.getMessageCount()); + instanceLog.debug("Message Count after all consumed: " + queueView.getMessageCount()); // Should be nothing left on the Queue AmqpReceiver receiver3 = session.createReceiver(getQueueName()); @@ -74,7 +74,7 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { AmqpMessage received = receiver3.receive(5, TimeUnit.SECONDS); if (received != null) { - System.out.println("Message read: " + received.getMessageId()); + instanceLog.debug("Message read: " + received.getMessageId()); } assertNull(received); @@ -103,14 +103,14 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { } receiver.close(); - System.out.println("Message Count after all consumed: " + queueView.getMessageCount()); + instanceLog.debug("Message Count after all consumed: " + queueView.getMessageCount()); // Open a new receiver and see if any message are left on the Queue receiver = session.createReceiver(getQueueName()); receiver.flow(1); AmqpMessage received = receiver.receive(5, TimeUnit.SECONDS); if (received != null) { - System.out.println("Message read: " + received.getMessageId()); + instanceLog.debug("Message read: " + received.getMessageId()); } assertNull(received); @@ -155,14 +155,14 @@ public class AmqpPresettledReceiverTest extends AmqpClientTestSupport { receiver.close(); - System.out.println("Message Count after all consumed: " + queueView.getMessageCount()); + instanceLog.debug("Message Count after all consumed: " + queueView.getMessageCount()); // Open a new receiver and see if any message are left on the Queue receiver = session.createReceiver(getQueueName()); receiver.flow(1); AmqpMessage received = receiver.receive(5, TimeUnit.SECONDS); if (received != null) { - System.out.println("Message read: " + received.getMessageId()); + instanceLog.debug("Message read: " + received.getMessageId()); } assertNull(received); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java index e16fd46667..90afa19734 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpProtocolHeaderHandlingTest.java @@ -22,7 +22,6 @@ import java.io.OutputStream; import java.net.Socket; import java.util.concurrent.TimeUnit; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.Wait; import org.fusesource.hawtbuf.Buffer; import org.junit.Test; @@ -50,7 +49,6 @@ public class AmqpProtocolHeaderHandlingTest extends AmqpClientTestSupport { AmqpHeader response = connection.readAmqpHeader(); assertNotNull(response); assertEquals(3, response.getProtocolId()); - IntegrationTestLogger.LOGGER.info("Broker responded with: " + response); // pump some bytes down the wire until broker closes the connection assertTrue("Broker should have closed client connection", Wait.waitFor(new Wait.Condition() { @@ -78,7 +76,6 @@ public class AmqpProtocolHeaderHandlingTest extends AmqpClientTestSupport { } public void send(AmqpHeader header) throws Exception { - IntegrationTestLogger.LOGGER.info("Client sending header: " + header); OutputStream outputStream = clientSocket.getOutputStream(); header.getBuffer().writeTo(outputStream); outputStream.flush(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java index 7cffe35111..ee0012f8ee 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDrainTest.java @@ -19,7 +19,6 @@ package org.apache.activemq.artemis.tests.integration.amqp; import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.core.server.Queue; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.transport.amqp.client.AmqpClient; import org.apache.activemq.transport.amqp.client.AmqpConnection; @@ -70,7 +69,7 @@ public class AmqpReceiverDrainTest extends AmqpClientTestSupport { for (int i = 0; i < MSG_COUNT; ++i) { AmqpMessage message = receiver.receive(5, TimeUnit.SECONDS); assertNotNull("Failed to read message: " + (i + 1), message); - IntegrationTestLogger.LOGGER.info("Read message: " + message.getMessageId()); + instanceLog.info("Read message: " + message.getMessageId()); message.accept(); } receiver.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java index 7d11d14b55..fe9e9e0d4e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverTest.java @@ -31,7 +31,6 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.transport.amqp.client.AmqpClient; import org.apache.activemq.transport.amqp.client.AmqpConnection; @@ -365,7 +364,6 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { @Override public void inspectClosedResource(Session session) { - IntegrationTestLogger.LOGGER.info("Session closed: " + session.getContext()); } @Override @@ -375,7 +373,6 @@ public class AmqpReceiverTest extends AmqpClientTestSupport { @Override public void inspectClosedResource(Receiver receiver) { - IntegrationTestLogger.LOGGER.info("Receiver closed: " + receiver.getContext()); closed.set(true); } }); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java index 1e140c70c6..d8a2cf8890 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverWithFiltersTest.java @@ -148,7 +148,7 @@ public class AmqpReceiverWithFiltersTest extends AmqpClientTestSupport { for (int i = 0; i < NUM_MESSAGES / 2; ++i) { AmqpMessage message = receiver.receive(5, TimeUnit.SECONDS); Assert.assertNotNull(message); - System.out.println("Read message: " + message.getApplicationProperty("myNewID")); + instanceLog.debug("Read message: " + message.getApplicationProperty("myNewID")); assertNotNull(message); messages.add(message); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java index c2cee06c9e..911d1fde72 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSecurityTest.java @@ -19,7 +19,6 @@ package org.apache.activemq.artemis.tests.integration.amqp; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.transport.amqp.client.AmqpClient; import org.apache.activemq.transport.amqp.client.AmqpConnection; import org.apache.activemq.transport.amqp.client.AmqpMessage; @@ -119,7 +118,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { session.createSender(getQueueName()); fail("Should not be able to consume here."); } catch (Exception ex) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } connection.getStateInspector().assertValid(); @@ -217,7 +216,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { session.createReceiver(getQueueName()); fail("Should not be able to consume here."); } catch (Exception ex) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } connection.getStateInspector().assertValid(); @@ -254,7 +253,7 @@ public class AmqpSecurityTest extends AmqpClientTestSupport { session.createReceiver(getQueueName(getPrecreatedQueueSize() + 1)); fail("Should not be able to consume here."); } catch (Exception ex) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } connection.getStateInspector().assertValid(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java index d11faad5e3..cb1db9246e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java @@ -371,7 +371,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { sender.send(message); sender.close(); - LOG.info("Attempting to read message with receiver"); + LOG.debug("Attempting to read message with receiver"); AmqpReceiver receiver = session.createReceiver(getQueueName()); receiver.flow(2); AmqpMessage received = receiver.receive(10, TimeUnit.SECONDS); @@ -400,7 +400,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { message.setMessageAnnotation("serialNo", i); message.setText("Test-Message"); - System.out.println("Sending message: " + message.getMessageId()); + instanceLog.debug("Sending message: " + message.getMessageId()); sender.send(message); } @@ -422,7 +422,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { for (int i = 0; i < MSG_COUNT; ++i) { received = receiver2.receive(5, TimeUnit.SECONDS); assertNotNull("Should have got a message", received); - System.out.println("Read message: " + received.getMessageId()); + instanceLog.debug("Read message: " + received.getMessageId()); assertEquals("msg" + i, received.getMessageId()); } @@ -516,7 +516,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { sender.close(); - LOG.info("Attempting to read first two messages with receiver #1"); + LOG.debug("Attempting to read first two messages with receiver #1"); AmqpReceiver receiver1 = session.createReceiver(getQueueName()); receiver1.flow(2); AmqpMessage message1 = receiver1.receive(10, TimeUnit.SECONDS); @@ -528,7 +528,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { message1.accept(); message2.accept(); - LOG.info("Attempting to read next two messages with receiver #2"); + LOG.debug("Attempting to read next two messages with receiver #2"); AmqpReceiver receiver2 = session.createReceiver(getQueueName()); receiver2.flow(2); AmqpMessage message3 = receiver2.receive(10, TimeUnit.SECONDS); @@ -540,7 +540,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { message3.accept(); message4.accept(); - LOG.info("Attempting to read remaining messages with receiver #1"); + LOG.debug("Attempting to read remaining messages with receiver #1"); receiver1.flow(MSG_COUNT - 4); for (int i = 4; i < MSG_COUNT; i++) { AmqpMessage message = receiver1.receive(10, TimeUnit.SECONDS); @@ -603,24 +603,24 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { message3.accept(); message4.accept(); - LOG.info("*** Attempting to read remaining messages with both receivers"); + LOG.debug("*** Attempting to read remaining messages with both receivers"); int splitCredit = (MSG_COUNT - 4) / 2; - LOG.info("**** Receiver #1 granting credit[{}] for its block of messages", splitCredit); + LOG.debug("**** Receiver #1 granting credit[{}] for its block of messages", splitCredit); receiver1.flow(splitCredit); for (int i = 0; i < splitCredit; i++) { AmqpMessage message = receiver1.receive(10, TimeUnit.SECONDS); assertNotNull("Receiver #1 should have read a message", message); - LOG.info("Receiver #1 read message: {}", message.getMessageId()); + LOG.debug("Receiver #1 read message: {}", message.getMessageId()); message.accept(); } - LOG.info("**** Receiver #2 granting credit[{}] for its block of messages", splitCredit); + LOG.debug("**** Receiver #2 granting credit[{}] for its block of messages", splitCredit); receiver2.flow(splitCredit); for (int i = 0; i < splitCredit; i++) { AmqpMessage message = receiver2.receive(10, TimeUnit.SECONDS); assertNotNull("Receiver #2 should have read message[" + i + "]", message); - LOG.info("Receiver #2 read message: {}", message.getMessageId()); + LOG.debug("Receiver #2 read message: {}", message.getMessageId()); message.accept(); } @@ -677,7 +677,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { @Override public void run() { try { - LOG.info("Starting consumer connection"); + LOG.debug("Starting consumer connection"); AmqpConnection connection = addConnection(client.connect()); AmqpSession session = connection.createSession(); AmqpReceiver receiver = session.createReceiver(address); @@ -928,7 +928,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { sender.send(message); } - LOG.info("Attempting to read first two messages with receiver #1"); + LOG.debug("Attempting to read first two messages with receiver #1"); receiver1.flow(2); AmqpMessage message1 = receiver1.receive(10, TimeUnit.SECONDS); AmqpMessage message2 = receiver1.receive(10, TimeUnit.SECONDS); @@ -939,7 +939,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { message1.accept(); message2.accept(); - LOG.info("Attempting to read next two messages with receiver #2"); + LOG.debug("Attempting to read next two messages with receiver #2"); receiver2.flow(2); AmqpMessage message3 = receiver2.receive(10, TimeUnit.SECONDS); AmqpMessage message4 = receiver2.receive(10, TimeUnit.SECONDS); @@ -950,24 +950,24 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { message3.accept(); message4.accept(); - LOG.info("*** Attempting to read remaining messages with both receivers"); + LOG.debug("*** Attempting to read remaining messages with both receivers"); int splitCredit = (MSG_COUNT - 4) / 2; - LOG.info("**** Receiver #1 granting credit[{}] for its block of messages", splitCredit); + LOG.debug("**** Receiver #1 granting credit[{}] for its block of messages", splitCredit); receiver1.flow(splitCredit); for (int i = 0; i < splitCredit; i++) { AmqpMessage message = receiver1.receive(10, TimeUnit.SECONDS); assertNotNull("Receiver #1 should have read a message", message); - LOG.info("Receiver #1 read message: {}", message.getMessageId()); + LOG.debug("Receiver #1 read message: {}", message.getMessageId()); message.accept(); } - LOG.info("**** Receiver #2 granting credit[{}] for its block of messages", splitCredit); + LOG.debug("**** Receiver #2 granting credit[{}] for its block of messages", splitCredit); receiver2.flow(splitCredit); for (int i = 0; i < splitCredit; i++) { AmqpMessage message = receiver2.receive(10, TimeUnit.SECONDS); assertNotNull("Receiver #2 should have read a message[" + i + "]", message); - LOG.info("Receiver #2 read message: {}", message.getMessageId()); + LOG.debug("Receiver #2 read message: {}", message.getMessageId()); message.accept(); } @@ -1153,7 +1153,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { received.accept(); done.countDown(); } catch (Exception ex) { - LOG.info("Caught error: {}", ex.getClass().getSimpleName()); + LOG.debug("Caught error: {}", ex.getClass().getSimpleName()); error.set(true); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java index 09b8025965..ea8e882745 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSenderTest.java @@ -23,7 +23,6 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.artemis.api.core.Message; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.transport.amqp.client.AmqpClient; import org.apache.activemq.transport.amqp.client.AmqpConnection; @@ -129,7 +128,6 @@ public class AmqpSenderTest extends AmqpClientTestSupport { @Override public void inspectDeliveryUpdate(Sender sender, Delivery delivery) { if (delivery.remotelySettled()) { - IntegrationTestLogger.LOGGER.trace("Remote settled message for sender: " + sender.getName()); settled.countDown(); } } @@ -143,9 +141,6 @@ public class AmqpSenderTest extends AmqpClientTestSupport { message.setText("Test-Message: " + i); sender.send(message); - if (i % 1000 == 0) { - IntegrationTestLogger.LOGGER.info("Sent message: " + i); - } } Queue queueView = getProxyToQueue(getQueueName()); @@ -173,9 +168,6 @@ public class AmqpSenderTest extends AmqpClientTestSupport { message.setText("Test-Message: " + i); sender.send(message); - if (i % 1000 == 0) { - IntegrationTestLogger.LOGGER.info("Sent message: " + i); - } } Queue queueView = getProxyToQueue(getQueueName()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java index 0048be55c3..b16eafa6dd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSessionTest.java @@ -16,7 +16,6 @@ */ package org.apache.activemq.artemis.tests.integration.amqp; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.transport.amqp.client.AmqpClient; import org.apache.activemq.transport.amqp.client.AmqpConnection; import org.apache.activemq.transport.amqp.client.AmqpReceiver; @@ -46,7 +45,7 @@ public class AmqpSessionTest extends AmqpClientTestSupport { @Override public void inspectClosedResource(Session session) { - IntegrationTestLogger.LOGGER.info("Session closed: " + session.getContext()); + instanceLog.debug("Session closed: " + session.getContext()); } @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java index 07c81f9848..0f33b4db68 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTempDestinationTest.java @@ -209,7 +209,7 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { // Get the new address String address = sender.getSender().getRemoteTarget().getAddress(); - LOG.info("New dynamic sender address -> {}", address); + LOG.debug("New dynamic sender address -> {}", address); // Create a message and send to a receive that is listening on the newly // created dynamic link address. @@ -258,7 +258,7 @@ public class AmqpTempDestinationTest extends AmqpClientTestSupport { // Get the new address String address = receiver.getReceiver().getRemoteSource().getAddress(); - LOG.info("New dynamic receiver address -> {}", address); + LOG.debug("New dynamic receiver address -> {}", address); // Create a message and send to a receive that is listening on the newly // created dynamic link address. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java index b6e04ec03a..42822a120c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTransactionTest.java @@ -715,7 +715,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { receiver.flow((NUM_MESSAGES + 2) * 2); for (int i = 0; i < NUM_MESSAGES; ++i) { AmqpMessage message = receiver.receive(5, TimeUnit.SECONDS); - System.out.println("Read message: " + message.getApplicationProperty("msgId")); + instanceLog.debug("Read message: " + message.getApplicationProperty("msgId")); assertNotNull(message); messages.add(message); } @@ -723,7 +723,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { // Commit half the consumed messages [0, 1, 2, 3, 4] txnSession.begin(); for (int i = 0; i < NUM_MESSAGES / 2; ++i) { - System.out.println("Commit: Accepting message: " + messages.get(i).getApplicationProperty("msgId")); + instanceLog.debug("Commit: Accepting message: " + messages.get(i).getApplicationProperty("msgId")); messages.get(i).accept(txnSession, false); } txnSession.commit(); @@ -731,7 +731,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { // Rollback the other half the consumed messages [5, 6, 7, 8, 9] txnSession.begin(); for (int i = NUM_MESSAGES / 2; i < NUM_MESSAGES; ++i) { - System.out.println("Rollback: Accepting message: " + messages.get(i).getApplicationProperty("msgId")); + instanceLog.debug("Rollback: Accepting message: " + messages.get(i).getApplicationProperty("msgId")); messages.get(i).accept(txnSession, false); } txnSession.rollback(); @@ -739,7 +739,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { // After rollback messages should still be acquired so we read last sent message [10] { AmqpMessage message = receiver.receive(5, TimeUnit.SECONDS); - System.out.println("Read message: " + message.getApplicationProperty("msgId")); + instanceLog.debug("Read message: " + message.getApplicationProperty("msgId")); assertNotNull(message); assertEquals(NUM_MESSAGES, message.getApplicationProperty("msgId")); message.release(); @@ -757,7 +757,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { { receiver.flow(1); AmqpMessage message = receiver.receive(5, TimeUnit.SECONDS); - System.out.println("Read message: " + message.getApplicationProperty("msgId")); + instanceLog.debug("Read message: " + message.getApplicationProperty("msgId")); assertNotNull(message); assertEquals(NUM_MESSAGES, message.getApplicationProperty("msgId")); message.accept(); @@ -767,7 +767,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { receiver.flow(1); AmqpMessage message = receiver.receive(1, TimeUnit.SECONDS); if (message != null) { - System.out.println("Read message: " + message.getApplicationProperty("msgId")); + instanceLog.debug("Read message: " + message.getApplicationProperty("msgId")); } assertNull(message); } finally { @@ -807,7 +807,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { { // This will result in message [0[ being consumed once we commit. message1.accept(txnSession, false); - System.out.println("Commit: accepting message: " + message1.getApplicationProperty("msgId")); + instanceLog.debug("Commit: accepting message: " + message1.getApplicationProperty("msgId")); AmqpMessage message = new AmqpMessage(); message.setText("Test-Message"); @@ -821,7 +821,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { txnSession.begin(); { message2.accept(txnSession, false); - System.out.println("Rollback: accepting message: " + message2.getApplicationProperty("msgId")); + instanceLog.debug("Rollback: accepting message: " + message2.getApplicationProperty("msgId")); AmqpMessage message = new AmqpMessage(); message.setText("Test-Message"); @@ -839,7 +839,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { for (int i = 1; i <= NUM_MESSAGES; ++i) { AmqpMessage message = receiver.receive(5, TimeUnit.SECONDS); assertNotNull("Expected a message for: " + i, message); - System.out.println("Accepting message: " + message.getApplicationProperty("msgId")); + instanceLog.debug("Accepting message: " + message.getApplicationProperty("msgId")); assertEquals(i, message.getApplicationProperty("msgId")); message.accept(); } @@ -878,7 +878,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { } if (i % 100 == 0) { - if (i % 1000 == 0) System.out.println("Read message " + i); + if (i % 1000 == 0) instanceLog.debug("Read message " + i); consumerSession.commit(); } } @@ -903,7 +903,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { for (int i = 0; i < MESSAGE_COUNT; i++) { producer.send(sendingSession.createTextMessage("message " + i), DeliveryMode.PERSISTENT, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE); if (i % 100 == 0) { - if (i % 1000 == 0) System.out.println("Sending " + i); + if (i % 1000 == 0) instanceLog.debug("Sending " + i); sendingSession.commit(); } } @@ -941,7 +941,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport { @Override public void inspectDeliveryUpdate(Sender sender, Delivery delivery) { if (delivery.remotelySettled()) { - LOG.info("Receiver got delivery update for: {}", delivery); + LOG.debug("Receiver got delivery update for: {}", delivery); if (!(delivery.getRemoteState() instanceof TransactionalState)) { markAsInvalid("Transactionally acquire work no tagged as being in a transaction."); } else { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java index 7199efca3b..57f4b6bca1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSConnectionWithSecurityTest.java @@ -26,7 +26,6 @@ import javax.jms.QueueBrowser; import javax.jms.Session; import javax.jms.TextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.qpid.jms.JmsConnectionFactory; import org.junit.Test; @@ -52,7 +51,8 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { connection.start(); fail("Expected JMSException"); } catch (JMSSecurityException ex) { - IntegrationTestLogger.LOGGER.debug("Failed to authenticate connection with no user / password."); + instanceLog.debug("Failed to authenticate connection with no user / password.", ex); + } finally { if (connection != null) { connection.close(); @@ -69,7 +69,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { connection.start(); fail("Expected Exception"); } catch (JMSSecurityException ex) { - IntegrationTestLogger.LOGGER.debug("Failed to authenticate connection with no user / password."); + instanceLog.debug("Failed to authenticate connection with no user / password."); } catch (Exception ex) { fail("Expected JMSSecurityException"); } finally { @@ -87,7 +87,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { connection.start(); fail("Expected JMSException"); } catch (JMSSecurityException ex) { - IntegrationTestLogger.LOGGER.debug("Failed to authenticate connection with unknown user ID"); + instanceLog.debug("Failed to authenticate connection with unknown user ID"); } finally { if (connection != null) { connection.close(); @@ -103,7 +103,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { connection.start(); fail("Expected JMSException"); } catch (JMSSecurityException ex) { - IntegrationTestLogger.LOGGER.debug("Failed to authenticate connection with incorrect password."); + instanceLog.debug("Failed to authenticate connection with incorrect password."); } finally { if (connection != null) { connection.close(); @@ -120,7 +120,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { connection.start(); fail("Expected JMSException"); } catch (JMSSecurityException ex) { - IntegrationTestLogger.LOGGER.debug("Failed to authenticate connection with incorrect password."); + instanceLog.debug("Failed to authenticate connection with incorrect password."); } finally { if (connection != null) { connection.close(); @@ -167,7 +167,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { session.createConsumer(queue); fail("Should not be able to consume here."); } catch (JMSSecurityException jmsSE) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } } finally { connection.close(); @@ -187,7 +187,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { browser.getEnumeration(); fail("Should not be able to consume here."); } catch (JMSSecurityException jmsSE) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } } finally { connection.close(); @@ -205,7 +205,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { session.createConsumer(queue); fail("Should not be able to consume here."); } catch (JMSSecurityException jmsSE) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } } finally { connection.close(); @@ -223,7 +223,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { session.createProducer(queue); fail("Should not be able to produce here."); } catch (JMSSecurityException jmsSE) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } } finally { connection.close(); @@ -243,7 +243,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { producer.send(queue, session.createTextMessage()); fail("Should not be able to produce here."); } catch (JMSSecurityException jmsSE) { - IntegrationTestLogger.LOGGER.info("Caught expected exception"); + instanceLog.debug("Caught expected exception"); } } finally { connection.close(); @@ -260,7 +260,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { try { session.createTemporaryQueue(); } catch (JMSSecurityException jmsse) { - IntegrationTestLogger.LOGGER.info("Client should have thrown a JMSSecurityException but only threw JMSException"); + instanceLog.debug("Client should have thrown a JMSSecurityException but only threw JMSException"); } // Should not be fatal @@ -280,7 +280,7 @@ public class JMSConnectionWithSecurityTest extends JMSClientTestSupport { try { session.createTemporaryTopic(); } catch (JMSSecurityException jmsse) { - IntegrationTestLogger.LOGGER.info("Client should have thrown a JMSSecurityException but only threw JMSException"); + instanceLog.debug("Client should have thrown a JMSSecurityException but only threw JMSException"); } // Should not be fatal diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java index 14c019b75b..b5b170dac6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageConsumerTest.java @@ -606,7 +606,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { message.acknowledge(); done.countDown(); } catch (JMSException ex) { - LOG.info("Caught exception.", ex); + LOG.debug("Caught exception.", ex); } } }); @@ -686,7 +686,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { while (count > 0) { try { if (++n % 1000 == 0) { - System.out.println("received " + n + " messages"); + instanceLog.debug("received " + n + " messages"); } Message m = consumer.receive(5000); @@ -738,11 +738,11 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { Wait.assertEquals(0, queueView::getMessageCount); long taken = (System.currentTimeMillis() - time); - System.out.println("Microbenchamrk ran in " + taken + " milliseconds, sending/receiving " + numMessages); + instanceLog.debug("Microbenchamrk ran in " + taken + " milliseconds, sending/receiving " + numMessages); double messagesPerSecond = ((double) numMessages / (double) taken) * 1000; - System.out.println(((int) messagesPerSecond) + " messages per second"); + instanceLog.debug(((int) messagesPerSecond) + " messages per second"); } @Test(timeout = 60000) @@ -776,9 +776,6 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { for (int i = 0; i < numMessages; i++) { Message msg = consumer.receive(5000); - if (msg == null) { - System.out.println("ProtonTest.testManyMessages"); - } Assert.assertNotNull("" + i, msg); Assert.assertTrue("" + msg, msg instanceof TextMessage); String text = ((TextMessage) msg).getText(); @@ -790,12 +787,7 @@ public class JMSMessageConsumerTest extends JMSClientTestSupport { consumer.close(); connection.close(); - // Wait for Acks to be processed and message removed from queue. - Thread.sleep(500); - Wait.assertEquals(0, queueView::getMessageCount); - long taken = (System.currentTimeMillis() - time) / 1000; - System.out.println("taken = " + taken); } finally { connection.close(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageTypesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageTypesTest.java index 4a1e29652e..a504bdcb45 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageTypesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSMessageTypesTest.java @@ -129,7 +129,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { MessageProducer producer = session.createProducer(queue); for (int i = 0; i < NUM_MESSAGES; i++) { - System.out.println("Sending " + i); + instanceLog.debug("Sending " + i); BytesMessage message = session.createBytesMessage(); message.writeBytes(bytes); @@ -151,13 +151,13 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { byte[] bytesReceived = new byte[(int) size]; m.readBytes(bytesReceived); - System.out.println("Received " + ByteUtil.bytesToHex(bytesReceived, 1) + " count - " + m.getIntProperty("count")); + instanceLog.debug("Received " + ByteUtil.bytesToHex(bytesReceived, 1) + " count - " + m.getIntProperty("count")); Assert.assertArrayEquals(bytes, bytesReceived); } long taken = (System.currentTimeMillis() - time) / 1000; - System.out.println("taken = " + taken); + instanceLog.debug("taken = " + taken); } @Test(timeout = 60000) @@ -188,7 +188,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { MessageProducer producer = session.createProducer(queue); for (int i = 0; i < NUM_MESSAGES; i++) { - System.out.println("Sending " + i); + instanceLog.debug("Sending " + i); Message message = session.createMessage(); message.setIntProperty("count", i); @@ -205,7 +205,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { } long taken = (System.currentTimeMillis() - time) / 1000; - System.out.println("taken = " + taken); + instanceLog.debug("taken = " + taken); } @Test(timeout = 60000) @@ -231,7 +231,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { MessageProducer producer = session.createProducer(queue); for (int i = 0; i < NUM_MESSAGES; i++) { - System.out.println("Sending " + i); + instanceLog.debug("Sending " + i); MapMessage message = session.createMapMessage(); message.setInt("i", i); @@ -252,7 +252,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { } long taken = (System.currentTimeMillis() - time) / 1000; - System.out.println("taken = " + taken); + instanceLog.debug("taken = " + taken); } @Test(timeout = 60000) @@ -278,7 +278,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { MessageProducer producer = session.createProducer(queue); for (int i = 0; i < NUM_MESSAGES; i++) { - System.out.println("Sending " + i); + instanceLog.debug("Sending " + i); TextMessage message = session.createTextMessage("text" + i); message.setStringProperty("text", "text" + i); producer.send(message); @@ -295,7 +295,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { } long taken = (System.currentTimeMillis() - time) / 1000; - System.out.println("taken = " + taken); + instanceLog.debug("taken = " + taken); } @Test(timeout = 60000) @@ -403,7 +403,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { MessageProducer producer = session.createProducer(queue); for (int i = 0; i < NUM_MESSAGES; i++) { - System.out.println("Sending " + i); + instanceLog.debug("Sending " + i); ObjectMessage message = session.createObjectMessage(new AnythingSerializable(i)); producer.send(message); } @@ -421,7 +421,7 @@ public class JMSMessageTypesTest extends JMSClientTestSupport { } long taken = (System.currentTimeMillis() - time) / 1000; - System.out.println("taken = " + taken); + instanceLog.debug("taken = " + taken); } @Test(timeout = 60000) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java index 776d55350b..01b185cf74 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java @@ -39,7 +39,7 @@ public class JMSTemporaryDestinationTest extends JMSClientTestSupport { try { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); TemporaryQueue queue = session.createTemporaryQueue(); - System.out.println("queue:" + queue.getQueueName()); + instanceLog.debug("queue:" + queue.getQueueName()); MessageProducer producer = session.createProducer(queue); TextMessage message = session.createTextMessage(); @@ -92,7 +92,7 @@ public class JMSTemporaryDestinationTest extends JMSClientTestSupport { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); TemporaryTopic topic = session.createTemporaryTopic(); - System.out.println("topic:" + topic.getTopicName()); + instanceLog.debug("topic:" + topic.getTopicName()); MessageConsumer consumer = session.createConsumer(topic); MessageProducer producer = session.createProducer(topic); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java index bcd59aa0ea..fa9551b5c8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTransactionTest.java @@ -40,7 +40,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { Session session = connection.createSession(true, Session.SESSION_TRANSACTED); javax.jms.Queue queue = session.createQueue(getQueueName()); - System.out.println("queue:" + queue.getQueueName()); + instanceLog.debug("queue:" + queue.getQueueName()); MessageProducer p = session.createProducer(queue); for (int i = 0; i < 10; i++) { TextMessage message = session.createTextMessage(); @@ -62,7 +62,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { Session session = connection.createSession(true, Session.SESSION_TRANSACTED); javax.jms.Queue queue = session.createQueue(getQueueName()); - System.out.println("queue:" + queue.getQueueName()); + instanceLog.debug("queue:" + queue.getQueueName()); MessageProducer p = session.createProducer(queue); for (int i = 0; i < 10; i++) { TextMessage message = session.createTextMessage(); @@ -106,7 +106,7 @@ public class JMSTransactionTest extends JMSClientTestSupport { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); javax.jms.Queue queue = session.createQueue(getQueueName()); - System.out.println("queue:" + queue.getQueueName()); + instanceLog.debug("queue:" + queue.getQueueName()); MessageProducer p = session.createProducer(queue); for (int i = 0; i < 10; i++) { TextMessage message = session.createTextMessage(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java index 30c177b077..c1c11c4476 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/QueueAutoCreationTest.java @@ -90,7 +90,7 @@ public class QueueAutoCreationTest extends JMSClientTestSupport { Map.Entry entry = map.entrySet().iterator().next(); AddressSettings settings = entry.getValue(); settings.setAutoCreateQueues(true); - System.out.println("server cofg, isauto? " + entry.getValue().isAutoCreateQueues()); + instanceLog.debug("server cofg, isauto? " + entry.getValue().isAutoCreateQueues()); } @@ -118,7 +118,7 @@ public class QueueAutoCreationTest extends JMSClientTestSupport { ConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:5672"); Connection connection = factory.createConnection(); SimpleString addressName = UUIDGenerator.getInstance().generateSimpleStringUUID(); - System.out.println("Address is " + addressName); + instanceLog.debug("Address is " + addressName); clientSession.createAddress(addressName, RoutingType.ANYCAST, false); Topic topic = new ActiveMQTopic(addressName.toString()); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -137,7 +137,7 @@ public class QueueAutoCreationTest extends JMSClientTestSupport { ConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:5672"); Connection connection = factory.createConnection(); SimpleString addressName = UUIDGenerator.getInstance().generateSimpleStringUUID(); - System.out.println("Address is " + addressName); + instanceLog.debug("Address is " + addressName); clientSession.createAddress(addressName, RoutingType.ANYCAST, false); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -158,7 +158,7 @@ public class QueueAutoCreationTest extends JMSClientTestSupport { ConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:5672"); Connection connection = factory.createConnection(); SimpleString addressName = UUIDGenerator.getInstance().generateSimpleStringUUID(); - System.out.println("Address is " + addressName); + instanceLog.debug("Address is " + addressName); clientSession.createAddress(addressName, RoutingType.ANYCAST, false); Connection recConnection = factory.createConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java index 0012c19bf7..d16a4b4a54 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java @@ -119,6 +119,7 @@ import static org.apache.activemq.artemis.tests.util.ActiveMQTestBase.NETTY_ACCE @CreateKdcServer(transports = {@CreateTransport(protocol = "TCP", port = 0)}) @ApplyLdifFiles("SaslKrb5LDAPSecurityTest.ldif") public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit { + private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(SaslKrb5LDAPSecurityTest.class); protected static final Logger LOG = LoggerFactory.getLogger(SaslKrb5LDAPSecurityTest.class); public static final String QUEUE_NAME = "some_queue"; @@ -222,7 +223,7 @@ public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit { Method refreshMethod = classRef.getMethod("refresh", new Class[0]); refreshMethod.invoke(classRef, new Object[0]); - LOG.info("krb5.conf to: {}", krb5conf.getAbsolutePath()); + LOG.debug("krb5.conf to: {}", krb5conf.getAbsolutePath()); } private void dumpLdapContents() throws Exception { @@ -234,7 +235,7 @@ public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit { String ss = LdifUtils.convertToLdif(entry); st += ss + "\n"; } - System.out.println(st); + log.debug(st); cursor = getService().getAdminSession().search(new Dn("dc=example,dc=com"), SearchScope.SUBTREE, new PresenceNode("ObjectClass"), AliasDerefMode.DEREF_ALWAYS); st = ""; @@ -244,7 +245,7 @@ public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit { String ss = LdifUtils.convertToLdif(entry); st += ss + "\n"; } - System.out.println(st); + log.debug(st); } private void initLogging() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/TopicDurableTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/TopicDurableTests.java index e4a9066a19..4c549ce9db 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/TopicDurableTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/TopicDurableTests.java @@ -53,7 +53,7 @@ public class TopicDurableTests extends JMSClientTestSupport { Connection connection = connectionFactory.createConnection(); connection.start(); - System.out.println("testMessageDurableSubscription"); + instanceLog.debug("testMessageDurableSubscription"); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Topic testTopic = session.createTopic("jmsTopic"); @@ -67,39 +67,39 @@ public class TopicDurableTests extends JMSClientTestSupport { String batchPrefix = "First"; List listMsgs = generateMessages(session, batchPrefix, count); sendMessages(messageProducer, listMsgs); - System.out.println("First batch messages sent"); + instanceLog.debug("First batch messages sent"); List recvd1 = receiveMessages(subscriber1, count); List recvd2 = receiveMessages(subscriber2, count); assertThat(recvd1.size(), is(count)); assertMessageContent(recvd1, batchPrefix); - System.out.println(sub1ID + " :First batch messages received"); + instanceLog.debug(sub1ID + " :First batch messages received"); assertThat(recvd2.size(), is(count)); assertMessageContent(recvd2, batchPrefix); - System.out.println(sub2ID + " :First batch messages received"); + instanceLog.debug(sub2ID + " :First batch messages received"); subscriber1.close(); - System.out.println(sub1ID + " : closed"); + instanceLog.debug(sub1ID + " : closed"); batchPrefix = "Second"; listMsgs = generateMessages(session, batchPrefix, count); sendMessages(messageProducer, listMsgs); - System.out.println("Second batch messages sent"); + instanceLog.debug("Second batch messages sent"); recvd2 = receiveMessages(subscriber2, count); assertThat(recvd2.size(), is(count)); assertMessageContent(recvd2, batchPrefix); - System.out.println(sub2ID + " :Second batch messages received"); + instanceLog.debug(sub2ID + " :Second batch messages received"); subscriber1 = session.createDurableSubscriber(testTopic, sub1ID); - System.out.println(sub1ID + " :connected"); + instanceLog.debug(sub1ID + " :connected"); recvd1 = receiveMessages(subscriber1, count); assertThat(recvd1.size(), is(count)); assertMessageContent(recvd1, batchPrefix); - System.out.println(sub1ID + " :Second batch messages received"); + instanceLog.debug(sub1ID + " :Second batch messages received"); subscriber1.close(); subscriber2.close(); @@ -113,7 +113,7 @@ public class TopicDurableTests extends JMSClientTestSupport { public void testSharedNonDurableSubscription() throws Exception { int iterations = 10; for (int i = 0; i < iterations; i++) { - System.out.println("testSharedNonDurableSubscription; iteration: " + i); + instanceLog.debug("testSharedNonDurableSubscription; iteration: " + i); //SETUP-START JmsConnectionFactory connectionFactory1 = new JmsConnectionFactory(getBrokerQpidJMSConnectionURI()); Connection connection1 = connectionFactory1.createConnection(); @@ -147,14 +147,14 @@ public class TopicDurableTests extends JMSClientTestSupport { List listMsgs = generateMessages(session, count); List>> results = receiveMessagesAsync(count, subscriber1, subscriber2, subscriber3); sendMessages(messageProducer, listMsgs); - System.out.println("messages sent"); + instanceLog.debug("messages sent"); assertThat("Each message should be received only by one consumer", results.get(0).get(20, TimeUnit.SECONDS).size() + results.get(1).get(20, TimeUnit.SECONDS).size() + results.get(2).get(20, TimeUnit.SECONDS).size(), is(count)); - System.out.println("messages received"); + instanceLog.debug("messages received"); //BODY-E //TEAR-DOWN-S @@ -238,7 +238,7 @@ public class TopicDurableTests extends JMSClientTestSupport { resultsList.add(new CompletableFuture<>()); receivedResList.add(new ArrayList<>()); MessageListener myListener = message -> { - System.out.println("Mesages received" + message + " count: " + totalCount.get()); + instanceLog.debug("Mesages received" + message + " count: " + totalCount.get()); receivedResList.get(index).add(message); if (totalCount.decrementAndGet() == 0) { for (int j = 0; j < consumer.length; j++) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java index be79b0f217..8b89e1d7a2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/interop/AmqpCoreTest.java @@ -108,9 +108,9 @@ public class AmqpCoreTest extends JMSClientTestSupport { @Override public void onMessage(ClientMessage message) { - System.out.println("received: " + message.getBodySize()); + instanceLog.debug("received: " + message.getBodySize()); if (message.getBodySize() == 0) { - System.out.println("xxx found zero len message!"); + instanceLog.debug("xxx found zero len message!"); zeroLen = true; } addMessage(message); @@ -118,7 +118,7 @@ public class AmqpCoreTest extends JMSClientTestSupport { private synchronized void addMessage(ClientMessage message) { numMsg++; - System.out.println("[receiver " + id + "] recieved: " + numMsg); + instanceLog.debug("[receiver " + id + "] recieved: " + numMsg); } public synchronized boolean waitForMessages(int num) throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/InterruptedAMQPLargeMessage.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/InterruptedAMQPLargeMessage.java index af7c5bb57f..1ea4bbf7da 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/InterruptedAMQPLargeMessage.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/InterruptedAMQPLargeMessage.java @@ -129,7 +129,7 @@ public class InterruptedAMQPLargeMessage extends AmqpClientTestSupport { } browserIterator.close(); - System.out.println("There are " + serverQueue.getMessageCount() + " on the queue"); + instanceLog.debug("There are " + serverQueue.getMessageCount() + " on the queue"); int messageCount = (int)serverQueue.getMessageCount(); AmqpClient client = createLocalClient(); @@ -148,7 +148,7 @@ public class InterruptedAMQPLargeMessage extends AmqpClientTestSupport { message.accept(true); received++; - System.out.println("Received " + received); + instanceLog.debug("Received " + received); Data data = (Data)message.getWrappedMessage().getBody(); byte[] byteArray = data.getValue().getArray(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java index 0dcb468fa9..6841b18bab 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/AddressCommandTest.java @@ -127,7 +127,7 @@ public class AddressCommandTest extends JMSTestBase { ShowAddress showAddress = new ShowAddress(); showAddress.setName(address); showAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error))); - System.out.println(output.toString()); + instanceLog.debug(output.toString()); } @Test @@ -158,7 +158,7 @@ public class AddressCommandTest extends JMSTestBase { showAddress.setName(address.toString()); showAddress.setBindings(true); showAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error))); - System.out.println(output.toString()); + instanceLog.debug(output.toString()); } @Test @@ -208,13 +208,13 @@ public class AddressCommandTest extends JMSTestBase { private void checkExecutionPassed(AbstractAction command) throws Exception { String fullMessage = output.toString(); - System.out.println("output: " + fullMessage); + instanceLog.debug("output: " + fullMessage); assertTrue(fullMessage, fullMessage.contains("successfully")); } private void checkExecutionFailure(AbstractAction command, String message) throws Exception { String fullMessage = error.toString(); - System.out.println("error: " + fullMessage); + instanceLog.debug("error: " + fullMessage); assertTrue(fullMessage, fullMessage.contains(message)); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java index 7ea05ac626..d4a9009ec3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/QueueCommandTest.java @@ -371,13 +371,13 @@ public class QueueCommandTest extends JMSTestBase { private void checkExecutionPassed(AbstractAction command) throws Exception { String fullMessage = output.toString(); - System.out.println("output: " + fullMessage); + instanceLog.debug("output: " + fullMessage); assertTrue(fullMessage, fullMessage.contains("successfully")); } private void checkExecutionFailure(AbstractAction command, String message) throws Exception { String fullMessage = error.toString(); - System.out.println("error: " + fullMessage); + instanceLog.debug("error: " + fullMessage); assertTrue(fullMessage, fullMessage.contains(message)); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java index 452398cfdb..c9acb18635 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java @@ -82,7 +82,7 @@ public class AckBatchSizeTest extends ActiveMQTestBase { ClientConsumer consumer = session.createConsumer(queueA); session.start(); for (int i = 0; i < numMessages - 1; i++) { - System.out.println("Receive "); + instanceLog.debug("Receive "); ClientMessage m = consumer.receive(5000); Assert.assertEquals(0, m.getPropertyNames().size()); Assert.assertEquals("expected to be " + originalSize, originalSize, m.getEncodeSize()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java index a6bec7aa88..310d03d630 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java @@ -43,7 +43,6 @@ import org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQConsumerConte import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.spi.core.remoting.ConsumerContext; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.UUID; import org.junit.Assert; @@ -51,8 +50,6 @@ import org.junit.Test; public class AcknowledgeTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - public final SimpleString addressA = new SimpleString("addressA"); public final SimpleString queueA = new SimpleString("queueA"); @@ -108,7 +105,7 @@ public class AcknowledgeTest extends ActiveMQTestBase { } Thread.sleep(500); - log.info("woke up"); + instanceLog.debug("woke up"); final CountDownLatch latch = new CountDownLatch(numMessages); session.start(); @@ -117,7 +114,7 @@ public class AcknowledgeTest extends ActiveMQTestBase { @Override public void onMessage(final ClientMessage message) { - log.info("Got message " + c++); + instanceLog.debug("Got message " + c++); latch.countDown(); } }); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java index 5270d9e99a..56c607faa0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ActiveMQCrashTest.java @@ -31,8 +31,8 @@ import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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; @@ -42,7 +42,7 @@ import org.junit.Test; */ public class ActiveMQCrashTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(ActiveMQCrashTest.class); public ActiveMQServer server; @@ -98,11 +98,11 @@ public class ActiveMQCrashTest extends ActiveMQTestBase { @Override public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException { - ActiveMQCrashTest.log.info("AckInterceptor.intercept " + packet); + log.debug("AckInterceptor.intercept " + packet); if (packet.getType() == PacketImpl.SESS_SEND) { try { - ActiveMQCrashTest.log.info("Stopping server"); + log.debug("Stopping server"); new Thread() { @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java index e5bd19916a..a7918dbea0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java @@ -47,7 +47,6 @@ import org.apache.activemq.artemis.jms.client.ActiveMQQueue; import org.apache.activemq.artemis.jms.client.ActiveMQTemporaryTopic; import org.apache.activemq.artemis.jms.client.ActiveMQTopic; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.apache.activemq.artemis.tests.util.RandomUtil; import org.apache.activemq.artemis.tests.util.Wait; @@ -340,8 +339,6 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { assertNotNull(server.locateQueue(topicAddress)); - IntegrationTestLogger.LOGGER.info("Topic name: " + topicAddress); - topic.delete(); connection.close(); @@ -381,7 +378,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { ConnectionFactory factory = new ActiveMQConnectionFactory(); Connection connection = factory.createConnection(); SimpleString addressName = UUIDGenerator.getInstance().generateSimpleStringUUID(); - System.out.println("Address is " + addressName); + instanceLog.debug("Address is " + addressName); clientSession.createAddress(addressName, RoutingType.ANYCAST, false); Topic topic = new ActiveMQTopic(addressName.toString()); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -405,7 +402,7 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase { ConnectionFactory factory = new ActiveMQConnectionFactory(); try (Connection connection = factory.createConnection()) { SimpleString addressName = UUIDGenerator.getInstance().generateSimpleStringUUID(); - System.out.println("Address is " + addressName); + instanceLog.debug("Address is " + addressName); javax.jms.Queue queue = new ActiveMQQueue(addressName.toString()); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = session.createProducer(null); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java index 7ed58f5bb4..d58214ddc8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java @@ -29,7 +29,6 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.MessageHandler; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Before; @@ -37,7 +36,6 @@ import org.junit.Test; public class AutogroupIdTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; public final SimpleString addressA = new SimpleString("addressA"); @@ -93,8 +91,6 @@ public class AutogroupIdTest extends ActiveMQTestBase { ClientConsumer consumer2 = session.createConsumer(groupTestQ); consumer2.setMessageHandler(myMessageHandler2); - log.info("starting session"); - session.start(); final int numMessages = 100; @@ -106,8 +102,6 @@ public class AutogroupIdTest extends ActiveMQTestBase { session.close(); - log.info(myMessageHandler2.messagesReceived); - Assert.assertEquals(100, myMessageHandler.messagesReceived); Assert.assertEquals(0, myMessageHandler2.messagesReceived); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java index 896989fa58..3977f974f2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/BlockingSendTest.java @@ -54,7 +54,7 @@ public class BlockingSendTest extends ActiveMQTestBase { server.start(); - System.out.println("sync = " + server.getConfiguration().isJournalSyncNonTransactional()); + instanceLog.debug("sync = " + server.getConfiguration().isJournalSyncNonTransactional()); locator = createInVMNonHALocator().setBlockOnDurableSend(true); factory = createSessionFactory(locator); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java index 1eee70d717..b558fe9300 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerFilterTest.java @@ -26,14 +26,14 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; 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.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; public class ConsumerFilterTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(ConsumerFilterTest.class); private ActiveMQServer server; private ClientSession session; @@ -90,7 +90,7 @@ public class ConsumerFilterTest extends ActiveMQTestBase { message.putStringProperty("animal", "giraffe"); - log.info("sending second msg"); + log.debug("sending second msg"); producer.send(message); @@ -243,7 +243,7 @@ public class ConsumerFilterTest extends ActiveMQTestBase { readConsumer("anyConsumer", anyConsumer); - log.info("### closing consumer ###"); + log.debug("### closing consumer ###"); anyConsumer.close(); @@ -251,7 +251,7 @@ public class ConsumerFilterTest extends ActiveMQTestBase { readConsumer("redConsumer", redConsumer); - log.info("### recreating consumer ###"); + log.debug("### recreating consumer ###"); anyConsumer = session.createConsumer("foo"); @@ -273,7 +273,7 @@ public class ConsumerFilterTest extends ActiveMQTestBase { private void readConsumer(String consumerName, ClientConsumer consumer) throws Exception { ClientMessage message = consumer.receive(5000); assertNotNull(message); - System.out.println("consumer = " + consumerName + " message, color=" + message.getStringProperty("color") + ", msg = " + message.getStringProperty("value")); + instanceLog.debug("consumer = " + consumerName + " message, color=" + message.getStringProperty("color") + ", msg = " + message.getStringProperty("value")); message.acknowledge(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java index 0de5f3dce4..b69bbbab06 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerRoundRobinTest.java @@ -25,14 +25,14 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class ConsumerRoundRobinTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(ConsumerRoundRobinTest.class); public final SimpleString addressA = new SimpleString("addressA"); @@ -67,9 +67,9 @@ public class ConsumerRoundRobinTest extends ActiveMQTestBase { } int currMessage = 0; for (int i = 0; i < numMessage / 5; i++) { - log.info("i is " + i); + log.debug("i is " + i); for (int j = 0; j < 5; j++) { - log.info("j is " + j); + log.debug("j is " + j); ClientMessage cm = consumers[j].receive(5000); Assert.assertNotNull(cm); Assert.assertEquals(currMessage++, cm.getBodyBuffer().readInt()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java index be72733ee2..908c07fd90 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerStuckTest.java @@ -85,7 +85,7 @@ public class ConsumerStuckTest extends ActiveMQTestBase { try { while (!Thread.interrupted()) { ClientMessage received = consumer.receive(500); - System.out.println("Received " + received); + instanceLog.debug("Received " + received); if (first) { first = false; nettyConnection.getNettyChannel().config().setAutoRead(false); @@ -107,7 +107,7 @@ public class ConsumerStuckTest extends ActiveMQTestBase { assertEquals(1, server.getSessions().size()); - System.out.println("sessions = " + server.getSessions().size()); + instanceLog.debug("sessions = " + server.getSessions().size()); assertEquals(1, server.getConnectionCount()); @@ -119,16 +119,16 @@ public class ConsumerStuckTest extends ActiveMQTestBase { Thread.sleep(10); } - System.out.println("Time = " + System.currentTimeMillis() + " time diff = " + (System.currentTimeMillis() - timeStart) + ", connections Size = " + server.getConnectionCount() + " sessions = " + server.getSessions().size()); + instanceLog.debug("Time = " + System.currentTimeMillis() + " time diff = " + (System.currentTimeMillis() - timeStart) + ", connections Size = " + server.getConnectionCount() + " sessions = " + server.getSessions().size()); if (server.getSessions().size() != 0) { System.out.println(threadDump("Thread dump")); fail("The cleanup wasn't able to finish cleaning the session. It's probably stuck, look at the thread dump generated by the test for more information"); } - System.out.println("Size = " + server.getConnectionCount()); + instanceLog.debug("Size = " + server.getConnectionCount()); - System.out.println("sessions = " + server.getSessions().size()); + instanceLog.debug("sessions = " + server.getSessions().size()); if (server.getSessions().size() != 0) { System.out.println(threadDump("Thread dump")); @@ -168,7 +168,7 @@ public class ConsumerStuckTest extends ActiveMQTestBase { try { while (!Thread.interrupted()) { ClientMessage received = consumer.receive(500); - System.out.println("Received " + received); + instanceLog.debug("Received " + received); if (first) { first = false; nettyConnection.getNettyChannel().config().setAutoRead(false); @@ -217,7 +217,7 @@ public class ConsumerStuckTest extends ActiveMQTestBase { assertEquals(2, server.getSessions().size()); - System.out.println("sessions = " + server.getSessions().size()); + instanceLog.debug("sessions = " + server.getSessions().size()); assertEquals(2, server.getConnectionCount()); @@ -227,9 +227,9 @@ public class ConsumerStuckTest extends ActiveMQTestBase { Thread.sleep(10); } - System.out.println("Size = " + server.getConnectionCount()); + instanceLog.debug("Size = " + server.getConnectionCount()); - System.out.println("sessions = " + server.getSessions().size()); + instanceLog.debug("sessions = " + server.getSessions().size()); if (server.getSessions().size() != 1) { System.out.println(threadDump("Thread dump")); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java index 5a73116911..12559da7b2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java @@ -192,13 +192,13 @@ public class ConsumerTest extends ActiveMQTestBase { Assert.assertNotNull(message2); - System.out.println("Id::" + message2.getMessageID()); + instanceLog.debug("Id::" + message2.getMessageID()); - System.out.println("Received " + message2); + instanceLog.debug("Received " + message2); - System.out.println("Clie:" + ByteUtil.bytesToHex(message2.getBuffer().array(), 4)); + instanceLog.debug("Clie:" + ByteUtil.bytesToHex(message2.getBuffer().array(), 4)); - System.out.println("String::" + message2.getReadOnlyBodyBuffer().readString()); + instanceLog.debug("String::" + message2.getReadOnlyBodyBuffer().readString()); Assert.assertEquals("elo", message2.getStringProperty("hello")); @@ -579,7 +579,7 @@ public class ConsumerTest extends ActiveMQTestBase { } long end = System.currentTimeMillis(); - System.out.println("Time = " + (end - time)); + instanceLog.debug("Time = " + (end - time)); { TextMessage dummyMessage = session.createTextMessage(); @@ -1012,7 +1012,7 @@ public class ConsumerTest extends ActiveMQTestBase { } if (cons.receiveImmediate() != null) { - System.out.println("ERROR: Received an extra message"); + instanceLog.debug("ERROR: Received an extra message"); errors.incrementAndGet(); } sessionSend.close(); @@ -1249,11 +1249,11 @@ public class ConsumerTest extends ActiveMQTestBase { final long messagesPerRun = (forks * messages); for (int r = 0; r < runs; r++) { onStartRun.await(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); - System.out.println("started run " + r); + instanceLog.debug("started run " + r); final long start = System.currentTimeMillis(); onFinishRun.await(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); final long elapsedMillis = System.currentTimeMillis() - start; - System.out.println((messagesPerRun * 1000L) / elapsedMillis + " msg/sec"); + instanceLog.debug((messagesPerRun * 1000L) / elapsedMillis + " msg/sec"); } Stream.of(producersRunners).forEach(runner -> { try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java index 9778ff1bc4..156c8159b5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java @@ -46,7 +46,6 @@ import org.apache.activemq.artemis.core.server.Consumer; import org.apache.activemq.artemis.core.server.ServerSession; import org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.Wait; import org.junit.Assert; @@ -62,10 +61,6 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase { private final int TIMEOUT = 5; - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - - private static final boolean isTrace = ConsumerWindowSizeTest.log.isTraceEnabled(); - private ServerLocator locator; protected boolean isNetty() { @@ -416,7 +411,7 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase { ClientMessage msg = consumer.receiveImmediate(); if (msg == null) { - System.out.println("Returning null"); + instanceLog.debug("Returning null"); break; } msg.acknowledge(); @@ -721,8 +716,6 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase { String str = getTextMessage(msg); Assert.assertEquals("Msg" + i, str); - log.info("got msg " + str); - msg.acknowledge(); Assert.assertEquals("A slow consumer shouldn't buffer anything on the client side!", 0, cons1.getBufferSize()); @@ -735,8 +728,6 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase { String str = getTextMessage(msg); - log.info("got msg " + str); - Assert.assertEquals("Msg" + i, str); msg.acknowledge(); @@ -1186,13 +1177,7 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase { @Override public synchronized void onMessage(final ClientMessage message) { try { - log.info("received msg " + message); String str = getTextMessage(message); - if (ConsumerWindowSizeTest.isTrace) { - ConsumerWindowSizeTest.log.trace("Received message " + str); - } - - ConsumerWindowSizeTest.log.info("Received message " + str); failed = failed || !str.equals("Msg" + count); @@ -1230,11 +1215,8 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase { Assert.assertTrue(latchReceived.await(TIMEOUT, TimeUnit.SECONDS)); - log.info("bs " + consReceiveOneAndHold.getBufferSize()); - long timeout = System.currentTimeMillis() + 1000 * TIMEOUT; while (consReceiveOneAndHold.getBufferSize() == 0 && System.currentTimeMillis() < timeout) { - log.info("bs " + consReceiveOneAndHold.getBufferSize()); Thread.sleep(10); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java index 4c3ad12aad..cc9894f281 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/CoreClientTest.java @@ -48,7 +48,6 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ActiveMQThreadFactory; import org.apache.activemq.artemis.utils.UUIDGenerator; @@ -57,8 +56,6 @@ import org.junit.Test; public class CoreClientTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Test public void testCoreClientNetty() throws Exception { testCoreClient(true, null); @@ -141,8 +138,6 @@ public class CoreClientTest extends ActiveMQTestBase { producer.send(message); } - CoreClientTest.log.info("sent messages"); - ClientConsumer consumer = session.createConsumer(QUEUE); session.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java index c921ff4274..dfc390b95a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/DeadLetterAddressTest.java @@ -39,7 +39,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.RandomUtil; import org.junit.Assert; @@ -49,8 +48,6 @@ import org.junit.Test; public class DeadLetterAddressTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ActiveMQServer server; private ClientSession clientSession; @@ -395,8 +392,6 @@ public class DeadLetterAddressTest extends ActiveMQTestBase { for (int i = 0; i < deliveryAttempt; i++) { ClientMessage m = clientConsumer.receive(500); Assert.assertNotNull(m); - DeadLetterAddressTest.log.info("i is " + i); - DeadLetterAddressTest.log.info("delivery cout is " + m.getDeliveryCount()); Assert.assertEquals(i + 1, m.getDeliveryCount()); m.acknowledge(); clientSession.rollback(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java index 84d0515479..2e40ab5615 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpireTestOnRestartTest.java @@ -121,7 +121,7 @@ public class ExpireTestOnRestartTest extends ActiveMQTestBase { int extras = 0; ClientMessage msg; while ((msg = cons.receiveImmediate()) != null) { - System.out.println(msg); + instanceLog.debug(msg); extras++; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java index c0ebef65c7..cffc2acc47 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryAddressTest.java @@ -28,7 +28,6 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.RandomUtil; import org.junit.Assert; @@ -37,8 +36,6 @@ import org.junit.Test; public class ExpiryAddressTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ActiveMQServer server; private ClientSession clientSession; @@ -161,7 +158,6 @@ public class ExpiryAddressTest extends ActiveMQTestBase { assertNotNull(m.getStringProperty(Message.HDR_ORIGINAL_ADDRESS)); assertNotNull(m.getStringProperty(Message.HDR_ORIGINAL_QUEUE)); - ExpiryAddressTest.log.info("acking"); m.acknowledge(); Assert.assertEquals(m.getBodyBuffer().readString(), "heyho!"); @@ -177,7 +173,6 @@ public class ExpiryAddressTest extends ActiveMQTestBase { assertNotNull(m.getStringProperty(Message.HDR_ORIGINAL_ADDRESS)); assertNotNull(m.getStringProperty(Message.HDR_ORIGINAL_QUEUE)); - ExpiryAddressTest.log.info("acking"); m.acknowledge(); Assert.assertEquals(m.getBodyBuffer().readString(), "heyho!"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java index 1f0a3ad1fd..f35c0f58c6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java @@ -32,7 +32,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.Wait; import org.junit.Test; @@ -42,8 +41,6 @@ import org.junit.Test; */ public class ExpiryLargeMessageTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Constants ----------------------------------------------------- final SimpleString EXPIRY = new SimpleString("my-expiry"); @@ -153,13 +150,12 @@ public class ExpiryLargeMessageTest extends ActiveMQTestBase { cons = session.createConsumer(EXPIRY); session.start(); - log.info("Trying " + rep); for (int i = 0; i < numberOfMessages / 2; i++) { ClientMessage message = cons.receive(5000); assertNotNull(message); if (i % 10 == 0) { - System.out.println("Received " + i); + instanceLog.debug("Received " + i); } for (int location = 0; location < messageSize; location++) { @@ -209,7 +205,7 @@ public class ExpiryLargeMessageTest extends ActiveMQTestBase { assertNotNull(message); if (i % 10 == 0) { - System.out.println("Received " + i); + instanceLog.debug("Received " + i); } for (int location = 0; location < messageSize; location++) { @@ -339,7 +335,7 @@ public class ExpiryLargeMessageTest extends ActiveMQTestBase { assertNotNull(message); if (i % 10 == 0) { - System.out.println("Received " + i); + instanceLog.debug("Received " + i); } for (int location = 0; location < messageSize; location++) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java index d2ea515ccd..3e9bfeca0d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FailureDeadlockTest.java @@ -30,15 +30,15 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQSession; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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 FailureDeadlockTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(FailureDeadlockTest.class); private ActiveMQServer server; @@ -79,7 +79,7 @@ public class FailureDeadlockTest extends ActiveMQTestBase { try { conn2.close(); } catch (Exception e) { - FailureDeadlockTest.log.error("Failed to close connection2", e); + log.error("Failed to close connection2", e); } } }; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java index 64cb0181fa..877f095b8a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FlowControlOnIgnoreLargeMessageBodyTest.java @@ -27,14 +27,15 @@ import javax.jms.Topic; import javax.jms.TopicSubscriber; import java.util.concurrent.CountDownLatch; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; +import org.jboss.logging.Logger; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { - IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(FlowControlOnIgnoreLargeMessageBodyTest.class); private Topic topic; @@ -105,7 +106,7 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { Connection connection = null; Session session = null; MessageProducer prod; - log.info("Starting producer for " + topic + " - " + getName()); + log.debug("Starting producer for " + topic + " - " + getName()); try { connection = cf.createConnection(); session = connection.createSession(true, Session.SESSION_TRANSACTED); @@ -126,10 +127,10 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { session.commit(); } if (i % 100 == 0) { - log.info("Address " + topic + " sent " + i + " messages"); + log.debug("Address " + topic + " sent " + i + " messages"); } } - System.out.println("Ending producer for " + topic + " - " + getName() + " messages " + sentMessages); + log.debug("Ending producer for " + topic + " - " + getName() + " messages " + sentMessages); } catch (Exception e) { error = true; e.printStackTrace(); @@ -203,7 +204,7 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { Session session = null; stopped = false; requestForStop = false; - System.out.println("Starting consumer for " + topic + " - " + getName()); + instanceLog.debug("Starting consumer for " + topic + " - " + getName()); try { connection = cf.createConnection(); @@ -221,11 +222,11 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { while (counter < numberOfMessages && !requestForStop && !error) { if (counter == 0) { - System.out.println("Starting to consume for " + topic + " - " + getName()); + instanceLog.debug("Starting to consume for " + topic + " - " + getName()); } BytesMessage msg = (BytesMessage) subscriber.receive(receiveTimeout); if (msg == null) { - System.out.println("Cannot get message in specified timeout: " + topic + " - " + getName()); + instanceLog.debug("Cannot get message in specified timeout: " + topic + " - " + getName()); error = true; } else { counter++; @@ -237,13 +238,13 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { session.commit(); } if (counter % 100 == 0) { - log.info("## " + getName() + " " + topic + " received " + counter); + log.debug("## " + getName() + " " + topic + " received " + counter); } receivedMessages = counter; } session.commit(); } catch (Exception e) { - System.out.println("Exception in consumer " + getName() + " : " + e.getMessage()); + instanceLog.debug("Exception in consumer " + getName() + " : " + e.getMessage()); e.printStackTrace(); } finally { if (session != null) { @@ -262,7 +263,7 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { } } stopped = true; - System.out.println("Stopping consumer for " + topic + + instanceLog.debug("Stopping consumer for " + topic + " - " + getName() + ", received " + @@ -312,14 +313,13 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase { } if (errorMessage != null) { - System.err.println(" ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR "); System.err.println(errorMessage); - } else { - System.out.println(" OK "); } assertFalse(error); - assertNull(errorMessage); + if (errorMessage != null) { + Assert.fail(errorMessage); + } } catch (Exception e) { log.warn(e.getMessage(), e); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FullQualifiedQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FullQualifiedQueueTest.java index daaf9e538a..f44e57b3ea 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FullQualifiedQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/FullQualifiedQueueTest.java @@ -91,31 +91,31 @@ public class FullQualifiedQueueTest extends ActiveMQTestBase { //each anycast consumer receives one, each multicast receives three. ClientMessage m = consumer1.receive(2000); assertNotNull(m); - System.out.println("consumer1 : " + m); + instanceLog.debug("consumer1 : " + m); m.acknowledge(); m = consumer2.receive(2000); assertNotNull(m); - System.out.println("consumer2 : " + m); + instanceLog.debug("consumer2 : " + m); m.acknowledge(); m = consumer3.receive(2000); assertNotNull(m); - System.out.println("consumer3 : " + m); + instanceLog.debug("consumer3 : " + m); m.acknowledge(); for (int i = 0; i < num; i++) { m = consumer4.receive(2000); assertNotNull(m); - System.out.println("consumer4 : " + m); + instanceLog.debug("consumer4 : " + m); m.acknowledge(); m = consumer5.receive(2000); assertNotNull(m); - System.out.println("consumer5 : " + m); + instanceLog.debug("consumer5 : " + m); m.acknowledge(); m = consumer6.receive(2000); assertNotNull(m); - System.out.println("consumer6 : " + m); + instanceLog.debug("consumer6 : " + m); m.acknowledge(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java index d900247674..318dbf934a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java @@ -440,14 +440,14 @@ public class HangConsumerTest extends ActiveMQTestBase { int bindings = 0; for (RecordInfo info : infos) { - System.out.println("info: " + info); + instanceLog.debug("info: " + info); if (info.getUserRecordType() == JournalRecordIds.QUEUE_BINDING_RECORD) { bindings++; } } assertEquals(1, bindings); - System.out.println("Bindings: " + bindings); + instanceLog.debug("Bindings: " + bindings); messagesJournal.stop(); if (i < 4) server.start(); @@ -613,7 +613,7 @@ public class HangConsumerTest extends ActiveMQTestBase { @Override public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException { if (packet instanceof SessionReceiveMessage) { - System.out.println("Receiving message"); + instanceLog.debug("Receiving message"); try { reusableLatch.countDown(); semaphore.acquire(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java index c44a7a0b44..c64a761130 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HeuristicXATest.java @@ -119,7 +119,7 @@ public class HeuristicXATest extends ActiveMQTestBase { Assert.assertEquals(1, preparedTransactions.length); - System.out.println(preparedTransactions[0]); + instanceLog.debug(preparedTransactions[0]); Assert.assertEquals(0, jmxServer.listHeuristicCommittedTransactions().length); Assert.assertEquals(0, jmxServer.listHeuristicRolledBackTransactions().length); @@ -191,7 +191,7 @@ public class HeuristicXATest extends ActiveMQTestBase { String[] preparedTransactions = jmxServer.listPreparedTransactions(); Assert.assertEquals(1, preparedTransactions.length); - System.out.println(preparedTransactions[0]); + instanceLog.debug(preparedTransactions[0]); if (isCommit) { jmxServer.commitPreparedTransaction(XidImpl.toBase64String(xid)); @@ -216,11 +216,11 @@ public class HeuristicXATest extends ActiveMQTestBase { if (isCommit) { String[] listHeuristicCommittedTransactions = jmxServer.listHeuristicCommittedTransactions(); Assert.assertEquals(1, listHeuristicCommittedTransactions.length); - System.out.println(listHeuristicCommittedTransactions[0]); + instanceLog.debug(listHeuristicCommittedTransactions[0]); } else { String[] listHeuristicRolledBackTransactions = jmxServer.listHeuristicRolledBackTransactions(); Assert.assertEquals(1, listHeuristicRolledBackTransactions.length); - System.out.println(listHeuristicRolledBackTransactions[0]); + instanceLog.debug(listHeuristicRolledBackTransactions[0]); } } @@ -269,7 +269,7 @@ public class HeuristicXATest extends ActiveMQTestBase { String[] preparedTransactions = jmxServer.listPreparedTransactions(); Assert.assertEquals(1, preparedTransactions.length); - System.out.println(preparedTransactions[0]); + instanceLog.debug(preparedTransactions[0]); if (heuristicCommit) { jmxServer.commitPreparedTransaction(XidImpl.toBase64String(xid)); @@ -295,11 +295,11 @@ public class HeuristicXATest extends ActiveMQTestBase { if (heuristicCommit) { String[] listHeuristicCommittedTransactions = jmxServer.listHeuristicCommittedTransactions(); Assert.assertEquals(1, listHeuristicCommittedTransactions.length); - System.out.println(listHeuristicCommittedTransactions[0]); + instanceLog.debug(listHeuristicCommittedTransactions[0]); } else { String[] listHeuristicRolledBackTransactions = jmxServer.listHeuristicRolledBackTransactions(); Assert.assertEquals(1, listHeuristicRolledBackTransactions.length); - System.out.println(listHeuristicRolledBackTransactions[0]); + instanceLog.debug(listHeuristicRolledBackTransactions[0]); } session = sf.createSession(true, false, false); @@ -370,7 +370,7 @@ public class HeuristicXATest extends ActiveMQTestBase { String[] preparedTransactions = jmxServer.listPreparedTransactions(); Assert.assertEquals(1, preparedTransactions.length); - System.out.println(preparedTransactions[0]); + instanceLog.debug(preparedTransactions[0]); if (heuristicCommit) { jmxServer.commitPreparedTransaction(XidImpl.toBase64String(xid)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java index ec641bd3d6..b296e4022c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/IncompatibleVersionTest.java @@ -40,10 +40,10 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSess import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.version.impl.VersionImpl; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.SpawnedTestBase; import org.apache.activemq.artemis.utils.SpawnedVMSupport; import org.apache.activemq.artemis.utils.VersionLoader; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -53,8 +53,9 @@ import static org.apache.activemq.artemis.tests.util.RandomUtil.randomString; public class IncompatibleVersionTest extends SpawnedTestBase { + private static final Logger log = Logger.getLogger(IncompatibleVersionTest.class); + private static final String WORD_START = "&*STARTED&*"; - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; // Constants ----------------------------------------------------- // Attributes ---------------------------------------------------- @@ -233,7 +234,7 @@ public class IncompatibleVersionTest extends SpawnedTestBase { System.out.println(WORD_START); - log.info("### server: " + startedString); + log.debug("### server: " + startedString); } } @@ -246,7 +247,7 @@ public class IncompatibleVersionTest extends SpawnedTestBase { locator = createNettyNonHALocator(); sf = locator.createSessionFactory(); ClientSession session = sf.createSession(false, true, true); - log.info("### client: connected. server incrementingVersion = " + session.getVersion()); + log.debug("### client: connected. server incrementingVersion = " + session.getVersion()); session.close(); } finally { closeSessionFactory(sf); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java index df4bc8c2ec..d4c73b1157 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/InterruptedLargeMessageTest.java @@ -63,11 +63,11 @@ import org.apache.activemq.artemis.core.settings.HierarchicalRepository; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.largemessage.LargeMessageTestBase; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ExecutorFactory; import org.apache.activemq.artemis.utils.actors.ArtemisExecutor; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -77,9 +77,9 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { static final int RECEIVE_WAIT_TIME = 60000; - private final int LARGE_MESSAGE_SIZE = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE * 3; + private static final Logger log = Logger.getLogger(InterruptedLargeMessageTest.class); - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private final int LARGE_MESSAGE_SIZE = ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE * 3; protected ServerLocator locator; @@ -180,7 +180,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { @Override public void run() { try { - System.out.println("Receiving message"); + instanceLog.debug("Receiving message"); ClientMessage msg = cons.receive(5000); if (msg == null) { System.err.println("Message not received"); @@ -234,7 +234,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { @Override public void run() { try { - System.out.println("Receiving message"); + instanceLog.debug("Receiving message"); javax.jms.Message msg = consumer.receive(5000); if (msg == null) { System.err.println("Message not received"); @@ -242,10 +242,10 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { return; } } catch (JMSException e) { - log.debug("This exception was ok as it was expected", e); + instanceLog.debug("This exception was ok as it was expected", e); expectedErrors.incrementAndGet(); } catch (Throwable e) { - log.warn("Captured unexpected exception", e); + instanceLog.warn("Captured unexpected exception", e); unexpectedErrors.incrementAndGet(); } } @@ -451,7 +451,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { server.start(); for (int start = 0; start < 2; start++) { - System.out.println("Start " + start); + instanceLog.debug("Start " + start); sf = createSessionFactory(locator); @@ -465,7 +465,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { ClientConsumer cons1 = session.createConsumer(ADDRESS); session.start(); for (int i = 0; i < 10; i++) { - log.info("I = " + i); + instanceLog.info("I = " + i); ClientMessage msg = cons1.receive(5000); Assert.assertNotNull(msg); Assert.assertEquals(1, msg.getIntProperty("txid").intValue()); @@ -529,7 +529,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { @Override public void postAcknowledge(final MessageReference ref, AckReason reason) { - System.out.println("Ignoring postACK on message " + ref); + instanceLog.debug("Ignoring postACK on message " + ref); } @Override @@ -739,7 +739,7 @@ public class InterruptedLargeMessageTest extends LargeMessageTestBase { if (packet instanceof SessionContinuationMessage) { SessionContinuationMessage msg = (SessionContinuationMessage) packet; if (!msg.isContinues() && intMessages) { - System.out.println("Ignored a message"); + log.debug("Ignored a message"); latch.countDown(); return false; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java index 48080fef02..99819af5b2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java @@ -57,7 +57,7 @@ public class JMSMessageCounterTest extends JMSTestBase { QueueControl control = (QueueControl) server.getManagementService().getResource(ResourceNames.QUEUE + queue.getQueueName()); assertNotNull(control); - System.out.println(control.listMessageCounterAsHTML()); + instanceLog.debug(control.listMessageCounterAsHTML()); jmsServer.stop(); @@ -66,7 +66,7 @@ public class JMSMessageCounterTest extends JMSTestBase { control = (QueueControl) server.getManagementService().getResource(ResourceNames.QUEUE + queue.getQueueName()); assertNotNull(control); - System.out.println(control.listMessageCounterAsHTML()); + instanceLog.debug(control.listMessageCounterAsHTML()); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java index f4087d4ba8..e883bf6b8f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSOrderTest.java @@ -113,7 +113,6 @@ public class JMSOrderTest extends JMSTestBase { Message message = consumer.receive(3000); assertNotNull("Failed to receive message: " + i, message); int msgNum = message.getIntProperty("nr"); - System.out.println("Received " + msgNum); messageNumbers.add(msgNum); } @@ -163,7 +162,6 @@ public class JMSOrderTest extends JMSTestBase { Message message = consumer.receive(3000); assertNotNull("Failed to receive message: " + i, message); int msgNum = message.getIntProperty("nr"); - System.out.println("Received " + msgNum); messageNumbers.add(msgNum); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java index bf2446b440..ff2335119a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java @@ -27,7 +27,6 @@ import javax.jms.Topic; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.paging.PagingStore; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.apache.activemq.artemis.tests.util.Wait; import org.junit.Before; @@ -38,8 +37,6 @@ import org.junit.Test; */ public class JMSPagingFileDeleteTest extends JMSTestBase { - static IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - Topic topic1; Connection connection; @@ -100,13 +97,13 @@ public class JMSPagingFileDeleteTest extends JMSTestBase { subscriber1 = session.createConsumer(topic1); // -----------------(Step1) Publish Messages to make Paging Files. -------------------- - System.out.println("---------- Send messages. ----------"); + instanceLog.debug("---------- Send messages. ----------"); BytesMessage bytesMessage = session.createBytesMessage(); bytesMessage.writeBytes(new byte[JMSPagingFileDeleteTest.MESSAGE_SIZE]); for (int i = 0; i < JMSPagingFileDeleteTest.MESSAGE_NUM; i++) { producer.send(bytesMessage); } - System.out.println("Sent " + JMSPagingFileDeleteTest.MESSAGE_NUM + " messages."); + instanceLog.debug("Sent " + JMSPagingFileDeleteTest.MESSAGE_NUM + " messages."); pagingStore = server.getPagingManager().getPageStore(new SimpleString("topic1")); printPageStoreInfo(pagingStore); @@ -148,13 +145,13 @@ public class JMSPagingFileDeleteTest extends JMSTestBase { subscriber2 = session.createDurableSubscriber(topic1, "subscriber-2"); // -----------------(Step1) Publish Messages to make Paging Files. -------------------- - System.out.println("---------- Send messages. ----------"); + instanceLog.debug("---------- Send messages. ----------"); BytesMessage bytesMessage = session.createBytesMessage(); bytesMessage.writeBytes(new byte[JMSPagingFileDeleteTest.MESSAGE_SIZE]); for (int i = 0; i < JMSPagingFileDeleteTest.MESSAGE_NUM; i++) { producer.send(bytesMessage); } - System.out.println("Sent " + JMSPagingFileDeleteTest.MESSAGE_NUM + " messages."); + instanceLog.debug("Sent " + JMSPagingFileDeleteTest.MESSAGE_NUM + " messages."); pagingStore = server.getPagingManager().getPageStore(new SimpleString("topic1")); printPageStoreInfo(pagingStore); @@ -167,7 +164,7 @@ public class JMSPagingFileDeleteTest extends JMSTestBase { stopAndStartServer(); // If try this test without restarting server, please comment out this line; // -----------------(Step3) Subscribe to all the messages from the topic.-------------- - System.out.println("---------- Receive all messages. ----------"); + instanceLog.debug("---------- Receive all messages. ----------"); for (int i = 0; i < JMSPagingFileDeleteTest.MESSAGE_NUM; i++) { Message message1 = subscriber1.receive(JMSPagingFileDeleteTest.RECEIVE_TIMEOUT); assertNotNull(message1); @@ -212,7 +209,7 @@ public class JMSPagingFileDeleteTest extends JMSTestBase { } private void stopAndStartServer() throws Exception { - System.out.println("---------- Restart server. ----------"); + instanceLog.debug("---------- Restart server. ----------"); connection.close(); jmsServer.stop(); @@ -235,11 +232,11 @@ public class JMSPagingFileDeleteTest extends JMSTestBase { } private void printPageStoreInfo(PagingStore pagingStore) throws Exception { - System.out.println("---------- Paging Store Info ----------"); - System.out.println(" CurrentPage = " + pagingStore.getCurrentPage()); - System.out.println(" FirstPage = " + pagingStore.getFirstPage()); - System.out.println(" Number of Pages = " + pagingStore.getNumberOfPages()); - System.out.println(" Address Size = " + pagingStore.getAddressSize()); - System.out.println(" Is Paging = " + pagingStore.isPaging()); + instanceLog.debug("---------- Paging Store Info ----------"); + instanceLog.debug(" CurrentPage = " + pagingStore.getCurrentPage()); + instanceLog.debug(" FirstPage = " + pagingStore.getFirstPage()); + instanceLog.debug(" Number of Pages = " + pagingStore.getNumberOfPages()); + instanceLog.debug(" Address Size = " + pagingStore.getAddressSize()); + instanceLog.debug(" Is Paging = " + pagingStore.isPaging()); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java index aa5a76be11..129ef389ef 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java @@ -282,9 +282,7 @@ public class JmsNettyNioStressTest extends ActiveMQTestBase { Wait.waitFor(() -> totalExpectedCount == totalCount.get(), 60000, 100); - System.out.println("Done.." + totalCount.get() + ", expected " + totalExpectedCount); Assert.assertEquals("Possible deadlock", totalExpectedCount, totalCount.get()); - System.out.println("After assert"); // attempt cleaning up (this is not in a finally, still needs some work) connectionProducer.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java index a03ca5d246..573ac1b5fa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java @@ -292,8 +292,6 @@ public class LargeMessageCompressTest extends LargeMessageTest { public void testHugeStreamingSpacesCompressed() throws Exception { final long messageSize = 1024L * 1024L; - System.out.println("Message size = " + messageSize); - ActiveMQServer server = createServer(true, isNetty()); server.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java index 7d4df6136a..745a6f7ea7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java @@ -50,21 +50,22 @@ import org.apache.activemq.artemis.core.server.MessageReference; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.largemessage.LargeMessageTestBase; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.RandomUtil; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class LargeMessageTest extends LargeMessageTestBase { - private static final int RECEIVE_WAIT_TIME = 10000; - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(LargeMessageTest.class); + + private static final int RECEIVE_WAIT_TIME = 10000; protected ServerLocator locator; @@ -85,7 +86,7 @@ public class LargeMessageTest extends LargeMessageTestBase { @Test public void testRollbackPartiallyConsumedBuffer() throws Exception { for (int i = 0; i < 1; i++) { - log.info("#test " + i); + log.debug("#test " + i); internalTestRollbackPartiallyConsumedBuffer(false); tearDown(); setUp(); @@ -600,7 +601,7 @@ public class LargeMessageTest extends LargeMessageTestBase { msg.acknowledge(); Assert.assertEquals(1, msg.getDeliveryCount()); - log.info("body buffer is " + msg.getBodyBuffer()); + log.debug("body buffer is " + msg.getBodyBuffer()); for (int i = 0; i < messageSize; i++) { Assert.assertEquals(ActiveMQTestBase.getSamplebyte(i), msg.getBodyBuffer().readByte()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java index 2a1145d680..593a1c1d31 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConcurrencyTest.java @@ -31,15 +31,15 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.MessageHandler; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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 MessageConcurrencyTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(MessageConcurrencyTest.class); private ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java index dee29af8bf..03d482c521 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java @@ -220,7 +220,6 @@ public class MessageConsumerRollbackTest extends ActiveMQTestBase { } if (counter.incrementAndGet() % 200 == 0) { - System.out.println("rollback " + message); session.rollback(); } else { commitLatch.countDown(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java index be7b48d11e..32108c337f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageGroupingTest.java @@ -37,8 +37,8 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.transaction.impl.XidImpl; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Assume; import org.junit.Before; @@ -46,7 +46,7 @@ import org.junit.Test; public class MessageGroupingTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(MessageGroupingTest.class); private ActiveMQServer server; @@ -199,7 +199,7 @@ public class MessageGroupingTest extends ActiveMQTestBase { Assert.assertEquals(cm.getBodyBuffer().readString(), "m" + i); } - MessageGroupingTest.log.info("closing consumer2"); + log.debug("closing consumer2"); consumer2.close(); @@ -294,7 +294,6 @@ public class MessageGroupingTest extends ActiveMQTestBase { } private void doTestMultipleGroupingTXRollback() throws Exception { - log.info("*** starting test"); ServerLocator locator = createInVMNonHALocator(); locator.setBlockOnAcknowledge(true); ClientSessionFactory sessionFactory = createSessionFactory(locator); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java index a43d5aedfc..08ac94f87b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java @@ -29,7 +29,6 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.MessageHandler; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Before; @@ -37,8 +36,6 @@ import org.junit.Test; public class MessageHandlerTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ActiveMQServer server; private final SimpleString QUEUE = new SimpleString("ConsumerTestQueue"); @@ -164,8 +161,6 @@ public class MessageHandlerTest extends ActiveMQTestBase { messageReceived++; - log.info("got message " + messageReceived); - latch.countDown(); if (latch.getCount() == 0) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java index bd0b88dedc..56ecd1c5fd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessagePriorityTest.java @@ -27,9 +27,9 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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.Test; @@ -38,7 +38,7 @@ public class MessagePriorityTest extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(MessagePriorityTest.class); // Attributes ---------------------------------------------------- @@ -118,7 +118,7 @@ public class MessagePriorityTest extends ActiveMQTestBase { for (int i = 9; i >= 0; i--) { ClientMessage m = consumer.receive(500); - log.info("received msg " + m.getPriority()); + log.debug("received msg " + m.getPriority()); Assert.assertNotNull(m); Assert.assertEquals(i, m.getPriority()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MixRoutingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MixRoutingTest.java index 7b3039dbe3..eb5b6d4aa5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MixRoutingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MixRoutingTest.java @@ -31,15 +31,15 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.SingleServerTestBase; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class MixRoutingTest extends SingleServerTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(MixRoutingTest.class); private static final long CONNECTION_TTL = 2000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java index 2af110413c..3986f1c39d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java @@ -154,7 +154,7 @@ public class MultipleThreadFilterOneTest extends ActiveMQTestBase { msg.acknowledge(); if (i % 500 == 0) { - System.out.println("Consumed " + i); + instanceLog.debug("Consumed " + i); consumerSession.commit(); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java index 0bd8145c98..623f8a5298 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/NIOvsOIOTest.java @@ -39,14 +39,14 @@ import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.core.settings.HierarchicalRepository; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.UUIDGenerator; +import org.jboss.logging.Logger; import org.junit.Test; public class NIOvsOIOTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(NIOvsOIOTest.class); // Constants ----------------------------------------------------- @@ -209,7 +209,7 @@ public class NIOvsOIOTest extends ActiveMQTestBase { log.error("Caught exception", e); } - //log.info(id + " sent message " + i); + //log.debug(id + " sent message " + i); } } @@ -283,7 +283,7 @@ public class NIOvsOIOTest extends ActiveMQTestBase { latch.countDown(); } - //log.info(id + " got msg " + count); + //log.debug(id + " got msg " + count); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java index 168475f2b7..aa1628664a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerFlowControlTest.java @@ -41,7 +41,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.settings.HierarchicalRepository; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.RandomUtil; import org.junit.Assert; @@ -50,8 +49,6 @@ import org.junit.Test; public class ProducerFlowControlTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ServerLocator locator; private ClientSessionFactory sf; @@ -247,7 +244,7 @@ public class ProducerFlowControlTest extends ActiveMQTestBase { } } catch (Exception e) { - ProducerFlowControlTest.log.error("Failed to handle message", e); + instanceLog.error("Failed to handle message", e); exception = e; @@ -303,7 +300,7 @@ public class ProducerFlowControlTest extends ActiveMQTestBase { double rate = 1000 * (double) numMessages / (end - start); - ProducerFlowControlTest.log.info("rate is " + rate + " msgs / sec"); + instanceLog.debug("rate is " + rate + " msgs / sec"); } @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java index ac66eecde3..8c5d6ac6b7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ProducerTest.java @@ -94,7 +94,7 @@ public class ProducerTest extends ActiveMQTestBase { for (int i = 0; i < 100; i++) { final CountDownLatch latch = new CountDownLatch(1); - System.out.println("Try " + i); + instanceLog.debug("Try " + i); ClientSessionFactory cf = locator.createSessionFactory(); final ClientSession session = cf.createSession(false, true, true); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java index e78e34ad38..84318671a9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java @@ -37,7 +37,6 @@ import org.apache.activemq.artemis.core.journal.RecordInfo; import org.apache.activemq.artemis.core.journal.impl.JournalImpl; import org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Test; @@ -46,8 +45,6 @@ public class RedeliveryConsumerTest extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Attributes ---------------------------------------------------- ActiveMQServer server; @@ -174,7 +171,7 @@ public class RedeliveryConsumerTest extends ActiveMQTestBase { setUp(strictUpdate); ClientSession session = factory.createSession(false, false, false); - RedeliveryConsumerTest.log.info("created"); + instanceLog.debug("created"); ClientProducer prod = session.createProducer(ADDRESS); prod.send(createTextMessage(session, "Hello")); @@ -226,7 +223,7 @@ public class RedeliveryConsumerTest extends ActiveMQTestBase { setUp(strict); ClientSession session = factory.createSession(false, false, false); - RedeliveryConsumerTest.log.info("created"); + instanceLog.debug("created"); ClientProducer prod = session.createProducer(ADDRESS); prod.send(createTextMessage(session, "Hello")); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java index 69ba87fbdf..4490c840d4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RequestorTest.java @@ -94,9 +94,6 @@ public class RequestorTest extends ActiveMQTestBase { requestConsumer.setMessageHandler(new SimpleMessageHandler(key, sessionRequest)); for (int i = 0; i < 2000; i++) { - if (i % 100 == 0) { - System.out.println(i); - } final ClientSession session = sf.createSession(false, true, true); session.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java index f9be93ae1c..9150e9519e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SelfExpandingBufferTest.java @@ -26,7 +26,6 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.RandomUtil; import org.junit.Assert; @@ -34,8 +33,6 @@ import org.junit.Test; public class SelfExpandingBufferTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - ActiveMQServer service; SimpleString ADDRESS = new SimpleString("Address"); @@ -79,8 +76,6 @@ public class SelfExpandingBufferTest extends ActiveMQTestBase { ActiveMQBuffer buffer = msg.getBodyBuffer(); - SelfExpandingBufferTest.log.info("buffer is " + buffer); - byte[] bytes = RandomUtil.randomBytes(10 * buffer.capacity()); buffer.writeBytes(bytes); @@ -103,11 +98,11 @@ public class SelfExpandingBufferTest extends ActiveMQTestBase { byte[] receivedBytes = new byte[bytes.length]; - // log.info("buffer start pos should be at " + PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT); + // log.debug("buffer start pos should be at " + PacketImpl.PACKET_HEADERS_SIZE + DataConstants.SIZE_INT); // - // log.info("buffer pos at " + msg2.getBodyBuffer().readerIndex()); + // log.debug("buffer pos at " + msg2.getBodyBuffer().readerIndex()); // - // log.info("buffer length should be " + msg2.getBodyBuffer().readInt(PacketImpl.PACKET_HEADERS_SIZE)); + // log.debug("buffer length should be " + msg2.getBodyBuffer().readInt(PacketImpl.PACKET_HEADERS_SIZE)); msg2.getBodyBuffer().readBytes(receivedBytes); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SendAckFailTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SendAckFailTest.java index 3e99da8b49..d3eda70349 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SendAckFailTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SendAckFailTest.java @@ -186,14 +186,14 @@ public class SendAckFailTest extends SpawnedTestBase { ClientMessage message = consumer.receive(1000); if (message == null) { for (Integer msgi : listSent) { - System.out.println("Message " + msgi + " was lost"); + instanceLog.debug("Message " + msgi + " was lost"); } fail("missed messages!"); } message.acknowledge(); if (!listSent.remove(message.getIntProperty("myid"))) { - System.out.println("Message " + message + " with id " + message.getIntProperty("myid") + " received in duplicate"); + instanceLog.debug("Message " + message + " with id " + message.getIntProperty("myid") + " received in duplicate"); fail("Message " + message + " with id " + message.getIntProperty("myid") + " received in duplicate"); } } @@ -252,8 +252,6 @@ public class SendAckFailTest extends SpawnedTestBase { if (fail) { if (count.incrementAndGet() == 110) { - System.out.println("Failing " + message); - System.out.flush(); Thread.sleep(100); Runtime.getRuntime().halt(-1); } @@ -268,7 +266,7 @@ public class SendAckFailTest extends SpawnedTestBase { - System.out.println("Location::" + server.getConfiguration().getJournalLocation().getAbsolutePath()); + instanceLog.debug("Location::" + server.getConfiguration().getJournalLocation().getAbsolutePath()); addServer(server); server.start(); return server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java index 083ac7c673..55e643d83d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionStopStartTest.java @@ -29,15 +29,15 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.MessageHandler; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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 SessionStopStartTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(SessionStopStartTest.class); private ActiveMQServer server; @@ -210,9 +210,6 @@ public class SessionStopStartTest extends ActiveMQTestBase { session.start(); for (int i = 0; i < 90; i++) { ClientMessage msg = consumer.receive(1000); - if (msg == null) { - System.out.println("ClientConsumerTest.testStopConsumer"); - } Assert.assertNotNull("message " + i, msg); msg.acknowledge(); } @@ -297,9 +294,6 @@ public class SessionStopStartTest extends ActiveMQTestBase { session.start(); for (int i = 0; i < 90; i++) { ClientMessage msg = consumer.receive(1000); - if (msg == null) { - System.out.println("ClientConsumerTest.testStopConsumer"); - } Assert.assertNotNull("message " + i, msg); msg.acknowledge(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java index 06250f2fa6..80d34e6f5c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SimpleSendMultipleQueuesTest.java @@ -59,9 +59,9 @@ public class SimpleSendMultipleQueuesTest extends ActiveMQTestBase { message.getBodyBuffer().writeString(body); - // log.info("sending message"); + // log.debug("sending message"); producer.send(message); - // log.info("sent message"); + // log.debug("sent message"); ClientMessage received1 = consumer1.receive(1000); Assert.assertNotNull(received1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java index 96bdfe07d6..76904100c0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java @@ -48,16 +48,16 @@ import org.apache.activemq.artemis.core.server.impl.ServerSessionImpl; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.SingleServerTestBase; import org.apache.activemq.artemis.utils.RandomUtil; +import org.jboss.logging.Logger; import org.junit.Test; public class TemporaryQueueTest extends SingleServerTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(TemporaryQueueTest.class); private static final long CONNECTION_TTL = 2000; @@ -108,8 +108,6 @@ public class TemporaryQueueTest extends SingleServerTestBase { sf.close(); - System.out.println("size = " + server.getAddressSettingsRepository().getCacheSize()); - assertTrue(server.getAddressSettingsRepository().getCacheSize() < 10); } @@ -398,7 +396,6 @@ public class TemporaryQueueTest extends SingleServerTestBase { localSession.start(); - log.info("Iteration " + i); String queueRed = address + "_red_" + (countTmpQueue++); String queueBlue = address + "_blue_" + (countTmpQueue++); @@ -556,7 +553,6 @@ public class TemporaryQueueTest extends SingleServerTestBase { errors.incrementAndGet(); } - System.out.println("done"); } }; @@ -590,7 +586,6 @@ public class TemporaryQueueTest extends SingleServerTestBase { for (ServerSession sessionIterator : server.getSessions()) { if (sessionIterator.getMetaData("consumer") != null) { - System.out.println("Failing session"); ServerSessionImpl impl = (ServerSessionImpl) sessionIterator; impl.getRemotingConnection().fail(new ActiveMQDisconnectedException("failure e")); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java index ff92b113c5..5aabb1e2be 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java @@ -29,9 +29,9 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.SpawnedVMCheck; import org.apache.activemq.artemis.utils.SpawnedVMSupport; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -44,6 +44,8 @@ import org.junit.Test; */ public class ClientCrashTest extends ClientTestBase { + private static final Logger log = Logger.getLogger(ClientCrashTest.class); + @Rule public SpawnedVMCheck spawnedVMCheck = new SpawnedVMCheck(); @@ -64,8 +66,6 @@ public class ClientCrashTest extends ClientTestBase { // Static -------------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Attributes ---------------------------------------------------- private ClientSessionFactory sf; @@ -125,8 +125,6 @@ public class ClientCrashTest extends ClientTestBase { assertEquals(9, p.exitValue()); - System.out.println("VM Exited"); - long timeout = ClientCrashTest.CONNECTION_TTL + ClientCrashTest.PING_PERIOD + 10000; assertActiveConnections(1, timeout); @@ -159,8 +157,6 @@ public class ClientCrashTest extends ClientTestBase { assertEquals(CrashClient2.OK, p.exitValue()); - System.out.println("VM Exited"); - long timeout = ClientCrashTest.CONNECTION_TTL + ClientCrashTest.PING_PERIOD + 10000L; assertActiveConnections(1, timeout); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java index e179826cb2..5fc6f1a0ae 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientExitTest.java @@ -23,9 +23,9 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage; import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.utils.SpawnedVMSupport; import org.apache.activemq.artemis.utils.RandomUtil; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; @@ -45,7 +45,7 @@ public class ClientExitTest extends ClientTestBase { // Static --------------------------------------------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(ClientExitTest.class); // Attributes ----------------------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java index 4bc6010040..13cbc08181 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.tests.integration.clientcrash; -import java.util.Arrays; - import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.api.core.client.ClientMessage; @@ -27,25 +25,23 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; /** * Code to be run in an external VM, via main() */ public class CrashClient { + private static final Logger log = Logger.getLogger(CrashClient.class); + public static int OK = 9; public static int NOT_OK = 1; // Constants ------------------------------------------------------------------------------------ - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Static --------------------------------------------------------------------------------------- public static void main(final String[] args) throws Exception { try { - CrashClient.log.debug("args = " + Arrays.asList(args)); - ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName())); locator.setClientFailureCheckPeriod(ClientCrashTest.PING_PERIOD); locator.setConnectionTTL(ClientCrashTest.CONNECTION_TTL); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java index 40367f5fbe..14c2183660 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/CrashClient2.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.tests.integration.clientcrash; -import java.util.Arrays; - import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.api.core.client.ClientConsumer; @@ -27,24 +25,21 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; /** * Code to be run in an external VM, via main() */ public class CrashClient2 { + private static final Logger log = Logger.getLogger(CrashClient2.class); public static final int OK = 9; // Constants ------------------------------------------------------------------------------------ - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Static --------------------------------------------------------------------------------------- public static void main(final String[] args) throws Exception { try { - log.debug("args = " + Arrays.asList(args)); - ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName())); locator.setClientFailureCheckPeriod(ClientCrashTest.PING_PERIOD); locator.setConnectionTTL(ClientCrashTest.CONNECTION_TTL); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java index cb2102384b..8c0f09b024 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptor.java @@ -25,11 +25,11 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.protocol.core.Packet; import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveMessage; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; public class DummyInterceptor implements Interceptor { - protected IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(DummyInterceptor.class); boolean sendException = false; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java index 81ef047f30..d8ec7c2009 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/DummyInterceptorB.java @@ -22,11 +22,11 @@ import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.Interceptor; import org.apache.activemq.artemis.core.protocol.core.Packet; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; public class DummyInterceptorB implements Interceptor { - protected IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(DummyInterceptorB.class); static AtomicInteger syncCounter = new AtomicInteger(0); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java index bec01f2d4d..d4d42caadc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/GracefulClient.java @@ -26,15 +26,15 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; /** * Code to be run in an external VM, via main() */ public class GracefulClient { - // Constants ------------------------------------------------------------------------------------ + private static final Logger log = Logger.getLogger(GracefulClient.class); - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + // Constants ------------------------------------------------------------------------------------ // Static --------------------------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java index 703de6b136..7e9401c346 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java @@ -48,7 +48,6 @@ public class PendingDeliveriesTest extends ClientTestBase { @After public void clearLogger() throws Exception { - System.out.println("After clearing"); AssertionLoggerHandler.stopCapture(); AssertionLoggerHandler.clear(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerAction.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerAction.java index 8ade9eed4d..7d5632194b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerAction.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/NodeManagerAction.java @@ -125,7 +125,6 @@ public class NodeManagerAction { e.printStackTrace(); System.exit(9); } - System.out.println("work performed"); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java index e2b819ea2b..49680f2f38 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java @@ -46,13 +46,14 @@ import org.apache.activemq.artemis.core.server.cluster.impl.BridgeImpl; import org.apache.activemq.artemis.core.server.impl.InVMNodeManager; import org.apache.activemq.artemis.core.server.management.ManagementService; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.apache.activemq.artemis.tests.util.Wait; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; public class BridgeReconnectTest extends BridgeTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(BridgeReconnectTest.class); private static final int NUM_MESSAGES = 100; @@ -204,7 +205,7 @@ public class BridgeReconnectTest extends BridgeTestBase { startServers(); - BridgeReconnectTest.log.info("** failing connection"); + BridgeReconnectTest.log.debug("** failing connection"); // Now we will simulate a failure of the bridge connection between server0 and server1 server0.fail(true); @@ -445,16 +446,16 @@ public class BridgeReconnectTest extends BridgeTestBase { ClientProducer prod0 = session0.createProducer(testAddress); - BridgeReconnectTest.log.info("stopping server1"); + BridgeReconnectTest.log.debug("stopping server1"); server1.stop(); if (sleep) { Thread.sleep(2 * clientFailureCheckPeriod); } - BridgeReconnectTest.log.info("restarting server1"); + BridgeReconnectTest.log.debug("restarting server1"); server1.start(); - BridgeReconnectTest.log.info("server 1 restarted"); + BridgeReconnectTest.log.debug("server 1 restarted"); ClientSessionFactory csf1 = locator.createSessionFactory(server1tc); session1 = csf1.createSession(false, true, true); @@ -474,7 +475,7 @@ public class BridgeReconnectTest extends BridgeTestBase { prod0.send(message); } - BridgeReconnectTest.log.info("sent messages"); + BridgeReconnectTest.log.debug("sent messages"); for (int i = 0; i < numMessages; i++) { ClientMessage r1 = cons1.receive(30000); @@ -482,7 +483,7 @@ public class BridgeReconnectTest extends BridgeTestBase { assertEquals("property value matches", i, r1.getObjectProperty(propKey)); } - BridgeReconnectTest.log.info("got messages"); + BridgeReconnectTest.log.debug("got messages"); closeServers(); assertNoMoreConnections(); } @@ -585,7 +586,7 @@ public class BridgeReconnectTest extends BridgeTestBase { fail("Message " + outOfOrder + " was received out of order, it was supposed to be " + supposed); } - log.info("=========== second failure, sending message"); + log.debug("=========== second failure, sending message"); // Fail again - should reconnect forwardingConnection = ((BridgeImpl) bridge).getForwardingConnection(); @@ -666,8 +667,6 @@ public class BridgeReconnectTest extends BridgeTestBase { final Queue queue = (Queue) server0.getPostOffice().getBinding(new SimpleString(queueName)).getBindable(); - System.out.println("DeliveringCount: " + queue.getDeliveringCount()); - for (int i = 0; i < numMessages; i++) { ClientMessage message = session0.createMessage(false); message.putIntProperty(propKey, i); @@ -679,12 +678,7 @@ public class BridgeReconnectTest extends BridgeTestBase { } } - for (int i = 0; i < 100 && queue.getDeliveringCount() != 0; i++) { - Thread.sleep(10); - } - - System.out.println("Check.. DeliveringCount: " + queue.getDeliveringCount()); - assertEquals("Delivering count of a source queue should be zero on connection failure", 0, queue.getDeliveringCount()); + Wait.assertEquals(0, queue::getDeliveringCount); closeServers(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeStartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeStartTest.java index ee52ea490d..13ba888be4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeStartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeStartTest.java @@ -37,7 +37,6 @@ import org.apache.activemq.artemis.core.config.BridgeConfiguration; import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.cluster.Bridge; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Test; @@ -58,8 +57,6 @@ public class BridgeStartTest extends ActiveMQTestBase { private final boolean netty; - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected boolean isNetty() { return netty; } @@ -337,12 +334,8 @@ public class BridgeStartTest extends ActiveMQTestBase { sf1.close(); - BridgeStartTest.log.info("stopping server 1"); - server1.stop(); - BridgeStartTest.log.info("stopped server 1"); - for (int i = 0; i < numMessages; i++) { ClientMessage message = session0.createMessage(false); @@ -351,13 +344,9 @@ public class BridgeStartTest extends ActiveMQTestBase { producer0.send(message); } - BridgeStartTest.log.info("sent some more messages"); - server1.start(); waitForServerToStart(server1); - BridgeStartTest.log.info("started server1"); - sf1 = locator.createSessionFactory(server1tc); session1 = sf1.createSession(false, true, true); @@ -366,8 +355,6 @@ public class BridgeStartTest extends ActiveMQTestBase { session1.start(); - BridgeStartTest.log.info("started session"); - for (int i = 0; i < numMessages; i++) { ClientMessage message = consumer1.receive(1000); @@ -625,8 +612,6 @@ public class BridgeStartTest extends ActiveMQTestBase { Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName); - BridgeStartTest.log.info("stopping bridge manually"); - bridge.stop(); bridge.flushExecutor(); @@ -643,8 +628,6 @@ public class BridgeStartTest extends ActiveMQTestBase { bridge.start(); - BridgeStartTest.log.info("started bridge"); - // The previous messages will get resent, but with duplicate detection they will be rejected // at the target diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java index 63de32ca54..00d2dc1390 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java @@ -82,6 +82,7 @@ import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.artemis.utils.RandomUtil; import org.apache.activemq.artemis.utils.ReusableLatch; import org.apache.activemq.artemis.utils.collections.LinkedListIterator; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -91,6 +92,8 @@ import org.junit.runners.Parameterized; @RunWith(value = Parameterized.class) public class BridgeTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(BridgeTest.class); + private ActiveMQServer server0; private ActiveMQServer server1; private ServerLocator locator; @@ -248,7 +251,6 @@ public class BridgeTest extends ActiveMQTestBase { assertEquals(0, loadQueues(server0).size()); } long timeTaken = System.currentTimeMillis() - time; - System.out.println(timeTaken + "ms"); } @Test @@ -391,7 +393,6 @@ public class BridgeTest extends ActiveMQTestBase { assertEquals(0, loadQueues(server0).size()); } long timeTaken = System.currentTimeMillis() - time; - System.out.println(timeTaken + "ms"); } public void internaltestSimpleBridge(final boolean largeMessage, final boolean useFiles) throws Exception { @@ -1495,7 +1496,7 @@ public class BridgeTest extends ActiveMQTestBase { msgCount.incrementAndGet(); if (i % 500 == 0) - System.out.println("received " + i); + instanceLog.debug("received " + i); } boolean failed = false; @@ -1569,14 +1570,11 @@ public class BridgeTest extends ActiveMQTestBase { if (packet instanceof SessionSendMessage && ++count == 100) { try { - System.out.println("Stopping server after " + count + " messages"); - thread = new Thread("***Server Restarter***") { @Override public void run() { try { - System.out.println("Stopping server"); serverToStop.fail(false); latch.countDown(); } catch (Exception e) { @@ -1816,7 +1814,7 @@ public class BridgeTest extends ActiveMQTestBase { File outputFile = new File(getTemporaryDir(), "huge_message_received.dat"); - System.out.println("-----message save to: " + outputFile.getAbsolutePath()); + instanceLog.debug("-----message save to: " + outputFile.getAbsolutePath()); FileOutputStream fileOutputStream = new FileOutputStream(outputFile); BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream); @@ -1861,7 +1859,7 @@ public class BridgeTest extends ActiveMQTestBase { createFile(fileInput, largeMessageSize); - System.out.println("File created at: " + fileInput.getAbsolutePath()); + instanceLog.debug("File created at: " + fileInput.getAbsolutePath()); ClientMessage message = session.createMessage(Message.BYTES_TYPE, true); @@ -1875,13 +1873,13 @@ public class BridgeTest extends ActiveMQTestBase { private static void createFile(final File file, final long fileSize) throws IOException { if (file.exists()) { - System.out.println("---file already there " + file.length()); + log.warn("---file already there " + file.length()); return; } FileOutputStream fileOut = new FileOutputStream(file); BufferedOutputStream buffOut = new BufferedOutputStream(fileOut); byte[] outBuffer = new byte[1024 * 1024]; - System.out.println(" --- creating file, size: " + fileSize); + log.debug(" --- creating file, size: " + fileSize); for (long i = 0; i < fileSize; i += outBuffer.length) { buffOut.write(outBuffer); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java index 3213953890..4fb2faf728 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java @@ -300,7 +300,7 @@ public class ProtocolsMessageLoadBalancingTest extends ClusterTestBase { startServers(MessageLoadBalancingType.STRICT); - System.out.println("connections " + servers[1].getRemotingService().getConnections().size()); + instanceLog.debug("connections " + servers[1].getRemotingService().getConnections().size()); Wait.assertEquals(3, () -> servers[1].getRemotingService().getConnections().size()); Wait.assertEquals(3, () -> servers[0].getRemotingService().getConnections().size()); @@ -356,7 +356,7 @@ public class ProtocolsMessageLoadBalancingTest extends ClusterTestBase { waitForBindings(0, "queues.0", 1, 1, false); waitForBindings(1, "queues.0", 1, 1, false); - System.out.println("connections " + servers[1].getRemotingService().getConnections().size()); + instanceLog.debug("connections " + servers[1].getRemotingService().getConnections().size()); // sending Messages.. they should be load balanced { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java index 1c873eb60d..02eb2450d8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteDistributedTest.java @@ -33,14 +33,13 @@ import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancing import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.logs.AssertionLoggerHandler; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class AutoDeleteDistributedTest extends ClusterTestBase { - - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(AutoDeleteDistributedTest.class); @Override @Before @@ -110,7 +109,7 @@ public class AutoDeleteDistributedTest extends ClusterTestBase { client2JmsConsumer.setMessageListener(new MessageListener() { @Override public void onMessage(final javax.jms.Message m) { - System.out.println("Message received. " + m); + log.debug("Message received. " + m); onMessageReceived.countDown(); } }); @@ -125,7 +124,7 @@ public class AutoDeleteDistributedTest extends ClusterTestBase { jmsProducer.setAsync(new javax.jms.CompletionListener() { @Override public void onCompletion(final javax.jms.Message m) { - System.out.println("Message sent. " + m); + log.debug("Message sent. " + m); onMessageSent.countDown(); } @@ -141,11 +140,11 @@ public class AutoDeleteDistributedTest extends ClusterTestBase { jmsProducer.send(client1JmsContext.createQueue("queues.myQueue"), jmsMsg); } - System.out.println("Waiting for message to be sent..."); + log.debug("Waiting for message to be sent..."); onMessageSent.await(5, TimeUnit.SECONDS); } - System.out.println("Waiting for message to be received..."); + log.debug("Waiting for message to be received..."); Assert.assertTrue(onMessageReceived.await(5, TimeUnit.SECONDS)); client2JmsConsumer.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterConnectionConfigTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterConnectionConfigTest.java index db775114f3..31c1520a3c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterConnectionConfigTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterConnectionConfigTest.java @@ -58,7 +58,6 @@ public class ClusterConnectionConfigTest extends ClusterTestBase { @Test public void testRedistributionFlowControl() throws Exception { final int producerWindow = new Random().nextInt(Integer.MAX_VALUE); - System.out.println("window is: " + producerWindow); setupCluster(MessageLoadBalancingType.ON_DEMAND, (ClusterConnectionConfiguration cfg) -> { cfg.setProducerWindowSize(producerWindow); }); @@ -82,7 +81,6 @@ public class ClusterConnectionConfigTest extends ClusterTestBase { //receiveMessages(consumers[1].consumer, 0, 1, true); Thread.sleep(5000); - System.out.println("checking records.........................."); makeSureForwardingFlowControl(producerWindow, 0, 1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java index 8205ee05f6..7e812a5b81 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java @@ -85,9 +85,9 @@ import org.apache.activemq.artemis.core.server.group.GroupingHandler; import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.server.impl.InVMNodeManager; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.PortCheckRule; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -95,7 +95,7 @@ import org.junit.ClassRule; public abstract class ClusterTestBase extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(ClusterTestBase.class); private static final int[] PORTS = {TransportConstants.DEFAULT_PORT, TransportConstants.DEFAULT_PORT + 1, TransportConstants.DEFAULT_PORT + 2, TransportConstants.DEFAULT_PORT + 3, TransportConstants.DEFAULT_PORT + 4, TransportConstants.DEFAULT_PORT + 5, TransportConstants.DEFAULT_PORT + 6, TransportConstants.DEFAULT_PORT + 7, TransportConstants.DEFAULT_PORT + 8, TransportConstants.DEFAULT_PORT + 9,}; @@ -349,7 +349,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { } } topologyDiagram.append("\n"); - log.info(topologyDiagram.toString()); + log.debug(topologyDiagram.toString()); } catch (Throwable e) { log.warn("error printing the topology::" + e.getMessage(), e); } @@ -430,14 +430,14 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { PostOffice po = server.getPostOffice(); Bindings bindings = po.getBindingsForAddress(new SimpleString(address)); - System.out.println("======================================================================="); - System.out.println("Binding information for address = " + address + " on node " + node); + log.debug("======================================================================="); + log.debug("Binding information for address = " + address + " on node " + node); for (Binding binding : bindings.getBindings()) { if (binding.isConnected() && (binding instanceof LocalQueueBinding && local || binding instanceof RemoteQueueBinding && !local)) { QueueBinding qBinding = (QueueBinding) binding; - System.out.println("Binding = " + qBinding + ", queue=" + qBinding.getQueue()); + log.debug("Binding = " + qBinding + ", queue=" + qBinding.getQueue()); } } @@ -544,7 +544,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { filterString = ClusterTestBase.FILTER_PROP.toString() + "='" + filterVal + "'"; } - log.info("Creating " + queueName + " , address " + address + " on " + servers[node]); + log.debug("Creating " + queueName + " , address " + address + " on " + servers[node]); session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filterString).setDurable(durable)); @@ -868,7 +868,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { ClientMessage message = holder.consumer.receive(2000); if (message == null) { - log.info("*** dumping consumers:"); + log.debug("*** dumping consumers:"); dumpConsumers(); @@ -952,7 +952,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { ClientMessage message = holder.consumer.receive(WAIT_TIMEOUT); if (message == null) { - log.info("*** dumping consumers:"); + log.debug("*** dumping consumers:"); dumpConsumers(); @@ -978,9 +978,9 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { message.getObjectProperty(ClusterTestBase.COUNT_PROP); } outOfOrder = true; - System.out.println("Message j=" + j + " was received out of order = " + + log.debug("Message j=" + j + " was received out of order = " + message.getObjectProperty(ClusterTestBase.COUNT_PROP)); - log.info("Message j=" + j + + log.debug("Message j=" + j + " was received out of order = " + message.getObjectProperty(ClusterTestBase.COUNT_PROP)); } @@ -993,7 +993,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { private void dumpConsumers() throws Exception { for (int i = 0; i < consumers.length; i++) { if (consumers[i] != null && !consumers[i].consumer.isClosed()) { - log.info("Dumping consumer " + i); + log.debug("Dumping consumer " + i); checkReceive(i); } @@ -1046,11 +1046,11 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { message = holder.consumer.receive(500); if (message != null) { - log.info("check receive Consumer " + consumerID + + log.debug("check receive Consumer " + consumerID + " received message " + message.getObjectProperty(ClusterTestBase.COUNT_PROP)); } else { - log.info("check receive Consumer " + consumerID + " null message"); + log.debug("check receive Consumer " + consumerID + " null message"); } } while (message != null); @@ -1220,7 +1220,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { checkMessageBody(message); - // log.info("consumer " + consumerIDs[i] + " received message " + count); + // log.debug("consumer " + consumerIDs[i] + " received message " + count); Assert.assertFalse(counts.contains(count)); @@ -1920,7 +1920,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { protected void startServers(final int... nodes) throws Exception { for (int node : nodes) { - log.info("#test start node " + node); + log.debug("#test start node " + node); final long currentTime = System.currentTimeMillis(); boolean waitForSelf = currentTime - timeStarts[node] < TIMEOUT_START_SERVER; boolean waitForPrevious = node > 0 && currentTime - timeStarts[node - 1] < TIMEOUT_START_SERVER; @@ -1928,10 +1928,10 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { Thread.sleep(TIMEOUT_START_SERVER); } timeStarts[node] = System.currentTimeMillis(); - log.info("starting server " + servers[node]); + log.debug("starting server " + servers[node]); servers[node].start(); - log.info("started server " + servers[node]); + log.debug("started server " + servers[node]); waitForServerToStart(servers[node]); for (int i = 0; i < node * 1000; i++) { @@ -1954,7 +1954,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { } protected void stopServers(final int... nodes) throws Exception { - log.info("Stopping nodes " + Arrays.toString(nodes)); + log.debug("Stopping nodes " + Arrays.toString(nodes)); Exception exception = null; for (int node : nodes) { if (servers[node] != null && servers[node].isStarted()) { @@ -1966,9 +1966,9 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { timeStarts[node] = System.currentTimeMillis(); - log.info("stopping server " + node); + log.debug("stopping server " + node); servers[node].stop(); - log.info("server " + node + " stopped"); + log.debug("server " + node + " stopped"); } catch (Exception e) { exception = e; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterWithBackupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterWithBackupTest.java index 0a65415691..ed0c637579 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterWithBackupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterWithBackupTest.java @@ -17,14 +17,11 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Before; import org.junit.Test; public class ClusterWithBackupTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override @Before public void setUp() throws Exception { @@ -39,41 +36,35 @@ public class ClusterWithBackupTest extends ClusterTestBase { @Test public void testBasicRoundRobin() throws Throwable { - try { - setupCluster(); + setupCluster(); - startServers(0, 1, 2, 3, 4, 5); + startServers(0, 1, 2, 3, 4, 5); - setupSessionFactory(3, isNetty()); - setupSessionFactory(4, isNetty()); - setupSessionFactory(5, isNetty()); + setupSessionFactory(3, isNetty()); + setupSessionFactory(4, isNetty()); + setupSessionFactory(5, isNetty()); - createQueue(3, "queues.testaddress", "queue0", null, false); - createQueue(4, "queues.testaddress", "queue0", null, false); - createQueue(5, "queues.testaddress", "queue0", null, false); + createQueue(3, "queues.testaddress", "queue0", null, false); + createQueue(4, "queues.testaddress", "queue0", null, false); + createQueue(5, "queues.testaddress", "queue0", null, false); - addConsumer(0, 3, "queue0", null); - addConsumer(1, 4, "queue0", null); - addConsumer(2, 5, "queue0", null); + addConsumer(0, 3, "queue0", null); + addConsumer(1, 4, "queue0", null); + addConsumer(2, 5, "queue0", null); - waitForBindings(3, "queues.testaddress", 1, 1, true); - waitForBindings(4, "queues.testaddress", 1, 1, true); - waitForBindings(5, "queues.testaddress", 1, 1, true); + waitForBindings(3, "queues.testaddress", 1, 1, true); + waitForBindings(4, "queues.testaddress", 1, 1, true); + waitForBindings(5, "queues.testaddress", 1, 1, true); - waitForBindings(3, "queues.testaddress", 2, 2, false); - waitForBindings(4, "queues.testaddress", 2, 2, false); - waitForBindings(5, "queues.testaddress", 2, 2, false); + waitForBindings(3, "queues.testaddress", 2, 2, false); + waitForBindings(4, "queues.testaddress", 2, 2, false); + waitForBindings(5, "queues.testaddress", 2, 2, false); - send(3, "queues.testaddress", 100, false, null); + send(3, "queues.testaddress", 100, false, null); - verifyReceiveRoundRobinInSomeOrder(100, 0, 1, 2); + verifyReceiveRoundRobinInSomeOrder(100, 0, 1, 2); - verifyNotReceive(0, 0, 1, 2); - } catch (Throwable e) { - e.printStackTrace(); - log.error(e.getMessage(), e); - throw e; - } + verifyNotReceive(0, 0, 1, 2); } protected void setupCluster() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java index 47c7dc44f3..a384507bc0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredGroupingTest.java @@ -48,14 +48,16 @@ import org.apache.activemq.artemis.core.server.management.Notification; import org.apache.activemq.artemis.core.server.management.NotificationListener; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.utils.ActiveMQThreadFactory; import org.apache.activemq.artemis.utils.RetryRule; +import org.jboss.logging.Logger; import org.junit.Rule; import org.junit.Test; public class ClusteredGroupingTest extends ClusterTestBase { + private static final Logger log = Logger.getLogger(ClusteredGroupingTest.class); + @Rule public RetryRule retryRule = new RetryRule(2); @@ -595,12 +597,12 @@ public class ClusteredGroupingTest extends ClusterTestBase { groups.add(group); } producer.send(message); - IntegrationTestLogger.LOGGER.trace("Sent message to server 1 with dupID: " + dupID); + log.trace("Sent message to server 1 with dupID: " + dupID); } session.commit(); totalMessageProduced.addAndGet(500); - IntegrationTestLogger.LOGGER.trace("Sent block of 500 messages to server 1. Total sent: " + totalMessageProduced.get()); + log.trace("Sent block of 500 messages to server 1. Total sent: " + totalMessageProduced.get()); session.close(); // need thread pool to service both consumers and producers plus a thread to cycle nodes @@ -622,7 +624,7 @@ public class ClusteredGroupingTest extends ClusterTestBase { String group = groupx; String basicID = UUID.randomUUID().toString(); - IntegrationTestLogger.LOGGER.debug("Starting producer thread..."); + log.debug("Starting producer thread..."); ClientSessionFactory factory; ClientSession session = null; ClientProducer producer = null; @@ -640,12 +642,12 @@ public class ClusteredGroupingTest extends ClusterTestBase { } else { factory = sf0; } - IntegrationTestLogger.LOGGER.debug("Creating producer session factory to node " + targetServer); + log.debug("Creating producer session factory to node " + targetServer); session = addClientSession(factory.createSession(false, true, true)); producer = addClientProducer(session.createProducer(ADDRESS)); } catch (Exception e) { errors.incrementAndGet(); - IntegrationTestLogger.LOGGER.warn("Producer thread couldn't establish connection", e); + log.warn("Producer thread couldn't establish connection", e); return; } @@ -661,11 +663,11 @@ public class ClusteredGroupingTest extends ClusterTestBase { totalMessageProduced.incrementAndGet(); messageCount++; } catch (ActiveMQException e) { - IntegrationTestLogger.LOGGER.warn("Producer thread threw exception while sending messages to " + targetServer + ": " + e.getMessage()); + log.warn("Producer thread threw exception while sending messages to " + targetServer + ": " + e.getMessage()); // in case of a failure we change the group to make possible errors more likely group = group + "afterFail"; } catch (Exception e) { - IntegrationTestLogger.LOGGER.warn("Producer thread threw unexpected exception while sending messages to " + targetServer + ": " + e.getMessage()); + log.warn("Producer thread threw unexpected exception while sending messages to " + targetServer + ": " + e.getMessage()); group = group + "afterFail"; break; } @@ -688,7 +690,6 @@ public class ClusteredGroupingTest extends ClusterTestBase { e.printStackTrace(); // ignore } - System.out.println("Cycling server"); cycleServer(1); } finally { okToConsume.countDown(); @@ -708,13 +709,13 @@ public class ClusteredGroupingTest extends ClusterTestBase { @Override public void run() { try { - IntegrationTestLogger.LOGGER.info("Waiting to start consumer thread..."); + log.debug("Waiting to start consumer thread..."); okToConsume.await(20, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); return; } - IntegrationTestLogger.LOGGER.info("Starting consumer thread..."); + log.debug("Starting consumer thread..."); ClientSessionFactory factory; ClientSession session = null; ClientConsumer consumer = null; @@ -731,14 +732,14 @@ public class ClusteredGroupingTest extends ClusterTestBase { } else { factory = sf0; } - IntegrationTestLogger.LOGGER.info("Creating consumer session factory to node " + targetServer); + log.debug("Creating consumer session factory to node " + targetServer); session = addClientSession(factory.createSession(false, false, true)); consumer = addClientConsumer(session.createConsumer(QUEUE)); session.start(); consumerCounter.incrementAndGet(); } } catch (Exception e) { - IntegrationTestLogger.LOGGER.info("Consumer thread couldn't establish connection", e); + log.debug("Consumer thread couldn't establish connection", e); errors.incrementAndGet(); return; } @@ -751,13 +752,13 @@ public class ClusteredGroupingTest extends ClusterTestBase { return; } m.acknowledge(); - IntegrationTestLogger.LOGGER.trace("Consumed message " + m.getStringProperty(Message.HDR_DUPLICATE_DETECTION_ID) + " from server " + targetServer + ". Total consumed: " + totalMessagesConsumed.incrementAndGet()); + log.trace("Consumed message " + m.getStringProperty(Message.HDR_DUPLICATE_DETECTION_ID) + " from server " + targetServer + ". Total consumed: " + totalMessagesConsumed.incrementAndGet()); } catch (ActiveMQException e) { errors.incrementAndGet(); - IntegrationTestLogger.LOGGER.warn("Consumer thread threw exception while receiving messages from server " + targetServer + ".: " + e.getMessage()); + log.warn("Consumer thread threw exception while receiving messages from server " + targetServer + ".: " + e.getMessage()); } catch (Exception e) { errors.incrementAndGet(); - IntegrationTestLogger.LOGGER.warn("Consumer thread threw unexpected exception while receiving messages from server " + targetServer + ".: " + e.getMessage()); + log.warn("Consumer thread threw unexpected exception while receiving messages from server " + targetServer + ".: " + e.getMessage()); return; } } @@ -1020,12 +1021,10 @@ public class ClusteredGroupingTest extends ClusterTestBase { @Override public void proposed(final Response response) throws Exception { - System.out.println("ClusteredGroupingTest.proposed"); } @Override public void sendProposalResponse(final Response response, final int distance) throws Exception { - System.out.println("ClusteredGroupingTest.send"); } @Override @@ -1036,12 +1035,10 @@ public class ClusteredGroupingTest extends ClusterTestBase { @Override public void onNotification(final Notification notification) { - System.out.println("ClusteredGroupingTest.onNotification " + notification); } @Override public void addGroupBinding(final GroupBinding groupBinding) { - System.out.println("ClusteredGroupingTest.addGroupBinding"); } @Override @@ -1397,7 +1394,6 @@ public class ClusteredGroupingTest extends ClusterTestBase { verifyReceiveAllInRange(40, 50, 3); sendInRange(2, "queues.testaddress", 50, 60, false, Message.HDR_GROUP_ID, new SimpleString("id1")); verifyReceiveAllInRange(50, 60, 3); - System.out.println("*****************************************************************************"); } @Test @@ -1457,9 +1453,6 @@ public class ClusteredGroupingTest extends ClusterTestBase { waitForBindings(0, "queues.testaddress", 2, 1, false); sendInRange(2, "queues.testaddress", 10, 20, true, Message.HDR_GROUP_ID, new SimpleString("id1")); verifyReceiveAllInRange(10, 20, 0); - - System.out.println("*****************************************************************************"); - } @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredMessageCounterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredMessageCounterTest.java index d59b03e4a7..62bdf37ab7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredMessageCounterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusteredMessageCounterTest.java @@ -129,7 +129,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { waitForBindings(0, "queues", 1, 1, false); - System.out.println("sending....."); send(0, "queues", numMsg, durable, null); verifyReceiveAllOnSingleConsumer(true, 0, numMsg, 1); @@ -162,7 +161,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { waitForBindings(1, "queues", 1, 0, true); waitForBindings(0, "queues", 1, 0, false); - System.out.println("sending....."); Thread sendThread = new Thread(new Runnable() { @Override public void run() { @@ -171,7 +169,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { } catch (Exception e) { e.printStackTrace(); } - System.out.println("messages sent."); } }); @@ -195,7 +192,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { stopFlag.set(true); } sendThread.join(); - System.out.println("Results collected: " + results.size()); //checking for (MessageCounterInfo info : results) { assertTrue("countDelta should be positive " + info.getCountDelta() + dumpResults(results), info.getCountDelta() >= 0); @@ -233,9 +229,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { try { String result = queueControl.listMessageCounter(); MessageCounterInfo info = MessageCounterInfo.fromJSON(result); - if (info.getCountDelta() != 0) { - System.out.println("non zero value got ---> " + info.getCountDelta()); - } results.add(info); resultLatch.countDown(); if (info.getCountDelta() < 0) { @@ -283,7 +276,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { for (; num < batchSize || stopFlag.get(); num++) { ClientMessage message = consumer.receive(2000); if (message == null) { - System.out.println("No more messages received!"); break; } message.acknowledge(); @@ -292,7 +284,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { } catch (ActiveMQException e) { e.printStackTrace(); } finally { - System.out.println("received messages: " + num); if (consumer != null) { try { consumer.close(); @@ -311,7 +302,6 @@ public class ClusteredMessageCounterTest extends ClusterTestBase { //we only receive (numMsg - 200) to avoid the paging being cleaned up //when all paged messages are consumed. if (!stopFlag.get() && total.addAndGet(num) < numMsg - 200) { - System.out.println("go for another batch " + total.get()); timer2.schedule(new PeriodicalReceiver(this.batchSize, this.serverID, this.period), period); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ExclusiveDivertWithClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ExclusiveDivertWithClusterTest.java index 095b0178b6..eef2f70f5e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ExclusiveDivertWithClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ExclusiveDivertWithClusterTest.java @@ -26,14 +26,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Before; import org.junit.Test; public class ExclusiveDivertWithClusterTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override @Before public void setUp() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java index 07bcbf9c06..57870beb6f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/LargeMessageRedistributionTest.java @@ -18,13 +18,10 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.tests.util.Wait; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Test; public class LargeMessageRedistributionTest extends MessageRedistributionTest { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override public boolean isLargeMessage() { return true; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java index df824c6e92..7a4398a1fc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java @@ -40,15 +40,15 @@ import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfigu import org.apache.activemq.artemis.core.server.impl.QueueImpl; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.Wait; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class MessageRedistributionTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(MessageRedistributionTest.class); @Override @Before @@ -84,7 +84,7 @@ public class MessageRedistributionTest extends ClusterTestBase { public void testRedistributionWithMessageGroups() throws Exception { setupCluster(MessageLoadBalancingType.ON_DEMAND); - MessageRedistributionTest.log.info("Doing test"); + log.debug("Doing test"); getServer(0).getConfiguration().setGroupingHandlerConfiguration(new GroupingHandlerConfiguration().setName(new SimpleString("handler")).setType(GroupingHandlerConfiguration.TYPE.LOCAL).setAddress(new SimpleString("queues"))); getServer(1).getConfiguration().setGroupingHandlerConfiguration(new GroupingHandlerConfiguration().setName(new SimpleString("handler")).setType(GroupingHandlerConfiguration.TYPE.REMOTE).setAddress(new SimpleString("queues"))); @@ -146,9 +146,6 @@ public class MessageRedistributionTest extends ClusterTestBase { //consume the non grouped messages for (int i = 0; i < 5; i++) { ClientMessage message = getConsumer(0).receive(5000); - if (message == null) { - System.out.println(); - } Assert.assertNotNull("" + i, message); message.acknowledge(); Assert.assertNull(message.getSimpleStringProperty(Message.HDR_GROUP_ID)); @@ -168,7 +165,7 @@ public class MessageRedistributionTest extends ClusterTestBase { message.acknowledge(); Assert.assertNotNull(message.getSimpleStringProperty(Message.HDR_GROUP_ID)); } - MessageRedistributionTest.log.info("Test done"); + log.debug("Test done"); } //https://issues.jboss.org/browse/HORNETQ-1057 @@ -176,7 +173,7 @@ public class MessageRedistributionTest extends ClusterTestBase { public void testRedistributionStopsWhenConsumerAdded() throws Exception { setupCluster(MessageLoadBalancingType.ON_DEMAND); - MessageRedistributionTest.log.info("Doing test"); + log.debug("Doing test"); startServers(0, 1, 2); @@ -206,14 +203,14 @@ public class MessageRedistributionTest extends ClusterTestBase { Bindable bindable = servers[0].getPostOffice().getBinding(new SimpleString("queue0")).getBindable(); String debug = ((QueueImpl) bindable).debug(); Assert.assertFalse(debug.contains(Redistributor.class.getName())); - MessageRedistributionTest.log.info("Test done"); + log.debug("Test done"); } @Test public void testRedistributionWhenConsumerIsClosed() throws Exception { setupCluster(MessageLoadBalancingType.ON_DEMAND); - MessageRedistributionTest.log.info("Doing test"); + log.debug("Doing test"); startServers(0, 1, 2); @@ -247,7 +244,7 @@ public class MessageRedistributionTest extends ClusterTestBase { verifyReceiveRoundRobinInSomeOrderWithCounts(false, ids1, 0, 2); - MessageRedistributionTest.log.info("Test done"); + log.debug("Test done"); } @Test @@ -329,7 +326,7 @@ public class MessageRedistributionTest extends ClusterTestBase { Assert.assertNull(consumer1.receiveImmediate()); Assert.assertNull(consumer2.receiveImmediate()); - MessageRedistributionTest.log.info("Test done"); + log.debug("Test done"); } @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterTest.java index e74e7eca94..e96c3aff56 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterTest.java @@ -16,12 +16,8 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; - public class NettyFileStorageSymmetricClusterTest extends SymmetricClusterTest { - IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override protected boolean isNetty() { return true; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterWithDiscoveryTest.java index df0dc9f496..c35602e77e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterWithDiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettyFileStorageSymmetricClusterWithDiscoveryTest.java @@ -16,12 +16,9 @@ */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; public class NettyFileStorageSymmetricClusterWithDiscoveryTest extends SymmetricClusterWithDiscoveryTest { - IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override protected boolean isNetty() { return true; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java index c360b74388..e7d84d2fed 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OneWayChainClusterTest.java @@ -23,14 +23,11 @@ import org.apache.activemq.artemis.core.server.cluster.ClusterConnection; import org.apache.activemq.artemis.core.server.cluster.MessageFlowRecord; import org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionImpl; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Before; import org.junit.Test; public class OneWayChainClusterTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override @Before public void setUp() throws Exception { @@ -298,23 +295,23 @@ public class OneWayChainClusterTest extends ClusterTestBase { verifyReceiveRoundRobin(10, 0, 1); verifyNotReceive(0, 1); - log.info("============================================ before restart"); - log.info(clusterDescription(servers[0])); - log.info(clusterDescription(servers[1])); - log.info(clusterDescription(servers[2])); - log.info(clusterDescription(servers[3])); - log.info(clusterDescription(servers[4])); + instanceLog.debug("============================================ before restart"); + instanceLog.debug(clusterDescription(servers[0])); + instanceLog.debug(clusterDescription(servers[1])); + instanceLog.debug(clusterDescription(servers[2])); + instanceLog.debug(clusterDescription(servers[3])); + instanceLog.debug(clusterDescription(servers[4])); stopServers(2); waitForTopology(servers[1], 4); Thread.sleep(1000); - log.info("============================================ after stop"); - log.info(clusterDescription(servers[0])); - log.info(clusterDescription(servers[1])); - log.info(clusterDescription(servers[3])); - log.info(clusterDescription(servers[4])); + instanceLog.debug("============================================ after stop"); + instanceLog.debug(clusterDescription(servers[0])); + instanceLog.debug(clusterDescription(servers[1])); + instanceLog.debug(clusterDescription(servers[3])); + instanceLog.debug(clusterDescription(servers[4])); startServers(2); @@ -322,12 +319,12 @@ public class OneWayChainClusterTest extends ClusterTestBase { waitForTopology(servers[1], 5); - log.info("============================================ after start"); - log.info(clusterDescription(servers[0])); - log.info(clusterDescription(servers[1])); - log.info(clusterDescription(servers[2])); - log.info(clusterDescription(servers[3])); - log.info(clusterDescription(servers[4])); + instanceLog.debug("============================================ after start"); + instanceLog.debug(clusterDescription(servers[0])); + instanceLog.debug(clusterDescription(servers[1])); + instanceLog.debug(clusterDescription(servers[2])); + instanceLog.debug(clusterDescription(servers[3])); + instanceLog.debug(clusterDescription(servers[4])); send(0, "queues.testaddress", 10, false, null); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java index c2c6982c0d..d3247d3eca 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/OnewayTwoNodeClusterTest.java @@ -18,14 +18,14 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class OnewayTwoNodeClusterTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(OnewayTwoNodeClusterTest.class); @Override @Before @@ -143,19 +143,19 @@ public class OnewayTwoNodeClusterTest extends ClusterTestBase { long start = System.currentTimeMillis(); - OnewayTwoNodeClusterTest.log.info("stopping server 1"); + OnewayTwoNodeClusterTest.log.debug("stopping server 1"); stopServers(1); waitForTopology(servers[0], 1); - OnewayTwoNodeClusterTest.log.info("restarting server 1(" + servers[1].getIdentity() + ")"); + OnewayTwoNodeClusterTest.log.debug("restarting server 1(" + servers[1].getIdentity() + ")"); startServers(1); waitForTopology(servers[0], 2); - log.info("Server 1 id=" + servers[1].getNodeID()); + log.debug("Server 1 id=" + servers[1].getNodeID()); long end = System.currentTimeMillis(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java index 595409304f..b627e8702f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java @@ -26,14 +26,11 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.tests.util.Wait; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Before; import org.junit.Test; public class RemoteBindingWithoutLoadBalancingTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override @Before public void setUp() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java index 09d9cbbfbc..fcadf9e638 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java @@ -17,16 +17,15 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; import org.junit.Ignore; import org.junit.Test; public class SimpleSymmetricClusterTest extends ClusterTestBase { + private static final Logger log = Logger.getLogger(SimpleSymmetricClusterTest.class); // Constants ----------------------------------------------------- - static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Attributes ---------------------------------------------------- // Static -------------------------------------------------------- @@ -65,19 +64,19 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase { startServers(0, 1, 2, 3, 4, 5); - log.info(""); + log.debug(""); for (int i = 0; i <= 5; i++) { - log.info(servers[i].describe()); - log.info(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString())); + log.debug(servers[i].describe()); + log.debug(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString())); } - log.info(""); + log.debug(""); - log.info(""); + log.debug(""); for (int i = 0; i <= 5; i++) { - log.info(servers[i].describe()); - log.info(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString())); + log.debug(servers[i].describe()); + log.debug(debugBindings(servers[i], servers[i].getConfiguration().getManagementNotificationAddress().toString())); } - log.info(""); + log.debug(""); stopServers(0, 1, 2, 3, 4, 5); @@ -155,7 +154,7 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase { public void _testLoop() throws Throwable { for (int i = 0; i < 10; i++) { loopNumber = i; - log.info("#test " + i); + log.debug("#test " + i); testSimple(); tearDown(); setUp(); @@ -186,7 +185,7 @@ public class SimpleSymmetricClusterTest extends ClusterTestBase { waitForTopology(servers[i], 5); } - log.info("All the servers have been started already!"); + log.debug("All the servers have been started already!"); for (int i = 0; i <= 4; i++) { setupSessionFactory(i, isNetty()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java index 79b2d00685..7f84cab533 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterTest.java @@ -21,8 +21,8 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; @@ -33,7 +33,7 @@ import org.junit.Test; */ public class SymmetricClusterTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(SymmetricClusterTest.class); @Override @Before @@ -273,14 +273,14 @@ public class SymmetricClusterTest extends ClusterTestBase { @Test public void testRoundRobinMultipleQueues() throws Exception { - SymmetricClusterTest.log.info("starting"); + log.debug("starting"); setupCluster(); - SymmetricClusterTest.log.info("setup cluster"); + log.debug("setup cluster"); startServers(); - SymmetricClusterTest.log.info("started servers"); + log.debug("started servers"); setupSessionFactory(0, isNetty()); setupSessionFactory(1, isNetty()); @@ -288,7 +288,7 @@ public class SymmetricClusterTest extends ClusterTestBase { setupSessionFactory(3, isNetty()); setupSessionFactory(4, isNetty()); - SymmetricClusterTest.log.info("Set up session factories"); + log.debug("Set up session factories"); createQueue(0, "queues.testaddress", "queue0", null, false); createQueue(1, "queues.testaddress", "queue0", null, false); @@ -308,7 +308,7 @@ public class SymmetricClusterTest extends ClusterTestBase { createQueue(3, "queues.testaddress", "queue2", null, false); createQueue(4, "queues.testaddress", "queue2", null, false); - SymmetricClusterTest.log.info("created queues"); + log.debug("created queues"); addConsumer(0, 0, "queue0", null); addConsumer(1, 1, "queue0", null); @@ -328,7 +328,7 @@ public class SymmetricClusterTest extends ClusterTestBase { addConsumer(13, 3, "queue2", null); addConsumer(14, 4, "queue2", null); - SymmetricClusterTest.log.info("added consumers"); + log.debug("added consumers"); waitForBindings(0, "queues.testaddress", 3, 3, true); waitForBindings(1, "queues.testaddress", 3, 3, true); @@ -342,23 +342,23 @@ public class SymmetricClusterTest extends ClusterTestBase { waitForBindings(3, "queues.testaddress", 12, 12, false); waitForBindings(4, "queues.testaddress", 12, 12, false); - SymmetricClusterTest.log.info("waited for bindings"); + log.debug("waited for bindings"); send(0, "queues.testaddress", 10, false, null); - SymmetricClusterTest.log.info("sent messages"); + log.debug("sent messages"); verifyReceiveRoundRobinInSomeOrder(10, 0, 1, 2, 3, 4); - SymmetricClusterTest.log.info("verified 1"); + log.debug("verified 1"); verifyReceiveRoundRobinInSomeOrder(10, 5, 6, 7, 8, 9); - SymmetricClusterTest.log.info("verified 2"); + log.debug("verified 2"); verifyReceiveRoundRobinInSomeOrder(10, 10, 11, 12, 13, 14); - SymmetricClusterTest.log.info("verified 3"); + log.debug("verified 3"); } @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java index 6e4792f48b..4fcadcdc32 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java @@ -18,14 +18,11 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Test; public class SymmetricClusterWithBackupTest extends SymmetricClusterTest { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override @Test public void testStopAllStartAll() throws Throwable { @@ -64,8 +61,6 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest { waitForBindings(3, "queues.testaddress", 4, 4, false); waitForBindings(4, "queues.testaddress", 4, 4, false); - System.out.println("waited for all bindings"); - send(0, "queues.testaddress", 10, false, null); verifyReceiveRoundRobinInSomeOrder(10, 0, 1, 2, 3, 4); @@ -244,8 +239,6 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest { startServers(); - SymmetricClusterWithBackupTest.log.info("setup session factories: "); - setupSessionFactory(0, isNetty()); setupSessionFactory(1, isNetty()); setupSessionFactory(2, isNetty()); @@ -322,8 +315,6 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest { addConsumer(26, 3, "queue18", null); addConsumer(27, 4, "queue18", null); - SymmetricClusterWithBackupTest.log.info("wait for bindings..."); - waitForBindings(0, "queues.testaddress", 5, 5, true); waitForBindings(1, "queues.testaddress", 5, 5, true); waitForBindings(2, "queues.testaddress", 5, 5, true); @@ -336,8 +327,6 @@ public class SymmetricClusterWithBackupTest extends SymmetricClusterTest { waitForBindings(3, "queues.testaddress", 22, 22, false); waitForBindings(4, "queues.testaddress", 21, 21, false); - SymmetricClusterWithBackupTest.log.info("send and receive messages"); - send(0, "queues.testaddress", 10, false, null); verifyReceiveAll(10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java index b09377d80a..927f1ffbb5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SymmetricClusterWithDiscoveryTest.java @@ -17,13 +17,10 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; public class SymmetricClusterWithDiscoveryTest extends SymmetricClusterTest { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected final String groupAddress = ActiveMQTestBase.getUDPDiscoveryAddress(); protected final int groupPort = ActiveMQTestBase.getUDPDiscoveryPort(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java index 3798b926c3..c117b565e4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TwoWayTwoNodeClusterTest.java @@ -26,7 +26,7 @@ import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; @@ -34,7 +34,7 @@ import java.util.Map; public class TwoWayTwoNodeClusterTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(TwoWayTwoNodeClusterTest.class); @Override @Before @@ -235,13 +235,13 @@ public class TwoWayTwoNodeClusterTest extends ClusterTestBase { waitForTopology(servers[1], 2); for (int i = 0; i < 10; i++) { - log.info("Sleep #test " + i); - log.info("#stop #test #" + i); + log.debug("Sleep #test " + i); + log.debug("#stop #test #" + i); Thread.sleep(500); stopServers(1); waitForTopology(servers[0], 1, -1, 2000); - log.info("#start #test #" + i); + log.debug("#start #test #" + i); startServers(1); waitForTopology(servers[0], 2, -1, 2000); waitForTopology(servers[1], 2, -1, 2000); @@ -284,12 +284,12 @@ public class TwoWayTwoNodeClusterTest extends ClusterTestBase { //allow the topology to be propagated before restarting waitForTopology(servers[0], 1, -1, 2000); - System.out.println(clusterDescription(servers[0])); + instanceLog.debug(clusterDescription(servers[0])); startServers(1); - System.out.println(clusterDescription(servers[0])); - System.out.println(clusterDescription(servers[1])); + instanceLog.debug(clusterDescription(servers[0])); + instanceLog.debug(clusterDescription(servers[1])); setupSessionFactory(1, isNetty()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java index cbf49cadd2..627c7ed5f2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java @@ -17,7 +17,6 @@ package org.apache.activemq.artemis.tests.integration.cluster.distribution; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Before; import org.junit.Test; @@ -28,8 +27,6 @@ import org.junit.Test; */ public class URISimpleClusterTest extends ClusterTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override @Before public void setUp() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java index 3ae5b64d40..ebfbdae3aa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java @@ -39,9 +39,9 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal; import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.CountDownSessionFailureListener; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; @@ -52,7 +52,7 @@ import org.junit.Test; */ public class AsynchronousFailoverTest extends FailoverTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(AsynchronousFailoverTest.class); private volatile CountDownSessionFailureListener listener; @@ -68,7 +68,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { try { doTestNonTransactional(this); } catch (Throwable e) { - AsynchronousFailoverTest.log.error("Test failed", e); + log.error("Test failed", e); addException(e); } } @@ -91,7 +91,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { running = false; } } catch (Throwable e) { - AsynchronousFailoverTest.log.error("Test failed", e); + log.error("Test failed", e); addException(e); } } @@ -139,7 +139,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { try { for (int i = 0; i < numIts; i++) { - AsynchronousFailoverTest.log.info("Iteration " + i); + log.debug("Iteration " + i); //set block timeout to 10 sec to reduce test time. ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(30).setRetryInterval(100).setConfirmationWindowSize(10 * 1024 * 1024).setCallTimeout(10000).setCallFailoverTimeout(10000); @@ -160,11 +160,11 @@ public class AsynchronousFailoverTest extends FailoverTestBase { long randomDelay = (long) (2000 * Math.random()); - AsynchronousFailoverTest.log.info("Sleeping " + randomDelay); + log.debug("Sleeping " + randomDelay); Thread.sleep(randomDelay); - AsynchronousFailoverTest.log.info("Failing asynchronously"); + log.debug("Failing asynchronously"); // Simulate failure on connection synchronized (lockFail) { @@ -183,7 +183,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { runnable.setFailed(); - AsynchronousFailoverTest.log.info("Fail complete"); + log.debug("Fail complete"); t.join(TimeUnit.SECONDS.toMillis(120)); if (t.isAlive()) { @@ -221,7 +221,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { private void doTestNonTransactional(final TestRunner runner) throws Exception { while (!runner.isFailed()) { - AsynchronousFailoverTest.log.info("looping"); + log.debug("looping"); ClientSession session = sf.createSession(true, true, 0); @@ -249,7 +249,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { retry = false; } catch (ActiveMQUnBlockedException ube) { - AsynchronousFailoverTest.log.info("exception when sending message with counter " + i); + log.debug("exception when sending message with counter " + i); ube.printStackTrace(); @@ -271,7 +271,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { retry = false; } catch (ActiveMQUnBlockedException ube) { - AsynchronousFailoverTest.log.info("exception when creating consumer"); + log.debug("exception when creating consumer"); retry = true; @@ -302,7 +302,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { Assert.fail("got another counter gap at " + count + ": " + counts); } else { if (lastCount != -1) { - AsynchronousFailoverTest.log.info("got first counter gap at " + count); + log.debug("got first counter gap at " + count); counterGap = true; } } @@ -328,7 +328,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { executionId++; - log.info("#test doTestTransactional starting now. Execution " + executionId); + log.debug("#test doTestTransactional starting now. Execution " + executionId); try { @@ -390,19 +390,19 @@ public class AsynchronousFailoverTest extends FailoverTestBase { logAndSystemOut("#test duplicate id rejected on sending"); break; } catch (ActiveMQTransactionRolledBackException trbe) { - log.info("#test transaction rollback retrying on sending"); + log.debug("#test transaction rollback retrying on sending"); // OK retry = true; } catch (ActiveMQUnBlockedException ube) { - log.info("#test transaction rollback retrying on sending"); + log.debug("#test transaction rollback retrying on sending"); // OK retry = true; } catch (ActiveMQTransactionOutcomeUnknownException toue) { - log.info("#test transaction rollback retrying on sending"); + log.debug("#test transaction rollback retrying on sending"); // OK retry = true; } catch (ActiveMQObjectClosedException closedException) { - log.info("#test producer closed, retrying on sending..."); + log.debug("#test producer closed, retrying on sending..."); Thread.sleep(2000); // OK retry = true; @@ -412,7 +412,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { Thread.sleep(2000); retry = true; } catch (ActiveMQException e) { - log.info("#test Exception " + e, e); + log.debug("#test Exception " + e, e); throw e; } } @@ -471,7 +471,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { message.acknowledge(); } - log.info("#test commit"); + log.debug("#test commit"); try { session.commit(); } catch (ActiveMQTransactionRolledBackException trbe) { @@ -492,7 +492,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { assertTrue("msgs.size is expected to be " + numMessages + " but it was " + msgs.size(), msgs.size() == numMessages); } } catch (Throwable e) { - log.info(threadDump("Thread dump, messagesReceived = " + msgs.size())); + log.debug(threadDump("Thread dump, messagesReceived = " + msgs.size())); logAndSystemOut(e.getMessage() + " messages received"); for (Integer msg : msgs) { logAndSystemOut(msg.toString()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/CheckRetryIntervalBackupManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/CheckRetryIntervalBackupManagerTest.java index d533588a2f..ae96b5de0f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/CheckRetryIntervalBackupManagerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/CheckRetryIntervalBackupManagerTest.java @@ -22,16 +22,16 @@ import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfigu import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration; import org.apache.activemq.artemis.core.server.cluster.BackupManager; import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.CountDownSessionFailureListener; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; import org.apache.activemq.artemis.utils.Wait; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; public class CheckRetryIntervalBackupManagerTest extends FailoverTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(CheckRetryIntervalBackupManagerTest.class); private volatile CountDownSessionFailureListener listener; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTest.java index 646e073176..e29f7e78b9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTest.java @@ -60,8 +60,8 @@ public abstract class ClusterWithBackupFailoverTest extends ClusterWithBackupFa send(2, QUEUES_TESTADDRESS, 10, false, null); verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2); Thread.sleep(1000); - log.info("######### Topology on client = " + locators[0].getTopology().describe() + " locator = " + locators[0]); - log.info("######### Crashing it........., sfs[0] = " + sfs[0]); + log.debug("######### Topology on client = " + locators[0].getTopology().describe() + " locator = " + locators[0]); + log.debug("######### Crashing it........., sfs[0] = " + sfs[0]); failNode(0); waitForFailoverTopology(4, 3, 1, 2); @@ -79,7 +79,7 @@ public abstract class ClusterWithBackupFailoverTest extends ClusterWithBackupFa // activated backup nodes waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false); - ClusterWithBackupFailoverTestBase.log.info("** now sending"); + ClusterWithBackupFailoverTestBase.log.debug("** now sending"); send(0, QUEUES_TESTADDRESS, 10, false, null); verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2); @@ -269,7 +269,7 @@ public abstract class ClusterWithBackupFailoverTest extends ClusterWithBackupFa // activated backup nodes waitForBindings(3, QUEUES_TESTADDRESS, 2, 2, false); - ClusterWithBackupFailoverTestBase.log.info("** now sending"); + ClusterWithBackupFailoverTestBase.log.debug("** now sending"); send(0, QUEUES_TESTADDRESS, 10, false, null); verifyReceiveRoundRobinInSomeOrder(true, 10, 0, 1, 2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java index 28746da17b..a87d6b033d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ClusterWithBackupFailoverTestBase.java @@ -21,17 +21,18 @@ import java.util.HashSet; import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; import org.apache.activemq.artemis.tests.integration.cluster.util.SameProcessActiveMQServer; import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer; +import org.jboss.logging.Logger; import org.junit.Before; public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase { protected static final String QUEUE_NAME = "queue0"; protected static final String QUEUES_TESTADDRESS = "queues.testaddress"; - protected static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + + protected static final Logger log = Logger.getLogger(ClusterWithBackupFailoverTestBase.class); protected abstract void setupCluster(MessageLoadBalancingType messageLoadBalancingType) throws Exception; @@ -72,7 +73,7 @@ public abstract class ClusterWithBackupFailoverTestBase extends ClusterTestBase * @throws Exception */ protected void failNode(final int node, final int originalLiveNode) throws Exception { - ClusterWithBackupFailoverTestBase.log.info("*** failing node " + node); + log.debug("*** failing node " + node); ActiveMQServer server = getServer(node); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java index 4840b02040..b3103414a6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java @@ -35,15 +35,16 @@ import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfigur import org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreSlavePolicy; import org.apache.activemq.artemis.core.server.impl.InVMNodeManager; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.CountDownSessionFailureListener; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; public class FailBackAutoTest extends FailoverTestBase { - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(FailBackAutoTest.class); + private static final int NUM_MESSAGES = 100; private ServerLocatorInternal locator; private ClientSessionFactoryInternal sf; @@ -71,9 +72,9 @@ public class FailBackAutoTest extends FailoverTestBase { assertTrue(latch.await(5, TimeUnit.SECONDS)); - log.info("backup (nowLive) topology = " + backupServer.getServer().getClusterManager().getDefaultConnection(null).getTopology().describe()); + log.debug("backup (nowLive) topology = " + backupServer.getServer().getClusterManager().getDefaultConnection(null).getTopology().describe()); - log.info("Server Crash!!!"); + log.debug("Server Crash!!!"); ClientProducer producer = session.createProducer(ADDRESS); @@ -93,12 +94,12 @@ public class FailBackAutoTest extends FailoverTestBase { session.addFailureListener(listener); - log.info("******* starting live server back"); + log.debug("******* starting live server back"); liveServer.start(); Thread.sleep(1000); - System.out.println("After failback: " + locator.getTopology().describe()); + log.debug("After failback: " + locator.getTopology().describe()); assertTrue(latch2.await(5, TimeUnit.SECONDS)); @@ -145,7 +146,7 @@ public class FailBackAutoTest extends FailoverTestBase { session.addFailureListener(listener); - IntegrationTestLogger.LOGGER.info("Crashing live server..."); + log.debug("Crashing live server..."); liveServer.crash(session); @@ -162,7 +163,7 @@ public class FailBackAutoTest extends FailoverTestBase { listener = new CountDownSessionFailureListener(session); session.addFailureListener(listener); - log.info("restarting live node now"); + log.debug("restarting live node now"); liveServer.start(); assertTrue("expected a session failure 1", listener.getLatch().await(5, TimeUnit.SECONDS)); @@ -181,7 +182,7 @@ public class FailBackAutoTest extends FailoverTestBase { waitForBackup(sf, 10); - IntegrationTestLogger.LOGGER.info("Crashing live server again..."); + log.debug("Crashing live server again..."); liveServer.crash(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java index 259deebd04..83db8a654e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java @@ -37,14 +37,12 @@ import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfigu import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration; import org.apache.activemq.artemis.core.server.impl.InVMNodeManager; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; import org.junit.Before; import org.junit.Test; public class FailoverListenerTest extends FailoverTestBase { - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; private ServerLocatorInternal locator; private ClientSessionFactoryInternal sf; @@ -74,9 +72,9 @@ public class FailoverListenerTest extends FailoverTestBase { assertTrue(failureLatch.await(5, TimeUnit.SECONDS)); assertEquals(FailoverEventType.FAILURE_DETECTED, listener.getFailoverEventType().get(0)); - log.info("backup (nowLive) topology = " + backupServer.getServer().getClusterManager().getDefaultConnection(null).getTopology().describe()); + instanceLog.debug("backup (nowLive) topology = " + backupServer.getServer().getClusterManager().getDefaultConnection(null).getTopology().describe()); - log.info("Server Crash!!!"); + instanceLog.debug("Server Crash!!!"); assertTrue(failureDoneLatch.await(5, TimeUnit.SECONDS)); //the backup server should be online by now @@ -92,7 +90,7 @@ public class FailoverListenerTest extends FailoverTestBase { verifyMessageOnServer(1, 1); - log.info("******* starting live server back"); + instanceLog.debug("******* starting live server back"); liveServer.start(); Thread.sleep(1000); //starting the live server trigger a failover event @@ -101,7 +99,7 @@ public class FailoverListenerTest extends FailoverTestBase { //the life server should be online by now assertEquals(FailoverEventType.FAILOVER_COMPLETED, listener.getFailoverEventType().get(3)); - System.out.println("After failback: " + locator.getTopology().describe()); + instanceLog.debug("After failback: " + locator.getTopology().describe()); message = session.createMessage(true); @@ -268,7 +266,7 @@ public class FailoverListenerTest extends FailoverTestBase { @Override public void failoverEvent(FailoverEventType eventType) { this.failoverTypeEvent.add(eventType); - log.info("Failover event just happen : " + eventType.toString()); + instanceLog.debug("Failover event just happen : " + eventType.toString()); if (eventType == FailoverEventType.FAILURE_DETECTED) { failureLatch.countDown(); } else if (eventType == FailoverEventType.FAILOVER_COMPLETED || eventType == FailoverEventType.FAILOVER_FAILED) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java index cc2d1db33e..3d39e09f50 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java @@ -33,14 +33,13 @@ import org.apache.activemq.artemis.core.protocol.core.Packet; import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionProducerCreditsMessage; import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnection; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; +import org.jboss.logging.Logger; import org.junit.Test; public class FailoverOnFlowControlTest extends FailoverTestBase { - private static IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - + private static final Logger log = Logger.getLogger(FailoverOnFlowControlTest.class); @Test public void testOverflowSend() throws Exception { ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setProducerWindowSize(1000).setRetryInterval(100); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java index 578743f162..e0b72662ef 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java @@ -59,13 +59,13 @@ import org.apache.activemq.artemis.core.server.files.FileMoveManager; import org.apache.activemq.artemis.core.server.impl.InVMNodeManager; import org.apache.activemq.artemis.core.transaction.impl.XidImpl; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer; import org.apache.activemq.artemis.tests.util.CountDownSessionFailureListener; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; import org.apache.activemq.artemis.utils.RandomUtil; import org.apache.activemq.artemis.utils.RetryRule; import org.apache.activemq.artemis.utils.Wait; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -73,11 +73,11 @@ import org.junit.Test; public class FailoverTest extends FailoverTestBase { + private static final Logger log = Logger.getLogger(FailoverTest.class); + @Rule public RetryRule retryRule = new RetryRule(2); - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected static final int NUM_MESSAGES = 100; protected ServerLocator locator; @@ -141,7 +141,6 @@ public class FailoverTest extends FailoverTestBase { ClientMessage message = session.createMessage(true); message.putIntProperty("counter", i); try { - System.out.println("Sent " + i); producer.send(message); if (i < 10) { latch.countDown(); @@ -217,7 +216,6 @@ public class FailoverTest extends FailoverTestBase { @Override public void onMessage(ClientMessage message) { - System.out.println("Received " + message); Integer counter = message.getIntProperty("counter"); received.put(counter, message); try { @@ -245,7 +243,7 @@ public class FailoverTest extends FailoverTestBase { }); latch.await(10, TimeUnit.SECONDS); - log.info("crashing session"); + log.debug("crashing session"); crash(session); Assert.assertTrue(endLatch.await(60, TimeUnit.SECONDS)); @@ -292,7 +290,7 @@ public class FailoverTest extends FailoverTestBase { Integer counter = message.getIntProperty("counter"); received.put(counter, message); try { - log.info("acking message = id = " + message.getMessageID() + + log.debug("acking message = id = " + message.getMessageID() + ", counter = " + message.getIntProperty("counter")); message.acknowledge(); @@ -300,7 +298,7 @@ public class FailoverTest extends FailoverTestBase { e.printStackTrace(); continue; } - log.info("Acked counter = " + counter); + log.debug("Acked counter = " + counter); if (counter.equals(10)) { latch.countDown(); } @@ -323,7 +321,7 @@ public class FailoverTest extends FailoverTestBase { try { ClientMessage msg = consumer.receive(20000); if (msg == null) { - log.info("Returning null message on consuming"); + log.debug("Returning null message on consuming"); } return msg; } catch (ActiveMQObjectClosedException oce) { @@ -337,7 +335,7 @@ public class FailoverTest extends FailoverTestBase { }; t.start(); latch.await(10, TimeUnit.SECONDS); - log.info("crashing session"); + log.debug("crashing session"); crash(session); endLatch.await(60, TimeUnit.SECONDS); t.join(); @@ -680,14 +678,14 @@ public class FailoverTest extends FailoverTestBase { TransportConfiguration initialLive = getFieldFromSF(sf, "currentConnectorConfig"); TransportConfiguration initialBackup = getFieldFromSF(sf, "backupConfig"); - System.out.println("initlive: " + initialLive); - System.out.println("initback: " + initialBackup); + instanceLog.debug("initlive: " + initialLive); + instanceLog.debug("initback: " + initialBackup); TransportConfiguration last = getFieldFromSF(sf, "connectorConfig"); TransportConfiguration current = getFieldFromSF(sf, "currentConnectorConfig"); - System.out.println("now last: " + last); - System.out.println("now current: " + current); + instanceLog.debug("now last: " + last); + instanceLog.debug("now current: " + current); assertTrue(current.equals(initialLive)); ClientSession session = createSession(sf, true, true); @@ -703,8 +701,8 @@ public class FailoverTest extends FailoverTestBase { last = getFieldFromSF(sf, "connectorConfig"); current = getFieldFromSF(sf, "currentConnectorConfig"); - System.out.println("now after live crashed last: " + last); - System.out.println("now current: " + current); + instanceLog.debug("now after live crashed last: " + last); + instanceLog.debug("now current: " + current); assertTrue(current.equals(initialBackup)); @@ -724,8 +722,8 @@ public class FailoverTest extends FailoverTestBase { last = getFieldFromSF(sf, "connectorConfig"); current = getFieldFromSF(sf, "currentConnectorConfig"); - System.out.println("now after live back again last: " + last); - System.out.println("now current: " + current); + instanceLog.debug("now after live back again last: " + last); + instanceLog.debug("now current: " + current); //cannot use equals here because the config's name (uuid) changes //after failover diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java index 4e0362afef..012a9ae069 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleBackupsFailoverTestBase.java @@ -33,15 +33,12 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; public abstract class MultipleBackupsFailoverTestBase extends ActiveMQTestBase { - IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected abstract boolean isNetty(); protected int waitForNewLive(long seconds, @@ -140,7 +137,7 @@ public abstract class MultipleBackupsFailoverTestBase extends ActiveMQTestBase { locator.removeClusterTopologyListener(topListener); if (!ok) { if (server != null) { - log.info("failed topology, Topology on server = " + server.getClusterManager().describe()); + instanceLog.warn("failed topology, Topology on server = " + server.getClusterManager().describe()); } } Assert.assertTrue("expected " + topologyMembers + " members", ok); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java index 30bd24c090..51709a8dea 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java @@ -78,7 +78,7 @@ public class MultipleLivesMultipleBackupsFailoverTest extends MultipleBackupsFai ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 4, servers.get(0).getServer()); ClientSession session = sendAndConsume(sf, true); - System.out.println(((ServerLocatorInternal) locator).getTopology().describe()); + instanceLog.debug(((ServerLocatorInternal) locator).getTopology().describe()); Thread.sleep(500); servers.get(0).crash(session); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java index b8a19cc9b7..cedc7e3dff 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyAsynchronousReattachTest.java @@ -19,16 +19,13 @@ package org.apache.activemq.artemis.tests.integration.cluster.failover; import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException; import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; public class NettyAsynchronousReattachTest extends NettyAsynchronousFailoverTest { - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; @Override protected void crash(final ClientSession... sessions) throws Exception { for (ClientSession session : sessions) { - log.debug("Crashing session " + session); ClientSessionInternal internalSession = (ClientSessionInternal) session; internalSession.getConnection().fail(new ActiveMQNotConnectedException("oops")); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicationStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicationStopTest.java index 88678c5e21..9f4eb9971b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicationStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicationStopTest.java @@ -124,12 +124,8 @@ public class NettyReplicationStopTest extends FailoverTestBase { ClientMessage message = session.createMessage(true).putIntProperty("i", code); alignedOnSend.countDown(); - System.out.println("blocking!!"); producer.send(message); codesSent.add(code); - - System.out.println("Sent!"); - } catch (Exception e) { // that's ok; e.printStackTrace(); // logging just for debug & reference diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java index b86e32983e..fc1f5bc145 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java @@ -163,13 +163,13 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { liveServer.addInterceptor(new Interceptor() { @Override public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException { - //System.out.println("Received " + packet); + //instanceLog.debug("Received " + packet); if (packet instanceof SessionSendMessage) { if (countSent.incrementAndGet() == 500) { try { NetUtil.netDown(LIVE_IP); - System.out.println("Blocking traffic"); + instanceLog.debug("Blocking traffic"); // Thread.sleep(3000); // this is important to let stuff to block liveServer.crash(true, false); } catch (Exception e) { @@ -248,11 +248,11 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { latchReceived.countDown(); msgReceived.acknowledge(); if (received++ % 100 == 0) { - System.out.println("Received " + received); + instanceLog.debug("Received " + received); sessionConsumer.commit(); } } else { - System.out.println("Null"); + instanceLog.debug("Null"); } } catch (Throwable e) { errors++; @@ -271,7 +271,7 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { do { try { if (sentMessages.get() % 100 == 0) { - System.out.println("Sent " + sentMessages.get()); + instanceLog.debug("Sent " + sentMessages.get()); } producer.send(createMessage(sessionProducer, sentMessages.get(), true)); break; @@ -382,15 +382,15 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { if (++received % 100 == 0) { if (received == 300) { - System.out.println("Shutting down IP"); + instanceLog.debug("Shutting down IP"); NetUtil.netDown(LIVE_IP); liveServer.crash(true, false); } - System.out.println("Received " + received); + instanceLog.debug("Received " + received); sessionConsumer.commit(); } } else { - System.out.println("Null"); + instanceLog.debug("Null"); } } catch (Throwable e) { errors++; @@ -408,7 +408,7 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { do { try { if (sentMessages.get() % 100 == 0) { - System.out.println("Sent " + sentMessages.get()); + instanceLog.debug("Sent " + sentMessages.get()); } producer.send(createMessage(sessionProducer, sentMessages.get(), true)); break; @@ -454,13 +454,13 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { liveServer.addInterceptor(new Interceptor() { @Override public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException { - //System.out.println("Received " + packet); + //instanceLog.debug("Received " + packet); if (packet instanceof CreateSessionMessage) { if (countSent.incrementAndGet() == 50) { try { NetUtil.netDown(LIVE_IP); - System.out.println("Blocking traffic"); + instanceLog.debug("Blocking traffic"); blockedAt.set(sentMessages.get()); latchDown.countDown(); } catch (Exception e) { @@ -517,7 +517,7 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { while (running.get() && received < numSessions) { try { ClientSession session = sessionFactory.createSession(); - System.out.println("Creating session, currentLatch = " + latchCreated.getCount()); + instanceLog.debug("Creating session, currentLatch = " + latchCreated.getCount()); session.close(); latchCreated.countDown(); } catch (Throwable e) { @@ -534,7 +534,7 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { Thread.sleep(1000); - System.out.println("Server crashed now!!!"); + instanceLog.debug("Server crashed now!!!"); liveServer.crash(true, false); @@ -565,13 +565,13 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { liveServer.addInterceptor(new Interceptor() { @Override public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException { - //System.out.println("Received " + packet); + //instanceLog.debug("Received " + packet); if (packet instanceof SessionSendMessage) { if (countSent.incrementAndGet() == 50) { try { NetUtil.netDown(LIVE_IP); - System.out.println("Blocking traffic"); + instanceLog.debug("Blocking traffic"); Thread.sleep(3000); // this is important to let stuff to block blockedAt.set(sentMessages.get()); latchBlocked.countDown(); @@ -650,7 +650,7 @@ public class NetworkFailureFailoverTest extends FailoverTestBase { while (sentMessages.get() < numMessages && running.get()) { try { if (sentMessages.get() % 10 == 0) { - System.out.println("Sent " + sentMessages.get()); + instanceLog.debug("Sent " + sentMessages.get()); } producer.send(createMessage(sessionProducer, sentMessages.get(), true)); sentMessages.incrementAndGet(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java index 07a8d38f32..68f201a342 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java @@ -194,7 +194,6 @@ public class PagingFailoverTest extends FailoverTestBase { while (timeout > System.currentTimeMillis() && queue.getPageSubscription().isPaging()) { Thread.sleep(100); // Simulating what would happen on expire - System.out.println("IsPaging " + queue.getPageSubscription().isPaging()); queue.expireReferences(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java index f76ca1678f..a7f058c121 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java @@ -122,7 +122,7 @@ public class ReplicatedDistributionTest extends ClusterTestBase { if (i != received) { // Shouldn't this be a failure? - System.out.println(i + "!=" + received); + instanceLog.warn(i + "!=" + received); } msg.acknowledge(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java index 427213972f..4e5f2bea7b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedPagedFailoverTest.java @@ -126,13 +126,11 @@ public class ReplicatedPagedFailoverTest extends ReplicatedFailoverTest { if (temperMode == 1) { // this is tampering with the system causing an artifical issue. The system should still heal itself. for (long pageID = store.getFirstPage(); pageID <= store.getCurrentPage().getPageId() + 10; pageID++) { - System.out.println("Sending close on " + pageID); liveServer.getServer().getStorageManager().pageClosed(store.getStoreName(), (int) pageID); } } else if (temperMode == 2) { // this is tampering with the system causing an artifical issue. The system should still heal itself. for (long pageID = store.getFirstPage(); pageID <= store.getCurrentPage().getPageId() + 10; pageID++) { - System.out.println("Sending close on " + pageID); liveServer.getServer().getStorageManager().pageDeleted(store.getStoreName(), (int) pageID); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java index 4574adfbda..6215df3390 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java @@ -30,7 +30,6 @@ public class SharedStoreBackupTest extends FailoverTestBase { @Test public void testStartSharedBackupWithScalingDownPolicyDisabled() throws Exception { - System.out.println("is backup active: " + backupServer.isActive()); liveServer.stop(); // wait max 10s for backup to activate Assert.assertTrue("Backup did not activate in 10s timeout.", waitForBackupToBecomeActive(backupServer, 10000)); @@ -59,7 +58,6 @@ public class SharedStoreBackupTest extends FailoverTestBase { nodeManager = new InVMNodeManager(false); TransportConfiguration liveConnector = getConnectorTransportConfiguration(true); TransportConfiguration backupConnector = getConnectorTransportConfiguration(false); - System.out.println("backup config created - mnovak"); backupConfig = super.createDefaultConfig(false).clearAcceptorConfigurations().addAcceptorConfiguration(getAcceptorTransportConfiguration(false)).setHAPolicyConfiguration(new SharedStoreSlavePolicyConfiguration().setScaleDownConfiguration(new ScaleDownConfiguration().setEnabled(false)).setRestartBackup(false)).addConnectorConfiguration(liveConnector.getName(), liveConnector).addConnectorConfiguration(backupConnector.getName(), backupConnector).addClusterConfiguration(basicClusterConnectionConfig(backupConnector.getName(), liveConnector.getName())); backupServer = createTestableServer(backupConfig); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java index a3174d7cc9..f04b4e8f0d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java @@ -30,7 +30,6 @@ import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfigu import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration; import org.apache.activemq.artemis.core.server.NodeManager; import org.apache.activemq.artemis.core.server.impl.InVMNodeManager; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.util.SameProcessActiveMQServer; import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer; import org.junit.Test; @@ -43,16 +42,6 @@ public class SingleLiveMultipleBackupsFailoverTest extends MultipleBackupsFailov protected ServerLocatorImpl locator; private NodeManager nodeManager; final boolean sharedStore = true; - IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - - public void _testLoop() throws Exception { - for (int i = 0; i < 100; i++) { - log.info("#test " + i); - testMultipleFailovers(); - tearDown(); - setUp(); - } - } @Test public void testMultipleFailovers() throws Exception { @@ -86,31 +75,31 @@ public class SingleLiveMultipleBackupsFailoverTest extends MultipleBackupsFailov int backupNode; ClientSession session = sendAndConsume(sf, true); - log.info("failing node 0"); + instanceLog.debug("failing node 0"); servers.get(0).crash(session); session.close(); backupNode = waitForNewLive(5, true, servers, 1, 2, 3, 4, 5); session = sendAndConsume(sf, false); - log.info("failing node " + backupNode); + instanceLog.debug("failing node " + backupNode); servers.get(backupNode).crash(session); session.close(); backupNode = waitForNewLive(5, true, servers, 1, 2, 3, 4, 5); session = sendAndConsume(sf, false); - log.info("failing node " + backupNode); + instanceLog.debug("failing node " + backupNode); servers.get(backupNode).crash(session); session.close(); backupNode = waitForNewLive(5, true, servers, 1, 2, 3, 4, 5); session = sendAndConsume(sf, false); - log.info("failing node " + backupNode); + instanceLog.debug("failing node " + backupNode); servers.get(backupNode).crash(session); session.close(); backupNode = waitForNewLive(5, true, servers, 1, 2, 3, 4, 5); session = sendAndConsume(sf, false); - log.info("failing node " + backupNode); + instanceLog.debug("failing node " + backupNode); servers.get(backupNode).crash(session); session.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java index 8299f2c62b..d914721596 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java @@ -37,15 +37,15 @@ import org.apache.activemq.artemis.core.remoting.impl.invm.InVMRegistry; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.jms.client.ActiveMQBytesMessage; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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.Test; public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReattachSupportTestBase { - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(MultiThreadRandomReattachTestBase.class); // Constants ----------------------------------------------------- @@ -364,7 +364,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestB(final ClientSessionFactory sf, final int threadNum) throws Exception { @@ -444,7 +444,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } @@ -545,7 +545,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestD(final ClientSessionFactory sf, final int threadNum) throws Exception { @@ -670,7 +670,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } // Now with synchronous receive() @@ -729,7 +729,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestF(final ClientSessionFactory sf, final int threadNum) throws Exception { @@ -788,7 +788,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestG(final ClientSessionFactory sf, final int threadNum) throws Exception { @@ -861,7 +861,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestH(final ClientSessionFactory sf, final int threadNum) throws Exception { @@ -936,7 +936,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt long end = System.currentTimeMillis(); - log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestI(final ClientSessionFactory sf, final int threadNum) throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java index 22b969a9c7..2eb12f8ef4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java @@ -29,9 +29,9 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; import org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl; import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnector; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.RetryRule; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -39,11 +39,10 @@ import org.junit.Rule; public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(MultiThreadReattachSupportTestBase.class); @Rule public RetryRule retryRule = new RetryRule(2); - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private Timer timer; protected abstract void start() throws Exception; @@ -77,7 +76,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas final boolean failOnCreateConnection, final long failDelay) throws Exception { for (int its = 0; its < numIts; its++) { - log.info("Beginning iteration " + its); + log.debug("Beginning iteration " + its); start(); @@ -214,7 +213,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas @Override public synchronized void run() { - log.info("** Failing connection"); + log.debug("** Failing connection"); RemotingConnectionImpl conn = (RemotingConnectionImpl) ((ClientSessionInternal) session).getConnection(); @@ -225,7 +224,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas conn.fail(new ActiveMQNotConnectedException("blah")); } - log.info("** Fail complete"); + log.debug("** Fail complete"); cancel(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java index b820311cd7..931b959ac8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java @@ -36,7 +36,6 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; import org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Test; @@ -47,8 +46,6 @@ public class OrderReattachTest extends ActiveMQTestBase { final SimpleString ADDRESS = new SimpleString("address"); // Attributes ---------------------------------------------------- - private final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ActiveMQServer server; // Static -------------------------------------------------------- @@ -204,7 +201,7 @@ public class OrderReattachTest extends ActiveMQTestBase { if (message.getIntProperty("count") != count) { failure = new Exception("counter " + count + " was not as expected (" + message.getIntProperty("count") + ")"); - log.warn("Failure on receiving message ", failure); + instanceLog.warn("Failure on receiving message ", failure); failure.printStackTrace(); latch.countDown(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java index 38f3fcb062..5194a97e07 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java @@ -41,16 +41,21 @@ import org.apache.activemq.artemis.core.remoting.impl.invm.InVMRegistry; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.activemq.artemis.utils.RetryRule; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; public class RandomReattachTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + @Rule + public RetryRule retryRule = new RetryRule(2); + + private static final Logger log = Logger.getLogger(RandomReattachTest.class); // Constants ----------------------------------------------------- @@ -204,7 +209,7 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numIts = getNumIterations(); for (int its = 0; its < numIts; its++) { - RandomReattachTest.log.info("####" + getName() + " iteration #" + its); + log.debug("####" + getName() + " iteration #" + its); start(); ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(15).setConfirmationWindowSize(1024 * 1024); @@ -324,7 +329,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestB(final ClientSessionFactory sf) throws Exception { @@ -423,7 +428,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } @@ -564,7 +569,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestD(final ClientSessionFactory sf) throws Exception { @@ -699,7 +704,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } // Now with synchronous receive() @@ -777,7 +782,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestF(final ClientSessionFactory sf) throws Exception { @@ -861,7 +866,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestG(final ClientSessionFactory sf) throws Exception { @@ -973,7 +978,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestH(final ClientSessionFactory sf) throws Exception { @@ -1089,7 +1094,7 @@ public class RandomReattachTest extends ActiveMQTestBase { long end = System.currentTimeMillis(); - RandomReattachTest.log.info("duration " + (end - start)); + log.debug("duration " + (end - start)); } protected void doTestI(final ClientSessionFactory sf) throws Exception { @@ -1274,11 +1279,11 @@ public class RandomReattachTest extends ActiveMQTestBase { @Override public synchronized void run() { - RandomReattachTest.log.info("** Failing connection"); + log.debug("** Failing connection"); session.getConnection().fail(new ActiveMQNotConnectedException("oops")); - RandomReattachTest.log.info("** Fail complete"); + log.debug("** Fail complete"); cancel(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java index 03e1efce0f..3c91e7d970 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java @@ -43,7 +43,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.After; import org.junit.Assert; @@ -52,8 +51,6 @@ import org.junit.Test; public class ReattachTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private static final SimpleString ADDRESS = new SimpleString("FailoverTestAddress"); private ActiveMQServer server; private ServerLocator locator; @@ -144,14 +141,10 @@ public class ReattachTest extends ActiveMQTestBase { @Override public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException { - System.out.println("Intercept..." + packet.getClass().getName()); - if (packet instanceof SessionProducerCreditsMessage) { SessionProducerCreditsMessage credit = (SessionProducerCreditsMessage) packet; - System.out.println("Credits: " + credit.getCredits()); if (count.incrementAndGet() == 2) { - System.out.println("Failing"); connection.fail(new ActiveMQException(ActiveMQExceptionType.UNSUPPORTED_PACKET, "bye")); return false; } @@ -505,7 +498,7 @@ public class ReattachTest extends ActiveMQTestBase { try { connFailure.fail(new ActiveMQNotConnectedException()); } catch (Exception e) { - ReattachTest.log.warn("Error on the timer " + e); + instanceLog.warn("Error on the timer " + e); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java index ccbe267afa..9b141c44c3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java @@ -21,14 +21,11 @@ import java.util.Collection; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.postoffice.Binding; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; import org.junit.Test; public class ClusterRestartTest extends ClusterTestBase { - IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Test public void testRestartWithQueuesCreateInDiffOrder() throws Exception { setupServer(0, isFileStorage(), isNetty()); @@ -40,8 +37,8 @@ public class ClusterRestartTest extends ClusterTestBase { startServers(0, 1); - System.out.println("server 0 = " + getServer(0).getNodeID()); - System.out.println("server 1 = " + getServer(1).getNodeID()); + instanceLog.debug("server 0 = " + getServer(0).getNodeID()); + instanceLog.debug("server 1 = " + getServer(1).getNodeID()); setupSessionFactory(0, isNetty(), 15); setupSessionFactory(1, isNetty()); @@ -73,7 +70,6 @@ public class ClusterRestartTest extends ClusterTestBase { sendInRange(1, "queues.testaddress", 0, 10, true, null); - log.info("stopping******************************************************"); stopServers(0); // Waiting some time after stopped Thread.sleep(2000); @@ -90,7 +86,7 @@ public class ClusterRestartTest extends ClusterTestBase { sendInRange(1, "queues.testaddress", 10, 20, false, null); verifyReceiveAllInRange(0, 20, 0); - System.out.println("*****************************************************************************"); + instanceLog.debug("*****************************************************************************"); } @Test @@ -104,8 +100,8 @@ public class ClusterRestartTest extends ClusterTestBase { startServers(0, 1); - System.out.println("server 0 = " + getServer(0).getNodeID()); - System.out.println("server 1 = " + getServer(1).getNodeID()); + instanceLog.debug("server 0 = " + getServer(0).getNodeID()); + instanceLog.debug("server 1 = " + getServer(1).getNodeID()); setupSessionFactory(0, isNetty(), 15); setupSessionFactory(1, isNetty()); @@ -133,11 +129,11 @@ public class ClusterRestartTest extends ClusterTestBase { sendInRange(1, "queues.testaddress", 0, 10, true, null); - System.out.println("stopping******************************************************"); + instanceLog.debug("stopping******************************************************"); stopServers(0); sendInRange(1, "queues.testaddress", 10, 20, true, null); - System.out.println("stopped******************************************************"); + instanceLog.debug("stopped******************************************************"); startServers(0); waitForBindings(0, "queues.testaddress", 1, 0, true); @@ -150,14 +146,14 @@ public class ClusterRestartTest extends ClusterTestBase { addConsumer(1, 0, "queue10", null); verifyReceiveRoundRobin(0, 20, 0, 1); - System.out.println("*****************************************************************************"); + instanceLog.debug("*****************************************************************************"); } private void printBindings(final int num) throws Exception { for (int i = 0; i < num; i++) { Collection bindings0 = getServer(i).getPostOffice().getBindingsForAddress(new SimpleString("queues.testaddress")).getBindings(); for (Binding binding : bindings0) { - System.out.println(binding + " on node " + i + " at " + binding.getID()); + instanceLog.debug(binding + " on node " + i + " at " + binding.getID()); } } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java index 337b5aa912..33a890a7df 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java @@ -38,7 +38,6 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.cluster.ClusterConnection; import org.apache.activemq.artemis.core.server.cluster.ClusterManager; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.Wait; @@ -92,8 +91,6 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase { } } - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected abstract ServerLocator createHAServerLocator(); protected abstract void setupServers() throws Exception; @@ -195,7 +192,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase { } while (System.currentTimeMillis() - start < ActiveMQTestBase.WAIT_TIMEOUT); - log.error(clusterDescription(servers[node])); + instanceLog.error(clusterDescription(servers[node])); Assert.assertEquals("Timed out waiting for cluster connections for server " + node, expected, nodesCount); } @@ -398,7 +395,7 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase { boolean ok = downLatch.await(10, SECONDS); if (!ok) { - log.warn("TopologyClusterTestBase.testMultipleClientSessionFactories will fail"); + instanceLog.warn("TopologyClusterTestBase.testMultipleClientSessionFactories will fail"); } Assert.assertTrue("Was not notified that all servers are Down", ok); checkContains(new int[]{0}, nodeIDs, nodes); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/CriticalCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/CriticalCrashTest.java index 548b99eaa8..a76922eabd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/CriticalCrashTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/CriticalCrashTest.java @@ -80,7 +80,6 @@ public class CriticalCrashTest extends SpawnedTestBase { producer.send(session.createTextMessage("text")); } - System.out.println("Sent messages"); } finally { server.stop(); @@ -108,7 +107,6 @@ public class CriticalCrashTest extends SpawnedTestBase { if (blocked.get()) { while (true) { try { - System.out.println("Blocking forever"); Thread.sleep(1000); } catch (Throwable ignored) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java index bbca7b8d03..28d8db6c96 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java @@ -72,8 +72,6 @@ public class ShutdownOnCriticalIOErrorMoveNextTest extends ActiveMQTestBase { Assert.assertFalse(server.isStarted()); - System.out.println("Sent messages"); - } finally { server.stop(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToJMSCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToJMSCoreTest.java index 45b5aa3597..381471d9f0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToJMSCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/AMQPToJMSCoreTest.java @@ -77,7 +77,6 @@ public class AMQPToJMSCoreTest extends ActiveMQTestBase { @Test public void testMessageDestination() throws Exception { - System.out.println("foo"); AmqpClient client = new AmqpClient(new URI("tcp://127.0.0.1:61616"), null, null); AmqpConnection amqpconnection = client.connect(); try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/MessageIDMultiProtocolTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/MessageIDMultiProtocolTest.java index f5275c72fb..f3c73f3a9d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/MessageIDMultiProtocolTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/MessageIDMultiProtocolTest.java @@ -115,8 +115,8 @@ public class MessageIDMultiProtocolTest extends OpenWireTestBase { Assert.assertTrue(messageId.startsWith("ID:")); - System.out.println("[" + protocolSender + "][" + protocolConsumer + "] " + messageId); - System.out.println("[" + protocolSender + "][" + protocolConsumer + "] " + sentMid); + instanceLog.debug("[" + protocolSender + "][" + protocolConsumer + "] " + messageId); + instanceLog.debug("[" + protocolSender + "][" + protocolConsumer + "] " + sentMid); if (protocolConsumer.equals(protocolSender)) { //only same protocol we guarantee the same JMSMessageID diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/RequestReplyMultiProtocolTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/RequestReplyMultiProtocolTest.java index 6ca7b968bc..1cfd0f7362 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/RequestReplyMultiProtocolTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/RequestReplyMultiProtocolTest.java @@ -156,7 +156,7 @@ public class RequestReplyMultiProtocolTest extends OpenWireTestBase { TextMessage received = (TextMessage)consumer.receive(5000); Assert.assertNotNull(received); - System.out.println("Destination::" + received.getJMSDestination()); + instanceLog.debug("Destination::" + received.getJMSDestination()); if (useTopic) { Assert.assertTrue("JMSDestination type is " + received.getJMSDestination().getClass(), received.getJMSDestination() instanceof Topic); @@ -167,7 +167,7 @@ public class RequestReplyMultiProtocolTest extends OpenWireTestBase { Assert.assertNotNull(received.getJMSReplyTo()); Assert.assertEquals("hello " + (i++), received.getText()); - System.out.println("received " + received.getText() + " and " + received.getJMSReplyTo()); + instanceLog.debug("received " + received.getText() + " and " + received.getJMSReplyTo()); if (destination instanceof Queue) { Assert.assertTrue("Type is " + received.getJMSReplyTo().getClass().toString(), received.getJMSReplyTo() instanceof Queue); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java index 650694f912..3182bdbe2c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java @@ -36,14 +36,12 @@ import org.apache.activemq.artemis.core.server.cluster.BroadcastGroup; import org.apache.activemq.artemis.core.server.cluster.impl.BroadcastGroupImpl; import org.apache.activemq.artemis.core.server.impl.CleaningActivateCallback; import org.apache.activemq.artemis.core.server.management.NotificationService; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.junit.Assert; public class DiscoveryBaseTest extends ActiveMQTestBase { - protected static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; protected final String address1 = getUDPDiscoveryAddress(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java index 8efcdcdfc5..7fd85b7292 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java @@ -355,7 +355,7 @@ public class DiscoveryTest extends DiscoveryBaseTest { byte[] btreceived = client.receiveBroadcast(5, TimeUnit.SECONDS); - System.out.println("BTReceived = " + Arrays.toString(btreceived)); + instanceLog.debug("BTReceived = " + Arrays.toString(btreceived)); assertNotNull(btreceived); @@ -393,7 +393,7 @@ public class DiscoveryTest extends DiscoveryBaseTest { InetAddress localAddress = InetAddress.getLoopbackAddress(); - log.info("Local address is " + localAddress); + instanceLog.debug("Local address is " + localAddress); bg = newBroadcast(nodeID, RandomUtil.randomString(), localAddress, -1, groupAddress, groupPort); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java index ad75c08d26..fb5dd81f2d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/DivertTest.java @@ -482,7 +482,7 @@ public class DivertTest extends ActiveMQTestBase { for (int i = 0; i < numMessages * 2; i++) { ClientMessage message = consumerExpiry.receive(5000); - System.out.println("Received message " + message); + instanceLog.debug("Received message " + message); assertNotNull(message); if (message.getStringProperty(Message.HDR_ORIGINAL_QUEUE).equals("divert1")) { @@ -490,7 +490,7 @@ public class DivertTest extends ActiveMQTestBase { } else if (message.getStringProperty(Message.HDR_ORIGINAL_QUEUE).equals("queue2")) { countOriginal2++; } else { - System.out.println("message not part of any expired queue" + message); + instanceLog.debug("message not part of any expired queue" + message); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java index 400c822983..0e6ff0f902 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/ReplicationWithDivertTest.java @@ -81,8 +81,6 @@ public class ReplicationWithDivertTest extends ActiveMQTestBase { public void setUp() throws Exception { super.setUp(); - System.out.println("Tmp::" + getTemporaryDir()); - flagChunkEntered.setCount(1); flagChunkWait.setCount(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Incoming.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Incoming.java index 4098842506..2f47e9f912 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Incoming.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Incoming.java @@ -29,7 +29,6 @@ public class Incoming implements Interceptor { @Override public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException { - System.out.println("Incoming:Packet : " + packet); if (packet.getType() == PacketImpl.SESS_RECEIVE_MSG) { SessionReceiveMessage p = (SessionReceiveMessage) packet; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java index c283a7ea40..35de96e589 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java @@ -108,13 +108,13 @@ public class InterceptorTest extends ActiveMQTestBase { CreateQueueMessage createQueue = (CreateQueueMessage) packet; createQueue.setFilterString(new SimpleString("userName='" + userName + "'")); - System.out.println("userName on createQueue = " + userName); + instanceLog.debug("userName on createQueue = " + userName); } else if (packet.getType() == PacketImpl.SESS_SEND) { String userName = getUsername(packet, connection); MessagePacket msgPacket = (MessagePacket) packet; msgPacket.getMessage().putStringProperty("userName", userName); - System.out.println("userName on send = " + userName); + instanceLog.debug("userName on send = " + userName); } return true; @@ -138,13 +138,13 @@ public class InterceptorTest extends ActiveMQTestBase { SessionCreateConsumerMessage createQueue = (SessionCreateConsumerMessage) packet; createQueue.setFilterString(new SimpleString("userName='" + userName + "'")); - System.out.println("userName = " + userName); + instanceLog.debug("userName = " + userName); } else if (packet.getType() == PacketImpl.SESS_SEND) { String userName = getUsername(packet, connection); MessagePacket msgPacket = (MessagePacket) packet; msgPacket.getMessage().putStringProperty("userName", userName); - System.out.println("userName on send = " + userName); + instanceLog.debug("userName on send = " + userName); } return true; @@ -1058,7 +1058,7 @@ public class InterceptorTest extends ActiveMQTestBase { String uri = "tcp://localhost:61616?incomingInterceptorList=" + Incoming.class.getCanonicalName() + "&outgoingInterceptorList=" + Outgoing.class.getName(); - System.out.println(uri); + instanceLog.debug(uri); ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(uri); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java index 5736762b85..e76aed6a5b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/Outgoing.java @@ -23,12 +23,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.protocol.core.impl.wireformat.SessionSendMessage; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; +import org.jboss.logging.Logger; public class Outgoing implements Interceptor { + private static final Logger log = Logger.getLogger(Outgoing.class); + @Override public boolean intercept(final Packet packet, final RemotingConnection connection) throws ActiveMQException { - System.out.println("Outgoin:Packet : " + packet); + log.debug("Outgoin:Packet : " + packet); if (packet.getType() == PacketImpl.SESS_SEND) { SessionSendMessage p = (SessionSendMessage) packet; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java index 8ab5ba65de..b1a9c58e8a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java @@ -48,7 +48,6 @@ import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfigu import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.jms.serializables.TestClass1; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ObjectInputStreamWithClassLoader; @@ -62,8 +61,6 @@ import org.junit.Test; */ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private final String groupAddress = getUDPDiscoveryAddress(); private final int groupPort = getUDPDiscoveryPort(); @@ -91,8 +88,6 @@ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { conn.close(); } - ActiveMQConnectionFactoryTest.log.info("Got here"); - testSettersThrowException(cf); } @@ -370,7 +365,6 @@ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { } } - System.out.println("query string: " + query); ActiveMQConnectionFactory factory = null; if (useJndi) { Hashtable props = new Hashtable<>(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java index 9af59b51cc..bb81924df6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java @@ -29,8 +29,8 @@ import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.jboss.logging.Logger; import org.junit.Before; import org.junit.Test; @@ -40,7 +40,7 @@ import org.junit.Test; public class FloodServerTest extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(FloodServerTest.class); private ActiveMQServer server; @@ -150,11 +150,6 @@ public class FloodServerTest extends ActiveMQTestBase { for (int i = 0; i < numMessages; i++) { producer.send(message); - - // if (i % 1000 == 0) - // { - // log.info("Producer " + this + " sent " + i); - // } } connection.close(); @@ -196,11 +191,6 @@ public class FloodServerTest extends ActiveMQTestBase { FloodServerTest.log.error("message is null"); break; } - - // if (i % 1000 == 0) - // { - // log.info("Consumer " + this + " received " + i); - // } } connection.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java index 1d4df12799..322d5f5465 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java @@ -38,7 +38,6 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Before; @@ -50,7 +49,6 @@ public class ManualReconnectionToSingleServerTest extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; public static final String BROKER_URL = "tcp://localhost:61616?minLargeMessageSize=10000&HA=true&retryInterval=100&reconnectAttempts=20&producerWindowSize=10000"; private Connection connection; @@ -154,20 +152,20 @@ public class ManualReconnectionToSingleServerTest extends ActiveMQTestBase { // Inner classes ------------------------------------------------- protected void disconnect() { - ManualReconnectionToSingleServerTest.log.info("calling disconnect"); + instanceLog.debug("calling disconnect"); if (connection == null) { - ManualReconnectionToSingleServerTest.log.info("connection is null"); + instanceLog.debug("connection is null"); return; } try { connection.setExceptionListener(null); - ManualReconnectionToSingleServerTest.log.info("closing the connection"); + instanceLog.debug("closing the connection"); connection.close(); connection = null; - ManualReconnectionToSingleServerTest.log.info("connection closed"); + instanceLog.debug("connection closed"); } catch (Exception e) { - ManualReconnectionToSingleServerTest.log.info("** got exception"); + instanceLog.debug("** got exception"); e.printStackTrace(); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/CreateQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/CreateQueueTest.java index 9977d44a43..9d34da8ad1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/CreateQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/CreateQueueTest.java @@ -22,15 +22,12 @@ import javax.jms.Queue; import javax.jms.Session; import javax.jms.Topic; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.Test; public class CreateQueueTest extends JMSTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Attributes ---------------------------------------------------- // Static -------------------------------------------------------- @@ -73,7 +70,7 @@ public class CreateQueueTest extends JMSTestBase { String queueName = queue.getQueueName(); - log.info("queue name is " + queueName); + instanceLog.debug("queue name is " + queueName); // assertFalse(queueName.startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java index 23de95689b..284d0e84d8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java @@ -284,7 +284,6 @@ public class GroupingTest extends JMSTestBase { assertNotNull(tm); long text = ((ActiveMQTextMessage) tm).getCoreMessage().getMessageID(); - System.out.println(tm.getJMSMessageID() + " text = " + text); //assertEquals("Message" + j, text); assertEquals(tm.getStringProperty("JMSXGroupID"), jmsxgroupID); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java index 5641bbf4fc..86f13ed5b3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java @@ -27,7 +27,6 @@ import javax.jms.StreamMessage; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.reader.MessageUtil; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.Assert; import org.junit.Test; @@ -35,8 +34,6 @@ import org.junit.Test; public class MessageTest extends JMSTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private static final long TIMEOUT = 1000; private static final String propName1 = "myprop1"; @@ -226,35 +223,35 @@ public class MessageTest extends JMSTestBase { Assert.assertNull(message.getObjectProperty(MessageTest.propName3)); try { - MessageTest.log.info(message.getIntProperty(MessageTest.propName1)); + instanceLog.debug(message.getIntProperty(MessageTest.propName1)); Assert.fail("Should throw exception"); } catch (NumberFormatException e) { // Ok } try { - MessageTest.log.info(message.getShortProperty(MessageTest.propName1)); + instanceLog.debug(message.getShortProperty(MessageTest.propName1)); } catch (NumberFormatException e) { // Ok } try { - MessageTest.log.info(message.getByteProperty(MessageTest.propName1)); + instanceLog.debug(message.getByteProperty(MessageTest.propName1)); } catch (NumberFormatException e) { // Ok } Assert.assertEquals(false, message.getBooleanProperty(MessageTest.propName1)); try { - MessageTest.log.info(message.getLongProperty(MessageTest.propName1)); + instanceLog.debug(message.getLongProperty(MessageTest.propName1)); } catch (NumberFormatException e) { // Ok } try { - MessageTest.log.info(message.getFloatProperty(MessageTest.propName1)); + instanceLog.debug(message.getFloatProperty(MessageTest.propName1)); } catch (NullPointerException e) { // Ok } try { - MessageTest.log.info(message.getDoubleProperty(MessageTest.propName1)); + instanceLog.debug(message.getDoubleProperty(MessageTest.propName1)); } catch (NullPointerException e) { // Ok } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NewQueueRequestorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NewQueueRequestorTest.java index 25377de8dd..d4aa5f63d1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NewQueueRequestorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NewQueueRequestorTest.java @@ -29,14 +29,11 @@ import javax.jms.QueueSession; import javax.jms.Session; import javax.jms.TextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.Test; public class NewQueueRequestorTest extends JMSTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Test public void testQueueRequestor() throws Exception { QueueConnection conn1 = null, conn2 = null; @@ -57,7 +54,6 @@ public class NewQueueRequestorTest extends JMSTestBase { conn2.start(); Message m1 = sess1.createMessage(); - log.trace("Sending request message"); TextMessage m2 = (TextMessage) requestor.request(m1); assertNotNull(m2); @@ -96,7 +92,7 @@ public class NewQueueRequestorTest extends JMSTestBase { Message m2 = sess.createTextMessage("This is the response"); sender.send(queue, m2); } catch (JMSException e) { - log.error(e); + instanceLog.error(e); } } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java index 2df214c925..437897ab11 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java @@ -26,7 +26,6 @@ import javax.jms.TextMessage; import javax.jms.Topic; import javax.jms.TopicSubscriber; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.apache.activemq.artemis.utils.RandomUtil; import org.junit.Test; @@ -34,8 +33,6 @@ import org.junit.Test; public class NoLocalSubscriberTest extends JMSTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Static -------------------------------------------------------- // Attributes ---------------------------------------------------- @@ -50,9 +47,6 @@ public class NoLocalSubscriberTest extends JMSTestBase { */ @Test public void testNoLocal() throws Exception { - if (log.isTraceEnabled()) { - log.trace("testNoLocal"); - } Connection defaultConn = null; Connection newConn = null; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java index 244a101f88..852109704d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java @@ -33,7 +33,6 @@ import org.apache.activemq.artemis.api.jms.JMSFactoryType; import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; import org.apache.activemq.artemis.jms.client.ActiveMQSession; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.Assert; import org.junit.Test; @@ -44,8 +43,6 @@ import org.junit.Test; public class SessionClosedOnRemotingConnectionFailureTest extends JMSTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Attributes ---------------------------------------------------- // Static -------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java index 5992ff47e7..eccb1c8bd9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java @@ -48,7 +48,6 @@ import org.apache.activemq.artemis.core.server.impl.InVMNodeManager; import org.apache.activemq.artemis.jms.client.ActiveMQConnection; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQSession; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.jms.server.management.JMSUtil; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.InVMNodeManagerServer; @@ -65,8 +64,6 @@ import org.junit.Test; */ public class JMSFailoverListenerTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - // Constants ----------------------------------------------------- // Attributes ---------------------------------------------------- @@ -152,13 +149,13 @@ public class JMSFailoverListenerTest extends ActiveMQTestBase { conn.start(); - JMSFailoverListenerTest.log.info("sent messages and started connection"); + instanceLog.debug("sent messages and started connection"); JMSUtil.crash(liveServer, ((ActiveMQSession) sess).getCoreSession()); Wait.assertTrue(() -> FailoverEventType.FAILURE_DETECTED == listener.get(0)); for (int i = 0; i < numMessages; i++) { - JMSFailoverListenerTest.log.info("got message " + i); + instanceLog.debug("got message " + i); BytesMessage bm = (BytesMessage) consumer.receive(1000); @@ -279,7 +276,7 @@ public class JMSFailoverListenerTest extends ActiveMQTestBase { backupServer = addServer(new InVMNodeManagerServer(backupConf, nodeManager)); backupServer.setIdentity("JMSBackup"); - log.info("Starting backup"); + instanceLog.debug("Starting backup"); backupServer.start(); liveConf = createBasicConfig().setJournalDirectory(getJournalDir()).setBindingsDirectory(getBindingsDir()).addAcceptorConfiguration(liveAcceptortc).setJournalType(getDefaultJournalType()).setBindingsDirectory(getBindingsDir()).setJournalMinFiles(2).setJournalDirectory(getJournalDir()).setPagingDirectory(getPageDir()).setLargeMessagesDirectory(getLargeMessagesDir()).addConnectorConfiguration(livetc.getName(), livetc).setPersistenceEnabled(true).setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration()).addClusterConfiguration(basicClusterConnectionConfig(livetc.getName())); @@ -288,7 +285,7 @@ public class JMSFailoverListenerTest extends ActiveMQTestBase { liveServer = addServer(new InVMNodeManagerServer(liveConf, nodeManager)); liveServer.setIdentity("JMSLive"); - log.info("Starting life"); + instanceLog.debug("Starting life"); liveServer.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java index 83d62446a2..7f22235c07 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java @@ -59,12 +59,12 @@ import org.apache.activemq.artemis.jms.client.ActiveMQSession; import org.apache.activemq.artemis.jms.server.JMSServerManager; import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.jms.server.management.JMSUtil; import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.InVMNodeManagerServer; import org.apache.activemq.artemis.utils.RandomUtil; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -77,7 +77,7 @@ import org.junit.Test; */ public class JMSFailoverTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(JMSFailoverTest.class); // Constants ----------------------------------------------------- @@ -222,14 +222,14 @@ public class JMSFailoverTest extends ActiveMQTestBase { conn.start(); - JMSFailoverTest.log.info("sent messages and started connection"); + instanceLog.debug("sent messages and started connection"); Thread.sleep(2000); JMSUtil.crash(liveServer, ((ActiveMQSession) sess).getCoreSession()); for (int i = 0; i < numMessages; i++) { - JMSFailoverTest.log.info("got message " + i); + log.debug("got message " + i); BytesMessage bm = (BytesMessage) consumer.receive(1000); @@ -344,7 +344,6 @@ public class JMSFailoverTest extends ActiveMQTestBase { if (packet instanceof SessionReceiveContinuationMessage) { if (count++ == 300 && !killed.get()) { - System.out.println("sending countDown on latch waitToKill"); killed.set(true); waitToKill.countDown(); } @@ -370,8 +369,6 @@ public class JMSFailoverTest extends ActiveMQTestBase { } try { - System.out.println("Killing server..."); - JMSUtil.crash(liveServer, coreSession); } catch (Exception e) { e.printStackTrace(); @@ -475,7 +472,7 @@ public class JMSFailoverTest extends ActiveMQTestBase { backupJMSServer.setRegistry(new JndiBindingRegistry(ctx2)); backupJMSServer.getActiveMQServer().setIdentity("JMSBackup"); - log.info("Starting backup"); + log.debug("Starting backup"); backupJMSServer.start(); liveConf = createBasicConfig().setJournalDirectory(getJournalDir()).setBindingsDirectory(getBindingsDir()).setSecurityEnabled(false).addAcceptorConfiguration(liveAcceptortc).setJournalType(getDefaultJournalType()).setBindingsDirectory(getBindingsDir()).setJournalMinFiles(2).setJournalDirectory(getJournalDir()).setPagingDirectory(getPageDir()).setLargeMessagesDirectory(getLargeMessagesDir()).addConnectorConfiguration(livetc.getName(), livetc).setPersistenceEnabled(true).setHAPolicyConfiguration(sharedStore ? new SharedStoreMasterPolicyConfiguration() : new ReplicatedPolicyConfiguration()).addClusterConfiguration(basicClusterConnectionConfig(livetc.getName())); @@ -487,7 +484,7 @@ public class JMSFailoverTest extends ActiveMQTestBase { liveJMSServer.setRegistry(new JndiBindingRegistry(ctx1)); liveJMSServer.getActiveMQServer().setIdentity("JMSLive"); - log.info("Starting life"); + log.debug("Starting life"); liveJMSServer.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java index 75583eca17..7c91c8c826 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/MultipleThreadsOpeningTest.java @@ -39,7 +39,7 @@ public class MultipleThreadsOpeningTest extends JMSClusteredTestBase { final int ITERATIONS = 50; for (int i = 0; i < ITERATIONS; i++) { - System.out.println("#test " + i); + instanceLog.info("#test " + i); internalMultipleOpen(200, 1); tearDown(); setUp(); @@ -75,7 +75,7 @@ public class MultipleThreadsOpeningTest extends JMSClusteredTestBase { for (int i = 0; i < numberOfOpens; i++) { if (i > 0 && i % 100 == 0) - System.out.println("connections created on Thread " + Thread.currentThread() + " " + i); + instanceLog.debug("connections created on Thread " + Thread.currentThread() + " " + i); Connection conn = cf1.createConnection(); Session sess = conn.createSession(true, Session.AUTO_ACKNOWLEDGE); sess.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java index e419a93b98..fab80dad6f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TemporaryQueueClusterTest.java @@ -42,8 +42,6 @@ public class TemporaryQueueClusterTest extends JMSClusteredTestBase { @Test public void testClusteredQueue() throws Exception { - System.out.println("Server1 = " + server1.getNodeID()); - System.out.println("Server2 = " + server2.getNodeID()); jmsServer1.createQueue(false, QUEUE_NAME, null, true, "/queue/target"); jmsServer2.createQueue(false, QUEUE_NAME, null, true, "/queue/target"); @@ -102,7 +100,6 @@ public class TemporaryQueueClusterTest extends JMSClusteredTestBase { Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue targetQueue1 = session1.createQueue(QUEUE_NAME); Queue tempQueue = session1.createTemporaryQueue(); - System.out.println("temp queue is " + tempQueue.getQueueName()); Session session2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue targetQueue2 = session2.createQueue(QUEUE_NAME); @@ -128,8 +125,6 @@ public class TemporaryQueueClusterTest extends JMSClusteredTestBase { for (int i = 0; i < 10; i++) { if (i % 2 == 0) { TextMessage received = (TextMessage) cons2.receive(5000); - System.out.println(received.getText()); - System.out.println("check temp queue on server #2"); MessageProducer tempProducer = session2.createProducer(received.getJMSReplyTo()); tempProducer.send(session2.createTextMessage(">>> " + received.getText())); tempProducer.close(); @@ -140,7 +135,6 @@ public class TemporaryQueueClusterTest extends JMSClusteredTestBase { if (i % 2 == 0) { TextMessage received = (TextMessage) tempCons1.receive(5000); assertNotNull(received); - System.out.println(received.getText()); } } } finally { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java index 00533da211..e9e72f9029 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/TopicClusterTest.java @@ -164,7 +164,6 @@ public class TopicClusterTest extends JMSClusteredTestBase { ActiveMQMessage hqMessage = (ActiveMQMessage) m; ClientMessage coreMessage = hqMessage.getCoreMessage(); Set coreProps = coreMessage.getPropertyNames(); - System.out.println("core props: " + coreProps); boolean exist = false; for (SimpleString prop : coreProps) { if (prop.startsWith(org.apache.activemq.artemis.api.core.Message.HDR_ROUTE_TO_IDS)) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java index dc865d195c..f0e8cf8c64 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java @@ -43,7 +43,6 @@ import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.artemis.utils.ReusableLatch; @@ -53,8 +52,6 @@ import org.junit.Test; public class JmsConsumerTest extends JMSTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private static final String Q_NAME = "ConsumerTestQueue"; private static final String T_NAME = "ConsumerTestTopic"; @@ -113,9 +110,9 @@ public class JmsConsumerTest extends JMSTestBase { TextMessage m3 = (TextMessage) cons.receive(2000); Assert.assertNull("m3 should be null", m3); - System.out.println("received m1: " + m1.getText()); - System.out.println("received m2: " + m2.getText()); - System.out.println("received m3: " + m3); + instanceLog.debug("received m1: " + m1.getText()); + instanceLog.debug("received m2: " + m2.getText()); + instanceLog.debug("received m3: " + m3); sess.commit(); } @@ -342,8 +339,6 @@ public class JmsConsumerTest extends JMSTestBase { @Test public void testPreCommitAcksWithMessageExpiry() throws Exception { - JmsConsumerTest.log.info("starting test"); - conn = cf.createConnection(); Session session = conn.createSession(false, ActiveMQJMSConstants.PRE_ACKNOWLEDGE); jBossQueue = ActiveMQJMSClient.createQueue(JmsConsumerTest.Q_NAME); @@ -767,11 +762,9 @@ public class JmsConsumerTest extends JMSTestBase { for (int i = 0; i < 50; i++) { String txt = consumer.receiveBody(String.class, 5000); - System.out.println("TXT:" + txt); Assert.assertNotNull(txt); txt = consumer.receiveBody(String.class, 5000); - System.out.println("TXT:" + txt); Assert.assertNotNull(txt); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/InvalidDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/InvalidDestinationTest.java index a4ed52ee54..eafb82c6fb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/InvalidDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/InvalidDestinationTest.java @@ -210,7 +210,6 @@ public class InvalidDestinationTest extends JMSTestBase { fail("Expected InvalidDestinationException, received " + e); } - System.out.println("Testing Session.createDurableConsumer(Topic, String) for InvalidDestinationException"); try { session.createDurableConsumer(invalidTopic, "InvalidDestinationException"); } catch (InvalidDestinationException e) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java index 7f6ff379fe..0e77f07e99 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java @@ -145,8 +145,6 @@ public class JmsContextTest extends JMSTestBase { String randomStr = newXID().toString(); - System.out.println("RandomStr:" + randomStr); - TextMessage sendMsg = context.createTextMessage(randomStr); producer.send(queue1, sendMsg); @@ -538,7 +536,6 @@ public class JmsContextTest extends JMSTestBase { public void illegalStateRuntimeExceptionTests() throws Exception { JMSProducer producer = context.createProducer(); JMSConsumer consumer = context.createConsumer(queue1); - System.out.println("Creating TextMessage"); TextMessage expTextMessage = context.createTextMessage("Call commit"); CountDownLatch latch = new CountDownLatch(1); JMSCOntextStopCompletionListener listener = new JMSCOntextStopCompletionListener(context, latch); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/SharedConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/SharedConsumerTest.java index 8460a5ac6d..72ef99ca92 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/SharedConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/SharedConsumerTest.java @@ -60,9 +60,7 @@ public class SharedConsumerTest extends JMSTestBase { for (int i = 0; i < numMessages; i += 2) { String msg = con1.receiveBody(String.class, 5000); - System.out.println("msg = " + msg); msg = con2.receiveBody(String.class, 5000); - System.out.println("msg = " + msg); } } finally { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java index ebef7e6829..ff166735d8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/largemessage/JMSLargeMessageTest.java @@ -91,8 +91,6 @@ public class JMSLargeMessageTest extends JMSTestBase { byte[] data = new byte[1024]; - System.out.println("Message = " + rm); - for (int i = 0; i < 1024 * 1024; i += 1024) { int numberOfBytes = rm.readBytes(data); Assert.assertEquals(1024, numberOfBytes); @@ -132,8 +130,6 @@ public class JMSLargeMessageTest extends JMSTestBase { byte[] data = new byte[1024]; - System.out.println("Message = " + rm); - int numberOfBytes = rm.readBytes(data); Assert.assertEquals(10, numberOfBytes); for (int j = 0; j < numberOfBytes; j++) { @@ -179,7 +175,7 @@ public class JMSLargeMessageTest extends JMSTestBase { rm.setObjectProperty("JMS_AMQ_OutputStream", new OutputStream() { @Override public void write(final int b) throws IOException { - System.out.println("b = " + b); + instanceLog.debug("b = " + b); } }); @@ -234,7 +230,7 @@ public class JMSLargeMessageTest extends JMSTestBase { public void write(final int b) throws IOException { numberOfBytes.incrementAndGet(); if (ActiveMQTestBase.getSamplebyte(position++) != b) { - System.out.println("Wrong byte at position " + position); + instanceLog.warn("Wrong byte at position " + position); numberOfErrors.incrementAndGet(); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java index f840c51467..3d80e5aad6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerDeployerTest.java @@ -29,9 +29,9 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactor import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.jms.server.JMSServerManager; import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext; 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; @@ -39,7 +39,7 @@ import org.junit.Test; public class JMSServerDeployerTest extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = org.jboss.logging.Logger.getLogger(JMSServerDeployerTest.class); // Attributes ---------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java index ee0ec5ca3e..fe6ef05bb7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java @@ -36,7 +36,6 @@ import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Before; @@ -44,8 +43,6 @@ import org.junit.Test; public class JMSServerStartStopTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ActiveMQServer server; private Connection conn; @@ -72,7 +69,7 @@ public class JMSServerStartStopTest extends ActiveMQTestBase { final int numMessages = 5; for (int j = 0; j < numMessages; j++) { - JMSServerStartStopTest.log.info("Iteration " + j); + instanceLog.debug("Iteration " + j); server.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java index fc0b3704bc..11dd26b57d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSUtil.java @@ -248,7 +248,6 @@ public class JMSUtil { @Override public void beforeReconnect(ActiveMQException exception) { - System.out.println("MyListener.beforeReconnect"); } } for (ClientSession session : sessions) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java index 17ca88e30f..40879c71b9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java @@ -510,13 +510,13 @@ public class NIOJournalCompactTest extends JournalImplTestBase { @Override public void onCompactDone() { latchDone.countDown(); - System.out.println("Waiting on Compact"); + instanceLog.debug("Waiting on Compact"); try { ActiveMQTestBase.waitForLatch(latchWait); } catch (InterruptedException e) { e.printStackTrace(); } - System.out.println("Done"); + instanceLog.debug("Done"); } }; @@ -627,17 +627,17 @@ public class NIOJournalCompactTest extends JournalImplTestBase { int count = 0; for (long liveID : liveIDs) { if (count++ % 2 == 0) { - System.out.println("Deleting no trans " + liveID); + instanceLog.debug("Deleting no trans " + liveID); delete(liveID); } else { - System.out.println("Deleting TX " + liveID); + instanceLog.debug("Deleting TX " + liveID); // A Total new transaction (that was created after the compact started) to delete a record that is being // compacted deleteTx(transactionID, liveID); commit(transactionID++); } - System.out.println("Deletes are going into " + ((JournalImpl) journal).getCurrentFile()); + instanceLog.debug("Deletes are going into " + ((JournalImpl) journal).getCurrentFile()); } } @@ -766,7 +766,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.testCompact(); - System.out.println("Debug after compact\n" + journal.debug()); + instanceLog.debug("Debug after compact\n" + journal.debug()); stopJournal(); createJournal(); @@ -1202,11 +1202,11 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); - System.out.println("Number of Files: " + journal.getDataFilesCount()); + instanceLog.debug("Number of Files: " + journal.getDataFilesCount()); - System.out.println("Before compact ****************************"); - System.out.println(journal.debug()); - System.out.println("*****************************************"); + instanceLog.debug("Before compact ****************************"); + instanceLog.debug(journal.debug()); + instanceLog.debug("*****************************************"); journal.testCompact(); @@ -1410,7 +1410,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); startCompact(); - System.out.println("Committing TX " + tx); + instanceLog.debug("Committing TX " + tx); commit(tx); finishCompact(); @@ -1460,7 +1460,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); startCompact(); - System.out.println("Committing TX " + tx1); + instanceLog.debug("Committing TX " + tx1); rollback(tx0); for (int i = 0; i < 10; i++) { addTx(tx1, ids[i]); @@ -1516,7 +1516,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); startCompact(); - System.out.println("Committing TX " + tx1); + instanceLog.debug("Committing TX " + tx1); rollback(tx0); for (int i = 0; i < 10; i++) { addTx(tx1, ids[i]); @@ -1784,7 +1784,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { try { while (running.get()) { Thread.sleep(500); - System.out.println("Compacting"); + instanceLog.debug("Compacting"); ((JournalImpl) storage.getMessageJournal()).testCompact(); ((JournalImpl) storage.getMessageJournal()).checkReclaimStatus(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java index 0da03eb02a..fdfb9d4d21 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalImplTest.java @@ -20,20 +20,15 @@ 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.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestUnit; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; public class NIOJournalImplTest extends JournalImplTestUnit { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override protected SequentialFileFactory getFileFactory() throws Exception { File file = new File(getTestDir()); - NIOJournalImplTest.log.debug("deleting directory " + getTestDir()); - ActiveMQTestBase.deleteDirectory(file); file.mkdir(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIONoBufferJournalImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIONoBufferJournalImplTest.java index 559725df78..b8533073e5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIONoBufferJournalImplTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIONoBufferJournalImplTest.java @@ -20,19 +20,14 @@ 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.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestUnit; public class NIONoBufferJournalImplTest extends JournalImplTestUnit { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override protected SequentialFileFactory getFileFactory() throws Exception { File file = new File(getTestDir()); - NIONoBufferJournalImplTest.log.debug("deleting directory " + getTestDir()); - deleteDirectory(file); file.mkdir(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/RelativePathTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/RelativePathTest.java index 349c76650c..7ed48cc4c9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/RelativePathTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/RelativePathTest.java @@ -61,9 +61,6 @@ public class RelativePathTest extends ActiveMQTestBase { // configuration.setJournal - System.out.println("Journal dir::" + configuration.getJournalDirectory()); - System.out.println("Journal loc::" + configuration.getJournalLocation()); - ActiveMQServer server = createServer(true, configuration, AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap()); server.start(); @@ -84,7 +81,6 @@ public class RelativePathTest extends ActiveMQTestBase { // One folder up for testing File bindingsHome = new File(instanceHome, "../binx"); - System.out.println("InstanceHome->" + instanceHome); instanceHome.mkdirs(); configuration.setBrokerInstance(instanceHome); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java index ef3eb1dbec..5e691b8dc5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java @@ -33,6 +33,7 @@ import org.apache.activemq.artemis.core.journal.impl.JournalImpl; import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext; import org.apache.activemq.artemis.tests.util.SpawnedTestBase; import org.apache.activemq.artemis.utils.SpawnedVMSupport; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; @@ -41,6 +42,8 @@ import org.junit.Test; */ public class ValidateTransactionHealthTest extends SpawnedTestBase { + private static final Logger log = Logger.getLogger(ValidateTransactionHealthTest.class); + private static final int OK = 10; @Test @@ -135,8 +138,7 @@ public class ValidateTransactionHealthTest extends SpawnedTestBase { final int numberOfThreads) throws Exception { try { if (type.equals("aio") && !LibaioContext.isLoaded()) { - // Using System.out as this output will go towards junit report - System.out.println("AIO not found, test being ignored on this platform"); + log.warn("AIO not found, test being ignored on this platform"); return; } @@ -214,7 +216,7 @@ public class ValidateTransactionHealthTest extends SpawnedTestBase { @Override public void addRecord(final RecordInfo info) { if (info.id == lastID) { - System.out.println("id = " + info.id + " last id = " + lastID); + log.debug("id = " + info.id + " last id = " + lastID); } ByteBuffer buffer = ByteBuffer.wrap(info.data); @@ -259,7 +261,6 @@ public class ValidateTransactionHealthTest extends SpawnedTestBase { " aio|nio|mmap "); System.exit(-1); } - System.out.println("Running"); String journalType = args[0]; String journalDir = args[1]; long numberOfElements = Long.parseLong(args[2]); @@ -399,7 +400,7 @@ public class ValidateTransactionHealthTest extends SpawnedTestBase { journal.appendAddRecordTransactional(transactionId, id, (byte) 99, buffer.array()); if (++transactionCounter == transactionSize) { - System.out.println("Commit transaction " + transactionId); + log.debug("Commit transaction " + transactionId); journal.appendCommitRecord(transactionId, true); transactionCounter = 0; transactionId = nextID.incrementAndGet(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java index aab6b24265..16d8786cf0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java @@ -83,7 +83,7 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; @RunWith(PaxExam.class) public class ArtemisFeatureTest extends Assert { - private static Logger LOG = Logger.getLogger(ArtemisFeatureTest.class.getName()); + private static Logger log = Logger.getLogger(ArtemisFeatureTest.class.getName()); @Inject BundleContext bundleContext; @@ -128,7 +128,7 @@ public class ArtemisFeatureTest extends Assert { String type = "xml/features"; UrlReference urlReference = mavenBundle().groupId("org.apache.activemq"). artifactId("artemis-features").versionAsInProject().type(type); - LOG.info("FeatureURL: " + urlReference.getURL()); + log.debug("FeatureURL: " + urlReference.getURL()); return urlReference; } @@ -146,7 +146,7 @@ public class ArtemisFeatureTest extends Assert { Object service = waitForService("(objectClass=org.apache.activemq.artemis.core.server.ActiveMQServer)", 30000); assertNotNull(service); - LOG.info("have service " + service); + log.debug("have service " + service); executeCommand("service:list -n"); @@ -236,7 +236,7 @@ public class ArtemisFeatureTest extends Assert { e.printStackTrace(System.err); response = "SHELL COMMAND TIMED OUT: "; } - LOG.info("Execute: " + command + " - Response:" + response); + log.debug("Execute: " + command + " - Response:" + response); return response; } @@ -263,7 +263,7 @@ public class ArtemisFeatureTest extends Assert { public boolean verifyBundleInstalled(final String bundleName) throws Exception { boolean found = false; for (Bundle bundle : bundleContext.getBundles()) { - LOG.debug("Checking: " + bundle.getSymbolicName()); + log.debug("Checking: " + bundle.getSymbolicName()); if (bundle.getSymbolicName().contains(bundleName)) { found = true; break; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java index df4500c6a5..e524221462 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java @@ -46,10 +46,10 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.config.StoreConfiguration; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.DataConstants; import org.apache.activemq.artemis.utils.DeflaterReader; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -58,7 +58,8 @@ import org.junit.runners.Parameterized; public abstract class LargeMessageTestBase extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + + private static final Logger log = Logger.getLogger(LargeMessageTestBase.class); protected final SimpleString ADDRESS = new SimpleString("SimpleAddress"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java index 80f164a612..a94f631550 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java @@ -81,13 +81,13 @@ import org.apache.activemq.artemis.jms.client.ActiveMQSession; import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.unit.core.config.impl.fakes.FakeConnectorServiceFactory; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.artemis.utils.RandomUtil; import org.apache.activemq.artemis.utils.RetryMethod; import org.apache.activemq.artemis.utils.RetryRule; import org.apache.activemq.artemis.utils.UUIDGenerator; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -100,6 +100,7 @@ import static org.apache.activemq.artemis.jms.client.ActiveMQConnection.JMS_SESS @RunWith(Parameterized.class) public class ActiveMQServerControlTest extends ManagementTestBase { + private static final Logger log = Logger.getLogger(ActiveMQServerControlTest.class); @Rule public RetryRule retryRule = new RetryRule(0); @@ -130,7 +131,6 @@ public class ActiveMQServerControlTest extends ManagementTestBase { private static boolean contains(final String name, final String[] strings) { boolean found = false; for (String str : strings) { - IntegrationTestLogger.LOGGER.info("Does " + str + " match " + name); if (name.equals(str)) { found = true; break; @@ -1629,8 +1629,6 @@ public class ActiveMQServerControlTest extends ManagementTestBase { boolean success = serverControl.commitPreparedTransaction(XidImpl.toBase64String(xid)); success = serverControl.commitPreparedTransaction(XidImpl.toBase64String(xid)); - - System.out.println("ActiveMQServerControlTest.testCommitPreparedTransactions"); } @Test @@ -1881,7 +1879,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { addClientSession(factories.get(1).createSession()); String jsonString = serverControl.listConnectionsAsJSON(); - IntegrationTestLogger.LOGGER.info(jsonString); + log.debug(jsonString); Assert.assertNotNull(jsonString); JsonArray array = JsonUtil.readJsonArray(jsonString); Assert.assertEquals(usingCore() ? 3 : 2, array.size()); @@ -1944,7 +1942,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { addClientConsumer(session.createConsumer(queueName, SimpleString.toSimpleString(filter), true)); String jsonString = serverControl.listConsumersAsJSON(factory.getConnection().getID().toString()); - IntegrationTestLogger.LOGGER.info(jsonString); + log.debug(jsonString); Assert.assertNotNull(jsonString); JsonArray array = JsonUtil.readJsonArray(jsonString); Assert.assertEquals(2, array.size()); @@ -2007,7 +2005,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { addClientConsumer(session2.createConsumer(queueName)); String jsonString = serverControl.listAllConsumersAsJSON(); - IntegrationTestLogger.LOGGER.info(jsonString); + log.debug(jsonString); Assert.assertNotNull(jsonString); JsonArray array = JsonUtil.readJsonArray(jsonString); Assert.assertEquals(usingCore() ? 3 : 2, array.size()); @@ -2080,7 +2078,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { session2.createConsumer(queueName); String jsonString = serverControl.listSessionsAsJSON(factory.getConnection().getID().toString()); - IntegrationTestLogger.LOGGER.info(jsonString); + log.debug(jsonString); Assert.assertNotNull(jsonString); JsonArray array = JsonUtil.readJsonArray(jsonString); Assert.assertEquals(2, array.size()); @@ -2144,7 +2142,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { session2.createConsumer(queueName); String jsonString = serverControl.listAllSessionsAsJSON(); - IntegrationTestLogger.LOGGER.info(jsonString); + log.debug(jsonString); Assert.assertNotNull(jsonString); JsonArray array = JsonUtil.readJsonArray(jsonString); Assert.assertEquals(2 + (usingCore() ? 1 : 0), array.size()); @@ -2185,7 +2183,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { con.setClientID(clientID); String jsonString = serverControl.listAllSessionsAsJSON(); - IntegrationTestLogger.LOGGER.info(jsonString); + log.debug(jsonString); Assert.assertNotNull(jsonString); JsonArray array = JsonUtil.readJsonArray(jsonString); Assert.assertEquals(1 + (usingCore() ? 1 : 0), array.size()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java index 4754f5efff..e23cbe8823 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java @@ -271,8 +271,6 @@ public class AddressControlTest extends ManagementTestBase { Assert.assertEquals("# of pages is 2", 2, addressControl.getNumberOfPages()); - System.out.println("Address size=" + addressControl.getAddressSize()); - Assert.assertEquals(serverQueue.getPageSubscription().getPagingStore().getAddressSize(), addressControl.getAddressSize()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DummyLoginModule.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DummyLoginModule.java index 1ecf824252..c1f04a0c9b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DummyLoginModule.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DummyLoginModule.java @@ -43,7 +43,6 @@ public class DummyLoginModule implements LoginModule { this.callbackHandler = callbackHandler; this.sharedState = sharedState; this.options = options; - System.out.println("DummyLoginModule.initialize"); } @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java index 315140876d..9aead03d4a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementHelperTest.java @@ -23,8 +23,8 @@ import java.util.Map; import org.apache.activemq.artemis.api.core.client.ClientMessage; import org.apache.activemq.artemis.api.core.management.ManagementHelper; import org.apache.activemq.artemis.core.client.impl.ClientMessageImpl; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.utils.RandomUtil; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Test; @@ -32,7 +32,7 @@ public class ManagementHelperTest extends Assert { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(ManagementHelperTest.class); // Attributes ---------------------------------------------------- @@ -55,7 +55,7 @@ public class ManagementHelperTest extends Assert { Assert.assertEquals(2, parameters.length); Assert.assertEquals(param, parameters[0]); Object parameter_2 = parameters[1]; - ManagementHelperTest.log.info("type " + parameter_2); + log.debug("type " + parameter_2); Assert.assertTrue(parameter_2 instanceof Object[]); Object[] retrievedParams = (Object[]) parameter_2; Assert.assertEquals(params.length, retrievedParams.length); @@ -189,12 +189,12 @@ public class ManagementHelperTest extends Assert { String key1 = RandomUtil.randomString(); String[] val1 = new String[]{"a", "b", "c"}; - ManagementHelperTest.log.info("val1 type is " + Arrays.toString(val1)); + log.debug("val1 type is " + Arrays.toString(val1)); String key2 = RandomUtil.randomString(); Long[] val2 = new Long[]{1L, 2L, 3L, 4L, 5L}; - ManagementHelperTest.log.info("val2 type is " + Arrays.toString(val2)); + log.debug("val2 type is " + Arrays.toString(val2)); map.put(key1, val1); map.put(key2, val2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java index ffc27eef69..ad5d81a991 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java @@ -89,11 +89,7 @@ public class ManagementWithPagingServerTest extends ManagementTestBase { for (JsonValue jsonValue : array) { JsonValue val = ((JsonObject) jsonValue).get("messageID"); Long l = ((JsonLongImpl) val).longValue(); - if (longs.contains(l)) { - System.out.println("ManagementWithPagingServerTest.testListMessagesAsJSON"); - } longs.add(l); - System.out.println("jsonValue = " + jsonValue); } assertEquals(num, array.size()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java index 0f2417c7b8..7b5fe289d9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/NotificationTest.java @@ -101,7 +101,6 @@ public class NotificationTest extends ActiveMQTestBase { SimpleString address = RandomUtil.randomSimpleString(); boolean durable = RandomUtil.randomBoolean(); - System.out.println(queue); notifConsumer.close(); notifConsumer = session.createConsumer(notifQueue.toString(), ManagementHelper.HDR_ROUTING_NAME + "= '" + queue + @@ -128,7 +127,6 @@ public class NotificationTest extends ActiveMQTestBase { SimpleString address = RandomUtil.randomSimpleString(); boolean durable = RandomUtil.randomBoolean(); - System.out.println(queue); notifConsumer.close(); notifConsumer = session.createConsumer(notifQueue.toString(), ManagementHelper.HDR_ROUTING_NAME + " <> '" + queue + "' AND " + ManagementHelper.HDR_ADDRESS + " <> '" + address + "'"); @@ -307,8 +305,6 @@ public class NotificationTest extends ActiveMQTestBase { Assert.assertNotNull(notifications[0].getObjectProperty(ManagementHelper.HDR_CONNECTION_NAME)); Assert.assertNotNull(notifications[0].getObjectProperty(ManagementHelper.HDR_SESSION_NAME)); Assert.assertEquals(SimpleString.toSimpleString("myUser"), notifications[0].getObjectProperty(ManagementHelper.HDR_USER)); - System.out.println(notifications[0].getTimestamp()); - System.out.println(start); Assert.assertTrue(notifications[0].getTimestamp() >= start); Assert.assertTrue((Long) notifications[0].getObjectProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP) >= start); @@ -488,21 +484,11 @@ public class NotificationTest extends ActiveMQTestBase { ClientMessage m = null; for (int i = 0; i < expected; i++) { m = consumer.receive(timeout); - if (m != null) { - for (SimpleString key : m.getPropertyNames()) { - System.out.println(key + "=" + m.getObjectProperty(key)); - } - } Assert.assertNotNull("expected to received " + expected + " messages, got only " + i, m); messages[i] = m; m.acknowledge(); } m = consumer.receiveImmediate(); - if (m != null) { - for (SimpleString key : m.getPropertyNames()) { - System.out.println(key + "=" + m.getObjectProperty(key)); - } - } Assert.assertNull("received one more message than expected (" + expected + ")", m); return messages; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java index 5fbe5df952..383a42917a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java @@ -301,8 +301,6 @@ public class QueueControlTest extends ManagementTestBase { ClientConsumer consumer = session.createConsumer(queue); Wait.assertEquals(1, () -> queueControl.getConsumerCount()); - System.out.println("Consumers: " + queueControl.listConsumersAsJSON()); - JsonArray obj = JsonUtil.readJsonArray(queueControl.listConsumersAsJSON()); assertEquals(1, obj.size()); @@ -355,15 +353,11 @@ public class QueueControlTest extends ManagementTestBase { ClientProducer producer = session.createProducer(address); producer.send(session.createMessage(false).putStringProperty("x", "valueX").putStringProperty("y", "valueY")); - System.out.println("first:" + queueControl.getFirstMessageAsJSON()); - long firstMessageTimestamp = queueControl.getFirstMessageTimestamp(); - System.out.println("first message timestamp: " + firstMessageTimestamp); assertTrue(beforeSend <= firstMessageTimestamp); assertTrue(firstMessageTimestamp <= System.currentTimeMillis()); long firstMessageAge = queueControl.getFirstMessageAge(); - System.out.println("first message age: " + firstMessageAge); assertTrue(firstMessageAge <= (System.currentTimeMillis() - firstMessageTimestamp)); session.deleteQueue(queue); @@ -670,8 +664,6 @@ public class QueueControlTest extends ManagementTestBase { assertEquals(2, srvqueue.getDeliveringCount()); assertEquals(2, srvqueue.getConsumerCount()); - System.out.println(queueControl.listDeliveringMessagesAsJSON()); - Map[]> deliveringMap = queueControl.listDeliveringMessages(); assertEquals(2, deliveringMap.size()); @@ -710,8 +702,6 @@ public class QueueControlTest extends ManagementTestBase { consumer.close(); assertEquals(1, srvqueue.getDeliveringCount()); - System.out.println(queueControl.listDeliveringMessagesAsJSON()); - Map[]> deliveringMap = queueControl.listDeliveringMessages(); assertEquals(1, deliveringMap.size()); @@ -3034,13 +3024,11 @@ public class QueueControlTest extends ManagementTestBase { Notification notif = listener.getNotification(); - System.out.println("got notif: " + notif); assertEquals(CoreNotificationType.BINDING_ADDED.toString(), notif.getType()); this.server.destroyQueue(testQueueName); notif = listener.getNotification(); - System.out.println("got notif: " + notif); assertEquals(CoreNotificationType.BINDING_REMOVED.toString(), notif.getType()); ActiveMQServerControl control = ManagementControlHelper.createActiveMQServerControl(mbeanServer); @@ -3048,13 +3036,11 @@ public class QueueControlTest extends ManagementTestBase { control.createQueue(new QueueConfiguration(testQueueName2).setRoutingType(RoutingType.MULTICAST).toJSON()); notif = listener.getNotification(); - System.out.println("got notif: " + notif); assertEquals(CoreNotificationType.BINDING_ADDED.toString(), notif.getType()); control.destroyQueue(testQueueName2); notif = listener.getNotification(); - System.out.println("got notif: " + notif); assertEquals(CoreNotificationType.BINDING_REMOVED.toString(), notif.getType()); } @@ -3145,7 +3131,7 @@ public class QueueControlTest extends ManagementTestBase { consumer.setMessageHandler(new MessageHandler() { @Override public void onMessage(ClientMessage message) { - System.out.println(message); + instanceLog.debug(message); } }); session.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SSLSecurityNotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SSLSecurityNotificationTest.java index 56e2773846..e4d1a6e8ff 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SSLSecurityNotificationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SSLSecurityNotificationTest.java @@ -205,21 +205,11 @@ public class SSLSecurityNotificationTest extends ActiveMQTestBase { ClientMessage m = null; for (int i = 0; i < expected; i++) { m = consumer.receive(500); - if (m != null) { - for (SimpleString key : m.getPropertyNames()) { - System.out.println(key + "=" + m.getObjectProperty(key)); - } - } Assert.assertNotNull("expected to received " + expected + " messages, got only " + i, m); messages[i] = m; m.acknowledge(); } m = consumer.receiveImmediate(); - if (m != null) { - for (SimpleString key : m.getPropertyNames()) { - System.out.println(key + "=" + m.getObjectProperty(key)); - } - } Assert.assertNull("received one more message than expected (" + expected + ")", m); return messages; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java index 2066987027..0bed0fb1d8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityNotificationTest.java @@ -227,21 +227,11 @@ public class SecurityNotificationTest extends ActiveMQTestBase { ClientMessage m = null; for (int i = 0; i < expected; i++) { m = consumer.receive(500); - if (m != null) { - for (SimpleString key : m.getPropertyNames()) { - System.out.println(key + "=" + m.getObjectProperty(key)); - } - } Assert.assertNotNull("expected to received " + expected + " messages, got only " + i, m); messages[i] = m; m.acknowledge(); } m = consumer.receiveImmediate(); - if (m != null) { - for (SimpleString key : m.getPropertyNames()) { - System.out.println(key + "=" + m.getObjectProperty(key)); - } - } Assert.assertNull("received one more message than expected (" + expected + ")", m); return messages; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java index eae7dba2b0..b44a3e8c39 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTInterceptorPropertiesTest.java @@ -39,7 +39,6 @@ public class MQTTInterceptorPropertiesTest extends MQTTTestSupport { private boolean checkMessageProperties(MqttMessage message, Map expectedProperties) { - System.out.println("Checking properties in interceptor"); try { assertNotNull(message); assertNotNull(server.getNodeID()); @@ -77,7 +76,6 @@ public class MQTTInterceptorPropertiesTest extends MQTTTestSupport { MQTTInterceptor incomingInterceptor = new MQTTInterceptor() { @Override public boolean intercept(MqttMessage packet, RemotingConnection connection) throws ActiveMQException { - System.out.println("incoming"); if (packet.getClass() == MqttPublishMessage.class) { return checkMessageProperties(packet, expectedProperties); } else { @@ -90,7 +88,6 @@ public class MQTTInterceptorPropertiesTest extends MQTTTestSupport { MQTTInterceptor outgoingInterceptor = new MQTTInterceptor() { @Override public boolean intercept(MqttMessage packet, RemotingConnection connection) throws ActiveMQException { - System.out.println("outgoing"); if (packet.getClass() == MqttPublishMessage.class) { return checkMessageProperties(packet, expectedProperties); } else { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTRejectingInterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTRejectingInterceptorTest.java index 1ae2d98869..c006613510 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTRejectingInterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTRejectingInterceptorTest.java @@ -45,7 +45,6 @@ public class MQTTRejectingInterceptorTest extends MQTTTestSupport { MQTTInterceptor incomingInterceptor = new MQTTInterceptor() { @Override public boolean intercept(MqttMessage packet, RemotingConnection connection) throws ActiveMQException { - System.out.println("incoming"); if (packet.getClass() == MqttPublishMessage.class) { return false; } else { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java index 96e1d28af1..e04c953d20 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java @@ -74,7 +74,7 @@ import org.slf4j.LoggerFactory; */ public class MQTTTest extends MQTTTestSupport { - private static final Logger LOG = LoggerFactory.getLogger(MQTTTest.class); + private static final Logger log = LoggerFactory.getLogger(MQTTTest.class); private static final String AMQP_URI = "tcp://localhost:61616"; @@ -588,7 +588,7 @@ public class MQTTTest extends MQTTTestSupport { final String[] clientIds = {null, "foo", "durable"}; for (String clientId : clientIds) { - LOG.info("Testing now with Client ID: {}", clientId); + log.debug("Testing now with Client ID: {}", clientId); mqtt.setClientId(clientId); mqtt.setCleanSession(!"durable".equals(clientId)); @@ -657,7 +657,7 @@ public class MQTTTest extends MQTTTestSupport { final String[] clientIds = {null, "foo", "durable"}; for (String clientId : clientIds) { - LOG.info("Testing now with Client ID: {}", clientId); + log.debug("Testing now with Client ID: {}", clientId); mqtt.setClientId(clientId); mqtt.setCleanSession(!"durable".equals(clientId)); @@ -710,7 +710,7 @@ public class MQTTTest extends MQTTTestSupport { msg.ack(); assertNull(connection.receive(100, TimeUnit.MILLISECONDS)); - LOG.info("Test now unsubscribing from: {} for the last time", TOPICA); + log.debug("Test now unsubscribing from: {} for the last time", TOPICA); connection.unsubscribe(new String[]{TOPICA}); connection.disconnect(); } @@ -727,7 +727,7 @@ public class MQTTTest extends MQTTTestSupport { mqtt.setTracer(new Tracer() { @Override public void onReceive(MQTTFrame frame) { - LOG.info("Client received:\n" + frame); + log.debug("Client received:\n" + frame); if (frame.messageType() == PUBLISH.TYPE) { PUBLISH publish = new PUBLISH(); try { @@ -741,7 +741,7 @@ public class MQTTTest extends MQTTTestSupport { @Override public void onSend(MQTTFrame frame) { - LOG.info("Client sent:\n" + frame); + log.debug("Client sent:\n" + frame); } }); @@ -813,7 +813,7 @@ public class MQTTTest extends MQTTTestSupport { mqtt.setTracer(new Tracer() { @Override public void onReceive(MQTTFrame frame) { - LOG.info("Client received:\n" + frame); + log.debug("Client received:\n" + frame); if (frame.messageType() == PUBLISH.TYPE) { PUBLISH publish = new PUBLISH(); try { @@ -827,7 +827,7 @@ public class MQTTTest extends MQTTTestSupport { @Override public void onSend(MQTTFrame frame) { - LOG.info("Client sent:\n" + frame); + log.debug("Client sent:\n" + frame); } }); @@ -870,12 +870,12 @@ public class MQTTTest extends MQTTTestSupport { mqtt.setTracer(new Tracer() { @Override public void onReceive(MQTTFrame frame) { - LOG.info("Client received:\n" + frame); + log.debug("Client received:\n" + frame); if (frame.messageType() == PUBLISH.TYPE) { PUBLISH publish = new PUBLISH(); try { publish.decode(frame); - LOG.info("PUBLISH " + publish); + log.debug("PUBLISH " + publish); } catch (ProtocolException e) { fail("Error decoding publish " + e.getMessage()); } @@ -888,7 +888,7 @@ public class MQTTTest extends MQTTTestSupport { @Override public void onSend(MQTTFrame frame) { - LOG.info("Client sent:\n" + frame); + log.debug("Client sent:\n" + frame); } }); @@ -950,12 +950,12 @@ public class MQTTTest extends MQTTTestSupport { mqtts[i].setTracer(new Tracer() { @Override public void onReceive(MQTTFrame frame) { - LOG.info("Client received:\n" + frame); + log.debug("Client received:\n" + frame); if (frame.messageType() == PUBLISH.TYPE) { PUBLISH publish = new PUBLISH(); try { publish.decode(frame); - LOG.info("PUBLISH " + publish); + log.debug("PUBLISH " + publish); } catch (ProtocolException e) { fail("Error decoding publish " + e.getMessage()); } @@ -968,7 +968,7 @@ public class MQTTTest extends MQTTTestSupport { @Override public void onSend(MQTTFrame frame) { - LOG.info("Client sent:\n" + frame); + log.debug("Client sent:\n" + frame); } }); } @@ -1367,7 +1367,7 @@ public class MQTTTest extends MQTTTestSupport { for (int i = 1; i <= 10; ++i) { - LOG.info("Creating MQTT Connection {}", i); + log.debug("Creating MQTT Connection {}", i); MQTT mqtt = createMQTTConnection(clientId, false); mqtt.setKeepAlive((short) 2); @@ -1464,7 +1464,7 @@ public class MQTTTest extends MQTTTestSupport { received++; payload = message.getPayload(); String messageContent = new String(payload); - LOG.info("Received message from topic: " + message.getTopic() + " Message content: " + messageContent); + log.debug("Received message from topic: " + message.getTopic() + " Message content: " + messageContent); message.ack(); } @@ -1593,7 +1593,7 @@ public class MQTTTest extends MQTTTestSupport { for (int i = 0; i < 5; ++i) { Message message = connectionSub.receive(5, TimeUnit.SECONDS); assertNotNull("Missing message " + i, message); - LOG.info("Message is " + new String(message.getPayload())); + log.debug("Message is " + new String(message.getPayload())); received++; message.ack(); } @@ -1642,7 +1642,7 @@ public class MQTTTest extends MQTTTestSupport { // @Override // public void onReceive(MQTTFrame frame) { // if (frame.messageType() == PUBLISH.TYPE) { - // LOG.info("Received message with retain=" + frame.retain()); + // log.debug("Received message with retain=" + frame.retain()); // if (frame.retain()) { // retain[0]++; // } else { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java index cae6b1d099..30665114b1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTestSupport.java @@ -62,21 +62,19 @@ import org.fusesource.hawtdispatch.internal.DispatcherConfig; import org.fusesource.mqtt.client.MQTT; import org.fusesource.mqtt.client.Tracer; import org.fusesource.mqtt.codec.MQTTFrame; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.rules.TestName; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import static java.util.Collections.singletonList; public class MQTTTestSupport extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(MQTTTestSupport.class); protected ActiveMQServer server; - private static final Logger LOG = LoggerFactory.getLogger(MQTTTestSupport.class); - static { DispatcherConfig.getDefaultDispatcher().getThreadQueues(DispatchPriority.DEFAULT); } @@ -235,7 +233,7 @@ public class MQTTTestSupport extends ActiveMQTestBase { TransportConfiguration transportConfiguration = new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params); server.getConfiguration().getAcceptorConfigurations().add(transportConfiguration); - LOG.info("Added connector {} to broker", getProtocolScheme()); + log.debugv("Added connector {} to broker", getProtocolScheme()); } protected void addMQTTConnector() throws Exception { @@ -245,7 +243,7 @@ public class MQTTTestSupport extends ActiveMQTestBase { server.getConfiguration().addAcceptorConfiguration("MQTT", "tcp://localhost:" + port + "?protocols=MQTT;anycastPrefix=anycast:;multicastPrefix=multicast:"); - LOG.info("Added connector {} to broker", getProtocolScheme()); + log.debugv("Added connector {} to broker", getProtocolScheme()); } public void stopBroker() throws Exception { @@ -407,17 +405,17 @@ public class MQTTTestSupport extends ActiveMQTestBase { return new Tracer() { @Override public void onReceive(MQTTFrame frame) { - LOG.info("Client Received:\n" + frame); + log.debug("Client Received:\n" + frame); } @Override public void onSend(MQTTFrame frame) { - LOG.info("Client Sent:\n" + frame); + log.debug("Client Sent:\n" + frame); } @Override public void debug(String message, Object... args) { - LOG.info(String.format(message, args)); + log.debug(String.format(message, args)); } }; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/PahoMQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/PahoMQTTTest.java index 7ac99b90c2..464adda8f9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/PahoMQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/PahoMQTTTest.java @@ -24,13 +24,13 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -import org.apache.activemq.artemis.core.protocol.mqtt.MQTTLogger; import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; import org.eclipse.paho.client.mqttv3.MqttCallback; import org.eclipse.paho.client.mqttv3.MqttClient; import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; +import org.jboss.logging.Logger; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -38,7 +38,7 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class PahoMQTTTest extends MQTTTestSupport { - private static MQTTLogger LOG = MQTTLogger.LOGGER; + private static final Logger log = Logger.getLogger(PahoMQTTTest.class); @Parameterized.Parameters(name = "protocol={0}") public static Collection getParams() { @@ -55,7 +55,7 @@ public class PahoMQTTTest extends MQTTTestSupport { public void testLotsOfClients() throws Exception { final int CLIENTS = Integer.getInteger("PahoMQTTTest.CLIENTS", 100); - LOG.info("Using: {} clients: " + CLIENTS); + log.debug("Using: {} clients: " + CLIENTS); final AtomicInteger receiveCounter = new AtomicInteger(); MqttClient client = createPahoClient("consumer"); @@ -111,7 +111,7 @@ public class PahoMQTTTest extends MQTTTestSupport { assertNull("Async error: " + asyncError.get(), asyncError.get()); sendBarrier.countDown(); - LOG.info("All clients connected... waiting to receive sent messages..."); + log.debug("All clients connected... waiting to receive sent messages..."); // We should eventually get all the messages. within(30, TimeUnit.SECONDS, new Task() { @@ -121,7 +121,7 @@ public class PahoMQTTTest extends MQTTTestSupport { } }); - LOG.info("All messages received."); + log.debug("All messages received."); disconnectDoneLatch.await(); assertNull("Async error: " + asyncError.get(), asyncError.get()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java index 30118f9641..982860fee4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java @@ -97,12 +97,9 @@ public class BasicOpenWireTest extends OpenWireTestBase { @After public void tearDown() throws Exception { System.clearProperty("org.apache.activemq.transport.AbstractInactivityMonitor.keepAliveTime"); - System.out.println("tear down! " + connection); try { if (connection != null) { - System.out.println("closing connection"); connection.close(); - System.out.println("connection closed."); } Iterator iterQueues = testQueues.values().iterator(); @@ -116,7 +113,6 @@ public class BasicOpenWireTest extends OpenWireTestBase { // just print, what else can we do? e.printStackTrace(); } - System.out.println("Destroyed queue: " + coreQ); } testQueues.clear(); } catch (Throwable e) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/DisableAdvisoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/DisableAdvisoryTest.java index c7fe96ef33..54a7605fb5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/DisableAdvisoryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/DisableAdvisoryTest.java @@ -59,8 +59,6 @@ public class DisableAdvisoryTest extends BasicOpenWireTest { TextMessage message = session.createTextMessage("This is a text message"); - System.out.println("Sent message: " + message.getText()); - producer.send(message); MessageConsumer messageConsumer = session.createConsumer(queue); @@ -69,8 +67,6 @@ public class DisableAdvisoryTest extends BasicOpenWireTest { TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000); - System.out.println("Received message: " + messageReceived.getText()); - //Openwire client will create advisory consumers to the broker. //The broker is configured supportAdvisory=false and therefore doesn't //actually create a server consumer. However the consumer info should be diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FQQNOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FQQNOpenWireTest.java index a88651425b..ab967cea75 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FQQNOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/FQQNOpenWireTest.java @@ -107,7 +107,7 @@ public class FQQNOpenWireTest extends OpenWireTestBase { Bindings bindings = server.getPostOffice().getBindingsForAddress(multicastAddress); for (Binding b : bindings.getBindings()) { - System.out.println("checking binidng " + b.getUniqueName() + " " + ((LocalQueueBinding)b).getQueue().getDeliveringMessages()); + instanceLog.debug("checking binidng " + b.getUniqueName() + " " + ((LocalQueueBinding)b).getQueue().getDeliveringMessages()); SimpleString qName = b.getUniqueName(); //do FQQN query QueueQueryResult result = server.queueQuery(CompositeAddress.toFullyQualified(multicastAddress, qName)); @@ -192,7 +192,6 @@ public class FQQNOpenWireTest extends OpenWireTestBase { producer3.send(session.createMessage()); assertTrue(Wait.waitFor(() -> server.locateQueue(anycastQ3).getMessageCount() == 5, 2000, 200)); - System.out.println("Queue is: " + q1); MessageConsumer consumer1 = session.createConsumer(q1); MessageConsumer consumer2 = session.createConsumer(q2); MessageConsumer consumer3 = session.createConsumer(q3); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java index b3f224d07f..ea1e3ad36f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/LargeMessageQueueAutoCreationTest.java @@ -88,7 +88,6 @@ public class LargeMessageQueueAutoCreationTest extends BasicOpenWireTest { Map.Entry entry = map.entrySet().iterator().next(); AddressSettings settings = entry.getValue(); settings.setAutoCreateQueues(true); - System.out.println("server cofg, isauto? " + entry.getValue().isAutoCreateQueues()); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertExclusiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertExclusiveTest.java index 1248544e78..6b86e6204b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertExclusiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertExclusiveTest.java @@ -93,7 +93,6 @@ public class OpenWireDivertExclusiveTest extends OpenWireDivertTestBase { MessageConsumer consumer3 = session.createConsumer(q3); MessageConsumer consumer4 = session.createConsumer(q4); - System.out.println("receiving ..."); for (int i = 0; i < numMessages; i++) { Message message = consumer1.receive(TIMEOUT); @@ -153,7 +152,6 @@ public class OpenWireDivertExclusiveTest extends OpenWireDivertTestBase { MessageConsumer consumer1 = session.createConsumer(q1); MessageConsumer consumer2 = session.createConsumer(q2); - System.out.println("receiving ..."); for (int i = 0; i < numMessages; i++) { Message message = consumer1.receive(TIMEOUT); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertNonExclusiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertNonExclusiveTest.java index 3d4cee9dd3..10bf65fc2f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertNonExclusiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireDivertNonExclusiveTest.java @@ -90,7 +90,6 @@ public class OpenWireDivertNonExclusiveTest extends OpenWireDivertTestBase { MessageConsumer consumer1 = session.createConsumer(q1); MessageConsumer consumer2 = session.createConsumer(q2); - System.out.println("receiving ..."); for (int i = 0; i < numMessages; i++) { Message message = consumer1.receive(TIMEOUT); @@ -160,7 +159,6 @@ public class OpenWireDivertNonExclusiveTest extends OpenWireDivertTestBase { MessageConsumer consumer1 = session.createConsumer(q1); MessageConsumer consumer2 = session.createConsumer(q2); - System.out.println("receiving ..."); for (int i = 0; i < numMessages; i++) { Message message = consumer1.receive(TIMEOUT); Assert.assertNotNull(message); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java index 89c99de54c..07c5fafa51 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java @@ -107,7 +107,6 @@ public class OpenWireTestBase extends ActiveMQTestBase { server.start(); coreCf = ActiveMQJMSClient.createConnectionFactory("vm://0?reconnectAttempts=-1","cf"); - System.out.println("debug: server started"); } protected void configureAddressSettings(Map addressSettingsMap) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SecurityOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SecurityOpenWireTest.java index 7746fc766f..ae7da5de44 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SecurityOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SecurityOpenWireTest.java @@ -69,7 +69,6 @@ public class SecurityOpenWireTest extends BasicOpenWireTest { try (Connection connection = factory.createConnection("denyQ", "denyQ")) { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue queue = session.createQueue("denyQ"); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); producer.setDeliveryMode(DeliveryMode.PERSISTENT); try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java index 6e7cf81b14..dac47943a6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java @@ -120,7 +120,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Session session = connection.createSession(true, Session.SESSION_TRANSACTED); Queue queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); MessageConsumer consumer = session.createConsumer(queue); producer.send(session.createTextMessage("test")); @@ -144,7 +143,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); MessageConsumer consumer = session.createConsumer(queue); producer.send(session.createTextMessage()); @@ -166,7 +164,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); MessageConsumer consumer = session.createConsumer(queue); producer.send(session.createMapMessage()); @@ -253,7 +250,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); Queue queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); MessageConsumer consumer = session.createConsumer(queue); producer.send(session.createTextMessage("test")); @@ -314,7 +310,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { try (Connection connection = factory.createConnection()) { Session session = connection.createSession(true, Session.SESSION_TRANSACTED); Queue queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); MessageConsumer consumer = session.createConsumer(queue); producer.send(session.createTextMessage("test")); @@ -340,7 +335,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); MessageConsumer consumer = session.createConsumer(queue); TextMessage msg = session.createTextMessage("test"); @@ -468,10 +462,8 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("creating queue: " + queueName); Destination dest = new ActiveMQQueue(queueName); - System.out.println("creating producer..."); MessageProducer producer = session.createProducer(dest); final int num = 1; @@ -479,18 +471,14 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { for (int i = 0; i < num; i++) { TextMessage msg = session.createTextMessage("MfromAMQ-" + i); producer.send(msg); - System.out.println("sent: "); } //receive MessageConsumer consumer = session.createConsumer(dest); - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) consumer.receive(5000); - System.out.println("received: " + msg); String content = msg.getText(); - System.out.println("content: " + content); assertEquals(msgBase + i, content); } @@ -504,10 +492,8 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("creating queue: " + queueName); Destination dest = new ActiveMQQueue(queueName); - System.out.println("creating producer..."); MessageProducer producer = session.createProducer(dest); final int num = 10; @@ -515,7 +501,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { for (int i = 0; i < num; i++) { TextMessage msg = session.createTextMessage(msgBase + i); producer.send(msg); - System.out.println("sent: "); } //receive loose @@ -525,12 +510,9 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Session looseSession = looseConn.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageConsumer looseConsumer = looseSession.createConsumer(dest); - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) looseConsumer.receive(5000); - System.out.println("received: " + msg); String content = msg.getText(); - System.out.println("content: " + content); assertEquals(msgBase + i, content); } @@ -543,17 +525,13 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { for (int i = 0; i < num; i++) { TextMessage msg = looseSession.createTextMessage(msgBase + i); looseProducer.send(msg); - System.out.println("sent: "); } MessageConsumer consumer = session.createConsumer(dest); - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) consumer.receive(5000); - System.out.println("received: " + msg); assertNotNull(msg); String content = msg.getText(); - System.out.println("content: " + content); assertEquals(msgBase + i, content); } @@ -581,7 +559,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("creating queue: " + topicName); Destination dest = new ActiveMQTopic(topicName); MessageConsumer consumer1 = session.createConsumer(dest); @@ -594,24 +571,19 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { for (int i = 0; i < num; i++) { TextMessage msg = session.createTextMessage("MfromAMQ-" + i); producer.send(msg); - System.out.println("Sent a message"); } //receive - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) consumer1.receive(5000); - System.out.println("received: " + msg); String content = msg.getText(); assertEquals(msgBase + i, content); } assertNull(consumer1.receive(500)); - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) consumer2.receive(5000); - System.out.println("received: " + msg); String content = msg.getText(); assertEquals(msgBase + i, content); } @@ -625,7 +597,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("creating queue: " + topicName); Destination dest = new ActiveMQTopic(topicName); MessageConsumer nolocalConsumer = session.createConsumer(dest, null, true); @@ -693,7 +664,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { connection.start(); TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("creating queue: " + topicName); Topic dest = new ActiveMQTopic(topicName); MessageConsumer nolocalConsumer = session.createDurableSubscriber(dest, "nolocal-subscriber1", "", true); @@ -837,41 +807,31 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("creating temp topic"); TemporaryTopic tempTopic = session.createTemporaryTopic(); - System.out.println("create consumer 1"); MessageConsumer consumer1 = session.createConsumer(tempTopic); - System.out.println("create consumer 2"); MessageConsumer consumer2 = session.createConsumer(tempTopic); - System.out.println("create producer"); MessageProducer producer = session.createProducer(tempTopic); - System.out.println("sending messages"); final int num = 1; final String msgBase = "MfromAMQ-"; for (int i = 0; i < num; i++) { TextMessage msg = session.createTextMessage("MfromAMQ-" + i); producer.send(msg); - System.out.println("Sent a message"); } //receive - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) consumer1.receive(5000); - System.out.println("received: " + msg); String content = msg.getText(); assertEquals(msgBase + i, content); } assertNull(consumer1.receive(500)); - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) consumer2.receive(5000); - System.out.println("received: " + msg); String content = msg.getText(); assertEquals(msgBase + i, content); } @@ -892,29 +852,22 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("creating temp queue"); TemporaryQueue tempQueue = session.createTemporaryQueue(); - System.out.println("create consumer 1"); MessageConsumer consumer1 = session.createConsumer(tempQueue); - System.out.println("create producer"); MessageProducer producer = session.createProducer(tempQueue); - System.out.println("sending messages"); final int num = 1; final String msgBase = "MfromAMQ-"; for (int i = 0; i < num; i++) { TextMessage msg = session.createTextMessage("MfromAMQ-" + i); producer.send(msg); - System.out.println("Sent a message"); } //receive - System.out.println("receiving messages..."); for (int i = 0; i < num; i++) { TextMessage msg = (TextMessage) consumer1.receive(5000); - System.out.println("received: " + msg); String content = msg.getText(); assertEquals(msgBase + i, content); } @@ -1221,7 +1174,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Queue queue; try (Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE)) { queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); for (int i = 0; i < 10; i++) { TextMessage msg = session.createTextMessage("test" + i); @@ -1256,10 +1208,8 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { TextMessage message = (TextMessage) consumer.receive(5000); Assert.assertNotNull(message); // Assert.assertEquals("test" + i, message.getText()); - System.out.println("Message " + message.getText()); } checkDuplicate(consumer); - System.out.println("Queue:" + queue); session.close(); } @@ -1271,7 +1221,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { Queue queue; try (Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE)) { queue = session.createQueue(queueName); - System.out.println("Queue:" + queue); MessageProducer producer = session.createProducer(queue); for (int i = 0; i < 10; i++) { TextMessage msg = session.createTextMessage("test" + i); @@ -1372,9 +1321,7 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { ActiveMQConnectionFactory testFactory = new ActiveMQConnectionFactory(brokerUri); Connection sendConnection = testFactory.createConnection(); - System.out.println("created send connection: " + sendConnection); Connection receiveConnection = testFactory.createConnection(); - System.out.println("created receive connection: " + receiveConnection); try { final int nMsg = 10; @@ -1480,9 +1427,7 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { // Assert.assertNull(consumer.receiveNoWait()); for (int i = 0; i < 10; i++) { TextMessage txt = (TextMessage) consumer.receive(5000); - // System.out.println("TXT::" + txt); Assert.assertNotNull(txt); - System.out.println("TXT " + txt.getText()); // Assert.assertEquals("testXX" + i, txt.getText()); } session.commit(); @@ -1518,7 +1463,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { for (int i = 0; i < 10; i++) { TextMessage txt = (TextMessage) consumer.receive(5000); Assert.assertNotNull(txt); - System.out.println("TXT " + txt.getText()); Assert.assertEquals("testXX" + i, txt.getText()); } @@ -1536,7 +1480,7 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { break; } else { duplicatedMessages = true; - System.out.println("received in duplicate:" + txt.getText()); + instanceLog.warn("received in duplicate:" + txt.getText()); } } @@ -1842,8 +1786,6 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { consumer.setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { - System.out.println("received : " + message); - messages.add(message); if (messages.size() < expectedMsgs) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer11Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer11Test.java index 28f15d8072..63e3954d8c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer11Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer11Test.java @@ -77,26 +77,18 @@ public class JMSConsumer11Test extends BasicOpenWireTest { Wait.assertEquals(1, consumer::getMessageSize); Wait.assertEquals(1, consumer2::getMessageSize); - System.out.println("consumer receiving ..."); // Pick up the first message. Message message1 = consumer.receive(1000); - System.out.println("received1: " + message1); assertNotNull(message1); - System.out.println("consumer 2 receiving..."); // Pick up the 2nd messages. Message message2 = consumer2.receive(5000); - System.out.println("received2: " + message2); assertNotNull(message2); - System.out.println("committing sessions !! " + session.getClass().getName()); session.commit(); - System.out.println("committed session, now 2"); session2.commit(); - System.out.println("all committed"); Message m = consumer.receiveNoWait(); - System.out.println("received 3: " + m); assertNull(m); try { @@ -106,7 +98,6 @@ public class JMSConsumer11Test extends BasicOpenWireTest { e.printStackTrace(); } - System.out.println("Test finished!!"); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer2Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer2Test.java index d308f9b020..e23866cc4f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer2Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer2Test.java @@ -144,21 +144,17 @@ public class JMSConsumer2Test extends BasicOpenWireTest { MessageConsumer consumer = session.createConsumer(destination); Message m = consumer.receive(1000); - System.out.println("m1 received: " + m); assertNotNull(m); m = consumer.receive(5000); - System.out.println("m2 received: " + m); assertNotNull(m); assertFalse("redelivered flag set", m.getJMSRedelivered()); // install another consumer while message dispatch is unacked/uncommitted Session redispatchSession = connection.createSession(true, Session.SESSION_TRANSACTED); MessageConsumer redispatchConsumer = redispatchSession.createConsumer(destination); - System.out.println("redispatch consumer: " + redispatchConsumer); // no commit so will auto rollback and get re-dispatched to // redisptachConsumer - System.out.println("closing session: " + session); session.close(); Message msg = redispatchConsumer.receive(3000); @@ -174,7 +170,6 @@ public class JMSConsumer2Test extends BasicOpenWireTest { redispatchSession.commit(); assertNull(redispatchConsumer.receive(500)); - System.out.println("closing dispatch session: " + redispatchSession); redispatchSession.close(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java index 47c380a82b..02fed22778 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java @@ -67,12 +67,10 @@ public class JMSConsumer3Test extends BasicOpenWireTest { // Send the messages sendMessages(session, destination, 4); - System.out.println("messages are sent."); // Make sure 4 messages were delivered. Message message = null; for (int i = 0; i < 4; i++) { message = consumer.receive(5000); - System.out.println("message received: " + message + " ack mode: " + ackMode); assertNotNull(message); } assertNull(consumer.receiveNoWait()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer5Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer5Test.java index 3fb9e95d5a..cf3a0ba12f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer5Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer5Test.java @@ -97,19 +97,16 @@ public class JMSConsumer5Test extends BasicOpenWireTest { public void onMessage(Message m) { counter.incrementAndGet(); if (counter.get() == 4) { - System.out.println("ok finished all 4, done sleep"); done.countDown(); } } }); assertTrue(done.await(1000, TimeUnit.MILLISECONDS)); - System.out.println("ok await ok"); Thread.sleep(200); // Make sure only 4 messages were delivered. assertEquals(4, counter.get()); - System.out.println("test done ok " + counter.get()); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer7Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer7Test.java index c15e5a1b9c..2499eb543d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer7Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer7Test.java @@ -87,10 +87,8 @@ public class JMSConsumer7Test extends BasicOpenWireTest { connection.close(); got2Done.countDown(); } - System.out.println("acking tm: " + tm.getText()); tm.acknowledge(); } catch (Throwable e) { - System.out.println("ack failed!!"); e.printStackTrace(); } } @@ -118,7 +116,6 @@ public class JMSConsumer7Test extends BasicOpenWireTest { public void onMessage(Message m) { try { TextMessage tm = (TextMessage) m; - System.out.println("2nd received: " + tm.getText()); // order is not guaranteed as the connection is started before // the listener is set. // assertEquals("" + counter.get(), tm.getText()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java index cbb3e312b2..353d916732 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java @@ -45,9 +45,6 @@ public class JMSDurableTopicRedeliverTest extends JmsTopicRedeliverTest { String text = "TEST: " + System.currentTimeMillis(); Message sendMessage = session.createTextMessage(text); - if (verbose) { - System.out.println("About to send a message: " + sendMessage + " with text: " + text); - } producer.send(producerDestination, sendMessage); // receive but don't acknowledge diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSUsecase1Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSUsecase1Test.java index a5e060aac8..320af5dc55 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSUsecase1Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSUsecase1Test.java @@ -56,7 +56,6 @@ public class JMSUsecase1Test extends BasicOpenWireTest { connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, destinationType); - System.out.println("destionation: " + destination); MessageProducer producer = session.createProducer(destination); producer.setDeliveryMode(this.deliveryMode); MessageConsumer consumer = session.createConsumer(destination); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckListenerTest.java index b69e3de367..9ddbec523f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckListenerTest.java @@ -59,7 +59,6 @@ public class JmsAutoAckListenerTest extends BasicOpenWireTest implements Message @Override public void onMessage(Message message) { - System.out.println("Received message: " + message); assertNotNull(message); latch.countDown(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java index 825f3238ad..657002aced 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java @@ -58,7 +58,6 @@ public class JmsCreateConsumerInOnMessageTest extends BasicOpenWireTest implemen Message msg = publisherSession.createMessage(); producer.send(msg); - System.out.println("message sent: " + msg); synchronized (lock) { long timeout = System.currentTimeMillis() + 3000; while (testConsumer == null && timeout > System.currentTimeMillis()) { @@ -75,7 +74,6 @@ public class JmsCreateConsumerInOnMessageTest extends BasicOpenWireTest implemen */ @Override public void onMessage(Message message) { - System.out.println("____________onmessage " + message); try { synchronized (lock) { testConsumer = consumerSession.createConsumer(topic); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java index f94defdd91..a6326e9044 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java @@ -79,7 +79,6 @@ public class JmsDurableTopicSendReceiveTest extends JmsTopicSendReceiveTest { message.setStringProperty("test", "test"); message.setJMSType("test"); producer2.send(producerDestination2, message); - System.out.println("Creating durable consumer"); consumer2 = consumeSession2.createDurableSubscriber((Topic) consumerDestination2, getName()); Message msg = consumer2.receive(1000); assertNotNull(msg); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java index d34c9633d1..011c9f3800 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java @@ -63,9 +63,7 @@ public class JmsQueueBrowserTest extends BasicOpenWireTest { assertEquals(outbound[0], consumer.receive(1000)); consumer.close(); - System.out.println("creating browser..."); QueueBrowser browser = session.createBrowser(destination); - System.out.println("browser created"); Enumeration enumeration = browser.getEnumeration(); // browse the second @@ -79,7 +77,6 @@ public class JmsQueueBrowserTest extends BasicOpenWireTest { // There should be no more. boolean tooMany = false; while (enumeration.hasMoreElements()) { - System.out.println("Got extra message: " + ((TextMessage) enumeration.nextElement()).getText()); tooMany = true; } assertFalse(tooMany); @@ -275,7 +272,6 @@ public class JmsQueueBrowserTest extends BasicOpenWireTest { // create consumer MessageConsumer consumer = session.createConsumer(destination); - System.out.println("created consumer ... "); // lets consume any outstanding messages from previous test runs while (consumer.receive(1000) != null) { } @@ -287,19 +283,14 @@ public class JmsQueueBrowserTest extends BasicOpenWireTest { producer.send(outbound[0]); // create browser first - System.out.println("creating browser..."); QueueBrowser browser = session.createBrowser(destination); - System.out.println("created " + browser); Enumeration enumeration = browser.getEnumeration(); - System.out.println("browsing first"); // browse the first message assertTrue("should have received the first message", enumeration.hasMoreElements()); - System.out.println("we have more"); assertEquals(outbound[0], enumeration.nextElement()); - System.out.println("ok"); consumer = session.createConsumer(destination); // Receive the first message. @@ -307,7 +298,6 @@ public class JmsQueueBrowserTest extends BasicOpenWireTest { consumer.close(); browser.close(); producer.close(); - System.out.println("test done."); } @Test @@ -334,12 +324,10 @@ public class JmsQueueBrowserTest extends BasicOpenWireTest { while (enumeration.hasMoreElements()) { Message browsed = (Message) enumeration.nextElement(); - System.out.println("Browsed Message [{}]" + browsed.getJMSMessageID()); numberBrowsed++; } - System.out.println("Number browsed: " + numberBrowsed); assertEquals(numberOfMessages, numberBrowsed); browser.close(); producer.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java index bd8cfd86b5..a314da5586 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java @@ -59,7 +59,6 @@ public class JmsResourceProvider { * @see org.apache.activemq.test.JmsResourceProvider#createSession(javax.jms.Connection) */ public Session createSession(Connection conn) throws JMSException { - System.out.println("createing a session tx ? " + transacted); return conn.createSession(transacted, ackMode); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java index 1e9a2d9e98..5aa83f1299 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java @@ -54,7 +54,6 @@ public abstract class JmsSendReceiveTestSupport extends BasicOpenWireTest implem protected boolean durable; protected int deliveryMode = DeliveryMode.PERSISTENT; protected final Object lock = new Object(); - protected boolean verbose; protected boolean useSeparateSession; @Override @@ -70,7 +69,6 @@ public abstract class JmsSendReceiveTestSupport extends BasicOpenWireTest implem } } - System.out.println("Message count for test case is: " + messageCount); data = new String[messageCount]; for (int i = 0; i < messageCount; i++) { @@ -112,7 +110,6 @@ public abstract class JmsSendReceiveTestSupport extends BasicOpenWireTest implem if (data.length != copyOfMessages.size()) { for (Iterator iter = copyOfMessages.iterator(); iter.hasNext(); ) { TextMessage message = (TextMessage) iter.next(); - System.out.println("<== " + counter++ + " = " + message.getText()); } } @@ -124,10 +121,6 @@ public abstract class JmsSendReceiveTestSupport extends BasicOpenWireTest implem String stringProperty = received.getStringProperty("stringProperty"); int intProperty = received.getIntProperty("intProperty"); - if (verbose) { - System.out.println("Received Text: " + text); - } - assertEquals("Message: " + i, data[i], text); assertEquals(data[i], stringProperty); assertEquals(i, intProperty); @@ -191,9 +184,6 @@ public abstract class JmsSendReceiveTestSupport extends BasicOpenWireTest implem * @param messageList -list of consumed messages. */ protected void consumeMessage(Message message, List messageList) { - if (verbose) { - System.out.println("Received message: " + message); - } messageList.add(message); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java index 38f678b3f6..1cfd7adb2a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java @@ -43,7 +43,6 @@ public class JmsTopicRedeliverTest extends BasicOpenWireTest { protected Destination producerDestination; protected boolean topic = true; protected boolean durable; - protected boolean verbose; protected long initRedeliveryDelay; @Override @@ -57,18 +56,12 @@ public class JmsTopicRedeliverTest extends BasicOpenWireTest { connection.setClientID(getClass().getName()); } - System.out.println("Created connection: " + connection); - session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); consumeSession = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); - System.out.println("Created session: " + session); - System.out.println("Created consumeSession: " + consumeSession); producer = session.createProducer(null); // producer.setRoutingType(deliveryMode); - System.out.println("Created producer: " + producer); - if (topic) { consumerDestination = this.createDestination(session, ActiveMQDestination.TOPIC_TYPE); producerDestination = this.createDestination(session, ActiveMQDestination.TOPIC_TYPE); @@ -77,12 +70,8 @@ public class JmsTopicRedeliverTest extends BasicOpenWireTest { producerDestination = this.createDestination(session, ActiveMQDestination.QUEUE_TYPE); } - System.out.println("Created consumer destination: " + consumerDestination + " of type: " + consumerDestination.getClass()); - System.out.println("Created producer destination: " + producerDestination + " of type: " + producerDestination.getClass()); consumer = createConsumer(getName()); connection.start(); - - System.out.println("Created connection: " + connection); } /** @@ -95,9 +84,6 @@ public class JmsTopicRedeliverTest extends BasicOpenWireTest { String text = "TEST"; Message sendMessage = session.createTextMessage(text); - if (verbose) { - System.out.println("About to send a message: " + sendMessage + " with text: " + text); - } producer.send(producerDestination, sendMessage); // receive but don't acknowledge @@ -124,7 +110,6 @@ public class JmsTopicRedeliverTest extends BasicOpenWireTest { protected MessageConsumer createConsumer(String durableName) throws JMSException { if (durable) { - System.out.println("Creating durable consumer " + durableName); return consumeSession.createDurableSubscriber((Topic) consumerDestination, durableName); } return consumeSession.createConsumer(consumerDestination); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java index 9e8cdb7468..6af9bc204c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java @@ -56,15 +56,12 @@ public class JmsTopicRequestReplyTest extends BasicOpenWireTest implements Messa clientConnection = createConnection(); clientConnection.setClientID("ClientConnection:" + name.getMethodName()); - System.out.println("Creating session."); Session session = clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE); clientConnection.start(); Destination replyDestination = createTemporaryDestination(session); - System.out.println("Created temporary topic " + replyDestination); - System.out.println("Creating consumer on: " + replyDestination); MessageConsumer replyConsumer = session.createConsumer(replyDestination); // lets test the destination @@ -75,7 +72,6 @@ public class JmsTopicRequestReplyTest extends BasicOpenWireTest implements Messa // replyDestination); // assertEquals("clientID from the temporary destination must be the // same", clientSideClientID, value); - System.out.println("Both the clientID and destination clientID match properly: " + clientSideClientID); /* build queues */ @@ -83,21 +79,15 @@ public class JmsTopicRequestReplyTest extends BasicOpenWireTest implements Messa TextMessage requestMessage = session.createTextMessage("Olivier"); requestMessage.setJMSReplyTo(replyDestination); - System.out.println("Creating producer on " + requestDestination); MessageProducer requestProducer = session.createProducer(requestDestination); - System.out.println("Sending message to " + requestDestination); requestProducer.send(requestMessage); - System.out.println("Sent request."); - System.out.println(requestMessage.toString()); Message msg = replyConsumer.receive(5000); if (msg instanceof TextMessage) { TextMessage replyMessage = (TextMessage) msg; - System.out.println("Received reply."); - System.out.println(replyMessage.toString()); assertEquals("Wrong message content", "Hello: Olivier", replyMessage.getText()); } else { fail("Should have received a reply by now"); @@ -122,8 +112,6 @@ public class JmsTopicRequestReplyTest extends BasicOpenWireTest implements Messa try { TextMessage requestMessage = (TextMessage) message; - System.out.println("Received request from " + requestDestination); - System.out.println(requestMessage.toString()); Destination replyDestination = requestMessage.getJMSReplyTo(); @@ -145,8 +133,6 @@ public class JmsTopicRequestReplyTest extends BasicOpenWireTest implements Messa replyProducer.send(replyDestination, replyMessage); } - System.out.println("Sent reply to " + replyDestination); - System.out.println(replyMessage.toString()); } catch (JMSException e) { onException(e); } @@ -182,7 +168,6 @@ public class JmsTopicRequestReplyTest extends BasicOpenWireTest implements Messa requestDestination = createDestination(serverSession); /* build queues */ - System.out.println("Creating consumer on: " + requestDestination); final MessageConsumer requestConsumer = serverSession.createConsumer(requestDestination); if (useAsyncConsume) { requestConsumer.setMessageListener(this); @@ -233,7 +218,6 @@ public class JmsTopicRequestReplyTest extends BasicOpenWireTest implements Messa if (topic) { ((TemporaryTopic) dest).delete(); } else { - System.out.println("Deleting: " + dest); ((TemporaryQueue) dest).delete(); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSelectorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSelectorTest.java index 231ddc81b7..475711e9e1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSelectorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSelectorTest.java @@ -54,12 +54,8 @@ public class JmsTopicSelectorTest extends BasicOpenWireTest { connection.setClientID(getClass().getName()); } - System.out.println("Created connection: " + connection); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - System.out.println("Created session: " + session); - if (topic) { consumerDestination = this.createDestination(session, ActiveMQDestination.TOPIC_TYPE); producerDestination = this.createDestination(session, ActiveMQDestination.TOPIC_TYPE); @@ -68,18 +64,14 @@ public class JmsTopicSelectorTest extends BasicOpenWireTest { producerDestination = this.createDestination(session, ActiveMQDestination.QUEUE_TYPE); } - System.out.println("Created consumer destination: " + consumerDestination + " of type: " + consumerDestination.getClass()); - System.out.println("Created producer destination: " + producerDestination + " of type: " + producerDestination.getClass()); producer = session.createProducer(producerDestination); producer.setDeliveryMode(deliveryMode); - System.out.println("Created producer: " + producer + " delivery mode = " + (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT")); connection.start(); } protected MessageConsumer createConsumer(String selector) throws JMSException { if (durable) { - System.out.println("Creating durable consumer"); return session.createDurableSubscriber((Topic) consumerDestination, getName(), selector, false); } return session.createConsumer(consumerDestination, selector); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSendReceiveTest.java index e9926931ae..9e76a84d47 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSendReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicSendReceiveTest.java @@ -16,7 +16,6 @@ */ package org.apache.activemq.artemis.tests.integration.openwire.amq; -import javax.jms.DeliveryMode; import javax.jms.JMSException; import javax.jms.MessageConsumer; import javax.jms.Session; @@ -39,17 +38,12 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport { connection.setClientID(getClass().getName()); } - System.out.println("Created connection: " + connection); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); consumeSession = createConsumerSession(); - System.out.println("Created session: " + session); producer = session.createProducer(null); producer.setDeliveryMode(deliveryMode); - System.out.println("Created producer: " + producer + " delivery mode = " + (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT")); - if (topic) { consumerDestination = createDestination(session, ActiveMQDestination.TOPIC_TYPE, getConsumerSubject()); producerDestination = createDestination(session, ActiveMQDestination.TOPIC_TYPE, getProducerSubject()); @@ -58,13 +52,11 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport { producerDestination = createDestination(session, ActiveMQDestination.QUEUE_TYPE, getConsumerSubject()); } - System.out.println("Created consumer destination: " + consumerDestination + " of type: " + consumerDestination.getClass()); - System.out.println("Created producer destination: " + producerDestination + " of type: " + producerDestination.getClass()); consumer = createConsumer(); consumer.setMessageListener(this); connection.start(); - // log.info("Created connection: " + connection); + // log.debug("Created connection: " + connection); } protected String getConsumerSubject() { @@ -77,7 +69,6 @@ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport { protected MessageConsumer createConsumer() throws JMSException { if (durable) { - System.out.println("Creating durable consumer"); return session.createDurableSubscriber((Topic) consumerDestination, getName()); } return session.createConsumer(consumerDestination); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java index 978c88d433..34659ec25f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java @@ -122,15 +122,12 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem TextMessage message = session.createTextMessage("Batch Message"); for (int j = 0; j < batchCount; j++) { - System.out.println("Producing bacth " + j + " of " + batchSize + " messages"); - beginTx(); for (int i = 0; i < batchSize; i++) { producer.send(message); } messageSent(); commitTx(); - System.out.println("Consuming bacth " + j + " of " + batchSize + " messages"); beginTx(); for (int i = 0; i < batchSize; i++) { @@ -139,7 +136,6 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem assertEquals("Batch Message", message.getText()); } - System.out.println("commit batch " + j); commitTx(); } } @@ -175,16 +171,12 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem // receives the first message beginTx(); ArrayList messages = new ArrayList<>(); - System.out.println("About to consume message 1"); Message message = consumer.receive(1000); messages.add(message); - System.out.println("Received: " + ((TextMessage) message).getText()); // receives the second message - System.out.println("About to consume message 2"); message = consumer.receive(4000); messages.add(message); - System.out.println("Received: " + ((TextMessage) message).getText()); // validates that the rollbacked was not consumed commitTx(); @@ -212,10 +204,8 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem // receives the first message beginTx(); ArrayList messages = new ArrayList<>(); - System.out.println("About to consume message 1"); Message message = consumer.receive(1000); messages.add(message); - System.out.println("Received: " + message); // validates that the rollbacked was not consumed commitTx(); @@ -254,17 +244,13 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem // receives the first message ArrayList messages = new ArrayList<>(); - System.out.println("About to consume message 1"); beginTx(); Message message = consumer.receive(1000); messages.add(message); - System.out.println("Received: " + message); // receives the second message - System.out.println("About to consume message 2"); message = consumer.receive(4000); messages.add(message); - System.out.println("Received: " + message); // validates that the rollbacked was not consumed commitTx(); @@ -303,17 +289,13 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem // receives the first message ArrayList messages = new ArrayList<>(); - System.out.println("About to consume message 1"); beginTx(); Message message = consumer.receive(1000); messages.add(message); - System.out.println("Received: " + message); // receives the second message - System.out.println("About to consume message 2"); message = consumer.receive(4000); messages.add(message); - System.out.println("Received: " + message); // validates that the rollbacked was not consumed commitTx(); @@ -344,8 +326,6 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem producer.send(outbound[1]); commitTx(); - System.out.println("Sent 0: " + outbound[0]); - System.out.println("Sent 1: " + outbound[1]); ArrayList messages = new ArrayList<>(); beginTx(); @@ -396,9 +376,6 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem producer.send(outbound[1]); commitTx(); - System.out.println("Sent 0: " + outbound[0]); - System.out.println("Sent 1: " + outbound[1]); - ArrayList messages = new ArrayList<>(); beginTx(); TextMessage message = (TextMessage) consumer.receive(1000); @@ -418,12 +395,10 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem beginTx(); message = (TextMessage) consumer.receive(5000); assertNotNull("Should have re-received the first message again!", message); - System.out.println("received1: " + message.getText()); messages.add(message); assertEquals(outbound[0], message); message = (TextMessage) consumer.receive(5000); assertNotNull("Should have re-received the second message again!", message); - System.out.println("received2: " + message.getText()); messages.add(message); assertEquals(outbound[1], message); @@ -457,10 +432,8 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem // receives the first message beginTx(); for (int i = 0; i < outbound.length; i++) { - System.out.println("About to consume message 1"); Message message = consumer.receive(1000); assertNotNull(message); - System.out.println("Received: " + message); } // validates that the rollbacked was not consumed @@ -526,8 +499,6 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem producer.send(outbound[0]); producer.send(outbound[1]); commitTx(); - System.out.println("Sent 0: " + outbound[0]); - System.out.println("Sent 1: " + outbound[1]); beginTx(); TextMessage message = (TextMessage) consumer.receive(1000); @@ -540,7 +511,6 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem // Create a new consumer consumer = resourceProvider.createConsumer(session, destination); - System.out.println("Created consumer: " + consumer); beginTx(); message = (TextMessage) consumer.receive(1000); @@ -559,7 +529,6 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem producer.send(outbound); commitTx(); - System.out.println("About to consume message 1"); beginTx(); Message message = consumer.receive(5000); @@ -592,7 +561,6 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem assertTrue("Should be an object message but was: " + message, message instanceof ObjectMessage); ObjectMessage objectMessage = (ObjectMessage) message; List body = (List) objectMessage.getObject(); - System.out.println("Received body: " + body); assertEquals("Size of list should be 1", 1, body.size()); assertEquals("element 0 of list", "First", body.get(0)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/MessageListenerRedeliveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/MessageListenerRedeliveryTest.java index 09dc56590e..26773bda87 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/MessageListenerRedeliveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/MessageListenerRedeliveryTest.java @@ -98,13 +98,10 @@ public class MessageListenerRedeliveryTest extends BasicOpenWireTest { @Override public void onMessage(Message message) { try { - System.out.println("Message Received: " + message); counter++; if (counter <= 4) { - System.out.println("Message Rollback."); session.rollback(); } else { - System.out.println("Message Commit."); message.acknowledge(); session.commit(); } @@ -271,7 +268,6 @@ public class MessageListenerRedeliveryTest extends BasicOpenWireTest { consumer.setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { - System.out.println("Message Received: " + message); try { received.add(((TextMessage) message).getText()); } catch (JMSException e) { @@ -318,7 +314,6 @@ public class MessageListenerRedeliveryTest extends BasicOpenWireTest { dlqConsumer.setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { - System.out.println("DLQ Message Received: " + message); dlqMessage[0] = message; gotDlqMessage.countDown(); } @@ -327,13 +322,11 @@ public class MessageListenerRedeliveryTest extends BasicOpenWireTest { MessageConsumer consumer = session.createConsumer(queue); final int maxDeliveries = getRedeliveryPolicy().getMaximumRedeliveries(); - System.out.println("max redlivery: " + maxDeliveries); final CountDownLatch gotMessage = new CountDownLatch(maxDeliveries); consumer.setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { - System.out.println("Message Received: " + message); gotMessage.countDown(); throw new RuntimeException(getName() + " force a redelivery"); } @@ -349,8 +342,6 @@ public class MessageListenerRedeliveryTest extends BasicOpenWireTest { assertNotNull("dlq message captured", message); String cause = message.getStringProperty(ActiveMQMessage.DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY); - System.out.println("DLQ'd message cause reported as: " + cause); - assertTrue("cause 'cause' exception is remembered", cause.contains("RuntimeException")); assertTrue("is correct exception", cause.contains(getName())); assertTrue("cause exception is remembered", cause.contains("Throwable")); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlSendFailTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlSendFailTest.java index e03ae27409..f417725afe 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlSendFailTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlSendFailTest.java @@ -97,7 +97,6 @@ public class ProducerFlowControlSendFailTest extends ProducerFlowControlBaseTest for (int idx = 0; idx < successSent; ++idx) { msg = (TextMessage) consumer.receive(1000); Assert.assertNotNull(msg); - System.out.println("Received " + msg); if (msg != null) { msg.acknowledge(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java index bde8b7909e..8587985847 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java @@ -100,7 +100,6 @@ public class ProducerFlowControlTest extends ProducerFlowControlBaseTest { TextMessage msg; for (int idx = 0; idx < 5; ++idx) { msg = (TextMessage) consumer.receive(1000); - System.out.println("received: " + idx + ", msg: " + msg.getJMSMessageID()); msg.acknowledge(); } Thread.sleep(1000); @@ -147,7 +146,6 @@ public class ProducerFlowControlTest extends ProducerFlowControlBaseTest { for (int idx = 0; idx < 5; ++idx) { msg = (TextMessage) consumer.receive(1000); assertNotNull("Got a message", msg); - System.out.println("received: " + idx + ", msg: " + msg.getJMSMessageID()); msg.acknowledge(); } Thread.sleep(1000); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java index 05625b8262..d8a2f2aab3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java @@ -674,8 +674,6 @@ public class RedeliveryPolicyTest extends BasicOpenWireTest { assertNotNull("Message null on iteration " + i, message); - System.out.println("received message: " + i); - System.out.println("is redelivered: " + message.getJMSRedelivered()); if (i > 0) { assertTrue(message.getJMSRedelivered()); } @@ -727,8 +725,6 @@ public class RedeliveryPolicyTest extends BasicOpenWireTest { assertNotNull("Message null", message); - System.out.println("received message: " + message); - System.out.println("is redelivered: " + message.getJMSRedelivered()); assertFalse(message.getJMSRedelivered()); } finally { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/MessageRedistributionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/MessageRedistributionTest.java index dc0aeb42f2..083c13b2eb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/MessageRedistributionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/MessageRedistributionTest.java @@ -79,7 +79,6 @@ public class MessageRedistributionTest extends ClusterTestBase { private void closeConsumerAndConnectionConcurrently(int targetNode, int remoteNode) throws Exception { String targetUri = getServerUri(targetNode); - System.out.println("uri is " + targetUri); ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(targetUri); Connection conn = null; CountDownLatch active = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java index 0bf60bfa34..cc818bb7b5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java @@ -52,7 +52,6 @@ public class TemporaryQueueClusterTest extends OpenWireJMSClusteredTestBase { @Test public void testClusteredQueue() throws Exception { - System.out.println("creating connections"); Connection conn1 = openWireCf1.createConnection(); Connection conn2 = openWireCf2.createConnection(); @@ -107,7 +106,6 @@ public class TemporaryQueueClusterTest extends OpenWireJMSClusteredTestBase { Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue targetQueue1 = session1.createQueue(QUEUE_NAME); Queue tempQueue = session1.createTemporaryQueue(); - System.out.println("temp queue is " + tempQueue.getQueueName()); Session session2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE); Queue targetQueue2 = session2.createQueue(QUEUE_NAME); @@ -135,8 +133,6 @@ public class TemporaryQueueClusterTest extends OpenWireJMSClusteredTestBase { for (int i = 0; i < 10; i++) { if (i % 2 == 0) { TextMessage received = (TextMessage) cons2.receive(5000); - System.out.println(received.getText()); - System.out.println("check temp queue on server #2"); MessageProducer tempProducer = session2.createProducer(received.getJMSReplyTo()); tempProducer.send(session2.createTextMessage(">>> " + received.getText())); tempProducer.close(); @@ -147,7 +143,6 @@ public class TemporaryQueueClusterTest extends OpenWireJMSClusteredTestBase { if (i % 2 == 0) { TextMessage received = (TextMessage) tempCons1.receive(5000); assertNotNull(received); - System.out.println(received.getText()); } } } finally { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java index 66d7247afb..869f6f2bda 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java @@ -71,7 +71,6 @@ public class GeneralInteropTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE); - System.out.println("destination: " + destination); final ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) session.createConsumer(destination); TextMessage textMessage = (TextMessage) consumer.receive(5000); @@ -577,7 +576,6 @@ public class GeneralInteropTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE); - System.out.println("destination: " + destination); final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination); javax.jms.Message message = session.createMessage(); @@ -596,7 +594,6 @@ public class GeneralInteropTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE); - System.out.println("destination: " + destination); final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination); BytesMessage bytesMessage = session.createBytesMessage(); @@ -615,7 +612,6 @@ public class GeneralInteropTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE); - System.out.println("destination: " + destination); final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination); StreamMessage streamMessage = session.createStreamMessage(); @@ -637,7 +633,6 @@ public class GeneralInteropTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE); - System.out.println("destination: " + destination); final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination); ObjectMessage objectMessage = session.createObjectMessage(obj); @@ -649,7 +644,6 @@ public class GeneralInteropTest extends BasicOpenWireTest { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE); - System.out.println("destination: " + destination); final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination); MapMessage mapMessage = session.createMapMessage(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/management/OpenWireManagementTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/management/OpenWireManagementTest.java index 858b0890d3..179269c8e9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/management/OpenWireManagementTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/management/OpenWireManagementTest.java @@ -98,7 +98,6 @@ public class OpenWireManagementTest extends OpenWireTestBase { Map params = tconfig.getExtraParams(); params.put("supportAdvisory", supportAdvisory); params.put("suppressInternalManagementObjects", suppressJmx); - System.out.println("Now use properties: " + params); } } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AddressFullLoggingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AddressFullLoggingTest.java index 28998e2d1b..749793e6f0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AddressFullLoggingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/AddressFullLoggingTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.logging.Level; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.QueueConfiguration; @@ -32,11 +33,13 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.logs.AssertionLoggerHandler; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ActiveMQThreadFactory; +import org.jboss.logmanager.Logger; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; @@ -44,11 +47,21 @@ import org.junit.Test; public class AddressFullLoggingTest extends ActiveMQTestBase { + private static final Logger logManager = org.jboss.logmanager.Logger.getLogger(ActiveMQServerLogger.class.getPackage().getName()); + private static java.util.logging.Level previousLevel = logManager.getLevel(); + @BeforeClass public static void prepareLogger() { + logManager.setLevel(Level.INFO); AssertionLoggerHandler.startCapture(); } + @AfterClass + public static void clearLogger() { + AssertionLoggerHandler.stopCapture(); + logManager.setLevel(previousLevel); + } + @Test public void testBlockLogging() throws Exception { final int MAX_MESSAGES = 200; @@ -145,8 +158,4 @@ public class AddressFullLoggingTest extends ActiveMQTestBase { Assert.assertFalse("Expected to not find AMQ222211", AssertionLoggerHandler.findText("AMQ222211")); } - @AfterClass - public static void clearLogger() { - AssertionLoggerHandler.stopCapture(); - } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java index fe03b7fb22..b093ffe71e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java @@ -102,7 +102,6 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.logs.AssertionLoggerHandler; import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.artemis.utils.RetryMethod; @@ -121,6 +120,8 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class PagingTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(PagingTest.class); + @Rule public RetryRule retryMethod = new RetryRule(0); @@ -132,8 +133,6 @@ public class PagingTest extends ActiveMQTestBase { static final int MESSAGE_SIZE = 1024; // 1k static final int LARGE_MESSAGE_SIZE = 100 * 1024; - protected static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected static final int RECEIVE_TIMEOUT = 5000; protected static final int PAGE_MAX = 100 * 1024; @@ -456,7 +455,6 @@ public class PagingTest extends ActiveMQTestBase { session.commit(); producer.close(); session.close(); - //System.out.println("Just sent " + numberOfMessages + " messages."); Queue queue = server.locateQueue(PagingTest.ADDRESS); @@ -499,7 +497,6 @@ public class PagingTest extends ActiveMQTestBase { assertTrue(pgComplete == null || pgComplete.get() == 0); - System.out.println("pgComplete = " + pgComplete); } @Test @@ -916,7 +913,6 @@ public class PagingTest extends ActiveMQTestBase { msg.individualAcknowledge(); - System.out.println(msg); } session.commit(); @@ -939,7 +935,6 @@ public class PagingTest extends ActiveMQTestBase { assertNotNull(msg); assertEquals(i, msg.getIntProperty("count").intValue()); msg.acknowledge(); - System.out.println(msg); } assertNull(consumer.receiveImmediate()); @@ -1000,7 +995,6 @@ public class PagingTest extends ActiveMQTestBase { producer.send(message); if ((i + 1) % 5 == 0) { - System.out.println("Forcing at " + i); session.commit(); queue.getPageSubscription().getPagingStore().forceAnotherPage(); } @@ -1040,7 +1034,6 @@ public class PagingTest extends ActiveMQTestBase { } ClientMessage message = cons.receive(5000); assertNotNull(message); - System.out.println("ACK " + i); message.acknowledge(); assertEquals(i, message.getIntProperty("count").intValue()); if (i == 20) { @@ -1103,8 +1096,6 @@ public class PagingTest extends ActiveMQTestBase { assertNull(cons.receiveImmediate()); session.commit(); - System.out.println("count = " + getMessageCount(queue)); - session.commit(); session.close(); @@ -1311,7 +1302,6 @@ public class PagingTest extends ActiveMQTestBase { // I want the buffer full to make sure there are pending messages on the server's side while (System.currentTimeMillis() < timeout && (cons.getBufferSize() < 1000 || cons2.getBufferSize() < 1000)) { - System.out.println("cons1 buffer = " + cons.getBufferSize() + ", cons2 buffer = " + cons2.getBufferSize()); Thread.sleep(100); } @@ -1335,10 +1325,6 @@ public class PagingTest extends ActiveMQTestBase { final HashMap recordsType = countJournal(config); - for (Map.Entry entry : recordsType.entrySet()) { - System.out.println(entry.getKey() + "=" + entry.getValue()); - } - assertNull("The system is acking page records instead of just delete data", recordsType.get(new Integer(JournalRecordIds.ACKNOWLEDGE_CURSOR))); Pair, List> journalData = loadMessageJournal(config); @@ -1363,7 +1349,7 @@ public class PagingTest extends ActiveMQTestBase { if (!deletedQueueReferences.isEmpty()) { for (Long value : deletedQueueReferences) { - System.out.println("Deleted Queue still has a reference:" + value); + instanceLog.warn("Deleted Queue still has a reference:" + value); } fail("Deleted queue still have references"); @@ -1723,18 +1709,18 @@ public class PagingTest extends ActiveMQTestBase { sessionConsumer.start(); ClientConsumer consumer = sessionConsumer.createConsumer(PagingTest.ADDRESS); for (int msgCount = 0; msgCount < numberOfMessages; msgCount++) { - log.info("Received " + msgCount); + log.debug("Received " + msgCount); msgReceived++; ClientMessage msg = consumer.receiveImmediate(); if (msg == null) { - log.info("It's null. leaving now"); + log.debug("It's null. leaving now"); sessionConsumer.commit(); fail("Didn't receive a message"); } msg.acknowledge(); if (msgCount % 5 == 0) { - log.info("commit"); + log.debug("commit"); sessionConsumer.commit(); } } @@ -1890,18 +1876,18 @@ public class PagingTest extends ActiveMQTestBase { sessionConsumer.start(); ClientConsumer consumer = sessionConsumer.createConsumer(PagingTest.ADDRESS); for (int msgCount = 0; msgCount < numberOfMessages; msgCount++) { - log.info("Received " + msgCount); + log.debug("Received " + msgCount); msgReceived++; ClientMessage msg = consumer.receiveImmediate(); if (msg == null) { - log.info("It's null. leaving now"); + log.debug("It's null. leaving now"); sessionConsumer.commit(); fail("Didn't receive a message"); } msg.acknowledge(); if (msgCount % 5 == 0) { - log.info("commit"); + log.debug("commit"); sessionConsumer.commit(); } } @@ -1972,19 +1958,18 @@ public class PagingTest extends ActiveMQTestBase { sessionConsumer.start(); consumer = sessionConsumer.createConsumer(PagingTest.ADDRESS); for (int msgCount = 0; msgCount < numberOfMessages; msgCount++) { - log.info("Received " + msgCount); + log.debug("Received " + msgCount); msgReceived++; ClientMessage msg = consumer.receive(5000); if (msg == null) { - log.info("It's null. leaving now"); + log.debug("It's null. leaving now"); sessionConsumer.commit(); fail("Didn't receive a message"); } - System.out.println("Message " + msg.getIntProperty(SimpleString.toSimpleString("theid"))); msg.acknowledge(); if (msgCount % 5 == 0) { - log.info("commit"); + log.debug("commit"); sessionConsumer.commit(); } } @@ -2525,7 +2510,7 @@ public class PagingTest extends ActiveMQTestBase { Thread.sleep(10); } } catch (InterruptedException e) { - log.info("Thread interrupted"); + log.debug("Thread interrupted"); } } } @@ -2555,7 +2540,7 @@ public class PagingTest extends ActiveMQTestBase { for (int i = 0; i < numberOfMessages; i++) { if (i % 500 == 0) { - log.info("Sent " + i + " messages"); + log.debug("Sent " + i + " messages"); session.commit(); } message = session.createMessage(true); @@ -2633,7 +2618,7 @@ public class PagingTest extends ActiveMQTestBase { if (i % 100 == 0) { if (i % 5000 == 0) { - log.info(addressToSubscribe + " consumed " + i + " messages"); + log.debug(addressToSubscribe + " consumed " + i + " messages"); } session.commit(); } @@ -2641,8 +2626,8 @@ public class PagingTest extends ActiveMQTestBase { try { assertBodiesEqual(body, message2.getBodyBuffer()); } catch (AssertionError e) { - PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); - PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); + PagingTest.log.debug("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); + PagingTest.log.debug("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); throw e; } } @@ -2801,8 +2786,8 @@ public class PagingTest extends ActiveMQTestBase { try { assertBodiesEqual(body, message2.getBodyBuffer()); } catch (AssertionError e) { - PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); - PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); + PagingTest.log.debug("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); + PagingTest.log.debug("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); throw e; } } @@ -2927,8 +2912,8 @@ public class PagingTest extends ActiveMQTestBase { try { assertBodiesEqual(body, message2.getBodyBuffer()); } catch (AssertionError e) { - PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); - PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); + PagingTest.log.debug("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); + PagingTest.log.debug("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); throw e; } } @@ -3099,7 +3084,6 @@ public class PagingTest extends ActiveMQTestBase { int numberOfMessages = 0; while (true) { - System.out.println("Sending message " + numberOfMessages); message = session.createMessage(IS_DURABLE_MESSAGE); message.getBodyBuffer().writeBytes(body); message.putIntProperty("id", numberOfMessages); @@ -3162,7 +3146,6 @@ public class PagingTest extends ActiveMQTestBase { Integer messageID = (Integer) message.getObjectProperty(new SimpleString("id")); - // System.out.println(messageID); Assert.assertNotNull(messageID); Assert.assertEquals("message received out of order", i, messageID.intValue()); @@ -3407,7 +3390,7 @@ public class PagingTest extends ActiveMQTestBase { sessionProducer.commit(); - log.info("Producer gone"); + log.debug("Producer gone"); } catch (Throwable e) { e.printStackTrace(); // >> junit report @@ -3439,8 +3422,8 @@ public class PagingTest extends ActiveMQTestBase { ClientMessage msg = consumer.receive(5000); assertNotNull(msg); if (i != msg.getIntProperty("count").intValue()) { - log.info("Received " + i + " with property = " + msg.getIntProperty("count")); - log.info("###### different"); + log.debug("Received " + i + " with property = " + msg.getIntProperty("count")); + log.debug("###### different"); } // assertEquals(i, msg.getIntProperty("count").intValue()); msg.acknowledge(); @@ -3546,8 +3529,8 @@ public class PagingTest extends ActiveMQTestBase { try { assertBodiesEqual(body, message2.getBodyBuffer()); } catch (AssertionError e) { - PagingTest.log.info("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); - PagingTest.log.info("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); + PagingTest.log.debug("Expected buffer:" + ActiveMQTestBase.dumpBytesHex(body, 40)); + PagingTest.log.debug("Arriving buffer:" + ActiveMQTestBase.dumpBytesHex(message2.getBodyBuffer().toByteBuffer().array(), 40)); throw e; } } @@ -3903,9 +3886,6 @@ public class PagingTest extends ActiveMQTestBase { session.start(); for (int i = 0; i < numberOfMessages; i++) { - if (i == 55) { - System.out.println("i = 55"); - } ClientMessage msg = consumer.receive(5000); Assert.assertNotNull(msg); msg.acknowledge(); @@ -4184,7 +4164,7 @@ public class PagingTest extends ActiveMQTestBase { count++; if (count % 1000 == 0) { - log.info("received " + count); + log.debug("received " + count); } try { @@ -4796,7 +4776,6 @@ public class PagingTest extends ActiveMQTestBase { assertNotNull(message); message.acknowledge(); - System.out.println("i = " + i + " msg = " + message.getIntProperty("propTest")); } session.commit(); @@ -5103,12 +5082,12 @@ public class PagingTest extends ActiveMQTestBase { try { if (!message.waitOutputStreamCompletion(10000)) { - log.info(threadDump("dump")); + log.debug(threadDump("dump")); fail("Couldn't finish large message receiving"); } } catch (Throwable e) { - log.info("output bytes = " + bytesOutput); - log.info(threadDump("dump")); + log.debug("output bytes = " + bytesOutput); + log.debug(threadDump("dump")); fail("Couldn't finish large message receiving for id=" + message.getStringProperty("id") + " with messageID=" + message.getMessageID()); } @@ -5254,7 +5233,7 @@ public class PagingTest extends ActiveMQTestBase { for (int i = 0; i < 500; i++) { if (i % 100 == 0) - log.info("send message #" + i); + log.debug("send message #" + i); message = session.createMessage(true); message.putStringProperty("id", "str" + i); @@ -5308,7 +5287,7 @@ public class PagingTest extends ActiveMQTestBase { ClientConsumer cons = session.createConsumer("DLA"); for (int i = 0; i < 500; i++) { - log.info("Received message " + i); + log.debug("Received message " + i); message = cons.receive(10000); assertNotNull(message); message.acknowledge(); @@ -5670,8 +5649,6 @@ public class PagingTest extends ActiveMQTestBase { queue.getPageSubscription().cleanupEntries(false); - System.out.println("Waiting there"); - server.stop(); } @@ -5714,7 +5691,6 @@ public class PagingTest extends ActiveMQTestBase { @Override public void onMessage(ClientMessage message) { - System.out.println("Received an unexpected message"); consumerQ3Msgs.incrementAndGet(); } }); @@ -6105,7 +6081,6 @@ public class PagingTest extends ActiveMQTestBase { for (int i = 0; i < 100; i++) { msg = cons1.receive(5000); - System.out.println("Received " + msg); assertNotNull(msg); if (!browsing) { msg.acknowledge(); @@ -6189,7 +6164,6 @@ public class PagingTest extends ActiveMQTestBase { for (int i = 0; i < 99; i++) { ClientMessage msg = cons1.receive(5000); assertNotNull(msg); - System.out.println("count = " + msg.getIntProperty("count")); msg.acknowledge(); } @@ -6539,7 +6513,6 @@ public class PagingTest extends ActiveMQTestBase { assertNotNull(i + "th msg is null", msg); assertEquals(i, msg.getIntProperty("count").intValue()); msg.acknowledge(); - System.out.println(msg); } assertNull(consumer.receiveImmediate()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java index 489c16eb27..3058bc3955 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java @@ -200,18 +200,16 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase { session.commit(); if (currentMsg > lastCommit) { lastCommit = currentMsg; - } else { - System.out.println("Ignoring setting lastCommit (" + lastCommit + ") <= currentMSG (" + currentMsg + ")"); } } msgcount++; } if (msgcount % 100 == 0) { - System.out.println("received " + msgcount + " on " + queueName); + instanceLog.debug("received " + msgcount + " on " + queueName); } } catch (Throwable e) { - System.out.println("=====> expected Error at " + currentMsg + " with lastCommit=" + lastCommit); + instanceLog.warn("=====> expected Error at " + currentMsg + " with lastCommit=" + lastCommit); } } @@ -245,8 +243,6 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase { session.createQueue(new QueueConfiguration("new-queue").setRoutingType(RoutingType.ANYCAST)); - System.out.println("created queue"); - session.start(); ClientProducer prod = session.createProducer("new-queue"); prod.send(session.createMessage(true)); @@ -260,8 +256,6 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase { e.printStackTrace(); fail(e.getMessage()); } - System.out.println("Started monitoring"); - Queue queue2 = inProcessBackup.getServer().locateQueue(SimpleString.toSimpleString("cons2")); while (isRunning(1)) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/TestDeadlockOnPurgePagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/TestDeadlockOnPurgePagingTest.java index be530e63fb..2249634aec 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/TestDeadlockOnPurgePagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/TestDeadlockOnPurgePagingTest.java @@ -32,7 +32,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.server.impl.QueueImpl; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.Wait; import org.jboss.logging.Logger; @@ -50,8 +49,6 @@ public class TestDeadlockOnPurgePagingTest extends ActiveMQTestBase { static final int MESSAGE_SIZE = 1024; // 1k static final int LARGE_MESSAGE_SIZE = 100 * 1024; - protected static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected static final int RECEIVE_TIMEOUT = 5000; protected static final int PAGE_MAX = 100 * 1024; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java index 48bdc9abbf..4238196cd2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java @@ -26,7 +26,6 @@ import org.apache.activemq.artemis.core.persistence.GroupingInfo; import org.apache.activemq.artemis.core.persistence.QueueBindingInfo; import org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager; import org.apache.activemq.artemis.core.postoffice.PostOffice; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeJournalLoader; import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakePostOffice; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; @@ -38,7 +37,6 @@ import org.junit.Test; public class RestartSMTest extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; // Attributes ---------------------------------------------------- @@ -97,7 +95,7 @@ public class RestartSMTest extends ActiveMQTestBase { try { journal.stop(); } catch (Exception ex) { - RestartSMTest.log.warn(ex.getMessage(), ex); + instanceLog.warn(ex.getMessage(), ex); } } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/StompPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/StompPluginTest.java index bb32407524..60c12f69f5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/StompPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/StompPluginTest.java @@ -67,7 +67,6 @@ import org.apache.activemq.artemis.core.server.ServerSession; import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerPlugin; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.protocol.SessionCallback; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.stomp.StompTestBase; import org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnection; @@ -81,7 +80,6 @@ import org.junit.runners.Parameterized; public class StompPluginTest extends StompTestBase { - private static final transient IntegrationTestLogger log = IntegrationTestLogger.LOGGER; public static final String CLIENT_ID = "myclientid"; private StompClientConnectionV12 conn; @@ -103,7 +101,6 @@ public class StompPluginTest extends StompTestBase { public void tearDown() throws Exception { try { boolean connected = conn != null && conn.isConnected(); - log.debug("Connection 1.2 : " + connected); if (connected) { conn.disconnect(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java index 9fd0bfa24c..d372054956 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java @@ -45,7 +45,6 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter; import org.apache.activemq.artemis.ra.inflow.ActiveMQActivation; import org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.junit.Test; public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase { @@ -948,7 +947,7 @@ public class ActiveMQMessageHandlerTest extends ActiveMQRATestBase { latch.countDown(); if (pause && messages.getAndIncrement() % 2 == 0) { try { - IntegrationTestLogger.LOGGER.info("pausing for 2 secs"); + instanceLog.debug("pausing for 2 secs"); Thread.sleep(2000); } catch (InterruptedException e) { interrupted.incrementAndGet(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java index b9ba54e9d9..7689a02c59 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java @@ -94,7 +94,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase { Set resources = ra.getRecoveryManager().getResources(); for (int i = 0; i < 10; i++) { - System.out.println(i); activation.start(); assertEquals(1, resources.size()); activation.stop(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/NetworkAddressTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/NetworkAddressTestBase.java index 6268c54490..93e93836b1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/NetworkAddressTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/NetworkAddressTestBase.java @@ -180,8 +180,6 @@ public abstract class NetworkAddressTestBase extends ActiveMQTestBase { final String connectorHost, final boolean mustConnect, final int localPort) throws Exception { - System.out.println("acceptor=" + acceptorHost + ", connector=" + connectorHost + ", mustConnect=" + mustConnect); - Map params = new HashMap<>(); params.put(getHostPropertyKey(), acceptorHost); TransportConfiguration acceptorConfig = new TransportConfiguration(getAcceptorFactoryClassName(), params); @@ -211,7 +209,6 @@ public abstract class NetworkAddressTestBase extends ActiveMQTestBase { Assert.assertTrue(address.endsWith(":" + localPort)); } sf.close(); - System.out.println("connection OK"); } else { try { locator.createSessionFactory(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java index 0285d56479..6affcf929b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java @@ -37,8 +37,8 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.Ping; import org.apache.activemq.artemis.core.remoting.CloseListener; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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; @@ -46,7 +46,7 @@ import org.junit.Test; public class PingTest extends ActiveMQTestBase { // Constants ----------------------------------------------------- - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(PingTest.class); private static final long CLIENT_FAILURE_CHECK_PERIOD = 500; @@ -105,8 +105,6 @@ public class PingTest extends ActiveMQTestBase { ClientSession session = csf.createSession(false, true, true); - PingTest.log.info("Created session"); - Assert.assertEquals(1, ((ClientSessionFactoryInternal) csf).numConnections()); Listener clientListener = new Listener(); @@ -137,8 +135,6 @@ public class PingTest extends ActiveMQTestBase { RemotingConnection serverConn2 = server.getRemotingService().getConnections().iterator().next(); - PingTest.log.info("Server conn2 is " + serverConn2); - Assert.assertTrue(serverConn == serverConn2); session.close(); @@ -191,8 +187,6 @@ public class PingTest extends ActiveMQTestBase { RemotingConnection serverConn2 = server.getRemotingService().getConnections().iterator().next(); - PingTest.log.info("Serverconn2 is " + serverConn2); - Assert.assertTrue(serverConn == serverConn2); session.close(); @@ -293,8 +287,6 @@ public class PingTest extends ActiveMQTestBase { if (!server.getRemotingService().getConnections().isEmpty()) { RemotingConnection serverConn2 = server.getRemotingService().getConnections().iterator().next(); - - PingTest.log.info("Serverconn2 is " + serverConn2); } Assert.assertTrue(server.getRemotingService().getConnections().isEmpty()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java index 3e6417a287..4e9731e7da 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java @@ -271,7 +271,6 @@ public class ReconnectTest extends ActiveMQTestBase { @Override public void beforeReconnect(ActiveMQException exception) { threadToBeInterrupted.add(Thread.currentThread()); - System.out.println("Thread " + Thread.currentThread() + " reconnecting now"); latchCommit.countDown(); } }); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/rest/RestDeserializationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/rest/RestDeserializationTest.java index 103383f0db..55e8525e09 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/rest/RestDeserializationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/rest/RestDeserializationTest.java @@ -156,7 +156,6 @@ public class RestDeserializationTest extends RestTestBase { deployWebApp("/restapp", warFile); server.start(); String uri = server.getURI().toASCIIString(); - System.out.println("Sever started with uri: " + uri); restConnection = new RestAMQConnection(uri); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java index 052772ae37..51bad7e04b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java @@ -26,7 +26,6 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Before; @@ -34,8 +33,6 @@ import org.junit.Test; public class DelayedMessageTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ActiveMQServer server; private static final long DELAY = 3000; @@ -120,8 +117,6 @@ public class DelayedMessageTest extends ActiveMQTestBase { long time = System.currentTimeMillis(); - log.info("delay " + (time - now)); - Assert.assertTrue(time - now >= DelayedMessageTest.DELAY); // Hudson can introduce a large degree of indeterminism diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java index 1a95b0ed32..697d2ce6b6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/MultipliedDelayedMessageTest.java @@ -26,15 +26,15 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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 MultipliedDelayedMessageTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(MultipliedDelayedMessageTest.class); private ActiveMQServer server; @@ -101,11 +101,11 @@ public class MultipliedDelayedMessageTest extends ActiveMQTestBase { session.rollback(); long expectedDelay = calculateExpectedDelay(DELAY, MAX_DELAY, MULTIPLIER, i); - log.info("\nExpected delay: " + expectedDelay); + log.debug("\nExpected delay: " + expectedDelay); tm = consumer.receive(expectedDelay + 500); long stop = System.currentTimeMillis(); Assert.assertNotNull(tm); - log.info("Actual delay: " + (stop - start)); + log.debug("Actual delay: " + (stop - start)); Assert.assertTrue(stop - start >= expectedDelay); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java index 5bd7d3faae..58160a1d0a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java @@ -35,7 +35,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.core.transaction.impl.XidImpl; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.junit.Assert; @@ -44,8 +43,6 @@ import org.junit.Test; public class ScheduledMessageTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private final SimpleString atestq = new SimpleString("ascheduledtestq"); private final SimpleString atestq2 = new SimpleString("ascheduledtestq2"); @@ -286,7 +283,6 @@ public class ScheduledMessageTest extends ActiveMQTestBase { message.putLongProperty(Message.HDR_SCHEDULED_DELIVERY_TIME, time); producer.send(message); - ScheduledMessageTest.log.info("Recover is " + recover); if (recover) { producer.close(); session.close(); @@ -613,7 +609,6 @@ public class ScheduledMessageTest extends ActiveMQTestBase { session.start(xid2, XAResource.TMNOFLAGS); ClientMessage message2 = consumer.receive(11000); long end = System.currentTimeMillis(); - System.out.println("elapsed time = " + (end - time)); Assert.assertTrue(end >= time); Assert.assertNotNull(message2); Assert.assertEquals("testINVMCoreClient", message2.getBodyBuffer().readString()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java index 7e6b035259..378b40f2d6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/NettySecurityClientTest.java @@ -23,7 +23,6 @@ import java.net.URLDecoder; import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.SpawnedTestBase; import org.apache.activemq.artemis.utils.SpawnedVMSupport; import org.junit.Assert; @@ -32,8 +31,6 @@ import org.junit.Test; public class NettySecurityClientTest extends SpawnedTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private ActiveMQServer messagingService; @Test @@ -88,7 +85,6 @@ public class NettySecurityClientTest extends SpawnedTestBase { // the client VM should exit by itself. If it doesn't, that means we have a problem // and the test will timeout - NettySecurityClientTest.log.debug("waiting for the client VM to exit ..."); p.waitFor(); Assert.assertEquals("client VM did not exit cleanly", 0, p.exitValue()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java index 135c901060..fcd34ceb6d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java @@ -1473,11 +1473,8 @@ public class SecurityTest extends ActiveMQTestBase { securityManager.getConfiguration().addRole("guest", "guest"); securityManager.getConfiguration().setDefaultUser("guest"); Role role = new Role("arole", false, false, false, false, false, false, false, false, false, false); - System.out.println("guest:" + role); Role sendRole = new Role("guest", true, false, true, false, false, false, false, false, true, false); - System.out.println("guest:" + sendRole); Role receiveRole = new Role("receiver", false, true, false, false, false, false, false, false, false, false); - System.out.println("guest:" + receiveRole); Set roles = new HashSet<>(); roles.add(sendRole); roles.add(role); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SimpleClient.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SimpleClient.java index b88dd1b3f8..384b977360 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SimpleClient.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SimpleClient.java @@ -39,7 +39,6 @@ final class SimpleClient { throw new Exception("require 1 argument: connector factory class name"); } - System.out.println("I'm here"); String connectorFactoryClassName = args[0]; String queueName = RandomUtil.randomString(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java index d4111cf708..966ae811ba 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AddressQueueDeleteDelayTest.java @@ -29,15 +29,17 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.util.Wait; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; 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.Test; public class AddressQueueDeleteDelayTest extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(AddressQueueDeleteDelayTest.class); + public static final int DURATION_MILLIS = 30_000; public static final int SLEEP_MILLIS = 100; @@ -82,14 +84,14 @@ public class AddressQueueDeleteDelayTest extends ActiveMQTestBase { long elapsedTime = System.currentTimeMillis() - start; - IntegrationTestLogger.LOGGER.info("Elapsed time to delete queue: " + elapsedTime); + log.debug("Elapsed time to delete queue: " + elapsedTime); assertTrue(elapsedTime >= (deleteQueuesDelay)); start = info.getBindingRemovedTimestamp(); assertTrue(Wait.waitFor(() -> server.getAddressInfo(address) == null, DURATION_MILLIS, SLEEP_MILLIS)); elapsedTime = System.currentTimeMillis() - start; - IntegrationTestLogger.LOGGER.info("Elapsed time to delete address: " + elapsedTime); + log.debug("Elapsed time to delete address: " + elapsedTime); assertTrue("ellapsedTime=" + elapsedTime + " while delay is " + deleteAddressesDelay, elapsedTime >= (deleteAddressesDelay)); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java index cc35660bae..95bacb7a72 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/FileLockTimeoutTest.java @@ -27,7 +27,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.JournalType; import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext; import org.apache.activemq.artemis.logs.AssertionLoggerHandler; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.ActiveMQThreadFactory; import org.junit.AfterClass; @@ -86,7 +85,7 @@ public class FileLockTimeoutTest extends ActiveMQTestBase { try { f.get(15, TimeUnit.SECONDS); } catch (Exception e) { - IntegrationTestLogger.LOGGER.warn("aborting test because server is taking too long to start"); + instanceLog.warn("aborting test because server is taking too long to start"); } service.shutdown(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java index 6950ae87ea..2f233a4465 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/LVQTest.java @@ -114,7 +114,7 @@ public class LVQTest extends ActiveMQTestBase { producer.send(m1); clientSessionTxReceives.start(); for (int i = 0; i < 10; i++) { - System.out.println("#Deliver " + i); + instanceLog.debug("#Deliver " + i); ClientMessage m = consumer.receive(5000); Assert.assertNotNull(m); m.acknowledge(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java index 350c04c8cc..648339ba90 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PredefinedQueueTest.java @@ -33,7 +33,6 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.postoffice.Bindings; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Before; @@ -41,8 +40,6 @@ import org.junit.Test; public class PredefinedQueueTest extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private Configuration configuration = null; @Override @@ -304,7 +301,7 @@ public class PredefinedQueueTest extends ActiveMQTestBase { final int numMessages = 1; - PredefinedQueueTest.log.info("sending messages"); + instanceLog.debug("sending messages"); for (int i = 0; i < numMessages; i++) { ClientMessage message = session.createMessage(true); @@ -316,7 +313,7 @@ public class PredefinedQueueTest extends ActiveMQTestBase { session.close(); - PredefinedQueueTest.log.info("stopping"); + instanceLog.debug("stopping"); sf.close(); @@ -377,7 +374,7 @@ public class PredefinedQueueTest extends ActiveMQTestBase { final int numMessages = 1; - PredefinedQueueTest.log.info("sending messages"); + instanceLog.debug("sending messages"); for (int i = 0; i < numMessages; i++) { ClientMessage message = session.createMessage(true); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressFailoverTest.java index 90bea96467..b0f7df2398 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressFailoverTest.java @@ -31,7 +31,6 @@ import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.failover.FailoverTestBase; import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils; import org.junit.Before; @@ -39,8 +38,6 @@ import org.junit.Test; public class RetroactiveAddressFailoverTest extends FailoverTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected ServerLocator locator; protected ClientSessionFactoryInternal sf; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java index ebbef7dc32..4a6c78da98 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java @@ -32,16 +32,18 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.Wait; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class ScaleDown3NodeTest extends ClusterTestBase { + private static final Logger log = Logger.getLogger(ScaleDown3NodeTest.class); + @Override @Before public void setUp() throws Exception { @@ -72,11 +74,11 @@ public class ScaleDown3NodeTest extends ClusterTestBase { setupSessionFactory(0, isNetty(), false, servers[0].getConfiguration().getClusterUser(), servers[0].getConfiguration().getClusterPassword()); setupSessionFactory(1, isNetty(), false, servers[1].getConfiguration().getClusterUser(), servers[1].getConfiguration().getClusterPassword()); setupSessionFactory(2, isNetty(), false, servers[2].getConfiguration().getClusterUser(), servers[2].getConfiguration().getClusterPassword()); - IntegrationTestLogger.LOGGER.info("==============================="); - IntegrationTestLogger.LOGGER.info("Node 0: " + servers[0].getClusterManager().getNodeId()); - IntegrationTestLogger.LOGGER.info("Node 1: " + servers[1].getClusterManager().getNodeId()); - IntegrationTestLogger.LOGGER.info("Node 2: " + servers[2].getClusterManager().getNodeId()); - IntegrationTestLogger.LOGGER.info("==============================="); + log.debug("==============================="); + log.debug("Node 0: " + servers[0].getClusterManager().getNodeId()); + log.debug("Node 1: " + servers[1].getClusterManager().getNodeId()); + log.debug("Node 2: " + servers[2].getClusterManager().getNodeId()); + log.debug("==============================="); servers[0].setIdentity("Node0"); servers[1].setIdentity("Node1"); @@ -167,7 +169,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase { Assert.assertEquals(TEST_SIZE, getMessageCount(snfQueue)); // trigger scaleDown from node 0 to node 1 - IntegrationTestLogger.LOGGER.info("============ Stopping " + servers[0].getNodeID()); + log.debug("============ Stopping " + servers[0].getNodeID()); removeConsumer(0); servers[0].stop(); @@ -192,7 +194,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase { Assert.assertEquals(ActiveMQTestBase.getSamplebyte(j), clientMessage.getBodyBuffer().readByte()); } } - IntegrationTestLogger.LOGGER.info("Received: " + clientMessage); + log.debug("Received: " + clientMessage); clientMessage.acknowledge(); } @@ -259,7 +261,7 @@ public class ScaleDown3NodeTest extends ClusterTestBase { Wait.assertEquals(TEST_SIZE * 2, snfQueue::getMessageCount); // trigger scaleDown from node 0 to node 1 - IntegrationTestLogger.LOGGER.info("============ Stopping " + servers[0].getNodeID()); + log.debug("============ Stopping " + servers[0].getNodeID()); removeConsumer(0); removeConsumer(1); servers[0].stop(); @@ -280,12 +282,12 @@ public class ScaleDown3NodeTest extends ClusterTestBase { for (int i = 0; i < TEST_SIZE; i++) { ClientMessage clientMessage = consumers[0].getConsumer().receive(1000); Assert.assertNotNull(clientMessage); - IntegrationTestLogger.LOGGER.info("Received: " + clientMessage); + log.debug("Received: " + clientMessage); clientMessage.acknowledge(); clientMessage = consumers[1].getConsumer().receive(1000); Assert.assertNotNull(clientMessage); - IntegrationTestLogger.LOGGER.info("Received: " + clientMessage); + log.debug("Received: " + clientMessage); clientMessage.acknowledge(); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java index 4fac38ab7b..473a8036d4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java @@ -148,8 +148,6 @@ public class ScaleDownDirectTest extends ClusterTestBase { messageCheckNull = consumer2.receiveImmediate(); - System.out.println("Received " + messageCheckNull); - assertNull(messageCheckNull); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownRemoveSFTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownRemoveSFTest.java index e220a8ffb9..c3cae96e1d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownRemoveSFTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownRemoveSFTest.java @@ -102,7 +102,7 @@ public class ScaleDownRemoveSFTest extends ClusterTestBase { ClusterConnectionImpl clusterconn1 = (ClusterConnectionImpl) servers[1].getClusterManager().getClusterConnection("cluster0"); SimpleString sfQueueName = clusterconn1.getSfQueueName(servers[0].getNodeID().toString()); - System.out.println("[sf queue on server 1]: " + sfQueueName); + instanceLog.debug("[sf queue on server 1]: " + sfQueueName); Assert.assertTrue(servers[1].queueQuery(sfQueueName).isExists()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java index 27d6f8a038..131e32a2ec 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java @@ -64,8 +64,6 @@ public class SimpleStartStopTest extends ActiveMQTestBase { assertTrue("The server should cleanup after IDs on the bindings record. It left " + recordCount + " ids on the journal", recordCount.intValue() < 5); - System.out.println("RecordCount::" + recordCount); - server.start(); records = this.internalCountJournalLivingRecords(server.getConfiguration(), false); @@ -74,8 +72,6 @@ public class SimpleStartStopTest extends ActiveMQTestBase { assertNotNull(recordCount); - System.out.println("Record count with server started: " + recordCount); - assertTrue("If this is zero it means we are removing too many records", recordCount.intValue() != 0); server.stop(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java index 5fe43d9b16..ab090bf5b2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/spring/SpringIntegrationTest.java @@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Assert; import org.junit.Before; @@ -31,8 +30,6 @@ import org.springframework.jms.listener.DefaultMessageListenerContainer; public class SpringIntegrationTest extends ActiveMQTestBase { - IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - @Override @Before public void setUp() throws Exception { @@ -44,12 +41,10 @@ public class SpringIntegrationTest extends ActiveMQTestBase { @Test public void testSpring() throws Exception { - System.out.println("Creating bean factory..."); ApplicationContext context = null; try { context = new ClassPathXmlApplicationContext(new String[]{"spring-jms-beans.xml"}); MessageSender sender = (MessageSender) context.getBean("MessageSender"); - System.out.println("Sending message..."); ExampleListener.latch.countUp(); sender.send("Hello world"); ExampleListener.latch.await(10, TimeUnit.SECONDS); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java index f948350f73..7331c5138f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java @@ -43,7 +43,6 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport; import org.apache.activemq.artemis.core.server.ActiveMQServer; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec; import org.apache.activemq.artemis.utils.PasswordMaskingUtil; @@ -794,7 +793,6 @@ public class CoreClientOverOneWaySSLTest extends ActiveMQTestBase { } } - IntegrationTestLogger.LOGGER.info("Using suite: " + result); return result; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLServerTest.java index 78502ec639..d9c36b3128 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLServerTest.java @@ -95,7 +95,6 @@ public class CoreClientOverTwoWayOpenSSLServerTest extends ActiveMQTestBase { if (packet.getType() == PacketImpl.SESS_SEND) { try { if (connection.getTransportConnection() instanceof NettyConnection) { - System.out.println("Passed through...."); NettyConnection nettyConnection = (NettyConnection) connection.getTransportConnection(); SslHandler sslHandler = (SslHandler) nettyConnection.getChannel().pipeline().get("ssl"); Assert.assertNotNull(sslHandler); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLTest.java index cdb8d033f6..0da717a00f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWayOpenSSLTest.java @@ -122,7 +122,6 @@ public class CoreClientOverTwoWayOpenSSLTest extends ActiveMQTestBase { if (packet.getType() == PacketImpl.SESS_SEND) { try { if (connection.getTransportConnection() instanceof NettyConnection) { - System.out.println("Passed through...."); NettyConnection nettyConnection = (NettyConnection) connection.getTransportConnection(); SslHandler sslHandler = (SslHandler) nettyConnection.getChannel().pipeline().get("ssl"); Assert.assertNotNull(sslHandler); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java index b195f1457e..e759739fb3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverTwoWaySSLTest.java @@ -126,7 +126,6 @@ public class CoreClientOverTwoWaySSLTest extends ActiveMQTestBase { if (packet.getType() == PacketImpl.SESS_SEND) { try { if (connection.getTransportConnection() instanceof NettyConnection) { - System.out.println("Passed through...."); NettyConnection nettyConnection = (NettyConnection) connection.getTransportConnection(); SslHandler sslHandler = (SslHandler) nettyConnection.getChannel().pipeline().get("ssl"); Assert.assertNotNull(sslHandler); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTest.java index a6349f2790..6b3d996de1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTest.java @@ -50,7 +50,6 @@ public class SSLProviderTest extends SSLTestBase { @Test public void testProviderLoading() throws Exception { if (!isOpenSSLSupported()) { - System.out.println("*** Skip test on un-supported platform."); return; } @@ -64,7 +63,6 @@ public class SSLProviderTest extends SSLTestBase { uri.append("&").append(TransportConstants.TRUSTSTORE_PATH_PROP_NAME).append("=").append(CLIENT_SIDE_TRUSTSTORE); uri.append("&").append(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME).append("=").append(PASSWORD); - System.out.println("uri: " + uri.toString()); ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocator(uri.toString())); ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator)); ClientSession session = addClientSession(sf.createSession(false, true, true)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTwoWayTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTwoWayTest.java index 6eb8b4a19e..85836cb18a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTwoWayTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLProviderTwoWayTest.java @@ -28,6 +28,7 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptor; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.junit.Assert; +import org.junit.Assume; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -62,10 +63,7 @@ public class SSLProviderTwoWayTest extends SSLTestBase { @Test public void testProviderLoading2Way() throws Exception { - if (!isOpenSSLSupported()) { - System.out.println("*** Skip test on un-supported platform."); - return; - } + Assume.assumeTrue(isOpenSSLSupported()); final String text = "Hello SSL!"; StringBuilder uri = new StringBuilder("tcp://" + tc.getParams().get(TransportConstants.HOST_PROP_NAME).toString() @@ -80,7 +78,6 @@ public class SSLProviderTwoWayTest extends SSLTestBase { uri.append("&").append(TransportConstants.TRUSTSTORE_PATH_PROP_NAME).append("=").append(CLIENT_SIDE_TRUSTSTORE); uri.append("&").append(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME).append("=").append(PASSWORD); - System.out.println("uri: " + uri.toString()); ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocator(uri.toString())); ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator)); ClientSession session = addClientSession(sf.createSession(false, true, true)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLTestBase.java index 92281e50b0..75ec9f8275 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/SSLTestBase.java @@ -83,7 +83,6 @@ public abstract class SSLTestBase extends ActiveMQTestBase { } protected void configureSSLParameters(Map params) { - System.out.println("*** Configure server SSL using provider: " + sslProvider); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); params.put(TransportConstants.SSL_PROVIDER, sslProvider); params.put(TransportConstants.KEYSTORE_PROVIDER_PROP_NAME, "JKS"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/FQQNStompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/FQQNStompTest.java index 348ffbf900..699b0b403a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/FQQNStompTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/FQQNStompTest.java @@ -53,7 +53,6 @@ public class FQQNStompTest extends StompTestBase { conn = StompClientConnectionFactory.createClientConnection(uri); QueueQueryResult result = server.queueQuery(new SimpleString(getQueueName())); assertTrue(result.isExists()); - System.out.println("address: " + result.getAddress() + " queue " + result.getName()); } @Override @@ -84,7 +83,7 @@ public class FQQNStompTest extends StompTestBase { ClientStompFrame frame = conn.receiveFrame(2000); assertNotNull(frame); assertEquals("Hello World!", frame.getBody()); - System.out.println("frame: " + frame); + instanceLog.debug("frame: " + frame); unsubscribe(conn, "sub-01"); } @@ -185,7 +184,7 @@ public class FQQNStompTest extends StompTestBase { ClientStompFrame frame = conn.receiveFrame(2000); assertNotNull(frame); assertEquals("Hello World!", frame.getBody()); - System.out.println("frame: " + frame); + instanceLog.debug("frame: " + frame); unsubscribe(conn, "sub-01"); //queue:: diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java index f5656f5faf..4251a6b44e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompPropertiesInterceptorTest.java @@ -63,7 +63,6 @@ public class StompPropertiesInterceptorTest extends StompTestBase { if (stompFrame.getCommand().equals("CONNECT") || stompFrame.getCommand().equals("CONNECTED")) { return true; } - System.out.println("Checking properties in interceptor"); assertNotNull(stompFrame); assertEquals(stompFrame.getHeader(MY_HEADER), expectedProperties.get(MY_HEADER)); assertEquals(stompFrame.getBody(), expectedProperties.get(MESSAGE_TEXT)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java index b5c53b7596..9a2786cbc2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTest.java @@ -824,11 +824,11 @@ public class StompTest extends StompTestBase { subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO); String text = "A" + "\u00ea" + "\u00f1" + "\u00fc" + "C"; - log.info(text); + log.debug(text); sendJmsMessage(text); ClientStompFrame frame = conn.receiveFrame(10000); - log.info(frame); + log.debug(frame); Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); Assert.assertEquals(getQueuePrefix() + getQueueName(), frame.getHeader(Stomp.Headers.Message.DESTINATION)); Assert.assertEquals(text, frame.getBody()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java index 741d88513f..27bfc00bba 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestBase.java @@ -50,12 +50,12 @@ import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.stomp.util.AbstractStompClientConnection; import org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnection; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.RetryRule; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -65,6 +65,8 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public abstract class StompTestBase extends ActiveMQTestBase { + private static final Logger log = Logger.getLogger(StompTestBase.class); + @Parameterized.Parameter public String scheme; @@ -608,7 +610,7 @@ public abstract class StompTestBase extends ActiveMQTestBase { assertEquals(uuid, frame.getHeader(Stomp.Headers.Response.RECEIPT_ID)); } - IntegrationTestLogger.LOGGER.info("Received: " + frame); + log.debug("Received: " + frame); return frame; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestMultiThreaded.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestMultiThreaded.java index 3b71ec22dc..00a3426acc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestMultiThreaded.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompTestMultiThreaded.java @@ -22,7 +22,6 @@ import java.util.UUID; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.protocol.stomp.Stomp; 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.util.StompClientConnection; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnectionFactory; import org.junit.Assert; @@ -33,7 +32,6 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class StompTestMultiThreaded extends StompTestBase { - private static final transient IntegrationTestLogger log = IntegrationTestLogger.LOGGER; private static final SimpleString QUEUE = new SimpleString("x"); class SomeConsumer extends Thread { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithLargeMessagesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithLargeMessagesTest.java index 4fdc5295a4..1f89e54b9e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithLargeMessagesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithLargeMessagesTest.java @@ -86,12 +86,10 @@ public class StompWithLargeMessagesTest extends StompTestBase { subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO, null, null, address, true); // Send Large Message - System.out.println("Sending Message Size: " + largeMessageStringSize); send(conn, address, null, payload); // Receive STOMP Message ClientStompFrame frame = conn.receiveFrame(); - System.out.println(frame.getBody().length()); assertTrue(frame.getBody().equals(payload)); } finally { conn.disconnect(); @@ -129,7 +127,6 @@ public class StompWithLargeMessagesTest extends StompTestBase { for (int i = 0; i < count; i++) { ClientStompFrame frame = conn.receiveFrame(60000); Assert.assertNotNull(frame); - System.out.println("part of frame: " + frame.getBody().substring(0, 200)); Assert.assertTrue(frame.getCommand().equals("MESSAGE")); Assert.assertTrue(frame.getHeader("destination").equals(getQueuePrefix() + getQueueName())); int index = frame.getBody().indexOf("AAAA"); @@ -173,7 +170,6 @@ public class StompWithLargeMessagesTest extends StompTestBase { for (int i = 0; i < count; i++) { ClientStompFrame frame = conn.receiveFrame(60000); Assert.assertNotNull(frame); - System.out.println("part of frame: " + frame.getBody().substring(0, 200)); Assert.assertTrue(frame.getCommand().equals("MESSAGE")); Assert.assertTrue(frame.getHeader("destination").equals(getQueuePrefix() + getQueueName())); int index = frame.getBody().indexOf("BBB"); @@ -311,7 +307,6 @@ public class StompWithLargeMessagesTest extends StompTestBase { for (int i = 0; i < count; i++) { ClientStompFrame receiveFrame = conn.receiveFrame(30000); Assert.assertNotNull(receiveFrame); - System.out.println("part of frame: " + receiveFrame.getBody().substring(0, 250)); Assert.assertTrue(receiveFrame.getCommand().equals("MESSAGE")); Assert.assertEquals(receiveFrame.getHeader("destination"), getQueuePrefix() + getQueueName()); int index = receiveFrame.getBody().indexOf(leadingPart); @@ -449,8 +444,8 @@ public class StompWithLargeMessagesTest extends StompTestBase { for (int i = 0; i < count; i++) { ClientStompFrame frame = conn.receiveFrame(60000); Assert.assertNotNull(frame); - System.out.println(frame.toString()); - System.out.println("part of frame: " + frame.getBody().substring(0, 250)); + instanceLog.debug(frame.toString()); + instanceLog.debug("part of frame: " + frame.getBody().substring(0, 250)); Assert.assertTrue(frame.getCommand().equals("MESSAGE")); Assert.assertTrue(frame.getHeader("destination").equals(getQueuePrefix() + getQueueName())); int index = frame.getBody().toString().indexOf(leadingPart); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/AbstractStompClientConnection.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/AbstractStompClientConnection.java index f64263f567..cee7bf4f43 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/AbstractStompClientConnection.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/AbstractStompClientConnection.java @@ -30,7 +30,6 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelFuture; import org.apache.activemq.artemis.core.protocol.stomp.Stomp; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet; import org.apache.activemq.transport.netty.NettyTransport; @@ -131,7 +130,6 @@ public abstract class AbstractStompClientConnection implements StompClientConnec private ClientStompFrame sendFrameInternal(ClientStompFrame frame, boolean wicked) throws IOException, InterruptedException { ClientStompFrame response = null; - IntegrationTestLogger.LOGGER.trace("Sending " + (wicked ? "*wicked* " : "") + "frame:\n" + frame); ByteBuffer buffer; if (wicked) { buffer = frame.toByteBufferWithExtra("\n"); @@ -165,8 +163,6 @@ public abstract class AbstractStompClientConnection implements StompClientConnec } } - IntegrationTestLogger.LOGGER.trace("Received:\n" + response); - return response; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java index 714840300e..4c74155884 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompClientConnectionV10.java @@ -20,10 +20,11 @@ import java.io.IOException; import java.net.URI; import org.apache.activemq.artemis.core.protocol.stomp.Stomp; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; +import org.jboss.logging.Logger; public class StompClientConnectionV10 extends AbstractStompClientConnection { + private static final Logger log = Logger.getLogger(StompClientConnectionV10.class); public StompClientConnectionV10(String host, int port) throws IOException { super("1.0", host, port); @@ -61,7 +62,7 @@ public class StompClientConnectionV10 extends AbstractStompClientConnection { if (response.getCommand().equals(Stomp.Responses.CONNECTED)) { connected = true; } else { - IntegrationTestLogger.LOGGER.warn("Connection failed with: " + response); + log.warn("Connection failed with: " + response); connected = false; } return response; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/ExtraStompTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/ExtraStompTest.java index 995be3708a..2a78cd3068 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/ExtraStompTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/ExtraStompTest.java @@ -198,10 +198,10 @@ public class ExtraStompTest extends StompTestBase { // receive but don't ack frame = conn.receiveFrame(10000); - System.out.println(frame); + instanceLog.debug(frame); frame = conn.receiveFrame(10000); - System.out.println(frame); + instanceLog.debug(frame); unsubscribe(conn, "a-sub"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java index 5605f0aa2e..7f08894469 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java @@ -41,7 +41,6 @@ import org.apache.activemq.artemis.core.protocol.stomp.v11.StompFrameHandlerV11; import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.stomp.StompTestBase; import org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnection; @@ -60,8 +59,6 @@ import org.junit.runners.Parameterized; */ @RunWith(Parameterized.class) public class StompV11Test extends StompTestBase { - - private static final transient IntegrationTestLogger log = IntegrationTestLogger.LOGGER; public static final String CLIENT_ID = "myclientid"; private StompClientConnection conn; @@ -86,7 +83,6 @@ public class StompV11Test extends StompTestBase { public void tearDown() throws Exception { try { boolean connected = conn != null && conn.isConnected(); - log.debug("Connection 1.1 : " + connected); if (connected) { conn.disconnect(); } @@ -234,7 +230,7 @@ public class StompV11Test extends StompTestBase { assertEquals(Stomp.Responses.ERROR, reply.getCommand()); - IntegrationTestLogger.LOGGER.info("Got error frame " + reply); + instanceLog.debug("Got error frame " + reply); } @@ -285,7 +281,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame frame = newConn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("received " + frame); + instanceLog.debug("received " + frame); assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); @@ -299,7 +295,7 @@ public class StompV11Test extends StompTestBase { frame = newConn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("received " + frame); + instanceLog.debug("received " + frame); unsubscribe(newConn, "a-sub"); @@ -319,7 +315,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame frame = newConn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("received " + frame); + instanceLog.debug("received " + frame); assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); @@ -354,7 +350,7 @@ public class StompV11Test extends StompTestBase { frame = newConn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("received " + frame); + instanceLog.debug("received " + frame); assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); @@ -381,7 +377,7 @@ public class StompV11Test extends StompTestBase { .addHeader(Stomp.Headers.CONTENT_LENGTH, cLen) .addHeader(hKey, hVal); - IntegrationTestLogger.LOGGER.info("key: |" + hKey + "| val: |" + hVal + "|"); + instanceLog.debug("key: |" + hKey + "| val: |" + hVal + "|"); frame.setBody(body); @@ -395,7 +391,7 @@ public class StompV11Test extends StompTestBase { frame = newConn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("received " + frame); + instanceLog.debug("received " + frame); assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); @@ -428,7 +424,7 @@ public class StompV11Test extends StompTestBase { String hVal = "is\\ttab"; frame.addHeader(hKey, hVal); - System.out.println("key: |" + hKey + "| val: |" + hVal + "|"); + instanceLog.debug("key: |" + hKey + "| val: |" + hVal + "|"); frame.setBody(body); @@ -436,7 +432,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - System.out.println("received " + error); + instanceLog.debug("received " + error); String desc = "Should have received an ERROR for undefined escape sequence"; Assert.assertNotNull(desc, error); @@ -523,7 +519,7 @@ public class StompV11Test extends StompTestBase { assertEquals("0,500", reply.getHeader(Stomp.Headers.Connect.HEART_BEAT)); - IntegrationTestLogger.LOGGER.info("========== start pinger!"); + instanceLog.debug("========== start pinger!"); conn.startPinger(500); @@ -572,7 +568,7 @@ public class StompV11Test extends StompTestBase { assertEquals("1000,500", reply.getHeader(Stomp.Headers.Connect.HEART_BEAT)); - IntegrationTestLogger.LOGGER.info("========== start pinger!"); + instanceLog.debug("========== start pinger!"); conn.startPinger(500); @@ -581,7 +577,7 @@ public class StompV11Test extends StompTestBase { //now check the frame size int size = conn.getServerPingNumber(); - IntegrationTestLogger.LOGGER.info("ping received: " + size); + instanceLog.debug("ping received: " + size); assertTrue(size > 5); @@ -788,7 +784,7 @@ public class StompV11Test extends StompTestBase { reply = connection.sendFrame(frame); - IntegrationTestLogger.LOGGER.info("Reply: " + reply); + instanceLog.debug("Reply: " + reply); assertEquals(Stomp.Responses.CONNECTED, reply.getCommand()); @@ -850,7 +846,7 @@ public class StompV11Test extends StompTestBase { assertEquals("0,2500", reply.getHeader(Stomp.Headers.Connect.HEART_BEAT)); - IntegrationTestLogger.LOGGER.info("========== start pinger!"); + instanceLog.debug("========== start pinger!"); connection.startPinger(2500); @@ -985,7 +981,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); unsubscribe(conn, "sub1"); @@ -1013,7 +1009,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); unsubscribe(conn, "sub1"); @@ -1065,7 +1061,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); unsubscribe(conn, "sub1"); @@ -1093,7 +1089,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - IntegrationTestLogger.LOGGER.info("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); unsubscribe(conn, "sub1"); @@ -1125,7 +1121,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame error = conn.sendFrame(ackFrame); - IntegrationTestLogger.LOGGER.info("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); assertEquals(Stomp.Responses.ERROR, error.getCommand()); @@ -1161,7 +1157,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame error = conn.sendFrame(ackFrame); - IntegrationTestLogger.LOGGER.info("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); assertEquals(Stomp.Responses.ERROR, error.getCommand()); @@ -1293,7 +1289,7 @@ public class StompV11Test extends StompTestBase { frame = conn.receiveFrame(); assertNotNull(frame); - IntegrationTestLogger.LOGGER.info(i + " == received: " + frame); + instanceLog.debug(i + " == received: " + frame); //ack on even numbers if (i % 2 == 0) { ack(conn, "sub1", frame); @@ -1311,7 +1307,7 @@ public class StompV11Test extends StompTestBase { for (int i = 0; i < num / 2; i++) { message = (TextMessage) consumer.receive(1000); Assert.assertNotNull(message); - IntegrationTestLogger.LOGGER.info("Legal: " + message.getText()); + instanceLog.debug("Legal: " + message.getText()); } message = (TextMessage) consumer.receive(1000); @@ -1335,13 +1331,13 @@ public class StompV11Test extends StompTestBase { // receive message from socket ClientStompFrame frame = conn.receiveFrame(5000); - IntegrationTestLogger.LOGGER.info("received frame : " + frame); + instanceLog.debug("received frame : " + frame); assertEquals("Hello World", frame.getBody()); assertEquals("sub1", frame.getHeader(Stomp.Headers.Message.SUBSCRIPTION)); frame = newConn.receiveFrame(5000); - IntegrationTestLogger.LOGGER.info("received 2 frame : " + frame); + instanceLog.debug("received 2 frame : " + frame); assertEquals("Hello World", frame.getBody()); assertEquals("sub2", frame.getHeader(Stomp.Headers.Message.SUBSCRIPTION)); @@ -1394,11 +1390,11 @@ public class StompV11Test extends StompTestBase { subscribe(conn, getName(), Stomp.Headers.Subscribe.AckModeValues.AUTO); String text = "A" + "\u00ea" + "\u00f1" + "\u00fc" + "C"; - IntegrationTestLogger.LOGGER.info(text); + instanceLog.debug(text); sendJmsMessage(text); ClientStompFrame frame = conn.receiveFrame(); - IntegrationTestLogger.LOGGER.info(frame); + instanceLog.debug(frame); Assert.assertTrue(frame.getCommand().equals(Stomp.Responses.MESSAGE)); Assert.assertNotNull(frame.getHeader(Stomp.Headers.Message.DESTINATION)); Assert.assertTrue(frame.getBody().equals(text)); @@ -1965,7 +1961,7 @@ public class StompV11Test extends StompTestBase { assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); - IntegrationTestLogger.LOGGER.info("Message: " + frame); + instanceLog.debug("Message: " + frame); assertEquals("5", frame.getHeader(Stomp.Headers.CONTENT_LENGTH)); @@ -2208,7 +2204,7 @@ public class StompV11Test extends StompTestBase { assertEquals("500,500", reply.getHeader("heart-beat")); - System.out.println("========== start pinger!"); + instanceLog.debug("========== start pinger!"); conn.startPinger(100); @@ -2243,7 +2239,7 @@ public class StompV11Test extends StompTestBase { ClientStompFrame reply = conn.sendFrame(frame); - System.out.println("Reply: " + reply.toString()); + instanceLog.debug("Reply: " + reply.toString()); assertEquals("CONNECTED", reply.getCommand()); @@ -2260,7 +2256,7 @@ public class StompV11Test extends StompTestBase { StompFrameHandlerV11 stompFrameHandler = (StompFrameHandlerV11) stompConnection.getStompVersionHandler(); - System.out.println("========== start pinger!"); + instanceLog.debug("========== start pinger!"); conn.startPinger(100); @@ -2275,7 +2271,7 @@ public class StompV11Test extends StompTestBase { f = conn.sendFrame(subFrame); f = conn.receiveFrame(1000); - System.out.println("Received " + f.toString()); + instanceLog.debug("Received " + f.toString()); Assert.assertTrue(f.getCommand().equals("ERROR")); conn.stopPinger(); @@ -2302,7 +2298,7 @@ public class StompV11Test extends StompTestBase { Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); - log.info("Reconnecting!"); + instanceLog.info("Reconnecting!"); if (sendDisconnect) { conn.disconnect(); 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 e50f40505d..da1fc5398a 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 @@ -39,13 +39,13 @@ 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.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.stomp.StompTestBase; import org.apache.activemq.artemis.tests.integration.stomp.util.ClientStompFrame; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnection; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnectionFactory; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnectionV11; import org.apache.activemq.artemis.tests.integration.stomp.util.StompClientConnectionV12; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -59,7 +59,8 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class StompV12Test extends StompTestBase { - private static final transient IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(StompV12Test.class); + public static final String CLIENT_ID = "myclientid"; private StompClientConnectionV12 conn; @@ -262,7 +263,7 @@ public class StompV12Test extends StompTestBase { conn.disconnect(); - System.out.println("Got error frame " + reply); + instanceLog.debug("Got error frame " + reply); } @@ -283,7 +284,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame frame = newConn.receiveFrame(); - System.out.println("received " + frame); + instanceLog.debug("received " + frame); Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); @@ -298,7 +299,7 @@ public class StompV12Test extends StompTestBase { frame = newConn.receiveFrame(); - System.out.println("received " + frame); + instanceLog.debug("received " + frame); //unsub unsubscribe(newConn, "a-sub"); @@ -319,7 +320,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame frame = newConn.receiveFrame(); - System.out.println("received " + frame); + instanceLog.debug("received " + frame); Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); @@ -417,7 +418,7 @@ public class StompV12Test extends StompTestBase { Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); Assert.assertEquals(body, frame.getBody()); - System.out.println("received: " + frame); + instanceLog.debug("received: " + frame); Assert.assertEquals("value1", frame.getHeader("foo")); //unsub @@ -475,7 +476,7 @@ public class StompV12Test extends StompTestBase { Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); Assert.assertEquals(body, frame.getBody()); - System.out.println("received: " + frame); + instanceLog.debug("received: " + frame); Assert.assertEquals(null, frame.getHeader("header1")); Assert.assertEquals("value1 ", frame.getHeader(" header1")); Assert.assertEquals("value2 ", frame.getHeader(" header2")); @@ -508,7 +509,7 @@ public class StompV12Test extends StompTestBase { .addHeader(hKey, hVal) .setBody(body); - System.out.println("key: |" + hKey + "| val: |" + hVal + "|"); + instanceLog.debug("key: |" + hKey + "| val: |" + hVal + "|"); conn.sendFrame(frame); @@ -520,7 +521,7 @@ public class StompV12Test extends StompTestBase { frame = newConn.receiveFrame(); - System.out.println("received " + frame); + instanceLog.debug("received " + frame); Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); @@ -552,7 +553,7 @@ public class StompV12Test extends StompTestBase { String hVal = "is\\ttab"; frame.addHeader(hKey, hVal); - System.out.println("key: |" + hKey + "| val: |" + hVal + "|"); + instanceLog.debug("key: |" + hKey + "| val: |" + hVal + "|"); frame.setBody(body); @@ -560,7 +561,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - System.out.println("received " + error); + instanceLog.debug("received " + error); String desc = "Should have received an ERROR for undefined escape sequence"; Assert.assertNotNull(desc, error); @@ -703,7 +704,7 @@ public class StompV12Test extends StompTestBase { //now check the frame size int size = conn.getServerPingNumber(); - System.out.println("ping received: " + size); + instanceLog.debug("ping received: " + size); Assert.assertTrue("size: " + size, size > 5); @@ -932,7 +933,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - System.out.println("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); waitDisconnect(conn); Assert.assertFalse("Should be disconnected in STOMP 1.2 after ERROR", conn.isConnected()); @@ -1016,7 +1017,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame error = conn.receiveFrame(); - System.out.println("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); waitDisconnect(conn); Assert.assertFalse("Should be disconnected in STOMP 1.2 after ERROR", conn.isConnected()); @@ -1047,7 +1048,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame error = conn.sendFrame(ackFrame); - System.out.println("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); Assert.assertEquals(Stomp.Responses.ERROR, error.getCommand()); @@ -1082,7 +1083,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame error = conn.sendFrame(ackFrame); - System.out.println("Receiver error: " + error); + instanceLog.debug("Receiver error: " + error); Assert.assertEquals(Stomp.Responses.ERROR, error.getCommand()); @@ -1250,7 +1251,7 @@ public class StompV12Test extends StompTestBase { frame = conn.receiveFrame(); Assert.assertNotNull(frame); - System.out.println(i + " == received: " + frame); + instanceLog.debug(i + " == received: " + frame); //ack on even numbers if (i % 2 == 0) { ack(conn, frame); @@ -1268,7 +1269,7 @@ public class StompV12Test extends StompTestBase { for (int i = 0; i < num / 2; i++) { message = (TextMessage) consumer.receive(1000); Assert.assertNotNull(message); - System.out.println("Legal: " + message.getText()); + instanceLog.debug("Legal: " + message.getText()); } message = (TextMessage) consumer.receiveNoWait(); @@ -1292,13 +1293,13 @@ public class StompV12Test extends StompTestBase { // receive message from socket ClientStompFrame frame = conn.receiveFrame(1000); - System.out.println("received frame : " + frame); + instanceLog.debug("received frame : " + frame); Assert.assertEquals("Hello World", frame.getBody()); Assert.assertEquals("sub1", frame.getHeader(Stomp.Headers.Message.SUBSCRIPTION)); frame = newConn.receiveFrame(1000); - System.out.println("received 2 frame : " + frame); + instanceLog.debug("received 2 frame : " + frame); Assert.assertEquals("Hello World", frame.getBody()); Assert.assertEquals("sub2", frame.getHeader(Stomp.Headers.Message.SUBSCRIPTION)); @@ -1351,11 +1352,11 @@ public class StompV12Test extends StompTestBase { subscribe(conn, getName(), Stomp.Headers.Subscribe.AckModeValues.AUTO); String text = "A" + "\u00ea" + "\u00f1" + "\u00fc" + "C"; - System.out.println(text); + instanceLog.debug(text); sendJmsMessage(text); ClientStompFrame frame = conn.receiveFrame(); - System.out.println(frame); + instanceLog.debug(frame); Assert.assertTrue(frame.getCommand().equals(Stomp.Responses.MESSAGE)); Assert.assertNotNull(frame.getHeader(Stomp.Headers.Subscribe.DESTINATION)); Assert.assertTrue(frame.getBody().equals(text)); @@ -1706,7 +1707,7 @@ public class StompV12Test extends StompTestBase { TextMessage m = (TextMessage) arg0; latch.countDown(); try { - System.out.println("___> latch now: " + latch.getCount() + " m: " + m.getText()); + instanceLog.debug("___> latch now: " + latch.getCount() + " m: " + m.getText()); } catch (JMSException e) { Assert.fail("here failed"); e.printStackTrace(); @@ -1997,7 +1998,7 @@ public class StompV12Test extends StompTestBase { Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); - System.out.println("Message: " + frame); + instanceLog.debug("Message: " + frame); Assert.assertEquals("5", frame.getHeader(Stomp.Headers.CONTENT_LENGTH)); @@ -2277,7 +2278,7 @@ public class StompV12Test extends StompTestBase { Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); - log.info("Reconnecting!"); + log.debug("Reconnecting!"); if (sendDisconnect) { conn.disconnect(); @@ -2353,7 +2354,7 @@ public class StompV12Test extends StompTestBase { ClientStompFrame frame = conn.receiveFrame(); - System.out.println("Received: " + frame); + instanceLog.debug("Received: " + frame); Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); Assert.assertEquals("ID:MYMACHINE-50616-635482262727823605-1:1:1:1", frame.getHeader(Stomp.Headers.Message.SUBSCRIPTION)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java index e7cc82ea28..19c2054911 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaRecoveryTest.java @@ -41,10 +41,10 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.core.transaction.impl.XidImpl; import org.apache.activemq.artemis.jms.client.ActiveMQBytesMessage; import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.UUIDGenerator; +import org.jboss.logging.Logger; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -55,7 +55,7 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class BasicXaRecoveryTest extends ActiveMQTestBase { - private static IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(BasicXaRecoveryTest.class); private final Map addressSettings = new HashMap<>(); @@ -282,7 +282,7 @@ public class BasicXaRecoveryTest extends ActiveMQTestBase { clientSession.end(xid, XAResource.TMSUCCESS); clientSession.prepare(xid); - BasicXaRecoveryTest.log.info("*** stopping and restarting"); + log.debug("*** stopping and restarting"); if (restartServer) { stopAndRestartServer(); @@ -519,7 +519,7 @@ public class BasicXaRecoveryTest extends ActiveMQTestBase { clientSession.end(xid, XAResource.TMSUCCESS); clientSession.prepare(xid); - BasicXaRecoveryTest.log.info("shutting down server"); + log.debug("shutting down server"); if (stopServer) { stopAndRestartServer(); @@ -527,7 +527,7 @@ public class BasicXaRecoveryTest extends ActiveMQTestBase { recreateClients(); } - BasicXaRecoveryTest.log.info("restarted"); + log.debug("restarted"); Xid[] xids = clientSession.recover(XAResource.TMSTARTRSCAN); @@ -944,7 +944,7 @@ public class BasicXaRecoveryTest extends ActiveMQTestBase { clientSession.end(xid, XAResource.TMSUCCESS); clientSession.prepare(xid); - BasicXaRecoveryTest.log.info("stopping and restarting"); + log.debug("stopping and restarting"); if (stopServer) { stopAndRestartServer(); @@ -952,7 +952,7 @@ public class BasicXaRecoveryTest extends ActiveMQTestBase { recreateClients(); } - BasicXaRecoveryTest.log.info("Restarted"); + log.debug("Restarted"); Xid[] xids = clientSession.recover(XAResource.TMSTARTRSCAN); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java index 6b025e5095..a545439444 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java @@ -45,10 +45,10 @@ import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.core.transaction.impl.XidImpl; import org.apache.activemq.artemis.ra.ActiveMQRAXAResource; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.UUIDGenerator; import org.apache.activemq.artemis.utils.Wait; +import org.jboss.logging.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -58,7 +58,7 @@ import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class BasicXaTest extends ActiveMQTestBase { - private static IntegrationTestLogger log = IntegrationTestLogger.LOGGER; + private static final Logger log = Logger.getLogger(BasicXaTest.class); private final Map addressSettings = new HashMap<>(); @@ -303,7 +303,7 @@ public class BasicXaTest extends ActiveMQTestBase { clientSession = sessionFactory.createSession(true, false, false); - log.info("committing"); + log.debug("committing"); clientSession.commit(xid, false); clientSession.start(); @@ -667,7 +667,7 @@ public class BasicXaTest extends ActiveMQTestBase { String[] preparedTransactions = messagingService.getActiveMQServerControl().listPreparedTransactions(); Assert.assertEquals(1, preparedTransactions.length); - System.out.println(preparedTransactions[0]); + instanceLog.debug(preparedTransactions[0]); Assert.assertTrue(messagingService.getActiveMQServerControl().commitPreparedTransaction(XidImpl.toBase64String(xid))); Assert.assertEquals(1, messagingService.getActiveMQServerControl().listHeuristicCommittedTransactions().length); @@ -685,7 +685,7 @@ public class BasicXaTest extends ActiveMQTestBase { String[] preparedTransactions = messagingService.getActiveMQServerControl().listPreparedTransactions(); Assert.assertEquals(1, preparedTransactions.length); - System.out.println(preparedTransactions[0]); + instanceLog.debug(preparedTransactions[0]); Assert.assertTrue(messagingService.getActiveMQServerControl().rollbackPreparedTransaction(XidImpl.toBase64String(xid))); Assert.assertEquals(1, messagingService.getActiveMQServerControl().listHeuristicRolledBackTransactions().length); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/SessionFailureXATest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/SessionFailureXATest.java index a80546bc0b..51041cfe6f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/SessionFailureXATest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/SessionFailureXATest.java @@ -38,7 +38,6 @@ import org.apache.activemq.artemis.core.config.StoreConfiguration; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ServerSession; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.utils.RetryRule; import org.apache.activemq.artemis.utils.Wait; @@ -55,8 +54,6 @@ public class SessionFailureXATest extends ActiveMQTestBase { @Rule public RetryRule retryRule = new RetryRule(1); - private static IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - private final Map addressSettings = new HashMap<>(); private ActiveMQServer messagingService; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java index 7e1f8a03a0..fb59a6d35b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java @@ -421,7 +421,7 @@ public class XaTimeoutTest extends ActiveMQTestBase { boolean rollback = false; if (msgCount.getAndIncrement() == 0) { rollback = true; - System.out.println("Forcing first message to time out"); + instanceLog.debug("Forcing first message to time out"); Thread.sleep(5000); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java index ac52d0266f..64d89ef52a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java @@ -36,14 +36,11 @@ import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancing import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl; import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl; -import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.unit.util.InVMNamingContext; import org.junit.Before; public class JMSClusteredTestBase extends ActiveMQTestBase { - private static final IntegrationTestLogger log = IntegrationTestLogger.LOGGER; - protected MBeanServer mBeanServer1; protected ActiveMQServer server1;