Skip to content

Commit b2be26a

Browse files
DATAREDIS-548 - Polishing.
Added connection starvation test for operations during readonly transaction. Original Pull Request: #214
1 parent 87f03bd commit b2be26a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/test/java/org/springframework/data/redis/connection/jedis/JedisTransactionalConnectionStarvationTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015 the original author or authors.
2+
* Copyright 2015-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,11 +26,13 @@
2626
import org.springframework.data.redis.core.ValueOperations;
2727
import org.springframework.test.annotation.Rollback;
2828
import org.springframework.test.context.ContextConfiguration;
29+
import org.springframework.transaction.annotation.Transactional;
2930

3031
import redis.clients.jedis.JedisPoolConfig;
3132

3233
/**
3334
* @author Thomas Darimont
35+
* @author Christoph Strobl
3436
*/
3537
@ContextConfiguration(classes = { PooledJedisContextConfiguration.class })
3638
public class JedisTransactionalConnectionStarvationTest extends AbstractTransactionalTestBase {
@@ -75,6 +77,15 @@ public void testNumberOfOperationsGreaterThanNumberOfConnections() {
7577
tryOperations(MAX_CONNECTIONS + 1);
7678
}
7779

80+
/**
81+
* @see DATAREDIS-548
82+
*/
83+
@Test
84+
@Transactional(readOnly = true)
85+
public void readonlyTransactionSyncShouldNotExcceedMaxConnections() {
86+
tryOperations(MAX_CONNECTIONS + 1);
87+
}
88+
7889
@Configuration
7990
public static class PooledJedisContextConfiguration extends RedisContextConfiguration {
8091

0 commit comments

Comments
 (0)