Skip to content

Commit

Permalink
update test units
Browse files Browse the repository at this point in the history
  • Loading branch information
gatsby068 committed Oct 30, 2023
1 parent 128c289 commit 8263699
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @author VvV
* @date 2023/8/23
*/
@QuarkusTest
//@QuarkusTest
public class RedisReentrantReadWriteLockTest {
private static final Logger LOG = Logger.getLogger("app.log");

Expand All @@ -34,7 +34,7 @@ public class RedisReentrantReadWriteLockTest {
/**
* 测试读锁 加锁和解锁流程
*/
@Test
// @Test
void testReadLock() {
String keyName = "testKey_read";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand All @@ -61,7 +61,7 @@ void testReadLock() {
/**
* 测试写锁加锁解锁流程
*/
@Test
// @Test
void testWriteLock() {
String keyName = "testKey_write";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand Down Expand Up @@ -89,7 +89,7 @@ void testWriteLock() {
/**
* 测试读锁并发加锁解锁
*/
@Test
// @Test
void testReadLockConcurrent() throws InterruptedException {
String keyName = "testKey_read_lock_concurrent";

Expand Down Expand Up @@ -135,7 +135,7 @@ void testReadLockConcurrent() throws InterruptedException {
/**
* 测试写锁并发加锁解锁
*/
@Test
// @Test
void testWriteLockConcurrent() throws InterruptedException {
String keyName = "testKey_write_lock_concurrent";

Expand Down Expand Up @@ -181,7 +181,7 @@ void testWriteLockConcurrent() throws InterruptedException {
/**
* 测试读读是否共享
*/
@Test
// @Test
void testReadReadSharing() throws JsonProcessingException {
String keyName = "test_read_sharing";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand All @@ -200,7 +200,7 @@ void testReadReadSharing() throws JsonProcessingException {
/**
* 测试读锁重入
*/
@Test
// @Test
void testReadReentrant() {
String keyName = "test_read_reentrant";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand All @@ -215,7 +215,7 @@ void testReadReentrant() {
/**
* 测试写锁重入
*/
@Test
// @Test
void testWriteReentrant() {
String keyName = "test_write_reentrant";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand Down Expand Up @@ -249,7 +249,7 @@ private Map<String, String> getHashAsMap(String keyName) {
/**
* 测试读写互斥
*/
@Test
// @Test
void testReadWriteMutex() {
String keyName = "test_read_write_mutex";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand All @@ -266,7 +266,7 @@ void testReadWriteMutex() {
/**
* 测试写写互斥
*/
@Test
// @Test
void testWriteWriteMutex() throws InterruptedException {
String keyName = "test_write_write_mutex";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand All @@ -283,7 +283,7 @@ void testWriteWriteMutex() throws InterruptedException {
/**
* 测试多线程并发的读写锁
*/
@Test
// @Test
void testConcurrentReadWriteLock() throws InterruptedException {
String keyName = "test_concurrent_read_write";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand Down Expand Up @@ -363,7 +363,7 @@ void testConcurrentReadWriteLock() throws InterruptedException {
/**
* 测试锁降级
*/
@Test
// @Test
void testLockDegradation() {
String keyName = "testKey_lock_degradation";
DistributedReadWriteLock readWriteLock = lockFactory.newLock(keyName, LockType.RedisReentrantReadWriteLock);
Expand Down

0 comments on commit 8263699

Please sign in to comment.