ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [11/50] incubator-ignite git commit: # master minor
Date Thu, 23 Jul 2015 12:51:35 GMT
# master minor


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d8f86f18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d8f86f18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d8f86f18

Branch: refs/heads/ignite-gg-10212
Commit: d8f86f18315da2c6882eae72117f5f2033e3b67a
Parents: f9d2a2e
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Jul 20 11:40:52 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Jul 20 11:40:52 2015 +0300

----------------------------------------------------------------------
 .../IgniteCachePutRetryAbstractSelfTest.java    | 52 +++++++++++++-------
 ...gniteCachePutRetryTransactionalSelfTest.java | 17 ++++---
 2 files changed, 44 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d8f86f18/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index bfddbe7..7f2d173 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -71,6 +71,8 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
     public void testPut() throws Exception {
         final AtomicBoolean finished = new AtomicBoolean();
 
+        int keysCnt = keysCount();
+
         IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>()
{
             @Override public Object call() throws Exception {
                 while (!finished.get()) {
@@ -85,13 +87,18 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
             }
         });
 
-        int keysCnt = keysCount();
 
-        for (int i = 0; i < keysCnt; i++)
-            ignite(0).cache(null).put(i, i);
+        try {
+            for (int i = 0; i < keysCnt; i++)
+                ignite(0).cache(null).put(i, i);
 
-        finished.set(true);
-        fut.get();
+            finished.set(true);
+
+            fut.get();
+        }
+        finally {
+            finished.set(true);
+        }
 
         for (int i = 0; i < keysCnt; i++)
             assertEquals(i, ignite(0).cache(null).get(i));
@@ -117,27 +124,34 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
             }
         });
 
-        int keysCnt = keysCount();
+        try {
+            int keysCnt = keysCount();
 
-        boolean exceptionThrown = false;
+            boolean eThrown = false;
 
-        for (int i = 0; i < keysCnt; i++) {
-            try {
-                ignite(0).cache(null).withNoRetries().put(i, i);
-            }
-            catch (Exception e) {
-                assertTrue("Invalid exception: " + e, X.hasCause(e, ClusterTopologyCheckedException.class)
|| X.hasCause(e, CachePartialUpdateException.class));
+            for (int i = 0; i < keysCnt; i++) {
+                try {
+                    ignite(0).cache(null).withNoRetries().put(i, i);
+                }
+                catch (Exception e) {
+                    assertTrue("Invalid exception: " + e, X.hasCause(e, ClusterTopologyCheckedException.class)
||
+                        X.hasCause(e, CachePartialUpdateException.class));
 
-                exceptionThrown = true;
+                    eThrown = true;
 
-                break;
+                    break;
+                }
             }
-        }
 
-        assertTrue(exceptionThrown);
+            assertTrue(eThrown);
 
-        finished.set(true);
-        fut.get();
+            finished.set(true);
+
+            fut.get();
+        }
+        finally {
+            finished.set(true);
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d8f86f18/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
index 91c454a..1d14dec 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
@@ -49,8 +49,7 @@ public class IgniteCachePutRetryTransactionalSelfTest extends IgniteCachePutRetr
         IgniteAtomicLong atomic = ignite(0).atomicLong("TestAtomic", 0, true);
 
         IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>()
{
-            @Override
-            public Object call() throws Exception {
+            @Override public Object call() throws Exception {
                 while (!finished.get()) {
                     stopGrid(3);
 
@@ -65,10 +64,16 @@ public class IgniteCachePutRetryTransactionalSelfTest extends IgniteCachePutRetr
 
         int keysCnt = keysCount();
 
-        for (int i = 0; i < keysCnt; i++)
-            atomic.incrementAndGet();
+        try {
+            for (int i = 0; i < keysCnt; i++)
+                atomic.incrementAndGet();
 
-        finished.set(true);
-        fut.get();
+            finished.set(true);
+
+            fut.get();
+        }
+        finally {
+            finished.set(true);
+        }
     }
 }


Mime
View raw message