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 65435173BE for ; Wed, 9 Sep 2015 12:37:48 +0000 (UTC) Received: (qmail 72201 invoked by uid 500); 9 Sep 2015 12:37:14 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 72116 invoked by uid 500); 9 Sep 2015 12:37:14 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 71511 invoked by uid 99); 9 Sep 2015 12:37:13 -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; Wed, 09 Sep 2015 12:37:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BE135E051B; Wed, 9 Sep 2015 12:37:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.apache.org Date: Wed, 09 Sep 2015 12:37:33 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [21/50] ignite git commit: Ignite-805 (cherry picked from commit adce9b9) Ignite-805 (cherry picked from commit adce9b9) Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/069653b7 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/069653b7 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/069653b7 Branch: refs/heads/ignite-843 Commit: 069653b74856d99b2b7535443d15b8515d9bd15c Parents: e5b06e3 Author: Anton Vinogradov Authored: Tue Sep 8 15:05:55 2015 +0300 Committer: Anton Vinogradov Committed: Tue Sep 8 15:12:26 2015 +0300 ---------------------------------------------------------------------- ...cheAbstractFullApiMultithreadedSelfTest.java | 63 +++++++++++++------- ...PartitionedFullApiMultithreadedSelfTest.java | 5 -- ...eReplicatedFullApiMultithreadedSelfTest.java | 5 -- ...dCacheLocalFullApiMultithreadedSelfTest.java | 5 -- 4 files changed, 40 insertions(+), 38 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/069653b7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiMultithreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiMultithreadedSelfTest.java index bfafe69..2959b34 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiMultithreadedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiMultithreadedSelfTest.java @@ -163,7 +163,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testContainsKey() throws Exception { - runTest(new CI1>() { + runTest(new CI1>() { @Override public void apply(IgniteCache cache) { assert cache.containsKey("key" + random()); assert !cache.containsKey("wrongKey"); @@ -175,7 +175,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testGet() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd = random(); @@ -189,7 +189,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testGetAsync() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd = random(); @@ -199,7 +199,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid assert cacheAsync.future().get() == rnd; - cache.get("wrongKey"); + cacheAsync.get("wrongKey"); assert cacheAsync.future().get() == null; } @@ -210,7 +210,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testGetAll() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd1 = random(); int rnd2 = random(); @@ -224,17 +224,20 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid }); } - /** + /** * @throws Exception In case of error. */ public void testGetAllAsync() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd1 = random(); int rnd2 = random(); - cache.withAsync().getAll(ImmutableSet.of("key" + rnd1, "key" + rnd2)); - Map map = cache.withAsync().>future().get(); + IgniteCache cacheAsync = cache.withAsync(); + + cacheAsync.getAll(ImmutableSet.of("key" + rnd1, "key" + rnd2)); + + Map map = cacheAsync.>future().get(); assert map.size() == (rnd1 != rnd2 ? 2 : 1); assert map.get("key" + rnd1) == rnd1; @@ -247,7 +250,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testRemove() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd1 = random(); int rnd2 = random(); @@ -255,13 +258,20 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid assert cache.getAndRemove("wrongKey") == null; assert !cache.remove("key" + rnd1, -1); - assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null || cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == rnd1; - assert cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == null || cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == rnd2; + Integer v1 = cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP); + Integer v2 = cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP); + + assert v1 == null || v1 == rnd1; + assert v2 == null || v2 == rnd2; + + v1 = cache.getAndRemove("key" + rnd1); - assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null || cache.getAndRemove("key" + rnd1) == rnd1; - assert cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == null || cache.remove("key" + rnd2, rnd2); + assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null && (v1 == null || v1 == rnd1); + + assert cache.getAndRemove("key" + rnd1) == null; + + cache.remove("key" + rnd2, rnd2); - assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null; assert cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == null; } }); @@ -271,7 +281,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testRemoveAsync() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd1 = random(); int rnd2 = random(); @@ -286,13 +296,20 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid assert !cacheAsync.future().get(); - assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null || cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == rnd1; - assert cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == null || cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == rnd2; + Integer v1 = cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP); + Integer v2 = cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP); + + assert v1 == null || v1 == rnd1; + assert v2 == null || v2 == rnd2; + + v1 = removeAsync(cache, "key" + rnd1); + + assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null && (v1 == null || v1 == rnd1); + + assert cache.getAndRemove("key" + rnd1) == null; - assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null || removeAsync(cache, "key" + rnd1) == rnd1; - assert cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == null || removeAsync(cache, "key" + rnd2, rnd2); + removeAsync(cache, "key" + rnd2, rnd2); - assert cache.localPeek("key" + rnd1, CachePeekMode.ONHEAP) == null; assert cache.localPeek("key" + rnd2, CachePeekMode.ONHEAP) == null; } }); @@ -302,7 +319,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testRemoveAll() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd = random(); @@ -318,7 +335,7 @@ public abstract class GridCacheAbstractFullApiMultithreadedSelfTest extends Grid * @throws Exception In case of error. */ public void testRemoveAllAsync() throws Exception { - runTest(new CIX1>() { + runTest(new CIX1>() { @Override public void applyx(IgniteCache cache) { int rnd = random(); http://git-wip-us.apache.org/repos/asf/ignite/blob/069653b7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java index 337febd..905996c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiMultithreadedSelfTest.java @@ -27,11 +27,6 @@ import static org.apache.ignite.cache.CacheMode.PARTITIONED; */ public class GridCachePartitionedFullApiMultithreadedSelfTest extends GridCacheAbstractFullApiMultithreadedSelfTest { /** {@inheritDoc} */ - @Override protected void beforeTest() throws Exception { - fail("https://issues.apache.org/jira/browse/IGNITE-805"); - } - - /** {@inheritDoc} */ @Override protected int gridCount() { return 3; } http://git-wip-us.apache.org/repos/asf/ignite/blob/069653b7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java index 81da1de..512713c 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiMultithreadedSelfTest.java @@ -27,11 +27,6 @@ import static org.apache.ignite.cache.CacheMode.REPLICATED; */ public class GridCacheReplicatedFullApiMultithreadedSelfTest extends GridCacheAbstractFullApiMultithreadedSelfTest { /** {@inheritDoc} */ - @Override protected void beforeTest() throws Exception { - fail("https://issues.apache.org/jira/browse/IGNITE-805"); - } - - /** {@inheritDoc} */ @Override protected int gridCount() { return 2; } http://git-wip-us.apache.org/repos/asf/ignite/blob/069653b7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java index fc97a59..27593a9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiMultithreadedSelfTest.java @@ -27,11 +27,6 @@ import static org.apache.ignite.cache.CacheMode.LOCAL; */ public class GridCacheLocalFullApiMultithreadedSelfTest extends GridCacheAbstractFullApiMultithreadedSelfTest { /** {@inheritDoc} */ - @Override protected void beforeTest() throws Exception { - fail("https://issues.apache.org/jira/browse/IGNITE-805"); - } - - /** {@inheritDoc} */ @Override protected int gridCount() { return 1; }