use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-integration by spring-projects.
the class RedisLockRegistryTests method testExpireNotChanged.
@Test
@RedisAvailable
public void testExpireNotChanged() throws Exception {
RedisConnectionFactory connectionFactory = this.getConnectionFactoryForTest();
final RedisLockRegistry registry = new RedisLockRegistry(connectionFactory, this.registryKey, 10000);
Lock lock = registry.obtain("foo");
lock.lock();
Long expire = getExpire(registry, "foo");
Future<Object> result = Executors.newSingleThreadExecutor().submit(() -> {
Lock lock2 = registry.obtain("foo");
assertFalse(lock2.tryLock());
return null;
});
result.get();
assertEquals(expire, getExpire(registry, "foo"));
lock.unlock();
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project redisson by redisson.
the class RedissonClusterConnectionTest method testConnectionFactoryReturnsClusterConnection.
@Test
public void testConnectionFactoryReturnsClusterConnection() {
RedisConnectionFactory connectionFactory = new RedissonConnectionFactory(redisson);
assertThat(connectionFactory.getConnection()).isInstanceOf(RedissonClusterConnection.class);
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-cloud-connectors by spring-cloud.
the class RedisServiceConnectorCreatorTest method cloudRedisCreationNoConfig.
@Test
public void cloudRedisCreationNoConfig() {
RedisServiceInfo serviceInfo = createServiceInfo(RedisServiceInfo.REDIS_SCHEME);
RedisConnectionFactory dataSource = testCreator.create(serviceInfo, null);
assertConnectorProperties(serviceInfo, dataSource, false);
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-cloud-connectors by spring-cloud.
the class RedisConnectionFactoryXmlConfigTest method cloudRedisConnectionFactoryWithMinMaxPool.
@Test
public void cloudRedisConnectionFactoryWithMinMaxPool() {
ApplicationContext testContext = getTestApplicationContext("cloud-redis-with-config.xml", createService("my-service"));
RedisConnectionFactory connector = testContext.getBean("service-pool5-30-wait3000", getConnectorType());
RedisConnectionFactoryCloudConfigTestHelper.assertPoolProperties(connector, 30, 5, 3000);
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-cloud-connectors by spring-cloud.
the class RedisConnectionFactoryConfigWithServiceConfig method cloudRedisConnectionFactoryWithMinMaxPool.
@Test
public void cloudRedisConnectionFactoryWithMinMaxPool() {
ApplicationContext testContext = getTestApplicationContext(RedisConnectionFactoryConfigWithServiceConfig.class, createService("my-service"));
RedisConnectionFactory connector = testContext.getBean("pool5_30Wait3000", getConnectorType());
RedisConnectionFactoryCloudConfigTestHelper.assertPoolProperties(connector, 30, 5, 3000);
}
Aggregations