Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/clients/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
<version>7.2.1</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import org.apache.ignite.configuration.ConnectorConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import redis.clients.jedis.ClientSetInfoConfig;
import redis.clients.jedis.DefaultJedisClientConfig;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

Expand Down Expand Up @@ -59,7 +62,13 @@ public class RedisCommonAbstractTest extends GridCommonAbstractTest {
jedisPoolCfg.setTestWhileIdle(true);
jedisPoolCfg.setTimeBetweenEvictionRunsMillis(30000);

pool = new JedisPool(jedisPoolCfg, HOST, PORT, 10000);
DefaultJedisClientConfig clientCfg = DefaultJedisClientConfig.builder()
.connectionTimeoutMillis(10000)
.socketTimeoutMillis(10000)
.clientSetInfoConfig(ClientSetInfoConfig.DISABLED)
.build();

pool = new JedisPool(jedisPoolCfg, new HostAndPort(HOST, PORT), clientCfg);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.exceptions.JedisDataException;
import redis.clients.jedis.params.SetParams;

/**
* Tests for String commands of Redis protocol.
Expand Down Expand Up @@ -188,14 +189,14 @@ public void testSet() throws Exception {
Assert.assertEquals("b0", jcache().get("setKey2"));

// test options.
jedis.set("setKey1", "2", "nx");
jedis.set("setKey3", "3", "nx", "px", EXPIRE_MS);
jedis.set("setKey1", "2", SetParams.setParams().nx());
jedis.set("setKey3", "3", SetParams.setParams().nx().px(EXPIRE_MS));

Assert.assertEquals("1", jcache().get("setKey1"));
Assert.assertEquals("3", jcache().get("setKey3"));

jedis.set("setKey1", "2", "xx", "ex", EXPIRE_SEC);
jedis.set("setKey4", "4", "xx");
jedis.set("setKey1", "2", SetParams.setParams().xx().ex(EXPIRE_SEC));
jedis.set("setKey4", "4", SetParams.setParams().xx());

Assert.assertEquals("2", jcache().get("setKey1"));
Assert.assertNull(jcache().get("setKey4"));
Expand Down