Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小五666\n哈哈
Rocketmq
提交
94f3b5a4
R
Rocketmq
项目概览
小五666\n哈哈
/
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看板
提交
94f3b5a4
编写于
7月 05, 2018
作者:
W
what-a-good-jungle
提交者:
von gosling
7月 05, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ISSUE #353]Optimzation For Unit Test (#356)
上级
650f46be
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
32 addition
and
27 deletion
+32
-27
filter/src/test/java/org/apache/rocketmq/filter/ParserTest.java
.../src/test/java/org/apache/rocketmq/filter/ParserTest.java
+9
-6
pom.xml
pom.xml
+3
-1
store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
...n/java/org/apache/rocketmq/store/DefaultMessageStore.java
+1
-1
store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java
...test/java/org/apache/rocketmq/store/ConsumeQueueTest.java
+0
-2
test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQAsyncSendProducer.java
...apache/rocketmq/test/client/rmq/RMQAsyncSendProducer.java
+11
-9
test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQNormalProducer.java
...rg/apache/rocketmq/test/client/rmq/RMQNormalProducer.java
+3
-3
test/src/main/java/org/apache/rocketmq/test/clientinterface/AbstractMQProducer.java
...che/rocketmq/test/clientinterface/AbstractMQProducer.java
+2
-2
test/src/main/java/org/apache/rocketmq/test/clientinterface/MQProducer.java
.../org/apache/rocketmq/test/clientinterface/MQProducer.java
+2
-2
test/src/main/java/org/apache/rocketmq/test/sendresult/ResultWrapper.java
...va/org/apache/rocketmq/test/sendresult/ResultWrapper.java
+1
-1
未找到文件。
filter/src/test/java/org/apache/rocketmq/filter/ParserTest.java
浏览文件 @
94f3b5a4
...
...
@@ -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"
);
}
s
tr
+=
"."
;
for
(
int
i
=
0
;
i
<
2048
;
i
++)
{
s
tr
+=
"111111111111111111111111111111111111111111111111111"
;
s
b
.
append
(
"."
)
;
for
(
int
i
=
0
;
i
<
2048
;
i
++)
{
s
b
.
append
(
"111111111111111111111111111111111111111111111111111"
)
;
}
String
str
=
sb
.
toString
();
SelectorParser
.
parse
(
"a > "
+
str
);
...
...
pom.xml
浏览文件 @
94f3b5a4
...
...
@@ -157,7 +157,7 @@
</executions>
<configuration>
<rules>
<banCircularDependencies
/>
<banCircularDependencies/>
</rules>
<fail>
true
</fail>
</configuration>
...
...
@@ -315,6 +315,7 @@
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.19.1
</version>
<configuration>
<skipAfterFailureCount>
1
</skipAfterFailureCount>
<forkCount>
1
</forkCount>
<reuseForks>
true
</reuseForks>
</configuration>
...
...
@@ -333,6 +334,7 @@
<artifactId>
maven-failsafe-plugin
</artifactId>
<version>
2.19.1
</version>
<configuration>
<skipAfterFailureCount>
1
</skipAfterFailureCount>
<excludes>
<exclude>
**/NormalMsgDelayIT.java
</exclude>
</excludes>
...
...
store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
浏览文件 @
94f3b5a4
...
...
@@ -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
);
}
...
...
store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java
浏览文件 @
94f3b5a4
...
...
@@ -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
();
...
...
test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQAsyncSendProducer.java
浏览文件 @
94f3b5a4
...
...
@@ -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
<
org
.
apache
.
rocketmq
.
client
.
producer
.
SendResult
>
successSendResult
=
Collections
.
synchronizedList
(
new
ArrayList
<
org
.
apache
.
rocketmq
.
client
.
producer
.
SendResult
>());
private
AtomicInteger
exceptionMsgCount
=
new
AtomicInteger
(
0
);
private
List
<
SendResult
>
successSendResult
=
Collections
.
synchronizedList
(
new
ArrayList
<
SendResult
>());
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
<
org
.
apache
.
rocketmq
.
client
.
producer
.
SendResult
>
getSuccessSendResult
()
{
public
List
<
SendResult
>
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
();
}
...
...
test/src/main/java/org/apache/rocketmq/test/client/rmq/RMQNormalProducer.java
浏览文件 @
94f3b5a4
...
...
@@ -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
();
...
...
test/src/main/java/org/apache/rocketmq/test/clientinterface/AbstractMQProducer.java
浏览文件 @
94f3b5a4
...
...
@@ -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
;
...
...
test/src/main/java/org/apache/rocketmq/test/clientinterface/MQProducer.java
浏览文件 @
94f3b5a4
...
...
@@ -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
();
...
...
test/src/main/java/org/apache/rocketmq/test/sendresult/
SendResult
.java
→
test/src/main/java/org/apache/rocketmq/test/sendresult/
ResultWrapper
.java
浏览文件 @
94f3b5a4
...
...
@@ -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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录