diff --git a/filter/src/test/java/org/apache/rocketmq/filter/ParserTest.java b/filter/src/test/java/org/apache/rocketmq/filter/ParserTest.java index 36ef2714fccfed4d78a36e5db96ebd0f32712568..115632faa0a6741d4b112872d15b71800451f587 100644 --- a/filter/src/test/java/org/apache/rocketmq/filter/ParserTest.java +++ b/filter/src/test/java/org/apache/rocketmq/filter/ParserTest.java @@ -84,14 +84,17 @@ public class ParserTest { @Test public void testParse_floatOverFlow() { try { - String str = "1"; - for (int i = 0; i < 2048; i++) { - str += "111111111111111111111111111111111111111111111111111"; + StringBuffer sb = new StringBuffer(210000); + sb.append("1"); + for (int i = 0; i < 2048; i ++) { + sb.append("111111111111111111111111111111111111111111111111111"); } - str += "."; - for (int i = 0; i < 2048; i++) { - str += "111111111111111111111111111111111111111111111111111"; + sb.append("."); + for (int i = 0; i < 2048; i ++) { + sb.append("111111111111111111111111111111111111111111111111111"); } + String str = sb.toString(); + SelectorParser.parse("a > " + str); diff --git a/pom.xml b/pom.xml index 6fe4f73f1b9474bcf87bfe2124d4196c5f52c7f9..72cd34963995ee8aa9fe0296eb3faa7e2260245a 100644 --- a/pom.xml +++ b/pom.xml @@ -157,7 +157,7 @@ - + true @@ -315,6 +315,7 @@ maven-surefire-plugin 2.19.1 + 1 1 true @@ -333,6 +334,7 @@ maven-failsafe-plugin 2.19.1 + 1 **/NormalMsgDelayIT.java diff --git a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java index 4fc7412b1fd99fcde81a9e2816cf06e3758870d3..1ade7c2838e0382eb8223646fd6ad31a74b77def 100644 --- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java +++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java @@ -247,7 +247,7 @@ public class DefaultMessageStore implements MessageStore { try { - Thread.sleep(1000 * 3); + Thread.sleep(1000); } catch (InterruptedException e) { log.error("shutdown Exception, ", e); } diff --git a/store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java b/store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java index b7d38f8c78f44cc308b370af515a1ce2a08cb337..7e01b8513c9adc0b6e99893170f3ba05d3a1f4b4 100644 --- a/store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java +++ b/store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java @@ -212,8 +212,6 @@ public class ConsumeQueueTest { try { try { putMsg(master); - // wait build consume queue - Thread.sleep(1000); } catch (Exception e) { e.printStackTrace(); assertThat(Boolean.FALSE).isTrue(); diff --git a/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQAsyncSendProducer.java b/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQAsyncSendProducer.java index 2f8af68b31eff537190c25825c8a0f81bae0aa5d..9907cac80083ddca1c73f5c90a278c4a324c635b 100644 --- a/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQAsyncSendProducer.java +++ b/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQAsyncSendProducer.java @@ -26,10 +26,11 @@ import org.apache.rocketmq.client.exception.MQClientException; import org.apache.rocketmq.client.producer.DefaultMQProducer; import org.apache.rocketmq.client.producer.MessageQueueSelector; import org.apache.rocketmq.client.producer.SendCallback; +import org.apache.rocketmq.client.producer.SendResult; import org.apache.rocketmq.common.message.Message; import org.apache.rocketmq.common.message.MessageQueue; import org.apache.rocketmq.test.clientinterface.AbstractMQProducer; -import org.apache.rocketmq.test.sendresult.SendResult; +import org.apache.rocketmq.test.sendresult.ResultWrapper; import org.apache.rocketmq.test.util.RandomUtil; import org.apache.rocketmq.test.util.TestUtil; @@ -39,20 +40,19 @@ public class RMQAsyncSendProducer extends AbstractMQProducer { private String nsAddr = null; private DefaultMQProducer producer = null; private SendCallback sendCallback = null; - private List successSendResult = Collections - .synchronizedList(new ArrayList()); - private AtomicInteger exceptionMsgCount = new AtomicInteger( - 0); + private List successSendResult = Collections.synchronizedList(new ArrayList()); + private AtomicInteger exceptionMsgCount = new AtomicInteger(0); private int msgSize = 0; public RMQAsyncSendProducer(String nsAddr, String topic) { super(topic); this.nsAddr = nsAddr; sendCallback = new SendCallback() { - public void onSuccess(org.apache.rocketmq.client.producer.SendResult sendResult) { + @Override + public void onSuccess(SendResult sendResult) { successSendResult.add(sendResult); } - + @Override public void onException(Throwable throwable) { exceptionMsgCount.getAndIncrement(); } @@ -66,7 +66,7 @@ public class RMQAsyncSendProducer extends AbstractMQProducer { return successSendResult.size(); } - public List getSuccessSendResult() { + public List getSuccessSendResult() { return successSendResult; } @@ -94,10 +94,12 @@ public class RMQAsyncSendProducer extends AbstractMQProducer { } } - public SendResult send(Object msg, Object arg) { + @Override + public ResultWrapper send(Object msg, Object arg) { return null; } + @Override public void shutdown() { producer.shutdown(); } diff --git a/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQNormalProducer.java b/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQNormalProducer.java index 42949339e33d1c4f24fc82bbadf54424a168c854..6bbec6cb948e2510bd321a7b15a9953c07f9fb96 100644 --- a/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQNormalProducer.java +++ b/test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQNormalProducer.java @@ -26,7 +26,7 @@ import org.apache.rocketmq.client.producer.SendStatus; import org.apache.rocketmq.common.message.Message; import org.apache.rocketmq.common.message.MessageQueue; import org.apache.rocketmq.test.clientinterface.AbstractMQProducer; -import org.apache.rocketmq.test.sendresult.SendResult; +import org.apache.rocketmq.test.sendresult.ResultWrapper; public class RMQNormalProducer extends AbstractMQProducer { private static Logger logger = Logger.getLogger(RMQNormalProducer.class); @@ -91,7 +91,7 @@ public class RMQNormalProducer extends AbstractMQProducer { } } - public SendResult send(Object msg, Object orderKey) { + public ResultWrapper send(Object msg, Object orderKey) { org.apache.rocketmq.client.producer.SendResult metaqResult = null; Message message = (Message) msg; try { @@ -132,7 +132,7 @@ public class RMQNormalProducer extends AbstractMQProducer { } } - public SendResult sendMQ(Message msg, MessageQueue mq) { + public ResultWrapper sendMQ(Message msg, MessageQueue mq) { org.apache.rocketmq.client.producer.SendResult metaqResult = null; try { long start = System.currentTimeMillis(); diff --git a/test/src/main/java/org/apache/rocketmq/test/clientinterface/AbstractMQProducer.java b/test/src/main/java/org/apache/rocketmq/test/clientinterface/AbstractMQProducer.java index 8201e6313c3e1cd29e1016084b8c90c1a8f0bc94..df6abfc662b3ad25bff885d76ce6c91b879cdc8b 100644 --- a/test/src/main/java/org/apache/rocketmq/test/clientinterface/AbstractMQProducer.java +++ b/test/src/main/java/org/apache/rocketmq/test/clientinterface/AbstractMQProducer.java @@ -21,14 +21,14 @@ import java.util.Date; import java.util.List; import org.apache.rocketmq.common.message.MessageQueue; import org.apache.rocketmq.test.client.rmq.RMQNormalProducer; -import org.apache.rocketmq.test.sendresult.SendResult; +import org.apache.rocketmq.test.sendresult.ResultWrapper; import org.apache.rocketmq.test.util.RandomUtil; import org.apache.rocketmq.test.util.TestUtil; public abstract class AbstractMQProducer extends MQCollector implements MQProducer { protected String topic = null; - protected SendResult sendResult = new SendResult(); + protected ResultWrapper sendResult = new ResultWrapper(); protected boolean startSuccess = false; protected String producerGroupName = null; protected String producerInstanceName = null; diff --git a/test/src/main/java/org/apache/rocketmq/test/clientinterface/MQProducer.java b/test/src/main/java/org/apache/rocketmq/test/clientinterface/MQProducer.java index 795457d19921ecff3b7cf5a29e61032e931d2fc3..e9ed0d3fdfc2539256d3811e2ca3bc471ce9d89f 100644 --- a/test/src/main/java/org/apache/rocketmq/test/clientinterface/MQProducer.java +++ b/test/src/main/java/org/apache/rocketmq/test/clientinterface/MQProducer.java @@ -17,10 +17,10 @@ package org.apache.rocketmq.test.clientinterface; -import org.apache.rocketmq.test.sendresult.SendResult; +import org.apache.rocketmq.test.sendresult.ResultWrapper; public interface MQProducer { - SendResult send(Object msg, Object arg); + ResultWrapper send(Object msg, Object arg); void setDebug(); diff --git a/test/src/main/java/org/apache/rocketmq/test/sendresult/SendResult.java b/test/src/main/java/org/apache/rocketmq/test/sendresult/ResultWrapper.java similarity index 98% rename from test/src/main/java/org/apache/rocketmq/test/sendresult/SendResult.java rename to test/src/main/java/org/apache/rocketmq/test/sendresult/ResultWrapper.java index d53ee7da25c1b1066f1c018fb32991d20d66904b..9fe31463e44a3b30e507e3dcec6f3f365370b1e8 100644 --- a/test/src/main/java/org/apache/rocketmq/test/sendresult/SendResult.java +++ b/test/src/main/java/org/apache/rocketmq/test/sendresult/ResultWrapper.java @@ -17,7 +17,7 @@ package org.apache.rocketmq.test.sendresult; -public class SendResult { +public class ResultWrapper { private boolean sendResult = false; private String msgId = null; private Exception sendException = null;