Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_57962205
redisson
提交
e124acfe
R
redisson
项目概览
weixin_57962205
/
redisson
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redisson
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e124acfe
编写于
12月 08, 2018
作者:
N
Nikita Koksharov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests fixed
上级
56ab865c
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
34 addition
and
20 deletion
+34
-20
redisson/src/test/java/org/redisson/RedissonBucketTest.java
redisson/src/test/java/org/redisson/RedissonBucketTest.java
+1
-1
redisson/src/test/java/org/redisson/RedissonFairLockTest.java
...sson/src/test/java/org/redisson/RedissonFairLockTest.java
+2
-1
redisson/src/test/java/org/redisson/RedissonScriptTest.java
redisson/src/test/java/org/redisson/RedissonScriptTest.java
+6
-6
redisson/src/test/java/org/redisson/executor/CallableTask.java
...son/src/test/java/org/redisson/executor/CallableTask.java
+2
-1
redisson/src/test/java/org/redisson/executor/DelayedTask.java
...sson/src/test/java/org/redisson/executor/DelayedTask.java
+2
-1
redisson/src/test/java/org/redisson/executor/IncrementCallableTask.java
...est/java/org/redisson/executor/IncrementCallableTask.java
+2
-1
redisson/src/test/java/org/redisson/executor/IncrementRunnableTask.java
...est/java/org/redisson/executor/IncrementRunnableTask.java
+3
-1
redisson/src/test/java/org/redisson/executor/ParameterizedTask.java
...rc/test/java/org/redisson/executor/ParameterizedTask.java
+2
-1
redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java
...va/org/redisson/executor/RedissonExecutorServiceTest.java
+4
-3
redisson/src/test/java/org/redisson/executor/RunnableRedissonTask.java
...test/java/org/redisson/executor/RunnableRedissonTask.java
+3
-1
redisson/src/test/java/org/redisson/executor/RunnableTask.java
...son/src/test/java/org/redisson/executor/RunnableTask.java
+3
-1
redisson/src/test/java/org/redisson/executor/RunnableTask2.java
...on/src/test/java/org/redisson/executor/RunnableTask2.java
+1
-1
redisson/src/test/java/org/redisson/executor/ScheduledLongRunnableTask.java
...java/org/redisson/executor/ScheduledLongRunnableTask.java
+3
-1
未找到文件。
redisson/src/test/java/org/redisson/RedissonBucketTest.java
浏览文件 @
e124acfe
...
@@ -21,7 +21,7 @@ public class RedissonBucketTest extends BaseTest {
...
@@ -21,7 +21,7 @@ public class RedissonBucketTest extends BaseTest {
public
void
testSizeInMemory
()
{
public
void
testSizeInMemory
()
{
RBucket
<
Integer
>
al
=
redisson
.
getBucket
(
"test"
);
RBucket
<
Integer
>
al
=
redisson
.
getBucket
(
"test"
);
al
.
set
(
1234
);
al
.
set
(
1234
);
assertThat
(
al
.
sizeInMemory
()).
isEqualTo
(
49
);
assertThat
(
al
.
sizeInMemory
()).
isEqualTo
(
55
);
}
}
@Test
@Test
...
...
redisson/src/test/java/org/redisson/RedissonFairLockTest.java
浏览文件 @
e124acfe
...
@@ -19,6 +19,7 @@ import org.junit.Assert;
...
@@ -19,6 +19,7 @@ import org.junit.Assert;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RScript
;
import
org.redisson.api.RScript
;
import
org.redisson.client.codec.LongCodec
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -96,7 +97,7 @@ public class RedissonFairLockTest extends BaseConcurrentTest {
...
@@ -96,7 +97,7 @@ public class RedissonFairLockTest extends BaseConcurrentTest {
Assert
.
fail
(
"Lock should have been unlocked by now"
);
Assert
.
fail
(
"Lock should have been unlocked by now"
);
}
}
//check the timeout scores - they should all be within a reasonable amount of time from now
//check the timeout scores - they should all be within a reasonable amount of time from now
List
<
Long
>
queue
=
redisson
.
getScript
().
eval
(
RScript
.
Mode
.
READ_ONLY
,
List
<
Long
>
queue
=
redisson
.
getScript
(
LongCodec
.
INSTANCE
).
eval
(
RScript
.
Mode
.
READ_ONLY
,
"local result = {}; "
+
"local result = {}; "
+
"local timeouts = redis.call('zrange', KEYS[1], 0, 99, 'WITHSCORES'); "
+
"local timeouts = redis.call('zrange', KEYS[1], 0, 99, 'WITHSCORES'); "
+
"for i=1,#timeouts,2 do "
+
"for i=1,#timeouts,2 do "
+
...
...
redisson/src/test/java/org/redisson/RedissonScriptTest.java
浏览文件 @
e124acfe
...
@@ -52,16 +52,16 @@ public class RedissonScriptTest extends BaseTest {
...
@@ -52,16 +52,16 @@ public class RedissonScriptTest extends BaseTest {
@Test
@Test
public
void
testEval
()
{
public
void
testEval
()
{
RScript
script
=
redisson
.
getScript
();
RScript
script
=
redisson
.
getScript
(
StringCodec
.
INSTANCE
);
List
<
Object
>
res
=
script
.
eval
(
RScript
.
Mode
.
READ_ONLY
,
"return {
1,2,3.3333,'\"foo\"
',nil,'bar'}"
,
RScript
.
ReturnType
.
MULTI
,
Collections
.
emptyList
());
List
<
Object
>
res
=
script
.
eval
(
RScript
.
Mode
.
READ_ONLY
,
"return {
'1','2','3.3333','foo
',nil,'bar'}"
,
RScript
.
ReturnType
.
MULTI
,
Collections
.
emptyList
());
assertThat
(
res
).
containsExactly
(
1L
,
2L
,
3L
,
"foo"
);
assertThat
(
res
).
containsExactly
(
"1"
,
"2"
,
"3.3333"
,
"foo"
);
}
}
@Test
@Test
public
void
testEvalAsync
()
{
public
void
testEvalAsync
()
{
RScript
script
=
redisson
.
getScript
();
RScript
script
=
redisson
.
getScript
(
StringCodec
.
INSTANCE
);
RFuture
<
List
<
Object
>>
res
=
script
.
evalAsync
(
RScript
.
Mode
.
READ_ONLY
,
"return {
1,2,3.3333,'\"foo\"
',nil,'bar'}"
,
RScript
.
ReturnType
.
MULTI
,
Collections
.
emptyList
());
RFuture
<
List
<
Object
>>
res
=
script
.
evalAsync
(
RScript
.
Mode
.
READ_ONLY
,
"return {
'1','2','3.3333','foo
',nil,'bar'}"
,
RScript
.
ReturnType
.
MULTI
,
Collections
.
emptyList
());
assertThat
(
res
.
awaitUninterruptibly
().
getNow
()).
containsExactly
(
1L
,
2L
,
3L
,
"foo"
);
assertThat
(
res
.
awaitUninterruptibly
().
getNow
()).
containsExactly
(
"1"
,
"2"
,
"3.3333"
,
"foo"
);
}
}
@Test
@Test
...
...
redisson/src/test/java/org/redisson/executor/CallableTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
import
java.io.Serializable
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
public
class
CallableTask
implements
Callable
<
String
>
{
public
class
CallableTask
implements
Callable
<
String
>
,
Serializable
{
public
static
final
String
RESULT
=
"callable"
;
public
static
final
String
RESULT
=
"callable"
;
...
...
redisson/src/test/java/org/redisson/executor/DelayedTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
import
java.io.Serializable
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
import
org.redisson.api.RAtomicLong
;
import
org.redisson.api.RAtomicLong
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.annotation.RInject
;
import
org.redisson.api.annotation.RInject
;
public
class
DelayedTask
implements
Callable
<
Object
>
{
public
class
DelayedTask
implements
Callable
<
Object
>
,
Serializable
{
@RInject
@RInject
private
RedissonClient
redisson
;
private
RedissonClient
redisson
;
...
...
redisson/src/test/java/org/redisson/executor/IncrementCallableTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
import
java.io.Serializable
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.annotation.RInject
;
import
org.redisson.api.annotation.RInject
;
public
class
IncrementCallableTask
implements
Callable
<
String
>
{
public
class
IncrementCallableTask
implements
Callable
<
String
>
,
Serializable
{
private
String
counterName
;
private
String
counterName
;
...
...
redisson/src/test/java/org/redisson/executor/IncrementRunnableTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
import
java.io.Serializable
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.annotation.RInject
;
import
org.redisson.api.annotation.RInject
;
public
class
IncrementRunnableTask
implements
Runnable
{
public
class
IncrementRunnableTask
implements
Runnable
,
Serializable
{
private
String
counterName
;
private
String
counterName
;
...
...
redisson/src/test/java/org/redisson/executor/ParameterizedTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
import
java.io.Serializable
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
public
class
ParameterizedTask
implements
Callable
<
String
>
{
public
class
ParameterizedTask
implements
Callable
<
String
>
,
Serializable
{
private
String
param
;
private
String
param
;
...
...
redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java
浏览文件 @
e124acfe
...
@@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import
static
org
.
awaitility
.
Awaitility
.
await
;
import
static
org
.
awaitility
.
Awaitility
.
await
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.Serializable
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -515,7 +516,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
...
@@ -515,7 +516,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
redisson
.
getExecutorService
(
"test"
).
submit
(
new
TaskCallableClass
());
redisson
.
getExecutorService
(
"test"
).
submit
(
new
TaskCallableClass
());
}
}
public
static
class
TaskStaticCallableClass
implements
Callable
<
String
>
{
public
static
class
TaskStaticCallableClass
implements
Callable
<
String
>
,
Serializable
{
@Override
@Override
public
String
call
()
throws
Exception
{
public
String
call
()
throws
Exception
{
...
@@ -530,7 +531,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
...
@@ -530,7 +531,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
assertThat
(
res
).
isEqualTo
(
"123"
);
assertThat
(
res
).
isEqualTo
(
"123"
);
}
}
public
class
TaskRunnableClass
implements
Runnable
{
public
class
TaskRunnableClass
implements
Runnable
,
Serializable
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
...
@@ -543,7 +544,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
...
@@ -543,7 +544,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
redisson
.
getExecutorService
(
"test"
).
submit
(
new
TaskRunnableClass
());
redisson
.
getExecutorService
(
"test"
).
submit
(
new
TaskRunnableClass
());
}
}
public
static
class
TaskStaticRunnableClass
implements
Runnable
{
public
static
class
TaskStaticRunnableClass
implements
Runnable
,
Serializable
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
...
...
redisson/src/test/java/org/redisson/executor/RunnableRedissonTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
import
java.io.Serializable
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.annotation.RInject
;
import
org.redisson.api.annotation.RInject
;
public
class
RunnableRedissonTask
implements
Runnable
{
public
class
RunnableRedissonTask
implements
Runnable
,
Serializable
{
@RInject
@RInject
private
RedissonClient
redissonClient
;
private
RedissonClient
redissonClient
;
...
...
redisson/src/test/java/org/redisson/executor/RunnableTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
public
class
RunnableTask
implements
Runnable
{
import
java.io.Serializable
;
public
class
RunnableTask
implements
Runnable
,
Serializable
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
...
...
redisson/src/test/java/org/redisson/executor/RunnableTask2.java
浏览文件 @
e124acfe
...
@@ -2,7 +2,7 @@ package org.redisson.executor;
...
@@ -2,7 +2,7 @@ package org.redisson.executor;
import
java.io.Serializable
;
import
java.io.Serializable
;
public
class
RunnableTask2
implements
Runnable
{
public
class
RunnableTask2
implements
Runnable
,
Serializable
{
private
static
final
long
serialVersionUID
=
2105094575950438867L
;
private
static
final
long
serialVersionUID
=
2105094575950438867L
;
...
...
redisson/src/test/java/org/redisson/executor/ScheduledLongRunnableTask.java
浏览文件 @
e124acfe
package
org.redisson.executor
;
package
org.redisson.executor
;
import
java.io.Serializable
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.RedissonClient
;
import
org.redisson.api.annotation.RInject
;
import
org.redisson.api.annotation.RInject
;
public
class
ScheduledLongRunnableTask
implements
Runnable
{
public
class
ScheduledLongRunnableTask
implements
Runnable
,
Serializable
{
@RInject
@RInject
private
RedissonClient
redisson
;
private
RedissonClient
redisson
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录