Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
Rocketmq
提交
4d760164
R
Rocketmq
项目概览
Kwan的解忧杂货铺@新空间代码工作室
/
Rocketmq
与 Fork 源项目一致
Fork自
Apache RocketMQ / Rocketmq
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rocketmq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4d760164
编写于
6月 12, 2018
作者:
V
vongosling
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish parts slow UT
上级
788c757a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
39 deletion
+13
-39
broker/src/test/java/org/apache/rocketmq/broker/BrokerControllerTest.java
...java/org/apache/rocketmq/broker/BrokerControllerTest.java
+3
-8
logappender/src/test/java/org/apache/rocketmq/logappender/Log4jTest.java
.../test/java/org/apache/rocketmq/logappender/Log4jTest.java
+1
-2
logappender/src/test/java/org/apache/rocketmq/logappender/LogbackTest.java
...est/java/org/apache/rocketmq/logappender/LogbackTest.java
+2
-4
store/src/test/java/org/apache/rocketmq/store/DefaultMessageStoreShutDownTest.java
...pache/rocketmq/store/DefaultMessageStoreShutDownTest.java
+3
-3
store/src/test/java/org/apache/rocketmq/store/DefaultMessageStoreTest.java
...va/org/apache/rocketmq/store/DefaultMessageStoreTest.java
+4
-22
未找到文件。
broker/src/test/java/org/apache/rocketmq/broker/BrokerControllerTest.java
浏览文件 @
4d760164
...
...
@@ -17,6 +17,7 @@
package
org.apache.rocketmq.broker
;
import
java.io.File
;
import
org.apache.rocketmq.common.BrokerConfig
;
import
org.apache.rocketmq.common.UtilAll
;
import
org.apache.rocketmq.remoting.netty.NettyClientConfig
;
...
...
@@ -25,16 +26,10 @@ import org.apache.rocketmq.store.config.MessageStoreConfig;
import
org.junit.After
;
import
org.junit.Test
;
import
java.io.File
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
public
class
BrokerControllerTest
{
/**
* Tests if the controller can be properly stopped and started.
*
* @throws Exception If fails.
*/
@Test
public
void
testBrokerRestart
()
throws
Exception
{
BrokerController
brokerController
=
new
BrokerController
(
...
...
@@ -48,7 +43,7 @@ public class BrokerControllerTest {
}
@After
public
void
dest
or
y
()
{
public
void
dest
ro
y
()
{
UtilAll
.
deleteFile
(
new
File
(
new
MessageStoreConfig
().
getStorePathRootDir
()));
}
}
logappender/src/test/java/org/apache/rocketmq/logappender/Log4jTest.java
浏览文件 @
4d760164
...
...
@@ -17,7 +17,6 @@
package
org.apache.rocketmq.logappender
;
import
org.apache.log4j.Logger
;
import
org.apache.rocketmq.client.exception.MQClientException
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -30,7 +29,7 @@ public abstract class Log4jTest extends AbstractTestCase {
public
abstract
String
getType
();
@Test
public
void
testLog4j
()
throws
InterruptedException
,
MQClientException
{
public
void
testLog4j
()
{
clear
();
Logger
logger
=
Logger
.
getLogger
(
"testLogger"
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
...
...
logappender/src/test/java/org/apache/rocketmq/logappender/LogbackTest.java
浏览文件 @
4d760164
...
...
@@ -20,15 +20,13 @@ import ch.qos.logback.classic.LoggerContext;
import
ch.qos.logback.classic.joran.JoranConfigurator
;
import
ch.qos.logback.core.joran.spi.JoranException
;
import
ch.qos.logback.core.util.StatusPrinter
;
import
org.apache.rocketmq.client.exception.MQClientException
;
import
java.io.File
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
public
class
LogbackTest
extends
AbstractTestCase
{
@Before
...
...
@@ -42,7 +40,7 @@ public class LogbackTest extends AbstractTestCase {
}
@Test
public
void
testLogback
()
throws
InterruptedException
,
MQClientException
{
public
void
testLogback
()
{
clear
();
Logger
logger
=
LoggerFactory
.
getLogger
(
"testLogger"
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
...
...
store/src/test/java/org/apache/rocketmq/store/DefaultMessageStoreShu
w
DownTest.java
→
store/src/test/java/org/apache/rocketmq/store/DefaultMessageStoreShu
t
DownTest.java
浏览文件 @
4d760164
...
...
@@ -35,7 +35,7 @@ import static org.mockito.Mockito.spy;
import
static
org
.
mockito
.
Mockito
.
when
;
@RunWith
(
MockitoJUnitRunner
.
class
)
public
class
DefaultMessageStoreShu
wD
ownTest
{
public
class
DefaultMessageStoreShu
td
ownTest
{
private
DefaultMessageStore
messageStore
;
@Before
...
...
@@ -48,7 +48,7 @@ public class DefaultMessageStoreShuwDownTest {
}
@Test
public
void
testDispatchBehindWhenShut
D
own
()
{
public
void
testDispatchBehindWhenShut
d
own
()
{
messageStore
.
shutdown
();
assertTrue
(!
messageStore
.
shutDownNormal
);
File
file
=
new
File
(
StorePathConfigHelper
.
getAbortFile
(
messageStore
.
getMessageStoreConfig
().
getStorePathRootDir
()));
...
...
@@ -56,7 +56,7 @@ public class DefaultMessageStoreShuwDownTest {
}
@After
public
void
dest
or
y
()
{
public
void
dest
ro
y
()
{
messageStore
.
destroy
();
File
file
=
new
File
(
messageStore
.
getMessageStoreConfig
().
getStorePathRootDir
());
UtilAll
.
deleteFile
(
file
);
...
...
store/src/test/java/org/apache/rocketmq/store/DefaultMessageStoreTest.java
浏览文件 @
4d760164
...
...
@@ -59,7 +59,6 @@ public class DefaultMessageStoreTest {
@Test
(
expected
=
OverlappingFileLockException
.
class
)
public
void
test_repate_restart
()
throws
Exception
{
long
totalMsgs
=
100
;
QUEUE_TOTAL
=
1
;
MessageBody
=
StoreMessage
.
getBytes
();
...
...
@@ -92,7 +91,7 @@ public class DefaultMessageStoreTest {
UtilAll
.
deleteFile
(
file
);
}
p
ublic
MessageStore
buildMessageStore
()
throws
Exception
{
p
rivate
MessageStore
buildMessageStore
()
throws
Exception
{
MessageStoreConfig
messageStoreConfig
=
new
MessageStoreConfig
();
messageStoreConfig
.
setMapedFileSizeCommitLog
(
1024
*
1024
*
10
);
messageStoreConfig
.
setMapedFileSizeConsumeQueue
(
1024
*
1024
*
10
);
...
...
@@ -103,8 +102,8 @@ public class DefaultMessageStoreTest {
}
@Test
public
void
testWriteAndRead
()
throws
Exception
{
long
totalMsgs
=
10
0
;
public
void
testWriteAndRead
()
{
long
totalMsgs
=
10
;
QUEUE_TOTAL
=
1
;
MessageBody
=
StoreMessage
.
getBytes
();
for
(
long
i
=
0
;
i
<
totalMsgs
;
i
++)
{
...
...
@@ -119,7 +118,7 @@ public class DefaultMessageStoreTest {
verifyThatMasterIsFunctional
(
totalMsgs
,
messageStore
);
}
p
ublic
MessageExtBrokerInner
buildMessage
()
{
p
rivate
MessageExtBrokerInner
buildMessage
()
{
MessageExtBrokerInner
msg
=
new
MessageExtBrokerInner
();
msg
.
setTopic
(
"FooBar"
);
msg
.
setTags
(
"TAG1"
);
...
...
@@ -134,23 +133,6 @@ public class DefaultMessageStoreTest {
return
msg
;
}
@Test
public
void
testGroupCommit
()
throws
Exception
{
long
totalMsgs
=
10
;
QUEUE_TOTAL
=
1
;
MessageBody
=
StoreMessage
.
getBytes
();
for
(
long
i
=
0
;
i
<
totalMsgs
;
i
++)
{
messageStore
.
putMessage
(
buildMessage
());
}
for
(
long
i
=
0
;
i
<
totalMsgs
;
i
++)
{
GetMessageResult
result
=
messageStore
.
getMessage
(
"GROUP_A"
,
"TOPIC_A"
,
0
,
i
,
1024
*
1024
,
null
);
assertThat
(
result
).
isNotNull
();
result
.
release
();
}
verifyThatMasterIsFunctional
(
totalMsgs
,
messageStore
);
}
private
void
verifyThatMasterIsFunctional
(
long
totalMsgs
,
MessageStore
master
)
{
for
(
long
i
=
0
;
i
<
totalMsgs
;
i
++)
{
master
.
putMessage
(
buildMessage
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录