Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_57962205
redisson
提交
a4a10991
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,体验更适合开发者的 AI 搜索 >>
提交
a4a10991
编写于
10月 22, 2020
作者:
N
Nikita Koksharov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests fixed
上级
7711c615
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
57 deletion
+14
-57
redisson/src/test/java/org/redisson/BaseTest.java
redisson/src/test/java/org/redisson/BaseTest.java
+12
-30
redisson/src/test/java/org/redisson/RedissonLocalCachedMapSerializationCodecTest.java
...edisson/RedissonLocalCachedMapSerializationCodecTest.java
+0
-21
redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java
...va/org/redisson/executor/RedissonExecutorServiceTest.java
+0
-2
redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java
...disson/executor/RedissonScheduledExecutorServiceTest.java
+0
-2
redisson/src/test/java/org/redisson/spring/support/SpringNamespaceObjectTest.java
...rg/redisson/spring/support/SpringNamespaceObjectTest.java
+2
-2
未找到文件。
redisson/src/test/java/org/redisson/BaseTest.java
浏览文件 @
a4a10991
...
...
@@ -3,6 +3,7 @@ package org.redisson;
import
java.io.IOException
;
import
org.junit.After
;
import
org.junit.AfterClass
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
org.redisson.api.RedissonClient
;
...
...
@@ -10,43 +11,24 @@ import org.redisson.config.Config;
public
abstract
class
BaseTest
{
protected
RedissonClient
redisson
;
protected
static
RedissonClient
defaultRedisson
;
protected
static
RedissonClient
redisson
;
@BeforeClass
public
static
void
beforeClass
()
throws
IOException
,
InterruptedException
{
if
(!
RedissonRuntimeEnvironment
.
isTravis
)
{
RedisRunner
.
startDefaultRedisServerInstance
();
defaultRedisson
=
createInstance
();
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
()
{
@Override
public
void
run
()
{
defaultRedisson
.
shutdown
();
}
});
}
RedisRunner
.
startDefaultRedisServerInstance
();
redisson
=
createInstance
();
}
@Before
public
void
before
()
throws
IOException
,
InterruptedException
{
if
(
RedissonRuntimeEnvironment
.
isTravis
)
{
RedisRunner
.
startDefaultRedisServerInstance
();
redisson
=
createInstance
();
}
else
{
if
(
redisson
==
null
)
{
redisson
=
defaultRedisson
;
}
if
(
flushBetweenTests
())
{
redisson
.
getKeys
().
flushall
();
}
}
@AfterClass
public
static
void
afterClass
()
throws
InterruptedException
{
redisson
.
shutdown
();
RedisRunner
.
shutDownDefaultRedisServerInstance
();
}
@After
public
void
after
()
throws
InterruptedException
{
if
(
RedissonRuntimeEnvironment
.
isTravis
)
{
redisson
.
shutdown
();
RedisRunner
.
shutDownDefaultRedisServerInstance
();
@Before
public
void
before
()
throws
IOException
,
InterruptedException
{
if
(
flushBetweenTests
())
{
redisson
.
getKeys
().
flushall
();
}
}
...
...
redisson/src/test/java/org/redisson/RedissonLocalCachedMapSerializationCodecTest.java
浏览文件 @
a4a10991
...
...
@@ -24,27 +24,6 @@ public class RedissonLocalCachedMapSerializationCodecTest extends RedissonLocalC
return
Redisson
.
create
(
config
);
}
@BeforeClass
public
static
void
beforeClass
()
throws
IOException
,
InterruptedException
{
if
(!
RedissonRuntimeEnvironment
.
isTravis
)
{
RedisRunner
.
startDefaultRedisServerInstance
();
defaultRedisson
=
createInstance
();
}
}
@Before
public
void
before
()
throws
IOException
,
InterruptedException
{
if
(
RedissonRuntimeEnvironment
.
isTravis
)
{
RedisRunner
.
startDefaultRedisServerInstance
();
redisson
=
createInstance
();
}
else
{
if
(
redisson
==
null
)
{
redisson
=
defaultRedisson
;
}
redisson
.
getKeys
().
flushall
();
}
}
@Test
@Override
public
void
testAddAndGet
()
throws
InterruptedException
{
// this method/test won't work with Java Serialization
...
...
redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java
浏览文件 @
a4a10991
...
...
@@ -44,9 +44,7 @@ public class RedissonExecutorServiceTest extends BaseTest {
}
@After
@Override
public
void
after
()
throws
InterruptedException
{
super
.
after
();
node
.
shutdown
();
}
...
...
redisson/src/test/java/org/redisson/executor/RedissonScheduledExecutorServiceTest.java
浏览文件 @
a4a10991
...
...
@@ -44,9 +44,7 @@ public class RedissonScheduledExecutorServiceTest extends BaseTest {
}
@After
@Override
public
void
after
()
throws
InterruptedException
{
super
.
after
();
node
.
shutdown
();
}
...
...
redisson/src/test/java/org/redisson/spring/support/SpringNamespaceObjectTest.java
浏览文件 @
a4a10991
...
...
@@ -115,10 +115,10 @@ public class SpringNamespaceObjectTest extends BaseTest {
public
static
void
startContext
()
{
TestREntity
entity
=
new
TestREntity
(
"live-object"
);
entity
.
setValue
(
"1"
);
defaultR
edisson
.
getLiveObjectService
().
merge
(
entity
);
r
edisson
.
getLiveObjectService
().
merge
(
entity
);
entity
=
new
TestREntity
(
"live-object-ext"
);
entity
.
setValue
(
"1"
);
defaultR
edisson
.
getLiveObjectService
().
merge
(
entity
);
r
edisson
.
getLiveObjectService
().
merge
(
entity
);
System
.
setProperty
(
"redisAddress"
,
RedisRunner
.
getDefaultRedisServerBindAddressAndPort
());
context
=
new
ClassPathXmlApplicationContext
(
"classpath:org/redisson/spring/support/redisson_objects.xml"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录