Skip to content

Commit 91435d9

Browse files
committed
Using .close() instead.
1 parent 49572e7 commit 91435d9

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

src/main/java/org/mybatis/caches/redis/RedisCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private Object execute(RedisCallback callback) {
4949
try {
5050
return callback.doWithRedis(jedis);
5151
} finally {
52-
pool.returnResource(jedis);
52+
jedis.close();
5353
}
5454
}
5555

src/test/java/org/mybatis/caches/redis/RedisTestCase.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static org.junit.Assert.assertNotNull;
2020
import static org.junit.Assert.assertNull;
2121

22-
import org.junit.Before;
2322
import org.junit.BeforeClass;
2423
import org.junit.Test;
2524

@@ -30,24 +29,13 @@ public final class RedisTestCase {
3029

3130
private static final String DEFAULT_ID = "REDIS";
3231

33-
// CacheManager holds any settings between tests
3432
private static RedisCache cache;
3533

3634
@BeforeClass
3735
public static void newCache() {
3836
cache = new RedisCache(DEFAULT_ID);
3937
}
4038

41-
@Test
42-
public void shouldDemonstrateHowAllObjectsAreKept() {
43-
for (int i = 0; i < 100000; i++) {
44-
cache.putObject(i, i);
45-
assertEquals(i, cache.getObject(i));
46-
}
47-
// TODO, size does not work
48-
// assertEquals(100000, cache.getSize());
49-
}
50-
5139
@Test
5240
public void shouldDemonstrateCopiesAreEqual() {
5341
for (int i = 0; i < 1000; i++) {

0 commit comments

Comments
 (0)