Add a version of RedissonLocalCachedMapTest that uses the SerializationCodec.
Fix most of the tests by making classes implement Serializable. The testAddAndGet test is still failing and after an hour of looking through it, I still can't figure why.pull/748/head
parent
4a8259cb05
commit
2cb015842d
@ -0,0 +1,46 @@
|
||||
package org.redisson;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.redisson.codec.SerializationCodec;
|
||||
import org.redisson.config.Config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Created by jribble on 1/12/17.
|
||||
*/
|
||||
public class RedissonLocalCachedMapSerializationCodecTest extends RedissonLocalCachedMapTest {
|
||||
public static Config createConfig() {
|
||||
Config config = RedissonLocalCachedMapTest.createConfig();
|
||||
config.setCodec(new SerializationCodec());
|
||||
return config;
|
||||
}
|
||||
|
||||
public static RedissonClient createInstance() {
|
||||
Config config = createConfig();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue