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 EEDB61857D for ; Mon, 20 Jul 2015 08:31:00 +0000 (UTC) Received: (qmail 35829 invoked by uid 500); 20 Jul 2015 08:30:39 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 35799 invoked by uid 500); 20 Jul 2015 08:30:39 -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 35790 invoked by uid 99); 20 Jul 2015 08:30:39 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jul 2015 08:30:39 +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 E16A71A745F for ; Mon, 20 Jul 2015 08:30:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-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 IBw9fxC37G-J for ; Mon, 20 Jul 2015 08:30:32 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id F2CFC343FB for ; Mon, 20 Jul 2015 08:30:20 +0000 (UTC) Received: (qmail 34038 invoked by uid 99); 20 Jul 2015 08:30:16 -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; Mon, 20 Jul 2015 08:30:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0D163E0428; Mon, 20 Jul 2015 08:30:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ivasilinets@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 20 Jul 2015 08:31:00 -0000 Message-Id: <19afac4310bb437cbdea326004e38b6e@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [46/50] [abbrv] incubator-ignite git commit: # master fix tests # master fix tests Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/192fefc2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/192fefc2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/192fefc2 Branch: refs/heads/ignite-1109 Commit: 192fefc2382d479a62504517cf3ddc8d5188657c Parents: f557728 Author: sboikov Authored: Mon Jul 20 10:09:24 2015 +0300 Committer: sboikov Committed: Mon Jul 20 10:09:24 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheUtils.java | 4 +- .../ignite/internal/util/IgniteUtils.java | 4 +- .../IgniteClientReconnectFailoverTest.java | 47 ++++++++++++-------- .../cache/IgniteCacheNearLockValueSelfTest.java | 2 + 4 files changed, 32 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java index bd2623d..e16e30d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java @@ -1561,9 +1561,7 @@ public class GridCacheUtils { */ @NotNull public static RuntimeException convertToCacheException(IgniteCheckedException e) { IgniteClientDisconnectedCheckedException disconnectedErr = - e instanceof IgniteClientDisconnectedCheckedException ? - (IgniteClientDisconnectedCheckedException)e - : e.getCause(IgniteClientDisconnectedCheckedException.class); + e.getCause(IgniteClientDisconnectedCheckedException.class); if (disconnectedErr != null) { assert disconnectedErr.reconnectFuture() != null : disconnectedErr; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 66eb596..42982b9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -691,9 +691,7 @@ public abstract class IgniteUtils { } IgniteClientDisconnectedCheckedException disconnectedErr = - e instanceof IgniteClientDisconnectedCheckedException ? - (IgniteClientDisconnectedCheckedException)e - : e.getCause(IgniteClientDisconnectedCheckedException.class); + e.getCause(IgniteClientDisconnectedCheckedException.class); if (disconnectedErr != null) { assert disconnectedErr.reconnectFuture() != null : disconnectedErr; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java index 7cfc329..b7de3eb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java @@ -22,6 +22,7 @@ import org.apache.ignite.configuration.*; import org.apache.ignite.lang.*; import org.apache.ignite.transactions.*; +import javax.cache.*; import java.util.*; import java.util.concurrent.*; @@ -114,37 +115,45 @@ public class IgniteClientReconnectFailoverTest extends IgniteClientReconnectFail reconnectFailover(new Callable() { @Override public Void call() throws Exception { - TreeMap map = new TreeMap<>(); + try { + TreeMap map = new TreeMap<>(); - ThreadLocalRandom rnd = ThreadLocalRandom.current(); + ThreadLocalRandom rnd = ThreadLocalRandom.current(); - for (int i = 0; i < 5; i++) { - Integer key = rnd.nextInt(0, 100_000); + for (int i = 0; i < 5; i++) { + Integer key = rnd.nextInt(0, 100_000); - cache.put(key, key); + cache.put(key, key); - assertEquals(key, cache.get(key)); + assertEquals(key, cache.get(key)); - map.put(key, key); - } + map.put(key, key); + } - for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) { - try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) { - for (Map.Entry e : map.entrySet()) { - cache.put(e.getKey(), e.getValue()); + for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) { + try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) { + for (Map.Entry e : map.entrySet()) { + cache.put(e.getKey(), e.getValue()); - assertNotNull(cache.get(e.getKey())); - } + assertNotNull(cache.get(e.getKey())); + } - tx.commit(); + tx.commit(); + } } - } - cache.putAll(map); + cache.putAll(map); - Map res = cache.getAll(map.keySet()); + Map res = cache.getAll(map.keySet()); - assertEquals(map, res); + assertEquals(map, res); + } + catch (CacheException e) { + if (e.getCause() instanceof IgniteClientDisconnectedException) + throw e; + else + log.info("Ignore error: " + e); + } return null; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java index cd04433..c500bbf 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java @@ -49,6 +49,8 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest { /** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { super.afterTestsStopped(); + + stopAllGrids(); } /** {@inheritDoc} */