issue #66 对去重逻辑做了一些调整

This commit is contained in:
Daniel Qian
2015-01-22 14:06:15 +08:00
parent 3ff9d260f2
commit 3216cb54dd
5 changed files with 55 additions and 13 deletions

View File

@ -12,21 +12,21 @@ public class WxMessageInMemoryDuplicateCheckerTest {
// 第一次检查
for (Long msgId : msgIds) {
boolean result = checker.isDuplicate(msgId);
boolean result = checker.isDuplicate(String.valueOf(msgId));
Assert.assertFalse(result);
}
// 过1秒再检查
Thread.sleep(1000l);
for (Long msgId : msgIds) {
boolean result = checker.isDuplicate(msgId);
boolean result = checker.isDuplicate(String.valueOf(msgId));
Assert.assertTrue(result);
}
// 过1.5秒再检查
Thread.sleep(1500l);
for (Long msgId : msgIds) {
boolean result = checker.isDuplicate(msgId);
boolean result = checker.isDuplicate(String.valueOf(msgId));
Assert.assertFalse(result);
}