提交 9dc3b5f5 编写于 作者: V vongosling

Bugfix for the unstable test

上级 1970813c
......@@ -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));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册