You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by vo...@apache.org on 2018/06/12 06:03:16 UTC
[rocketmq] branch develop updated: Bugfix for the unstable test
This is an automated email from the ASF dual-hosted git repository.
vongosling pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 9dc3b5f Bugfix for the unstable test
9dc3b5f is described below
commit 9dc3b5f5fc375eb0e84db5366566b8e891d87ee9
Author: vongosling <vo...@alibaba-inc.com>
AuthorDate: Tue Jun 12 14:02:58 2018 +0800
Bugfix for the unstable test
---
.../apache/rocketmq/client/log/ClientLoggerTest.java | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/client/src/test/java/org/apache/rocketmq/client/log/ClientLoggerTest.java b/client/src/test/java/org/apache/rocketmq/client/log/ClientLoggerTest.java
index 4888186..cf66bc6 100644
--- a/client/src/test/java/org/apache/rocketmq/client/log/ClientLoggerTest.java
+++ b/client/src/test/java/org/apache/rocketmq/client/log/ClientLoggerTest.java
@@ -17,18 +17,16 @@
package org.apache.rocketmq.client.log;
+import java.io.File;
+import java.io.IOException;
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.common.UtilAll;
import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.logging.InternalLoggerFactory;
-import org.junit.After;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
-import java.io.File;
-import java.io.IOException;
-
-
public class ClientLoggerTest {
public static final String CLIENT_LOG_ROOT = "rocketmq.client.logRoot";
@@ -46,13 +44,10 @@ public class ClientLoggerTest {
for (int i = 0; i < 10; i++) {
logger.info("testClientlog test {}", i);
- rocketmqCommon.info("common message {}", i, new RuntimeException());
- rocketmqRemoting.info("remoting message {}", i, new RuntimeException());
- }
- try {
- Thread.sleep(10);
- } catch (InterruptedException ignore) {
+ rocketmqCommon.info("common message {}", i);
+ rocketmqRemoting.info("remoting message {}", i);
}
+
String content = MixAll.file2String(LOG_DIR + "/rocketmq_client.log");
Assert.assertTrue(content.contains("testClientlog"));
Assert.assertTrue(content.contains("RocketmqClient"));
@@ -61,7 +56,7 @@ public class ClientLoggerTest {
Assert.assertTrue(content.contains("RocketmqRemoting"));
}
- @After
+ @Before
public void cleanFiles() {
UtilAll.deleteFile(new File(LOG_DIR));
}
--
To stop receiving notification emails like this one, please contact
vongosling@apache.org.