Search in sources :

Example 6 with RedisConnectionFactory

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);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Example 7 with RedisConnectionFactory

use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-cloud-connectors by spring-cloud.

the class RedisConnectionFactoryXmlConfigTest method cloudRedisConnectionFactoryWithTimeout.

@Test
public void cloudRedisConnectionFactoryWithTimeout() {
    ApplicationContext testContext = getTestApplicationContext("cloud-redis-with-config.xml", createService("my-service"));
    RedisConnectionFactory connector = testContext.getBean("service-timeout10", getConnectorType());
    RedisConnectionFactoryCloudConfigTestHelper.assertConnectionProperties(connector, 10);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Example 8 with RedisConnectionFactory

use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-cloud-connectors by spring-cloud.

the class RedisConnectionFactoryConfigWithServiceConfig method cloudRedisConnectionFactoryWithWithMaxPoolAndTimeout.

@Test
public void cloudRedisConnectionFactoryWithWithMaxPoolAndTimeout() {
    ApplicationContext testContext = getTestApplicationContext(RedisConnectionFactoryConfigWithServiceConfig.class, createService("my-service"));
    RedisConnectionFactory connector = testContext.getBean("pool30Wait300_timeout20", getConnectorType());
    RedisConnectionFactoryCloudConfigTestHelper.assertPoolProperties(connector, 30, 0, 300);
    RedisConnectionFactoryCloudConfigTestHelper.assertConnectionProperties(connector, 20);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Example 9 with RedisConnectionFactory

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);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Example 10 with RedisConnectionFactory

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() throws Exception {
    RedisServiceInfo serviceInfo = createServiceInfo();
    RedisConnectionFactory dataSource = testCreator.create(serviceInfo, null);
    assertConnectorProperties(serviceInfo, dataSource);
}
Also used : RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Aggregations

RedisConnectionFactory (org.springframework.data.redis.connection.RedisConnectionFactory)13 Test (org.junit.Test)12 ApplicationContext (org.springframework.context.ApplicationContext)8 Properties (java.util.Properties)2 RedisConnection (org.springframework.data.redis.connection.RedisConnection)2 MetricsProperties (org.apereo.cas.configuration.model.core.metrics.MetricsProperties)1 RedisObjectFactory (org.apereo.cas.redis.core.RedisObjectFactory)1 ExportMetricWriter (org.springframework.boot.actuate.autoconfigure.ExportMetricWriter)1 RedisMetricRepository (org.springframework.boot.actuate.metrics.repository.redis.RedisMetricRepository)1 ConditionalOnProperty (org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)1 RedisServiceInfo (org.springframework.cloud.service.common.RedisServiceInfo)1 Bean (org.springframework.context.annotation.Bean)1 RedisConnectionFailureException (org.springframework.data.redis.RedisConnectionFailureException)1 ClusterInfo (org.springframework.data.redis.connection.ClusterInfo)1 RedisClusterConnection (org.springframework.data.redis.connection.RedisClusterConnection)1 RedisClusterNode (org.springframework.data.redis.connection.RedisClusterNode)1