Search in sources :

Example 16 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonCodecTest method testKryo.

@Test
public void testKryo() {
    Config config = createConfig();
    config.setCodec(kryoCodec);
    RedissonClient redisson = Redisson.create(config);
    test(redisson);
}
Also used : RedissonClient(org.redisson.api.RedissonClient) Config(org.redisson.config.Config) Test(org.junit.Test)

Example 17 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonCodecTest method testSnappy.

@Test
public void testSnappy() {
    Config config = createConfig();
    config.setCodec(snappyCodec);
    RedissonClient redisson = Redisson.create(config);
    test(redisson);
}
Also used : RedissonClient(org.redisson.api.RedissonClient) Config(org.redisson.config.Config) Test(org.junit.Test)

Example 18 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonLocalCachedMapSerializationCodecTest method createConfig.

public static Config createConfig() {
    Config config = RedissonLocalCachedMapTest.createConfig();
    config.setCodec(new SerializationCodec());
    return config;
}
Also used : Config(org.redisson.config.Config) SerializationCodec(org.redisson.codec.SerializationCodec)

Example 19 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonBlockingQueueTest method testTakeAsyncCancel.

@Test
public void testTakeAsyncCancel() {
    Config config = createConfig();
    config.useSingleServer().setConnectionMinimumIdleSize(1).setConnectionPoolSize(1);
    RedissonClient redisson = Redisson.create(config);
    RBlockingQueue<Integer> queue1 = redisson.getBlockingQueue("testTakeAsyncCancel");
    for (int i = 0; i < 10; i++) {
        RFuture<Integer> f = queue1.takeAsync();
        f.cancel(true);
    }
    assertThat(queue1.add(1)).isTrue();
    assertThat(queue1.add(2)).isTrue();
    assertThat(queue1.size()).isEqualTo(2);
    redisson.shutdown();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) RedissonClient(org.redisson.api.RedissonClient) Config(org.redisson.config.Config) Test(org.junit.Test)

Example 20 with Config

use of org.redisson.config.Config in project redisson by redisson.

the class RedissonScheduledExecutorServiceTest method before.

@Before
@Override
public void before() throws IOException, InterruptedException {
    super.before();
    Config config = createConfig();
    RedissonNodeConfig nodeConfig = new RedissonNodeConfig(config);
    nodeConfig.setExecutorServiceWorkers(Collections.singletonMap("test", 1));
    node = RedissonNode.create(nodeConfig);
    node.start();
}
Also used : Config(org.redisson.config.Config) RedissonNodeConfig(org.redisson.config.RedissonNodeConfig) RedissonNodeConfig(org.redisson.config.RedissonNodeConfig) Before(org.junit.Before)

Aggregations

Config (org.redisson.config.Config)68 Test (org.junit.Test)51 RedissonClient (org.redisson.api.RedissonClient)44 RedisProcess (org.redisson.RedisRunner.RedisProcess)17 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)13 IOException (java.io.IOException)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 RedissonNodeConfig (org.redisson.config.RedissonNodeConfig)4 HashMap (java.util.HashMap)3 ExecutorService (java.util.concurrent.ExecutorService)3 Before (org.junit.Before)3 SerializationCodec (org.redisson.codec.SerializationCodec)3 File (java.io.File)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 LifecycleException (org.apache.catalina.LifecycleException)2 BeforeClass (org.junit.BeforeClass)2 BaseTest.createConfig (org.redisson.BaseTest.createConfig)2 RLock (org.redisson.api.RLock)2 JsonJacksonCodec (org.redisson.codec.JsonJacksonCodec)2