DATAREDIS-548 - Polishing.

Added connection starvation test for operations during readonly transaction.

Original Pull Request: #214
This commit is contained in:
Christoph Strobl
2016-08-30 10:36:14 +02:00
parent 53c7f80676
commit 5fd719bd8a

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,11 +26,13 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.annotation.Transactional;
import redis.clients.jedis.JedisPoolConfig;
/**
* @author Thomas Darimont
* @author Christoph Strobl
*/
@ContextConfiguration(classes = { PooledJedisContextConfiguration.class })
public class JedisTransactionalConnectionStarvationTest extends AbstractTransactionalTestBase {
@@ -75,6 +77,15 @@ public class JedisTransactionalConnectionStarvationTest extends AbstractTransact
tryOperations(MAX_CONNECTIONS + 1);
}
/**
* @see DATAREDIS-548
*/
@Test
@Transactional(readOnly = true)
public void readonlyTransactionSyncShouldNotExcceedMaxConnections() {
tryOperations(MAX_CONNECTIONS + 1);
}
@Configuration
public static class PooledJedisContextConfiguration extends RedisContextConfiguration {