release branch 1.1.0
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
package com.github.houbb.lock.test.core;
|
||||
|
||||
|
||||
import com.github.houbb.id.core.core.Ids;
|
||||
import com.github.houbb.lock.api.core.ILock;
|
||||
import com.github.houbb.lock.core.bs.LockBs;
|
||||
import com.github.houbb.lock.core.support.format.LockKeyFormat;
|
||||
import com.github.houbb.lock.core.support.handler.LockReleaseFailHandler;
|
||||
import com.github.houbb.lock.core.support.lock.RedisLockSupport;
|
||||
import com.github.houbb.redis.config.core.factory.JedisRedisServiceFactory;
|
||||
import org.junit.Test;
|
||||
|
||||
public class LockBsTest {
|
||||
|
||||
@Test
|
||||
public void helloTest() {
|
||||
ILock lock = LockBs.newInstance()
|
||||
.init();
|
||||
|
||||
ILock lock = LockBs.newInstance();
|
||||
String key = "ddd";
|
||||
try {
|
||||
// 加锁
|
||||
@@ -25,4 +28,15 @@ public class LockBsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void configTest() {
|
||||
LockBs.newInstance()
|
||||
.id(Ids.uuid32()) //id 生成策略
|
||||
.cache(JedisRedisServiceFactory.pooled("127.0.0.1", 6379)) //缓存策略
|
||||
.lockSupport(new RedisLockSupport()) // 锁实现策略
|
||||
.lockKeyFormat(new LockKeyFormat()) // 针对 key 的格式化处理策略
|
||||
.lockReleaseFailHandler(new LockReleaseFailHandler()) //释放锁失败处理
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user