mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-14 02:05:12 +08:00
修复小l字符问题
This commit is contained in:
@@ -192,7 +192,7 @@ public class StandardSessionManager implements WxSessionManager, InternalSession
|
||||
while (true) {
|
||||
try {
|
||||
// 每秒清理一次
|
||||
Thread.sleep(StandardSessionManager.this.backgroundProcessorDelay * 1000l);
|
||||
Thread.sleep(StandardSessionManager.this.backgroundProcessorDelay * 1000L);
|
||||
backgroundProcess();
|
||||
} catch (InterruptedException e) {
|
||||
StandardSessionManager.this.log.error("SessionManagerImpl.backgroundProcess error", e);
|
||||
|
@@ -77,7 +77,7 @@ public class GsonHelper {
|
||||
|
||||
public static long getAsPrimitiveLong(JsonElement element) {
|
||||
Long r = getAsLong(element);
|
||||
return r == null ? 0l : r;
|
||||
return r == null ? 0L : r;
|
||||
}
|
||||
|
||||
public static Integer getAsInteger(JsonElement element) {
|
||||
|
@@ -3,15 +3,17 @@ package me.chanjar.weixin.common.api;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
@Test
|
||||
public class WxMessageInMemoryDuplicateCheckerTest {
|
||||
private WxMessageInMemoryDuplicateChecker checker = new WxMessageInMemoryDuplicateChecker(2000l, 1000l);
|
||||
private WxMessageInMemoryDuplicateChecker checker = new WxMessageInMemoryDuplicateChecker(2000L, 1000L);
|
||||
|
||||
public void test() throws InterruptedException {
|
||||
Long[] msgIds = new Long[]{1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l};
|
||||
Long[] msgIds = new Long[]{1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L};
|
||||
|
||||
// 第一次检查
|
||||
for (Long msgId : msgIds) {
|
||||
@@ -20,14 +22,14 @@ public class WxMessageInMemoryDuplicateCheckerTest {
|
||||
}
|
||||
|
||||
// 过1秒再检查
|
||||
Thread.sleep(1000l);
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
for (Long msgId : msgIds) {
|
||||
boolean result = checker.isDuplicate(String.valueOf(msgId));
|
||||
assertTrue(result);
|
||||
}
|
||||
|
||||
// 过1.5秒再检查
|
||||
Thread.sleep(1500l);
|
||||
TimeUnit.MILLISECONDS.sleep(1500L);
|
||||
for (Long msgId : msgIds) {
|
||||
boolean result = checker.isDuplicate(String.valueOf(msgId));
|
||||
assertFalse(result);
|
||||
|
@@ -80,7 +80,7 @@ public class SessionTest {
|
||||
InternalSession abc = ism.createSession("abc");
|
||||
abc.endAccess();
|
||||
|
||||
Thread.sleep(2000l);
|
||||
Thread.sleep(2000);
|
||||
Assert.assertEquals(ism.getActiveSessions(), 0);
|
||||
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class SessionTest {
|
||||
abc.setMaxInactiveInterval(1);
|
||||
abc.endAccess();
|
||||
|
||||
Thread.sleep(2000l);
|
||||
Thread.sleep(2000);
|
||||
Assert.assertEquals(ism.getActiveSessions(), 0);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user