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 DC3FB178E2 for ; Mon, 22 Jun 2015 09:05:06 +0000 (UTC) Received: (qmail 19431 invoked by uid 500); 22 Jun 2015 09:05:06 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 19400 invoked by uid 500); 22 Jun 2015 09:05:06 -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 19391 invoked by uid 99); 22 Jun 2015 09:05:06 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2015 09:05:06 +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 567501A5AE0 for ; Mon, 22 Jun 2015 09:05:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, 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 8StsCTnHU-O3 for ; Mon, 22 Jun 2015 09:04:58 +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 BCEAD21F26 for ; Mon, 22 Jun 2015 09:04:58 +0000 (UTC) Received: (qmail 18395 invoked by uid 99); 22 Jun 2015 09:04:58 -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, 22 Jun 2015 09:04:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7D73CE022E; Mon, 22 Jun 2015 09:04:58 +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: Mon, 22 Jun 2015 09:05:00 -0000 Message-Id: In-Reply-To: <2d9448a9380548219224bd75d977bf06@git.apache.org> References: <2d9448a9380548219224bd75d977bf06@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/38] incubator-ignite git commit: # ignite-sprint-6 more info in test assert # ignite-sprint-6 more info in test assert Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d874b00d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d874b00d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d874b00d Branch: refs/heads/ignite-yardstick-client Commit: d874b00dcb1687339adc34b6212e8cbc5b9ffe16 Parents: 6c683c2 Author: sboikov Authored: Thu Jun 18 11:07:04 2015 +0300 Committer: sboikov Committed: Thu Jun 18 11:07:04 2015 +0300 ---------------------------------------------------------------------- .../IgniteCacheAbstractStopBusySelfTest.java | 30 ++++++++++++-------- .../IgniteCacheAtomicStopBusySelfTest.java | 8 +++--- ...gniteCacheTransactionalStopBusySelfTest.java | 8 +++--- 3 files changed, 26 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d874b00d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java index 10b14cc..074f6ff 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java @@ -36,9 +36,13 @@ import org.apache.ignite.testframework.junits.common.*; import org.jetbrains.annotations.*; import java.io.*; +import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; +import static org.apache.ignite.cache.CacheRebalanceMode.*; +import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*; + /** * */ @@ -53,7 +57,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst public static final String CACHE_NAME = "StopTest"; /** */ - public static final TcpDiscoveryIpFinder finder = new TcpDiscoveryVmIpFinder(true); + public final TcpDiscoveryIpFinder finder = new TcpDiscoveryVmIpFinder(true); /** */ private AtomicBoolean suspended = new AtomicBoolean(false); @@ -62,7 +66,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst private CountDownLatch blocked; /** */ - protected AtomicReference bannedMessage = new AtomicReference<>(); + protected AtomicReference bannedMsg = new AtomicReference<>(); /** * @return Cache mode. @@ -93,9 +97,9 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst if (gridName.endsWith(String.valueOf(CLN_GRD))) cfg.setClientMode(true); - cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC); + cacheCfg.setRebalanceMode(SYNC); - cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); + cacheCfg.setWriteSynchronizationMode(FULL_SYNC); cacheCfg.setBackups(1); @@ -125,14 +129,14 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst TimeUnit.MILLISECONDS.sleep(100L); } - assert clientNode().cluster().nodes().size() == 2; + assertEquals(2, clientNode().cluster().nodes().size()); } /** {@inheritDoc} */ @Override protected void afterTest() throws Exception { suspended.set(false); - bannedMessage.set(null); + bannedMsg.set(null); afterTestsStopped(); @@ -140,7 +144,9 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst stopGrid(CLN_GRD); - assert G.allGrids().isEmpty(); + List nodes = G.allGrids(); + + assertTrue("Unexpected nodes: " + nodes, nodes.isEmpty()); } /** @@ -203,12 +209,11 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst * @throws Exception If failed. */ public void testGet() throws Exception { - bannedMessage.set(GridNearGetRequest.class); + bannedMsg.set(GridNearGetRequest.class); executeTest(new Callable() { /** {@inheritDoc} */ - @Override - public Integer call() throws Exception { + @Override public Integer call() throws Exception { info("Start operation."); Integer put = (Integer) clientCache().get(1); @@ -318,6 +323,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst * @return Cache configuration. * @throws Exception In case of error. */ + @SuppressWarnings("unchecked") private CacheConfiguration cacheConfiguration(@Nullable String cacheName) throws Exception { CacheConfiguration cfg = defaultCacheConfiguration(); @@ -339,10 +345,10 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst /** {@inheritDoc} */ @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException { if (suspended.get()) { - assert bannedMessage.get() != null; + assert bannedMsg.get() != null; if (msg instanceof GridIoMessage - && ((GridIoMessage)msg).message().getClass().equals(bannedMessage.get())) { + && ((GridIoMessage)msg).message().getClass().equals(bannedMsg.get())) { blocked.countDown(); return; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d874b00d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java index bae1601..ed15724 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java @@ -31,28 +31,28 @@ public class IgniteCacheAtomicStopBusySelfTest extends IgniteCacheAbstractStopBu /** {@inheritDoc} */ @Override public void testPut() throws Exception { - bannedMessage.set(GridNearAtomicUpdateRequest.class); + bannedMsg.set(GridNearAtomicUpdateRequest.class); super.testPut(); } /** {@inheritDoc} */ @Override public void testPutBatch() throws Exception { - bannedMessage.set(GridNearAtomicUpdateRequest.class); + bannedMsg.set(GridNearAtomicUpdateRequest.class); super.testPut(); } /** {@inheritDoc} */ @Override public void testPutAsync() throws Exception { - bannedMessage.set(GridNearAtomicUpdateRequest.class); + bannedMsg.set(GridNearAtomicUpdateRequest.class); super.testPut(); } /** {@inheritDoc} */ @Override public void testRemove() throws Exception { - bannedMessage.set(GridNearAtomicUpdateRequest.class); + bannedMsg.set(GridNearAtomicUpdateRequest.class); super.testPut(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d874b00d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java index fe1b266..e87a772 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java @@ -30,28 +30,28 @@ public class IgniteCacheTransactionalStopBusySelfTest extends IgniteCacheAbstrac /** {@inheritDoc} */ @Override public void testPut() throws Exception { - bannedMessage.set(GridNearTxPrepareRequest.class); + bannedMsg.set(GridNearTxPrepareRequest.class); super.testPut(); } /** {@inheritDoc} */ @Override public void testPutBatch() throws Exception { - bannedMessage.set(GridNearTxPrepareRequest.class); + bannedMsg.set(GridNearTxPrepareRequest.class); super.testPut(); } /** {@inheritDoc} */ @Override public void testPutAsync() throws Exception { - bannedMessage.set(GridNearTxPrepareRequest.class); + bannedMsg.set(GridNearTxPrepareRequest.class); super.testPut(); } /** {@inheritDoc} */ @Override public void testRemove() throws Exception { - bannedMessage.set(GridNearTxPrepareRequest.class); + bannedMsg.set(GridNearTxPrepareRequest.class); super.testPut(); }