Package org.springframework.data.redis.core

Examples of org.springframework.data.redis.core.StringRedisTemplate


  }

  @SuppressWarnings("unchecked")
  @Test
  public void testExecuteTx() {
    this.template = new StringRedisTemplate();
    template.setConnectionFactory(connFactory);
    template.afterPropertiesSet();
    final DefaultRedisScript<String> script = new DefaultRedisScript<String>();
    script.setScriptText("return 'bar'..KEYS[1]");
    script.setResultType(String.class);
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  @Test
  public void testExecuteCachedNullKeys() {
    this.template = new StringRedisTemplate();
    template.setConnectionFactory(connFactory);
    template.afterPropertiesSet();
    final DefaultRedisScript<String> script = new DefaultRedisScript<String>();
    script.setScriptText("return 'HELLO'");
    script.setResultType(String.class);
View Full Code Here

  @Test
  public void testNullSerialization() throws Exception {
    String[] keys = new String[] { "~", "[" };
    actual.add(connection.mGet(keys));
    verifyResults(Arrays.asList(new Object[] { Arrays.asList(new String[] { null, null }) }));
    StringRedisTemplate stringTemplate = new StringRedisTemplate(connectionFactory);
    List<String> multiGet = stringTemplate.opsForValue().multiGet(Arrays.asList(keys));
    assertEquals(Arrays.asList(new String[] { null, null }), multiGet);
  }
View Full Code Here

    jedisConnFactory.setHostName(SettingsUtils.getHost());
    jedisConnFactory.setDatabase(2);

    jedisConnFactory.afterPropertiesSet();

    RedisTemplate<String, String> stringTemplate = new StringRedisTemplate(jedisConnFactory);
    RedisTemplate<String, Person> personTemplate = new RedisTemplate<String, Person>();
    personTemplate.setConnectionFactory(jedisConnFactory);
    personTemplate.afterPropertiesSet();
    RedisTemplate<byte[], byte[]> rawTemplate = new RedisTemplate<byte[], byte[]>();
    rawTemplate.setEnableDefaultSerializer(false);
    rawTemplate.setConnectionFactory(jedisConnFactory);
    rawTemplate.afterPropertiesSet();

    // add Lettuce
    LettuceConnectionFactory lettuceConnFactory = new LettuceConnectionFactory();
    lettuceConnFactory.setPort(SettingsUtils.getPort());
    lettuceConnFactory.setHostName(SettingsUtils.getHost());
    lettuceConnFactory.afterPropertiesSet();

    RedisTemplate<String, String> stringTemplateLtc = new StringRedisTemplate(lettuceConnFactory);
    RedisTemplate<String, Person> personTemplateLtc = new RedisTemplate<String, Person>();
    personTemplateLtc.setConnectionFactory(lettuceConnFactory);
    personTemplateLtc.afterPropertiesSet();
    RedisTemplate<byte[], byte[]> rawTemplateLtc = new RedisTemplate<byte[], byte[]>();
    rawTemplateLtc.setEnableDefaultSerializer(false);
    rawTemplateLtc.setConnectionFactory(lettuceConnFactory);
    rawTemplateLtc.afterPropertiesSet();

    // SRP
    SrpConnectionFactory srpConnFactory = new SrpConnectionFactory();
    srpConnFactory.setPort(SettingsUtils.getPort());
    srpConnFactory.setHostName(SettingsUtils.getHost());
    srpConnFactory.afterPropertiesSet();

    RedisTemplate<String, String> stringTemplateSrp = new StringRedisTemplate(srpConnFactory);
    RedisTemplate<String, Person> personTemplateSrp = new RedisTemplate<String, Person>();
    personTemplateSrp.setConnectionFactory(srpConnFactory);
    personTemplateSrp.afterPropertiesSet();
    RedisTemplate<byte[], byte[]> rawTemplateSrp = new RedisTemplate<byte[], byte[]>();
    rawTemplateSrp.setEnableDefaultSerializer(false);
View Full Code Here

  public void setUp() throws Exception {

    // JredisConnection#publish is currently not supported -> tests would fail
    assumeThat(ConnectionUtils.isJredis(factory), is(false));

    template = new StringRedisTemplate(factory);

    adapter.setSerializer(template.getValueSerializer());
    adapter.afterPropertiesSet();

    container = new RedisMessageListenerContainer();
View Full Code Here

TOP

Related Classes of org.springframework.data.redis.core.StringRedisTemplate

Copyright © 2018 www.massapicom. 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.