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 2FCB419CD8 for ; Tue, 26 Apr 2016 01:07:09 +0000 (UTC) Received: (qmail 43384 invoked by uid 500); 26 Apr 2016 01:07:09 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 43305 invoked by uid 500); 26 Apr 2016 01:07:09 -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 42877 invoked by uid 99); 26 Apr 2016 01:07:08 -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; Tue, 26 Apr 2016 01:07:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CD5AFDFC6E; Tue, 26 Apr 2016 01:07:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agoncharuk@apache.org To: commits@ignite.apache.org Date: Tue, 26 Apr 2016 01:07:33 -0000 Message-Id: <8bb0def4880145d1b6efedc4f06d5057@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/50] [abbrv] ignite git commit: ignite-2835 Minor test changes. ignite-2835 Minor test changes. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d33b4340 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d33b4340 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d33b4340 Branch: refs/heads/ignite-testing-discovery Commit: d33b4340a68553e59e4adecf78fea79af55bf2ae Parents: e85a717 Author: sboikov Authored: Tue Apr 5 16:42:50 2016 +0300 Committer: sboikov Committed: Tue Apr 5 16:42:50 2016 +0300 ---------------------------------------------------------------------- .../BinaryObjectOffHeapUnswapTemporaryTest.java | 55 ++++++++------------ 1 file changed, 23 insertions(+), 32 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d33b4340/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java index 4272a14..d63b2c3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/BinaryObjectOffHeapUnswapTemporaryTest.java @@ -35,6 +35,7 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl; +import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.transactions.Transaction; import org.apache.ignite.transactions.TransactionConcurrency; @@ -81,7 +82,7 @@ public class BinaryObjectOffHeapUnswapTemporaryTest extends GridCommonAbstractTe CacheMemoryMode memoryMode) { this.atomicityMode = atomicityMode; - CacheConfiguration cfg = new CacheConfiguration(); + CacheConfiguration cfg = new CacheConfiguration<>(); cfg.setCacheMode(CacheMode.PARTITIONED); cfg.setAtomicityMode(atomicityMode); @@ -184,50 +185,50 @@ public class BinaryObjectOffHeapUnswapTemporaryTest extends GridCommonAbstractTe for (int i = 0; i < 2 * CNT; i++) keys.add(i); - check(new TestCheck() { - @Override public void check(Integer key) { + check(new IgniteInClosure() { + @Override public void apply(Integer key) { assertFalse(cache.get(key) instanceof BinaryObjectOffheapImpl); } }); - check(new TestCheck() { - @Override public void check(Integer key) { - assertFalse(cache.getEntry(key) instanceof BinaryObjectOffheapImpl); + check(new IgniteInClosure() { + @Override public void apply(Integer key) { + assertFalse(cache.getEntry(key).getValue() instanceof BinaryObjectOffheapImpl); } }); - check(new TestCheck() { - @Override public void check(Integer key) { + check(new IgniteInClosure() { + @Override public void apply(Integer key) { assertFalse(cache.getAndPut(key, cache.get(key)) instanceof BinaryObjectOffheapImpl); } }); - check(new TestCheck() { - @Override public void check(Integer key) { + check(new IgniteInClosure() { + @Override public void apply(Integer key) { assertFalse(cache.getAndReplace(key, cache.get(key)) instanceof BinaryObjectOffheapImpl); } }); - check(new TestCheck() { - @Override public void check(Integer key) { + check(new IgniteInClosure() { + @Override public void apply(Integer key) { assertFalse(cache.getAndPutIfAbsent(key, cache.get(key)) instanceof BinaryObjectOffheapImpl); } }); - check(new TestCheck() { - @Override public void check(Integer key) { + check(new IgniteInClosure() { + @Override public void apply(Integer key) { assertFalse(cache.localPeek(key) instanceof BinaryObjectOffheapImpl); } }); - check(new TestCheck() { - @Override public void check(Integer key) { + check(new IgniteInClosure() { + @Override public void apply(Integer key) { assertFalse(cache.getAndRemove(key) instanceof BinaryObjectOffheapImpl); } }); - check(new TestCheck() { - @Override public void check(Integer key) { + check(new IgniteInClosure() { + @Override public void apply(Integer key) { assertFalse(cache.invoke(key, PROC) instanceof BinaryObjectOffheapImpl); } }); @@ -318,17 +319,17 @@ public class BinaryObjectOffHeapUnswapTemporaryTest extends GridCommonAbstractTe } /** - * + * @param checkOp Check closure. */ - private void check(TestCheck checkOp) { + private void check(IgniteInClosure checkOp) { for (int key = 0; key < 2 * CNT; key++) { - checkOp.check(key); + checkOp.apply(key); if (atomicityMode == TRANSACTIONAL) { for (TransactionIsolation isolation : TransactionIsolation.values()) { for (TransactionConcurrency concurrency : TransactionConcurrency.values()) { try (Transaction tx = ignite(0).transactions().txStart(concurrency, isolation)) { - checkOp.check(key); + checkOp.apply(key); tx.commit(); } @@ -357,14 +358,4 @@ public class BinaryObjectOffHeapUnswapTemporaryTest extends GridCommonAbstractTe field2 = key; } } - - /** - * - */ - private static interface TestCheck { - /** - * @param t Parameter. - */ - public void check(T t); - } }