polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject zest-java git commit: redis-entitystore: remove usage of deprecated methods in tests
Date Sat, 03 Dec 2016 12:09:43 GMT
Repository: zest-java
Updated Branches:
  refs/heads/develop 7ac533885 -> 07f569983


redis-entitystore: remove usage of deprecated methods in tests


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/07f56998
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/07f56998
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/07f56998

Branch: refs/heads/develop
Commit: 07f569983b5828c57b5a2872ab15fc0406da0aab
Parents: 7ac5338
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sat Dec 3 13:00:38 2016 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sat Dec 3 13:00:38 2016 +0100

----------------------------------------------------------------------
 .../zest/entitystore/redis/RedisMapEntityStoreTest.java     | 9 ++-------
 .../entitystore/redis/RedisMapEntityStoreWithCacheTest.java | 8 +-------
 2 files changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/07f56998/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java
b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java
index 6ca6986..77b8f77 100644
--- a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java
+++ b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java
@@ -55,6 +55,7 @@ public class RedisMapEntityStoreTest
         new RedisEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble(
module );
     }
     // END SNIPPET: assembly
+
     private JedisPool jedisPool;
 
     @Override
@@ -64,22 +65,16 @@ public class RedisMapEntityStoreTest
         super.setUp();
         RedisMapEntityStoreService es = serviceFinder.findService( RedisMapEntityStoreService.class
).get();
         jedisPool = es.jedisPool();
-
     }
 
     @Override
     public void tearDown()
         throws Exception
     {
-        Jedis jedis = jedisPool.getResource();
-        try
+        try( Jedis jedis = jedisPool.getResource() )
         {
             jedis.flushDB();
         }
-        finally
-        {
-            jedisPool.returnResource( jedis );
-        }
         super.tearDown();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/07f56998/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java
b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java
index 0f0f23b..6354bce 100644
--- a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java
+++ b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java
@@ -61,22 +61,16 @@ public class RedisMapEntityStoreWithCacheTest
         super.setUp();
         RedisMapEntityStoreService es = serviceFinder.findService( RedisMapEntityStoreService.class
).get();
         jedisPool = es.jedisPool();
-
     }
 
     @Override
     public void tearDown()
         throws Exception
     {
-        Jedis jedis = jedisPool.getResource();
-        try
+        try( Jedis jedis = jedisPool.getResource() )
         {
             jedis.flushDB();
         }
-        finally
-        {
-            jedisPool.returnResource( jedis );
-        }
         super.tearDown();
     }
 }


Mime
View raw message