This commit is contained in:
Looly
2022-04-17 17:56:53 +08:00
parent 7bd5aaab7c
commit c57ecead27
3 changed files with 24 additions and 6 deletions

View File

@@ -26,11 +26,13 @@ public class WeakCacheTest {
@Ignore
public void removeByGcTest(){
// https://gitee.com/dromara/hutool/issues/I51O7M
// 经过GC
WeakCache<String, String> cache = new WeakCache<>(-1);
cache.put("a", "1");
cache.put("b", "2");
// 监听
Assert.assertEquals(2, cache.size());
cache.setListener(Console::log);
// GC测试
int i=0;