Examples of RedisConnection


Examples of org.springframework.data.redis.connection.RedisConnection

    verify(redisConnection).info();
  }

  @Test
  public void redisIsDown() throws Exception {
    RedisConnection redisConnection = mock(RedisConnection.class);
    RedisConnectionFactory redisConnectionFactory = mock(RedisConnectionFactory.class);
    given(redisConnectionFactory.getConnection()).willReturn(redisConnection);
    given(redisConnection.info()).willThrow(
        new RedisConnectionFailureException("Connection failed"));
    RedisHealthIndicator healthIndicator = new RedisHealthIndicator(
        redisConnectionFactory);

    Health health = healthIndicator.health();
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

    ConnectionFactoryTracker.add(factory);
  }

  @After
  public void stop() {
    RedisConnection connection = factory.getConnection();
    connection.flushDb();
    connection.close();
  }
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

  public RedisTestProfileValueSource() {
    if (redisVersion == null) {
      LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(SettingsUtils.getHost(),
          SettingsUtils.getPort());
      connectionFactory.afterPropertiesSet();
      RedisConnection connection = connectionFactory.getConnection();
      redisVersion = RedisVersionUtils.getRedisVersion(connection);
      connection.close();
      connectionFactory.destroy();
    }
  }
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

    assumeTrue(RedisTestProfileValueSource.matches("redisVersion", "2.6"));
  }

  @After
  public void stop() {
    RedisConnection connection = factory.getConnection();
    connection.flushDb();
    connection.close();
  }
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

    connectionFactory.setHostName(SettingsUtils.getHost());
    connectionFactory.setPort(SettingsUtils.getPort());
    connectionFactory.setTimeout(100);

    connectionFactory.afterPropertiesSet();
    RedisConnection connection = connectionFactory.getConnection();

    Version version = Version.UNKNOWN;

    try {
      version = RedisVersionUtils.getRedisVersion(connection);
      connection.close();
    } finally {
      connectionFactory.destroy();
    }

    return version;
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

    @SuppressWarnings({ "rawtypes" })
    @Bean
    public RedisTemplate redisTemplate() {

      RedisConnection connectionMock = mock(RedisConnection.class);
      RedisConnectionFactory factoryMock = mock(RedisConnectionFactory.class);

      when(factoryMock.getConnection()).thenReturn(connectionMock);

      RedisTemplate template = new RedisTemplate();
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

    @SuppressWarnings({ "rawtypes" })
    @Bean
    public RedisTemplate redisTemplate() {

      RedisConnection connectionMock = mock(RedisConnection.class);
      RedisConnectionFactory factoryMock = mock(RedisConnectionFactory.class);

      when(factoryMock.getConnection()).thenReturn(connectionMock);

      RedisTemplate template = new RedisTemplate();
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

    if (log.isDebugEnabled()) {
      log.debug("Opening RedisConnection");
    }

    RedisConnection conn = factory.getConnection();

    if (bind) {

      RedisConnection connectionToBind = conn;
      if (enableTransactionSupport && isActualNonReadonlyTransactionActive()) {
        connectionToBind = createConnectionProxy(conn, factory);
      }

      connHolder = new RedisConnectionHolder(connectionToBind);
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

    if (isActualNonReadonlyTransactionActive()) {

      if (!connHolder.isTransactionSyncronisationActive()) {
        connHolder.setTransactionSyncronisationActive(true);
       
        RedisConnection conn = connHolder.getConnection();
        conn.multi();

        TransactionSynchronizationManager.registerSynchronization(new RedisTransactionSynchronizer(connHolder, conn));
      }
    }
  }
View Full Code Here

Examples of org.springframework.data.redis.connection.RedisConnection

        }
      } else {
        if (log.isDebugEnabled()) {
          log.debug("Closing bound connection.");
        }
        RedisConnection connection = connHolder.getConnection();
        connection.close();
      }
    }

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.