Repository: incubator-rocketmq
Updated Branches:
  refs/heads/develop aa1c75774 -> 38bbb1417


[ROCKETMQ-263]Sets a small timeout value for unit tests in OpenMessaging module


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/38bbb141
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/38bbb141
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/38bbb141

Branch: refs/heads/develop
Commit: 38bbb1417bcd8bba6eee19df1afe9e6b3061db89
Parents: aa1c757
Author: yukon <yu...@apache.org>
Authored: Fri Aug 11 17:27:06 2017 +0800
Committer: yukon <yu...@apache.org>
Committed: Fri Aug 11 17:27:06 2017 +0800

----------------------------------------------------------------------
 .../rocketmq/consumer/PullConsumerImplTest.java              | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/38bbb141/openmessaging/src/test/java/io/openmessaging/rocketmq/consumer/PullConsumerImplTest.java
----------------------------------------------------------------------
diff --git 
a/openmessaging/src/test/java/io/openmessaging/rocketmq/consumer/PullConsumerImplTest.java
 
b/openmessaging/src/test/java/io/openmessaging/rocketmq/consumer/PullConsumerImplTest.java
index 277a5c6..843ddb7 100644
--- 
a/openmessaging/src/test/java/io/openmessaging/rocketmq/consumer/PullConsumerImplTest.java
+++ 
b/openmessaging/src/test/java/io/openmessaging/rocketmq/consumer/PullConsumerImplTest.java
@@ -46,13 +46,13 @@ public class PullConsumerImplTest {
 
     @Mock
     private DefaultMQPullConsumer rocketmqPullConsumer;
-    private LocalMessageCache localMessageCache =
-        spy(new LocalMessageCache(rocketmqPullConsumer, new ClientConfig()));
+    private LocalMessageCache localMessageCache = null;
 
     @Before
     public void init() throws NoSuchFieldException, IllegalAccessException {
         final MessagingAccessPoint messagingAccessPoint = 
MessagingAccessPointFactory
             
.getMessagingAccessPoint("openmessaging:rocketmq://IP1:9876,IP2:9876/namespace");
+
         consumer = messagingAccessPoint.createPullConsumer(queueName,
             OMS.newKeyValue().put(NonStandardKeys.CONSUMER_GROUP, 
"TestGroup"));
 
@@ -60,6 +60,10 @@ public class PullConsumerImplTest {
         field.setAccessible(true);
         field.set(consumer, rocketmqPullConsumer); //Replace
 
+        ClientConfig clientConfig = new ClientConfig();
+        clientConfig.setOmsOperationTimeout(200);
+        localMessageCache = spy(new LocalMessageCache(rocketmqPullConsumer, 
clientConfig));
+
         field = PullConsumerImpl.class.getDeclaredField("localMessageCache");
         field.setAccessible(true);
         field.set(consumer, localMessageCache);

Reply via email to