ignite-341 - tests 2
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/385c7de1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/385c7de1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/385c7de1 Branch: refs/heads/ignite-443 Commit: 385c7de1cb6e890c1d38ee0e138bf1c4684a7394 Parents: e712b49 Author: S.Vladykin <svlady...@gridgain.com> Authored: Wed Mar 25 17:52:34 2015 +0300 Committer: S.Vladykin <svlady...@gridgain.com> Committed: Wed Mar 25 17:52:34 2015 +0300 ---------------------------------------------------------------------- .../query/h2/opt/GridH2AbstractKeyValueRow.java | 2 +- .../IgniteCacheQueryMultiThreadedSelfTest.java | 29 ++++---------------- 2 files changed, 7 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/385c7de1/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java index e6eae5c..2770a10 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2AbstractKeyValueRow.java @@ -261,7 +261,7 @@ public abstract class GridH2AbstractKeyValueRow extends GridH2Row { v = syncValue(); } - if (++loops == 1000) + if (++loops == 1000_000) throw new IllegalStateException("Failed to get value for key: " + k); } catch (IgniteCheckedException e) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/385c7de1/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java index 8029cf3..1b1d094 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryMultiThreadedSelfTest.java @@ -53,7 +53,7 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes private static final boolean TEST_INFO = true; /** Number of test grids (nodes). Should not be less than 2. */ - private static final int GRID_CNT = 2; + private static final int GRID_CNT = 3; /** */ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); @@ -289,15 +289,8 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes case 4: int from = rnd.nextInt(valCnt); - QueryCursor<Cache.Entry<Integer, String>> qry = c.query( - new SqlQuery(String.class, "_val between ? and ?").setArgs( - String.valueOf(from), String.valueOf(from + 250))); - - Collection<Cache.Entry<Integer, String>> res = qry.getAll(); - - for (Cache.Entry<Integer, String> ignored : res) { - //No-op. - } + c.query(new SqlQuery(String.class, "_val between ? and ?").setArgs( + String.valueOf(from), String.valueOf(from + 250))).getAll(); } } } @@ -442,13 +435,8 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes case 4: int from = rnd.nextInt(valCnt); - Collection<Cache.Entry<Integer, Object>> res = c.query( - new SqlQuery(Object.class, "_val between ? and ?").setArgs(from, from + 250)) + c.query(new SqlQuery(Object.class, "_val between ? and ?").setArgs(from, from + 250)) .getAll(); - - for (Cache.Entry<Integer, Object> ignored : res) { - //No-op. - } } } } @@ -517,13 +505,8 @@ public class IgniteCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTes case 4: int from = rnd.nextInt(valCnt); - Collection<Cache.Entry<Integer, TestValue>> res = - c.query(new SqlQuery(TestValue.class, "TestValue.val between ? and ?").setArgs( - from, from + 250)).getAll(); - - for (Cache.Entry<Integer, TestValue> ignored : res) { - //No-op. - } + c.query(new SqlQuery(TestValue.class, "TestValue.val between ? and ?") + .setArgs(from, from + 250)).getAll(); } } }