[Change] Locker 增加清理日志;

[Add] LockerMapTest 增加单元测试;
This commit is contained in:
2020-06-15 17:18:28 +08:00
parent 2f647ee9fa
commit 08822f68eb
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,18 @@
package net.lamgc.cgj.util;
import org.junit.Assert;
import org.junit.Test;
public class LockerMapTest {
@Test
public void createAndFinalizeTest() {
LockerMap<String> map = new LockerMap<>();
Locker<String> locker = map.createLocker("Test", true);
Assert.assertEquals(locker, map.createLocker("Test", true));
locker.lock();
locker.unlock();
System.gc();
}
}