Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED5241861A for ; Thu, 23 Jul 2015 12:51:44 +0000 (UTC) Received: (qmail 11599 invoked by uid 500); 23 Jul 2015 12:51:41 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 11560 invoked by uid 500); 23 Jul 2015 12:51:41 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 11463 invoked by uid 99); 23 Jul 2015 12:51:41 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2015 12:51:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 68DEB1A76BE for ; Thu, 23 Jul 2015 12:51:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.791 X-Spam-Level: X-Spam-Status: No, score=0.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id HkRgD_-WG70h for ; Thu, 23 Jul 2015 12:51:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 808B72C6AC for ; Thu, 23 Jul 2015 12:51:25 +0000 (UTC) Received: (qmail 8198 invoked by uid 99); 23 Jul 2015 12:51:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jul 2015 12:51:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 491F6E6814; Thu, 23 Jul 2015 12:51:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 23 Jul 2015 12:51:35 -0000 Message-Id: <50c665bdafe54b8d95014fdb990be6b2@git.apache.org> In-Reply-To: <43889123f6864b0896167376fab79223@git.apache.org> References: <43889123f6864b0896167376fab79223@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/50] incubator-ignite git commit: # master minor # 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 Authored: Mon Jul 20 11:40:52 2015 +0300 Committer: sboikov 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 fut = GridTestUtils.runAsync(new Callable() { @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 fut = GridTestUtils.runAsync(new Callable() { - @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); + } } }