This is an automated email from the ASF dual-hosted git repository. robbie pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit 31cb265c89f92e548403fd7b9d1de9ad170b189c Author: Justin Bertram <[email protected]> AuthorDate: Thu Feb 6 13:06:15 2025 -0600 ARTEMIS-5294 more cases for String.repeat() --- .../activemq/artemis/tests/integration/cli/RecoverTest.java | 13 +------------ .../artemis/tests/integration/client/ConsumerTest.java | 6 +----- .../tests/smoke/bridgeTransfer/BridgeTransferingTest.java | 11 +---------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/RecoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/RecoverTest.java index 2ccf09bfd3..1d9225c2fe 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/RecoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cli/RecoverTest.java @@ -129,18 +129,7 @@ public class RecoverTest extends JMSTestBase { Session session = connection.createSession(useTX, useTX ? Session.SESSION_TRANSACTED : Session.AUTO_ACKNOWLEDGE); Queue queue = session.createQueue("TestQueue"); MessageProducer producer = session.createProducer(queue); - String messageBody; - { - StringBuilder sb = new StringBuilder(); - if (large) { - while (sb.length() < 110 * 1024) { - sb.append(" "); - } - } else { - sb.append("hello"); - } - messageBody = sb.toString(); - } + String messageBody = large ? " ".repeat(110 * 1024) : "hello"; int maxMessage = large ? 10 : 1000; for (int i = 0; i < maxMessage; i++) { producer.send(session.createTextMessage(i + messageBody)); 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 9e4918e61a..2ecdcbc79d 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 @@ -488,11 +488,7 @@ public class ConsumerTest extends ActiveMQTestBase { ConnectionFactory factorySend = createFactory(protocolSender); ConnectionFactory factoryConsume = protocolConsumer == protocolSender ? factorySend : createFactory(protocolConsumer); - StringBuilder bufferLarge = new StringBuilder(); - while (bufferLarge.length() < 100 * 1024) { - bufferLarge.append(" "); - } - final String bufferLargeContent = bufferLarge.toString(); + final String bufferLargeContent = " ".repeat(1000 * 1024); try (Connection connection = factorySend.createConnection()) { connection.start(); diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java index 271fe2db14..15db704c70 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/bridgeTransfer/BridgeTransferingTest.java @@ -123,16 +123,7 @@ public class BridgeTransferingTest extends SmokeTestBase { ConnectionFactory cf = CFUtil.createConnectionFactory(theprotocol, "tcp://localhost:61616"); ((ActiveMQConnectionFactory) cf).setMinLargeMessageSize(minlargeMessageSize); - String body; - - { - StringBuilder sb = new StringBuilder(); - while (sb.length() < messageSize) { - sb.append(" "); - } - body = sb.toString(); - } - + String body = " ".repeat(messageSize); { Connection connection = cf.createConnection(); Session session = connection.createSession(true, Session.SESSION_TRANSACTED); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information, visit: https://activemq.apache.org/contact
