Repository: incubator-ignite Updated Branches: refs/heads/ignite-96 fd700908a -> 5055a9051
#IGNITE-96 - Fixed hang in test Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5055a905 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5055a905 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5055a905 Branch: refs/heads/ignite-96 Commit: 5055a90517838baa4100741276fde177170cd7e8 Parents: fd70090 Author: Alexey Goncharuk <agoncha...@gridgain.com> Authored: Sat Feb 7 14:51:29 2015 -0800 Committer: Alexey Goncharuk <agoncha...@gridgain.com> Committed: Sat Feb 7 14:51:29 2015 -0800 ---------------------------------------------------------------------- .../distributed/GridCacheEventAbstractTest.java | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5055a905/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java index cc69a5f..7206db8 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java @@ -615,29 +615,30 @@ public abstract class GridCacheEventAbstractTest extends GridCacheAbstractSelfTe Iterator<Map.Entry<String, Integer>> iter = pairs(2).entrySet().iterator(); // Optimistic transaction. - IgniteTx tx = cache.txStart(OPTIMISTIC, REPEATABLE_READ); + try (IgniteTx tx = cache.txStart(OPTIMISTIC, REPEATABLE_READ)) { - Map.Entry<String, Integer> e = iter.next(); + Map.Entry<String, Integer> e = iter.next(); - String key = e.getKey(); - Integer val = e.getValue(); + String key = e.getKey(); + Integer val = e.getValue(); - assert cache.putIfAbsentAsync(key, val).get() == null; - assert val.equals(cache.putIfAbsentAsync(key, val).get()); + assert cache.putIfAbsentAsync(key, val).get() == null; + assert val.equals(cache.putIfAbsentAsync(key, val).get()); - assert cache.containsKey(key); + assert cache.containsKey(key); - e = iter.next(); + e = iter.next(); - key = e.getKey(); - val = e.getValue(); + key = e.getKey(); + val = e.getValue(); - assert cache.putxIfAbsentAsync(key, val).get(); - assert !cache.putxIfAbsentAsync(key, val).get(); + assert cache.putxIfAbsentAsync(key, val).get(); + assert !cache.putxIfAbsentAsync(key, val).get(); - assert cache.containsKey(key); + assert cache.containsKey(key); - tx.commit(); + tx.commit(); + } assert cache.containsKey(key); }