ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [20/50] incubator-ignite git commit: #ignite-565: Remove GridCache from tests.
Date Fri, 27 Mar 2015 12:52:31 GMT
#ignite-565: Remove GridCache from 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/175e0f99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/175e0f99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/175e0f99

Branch: refs/heads/sprint-3
Commit: 175e0f99af83b7282e9c2a4bea1f322cebf9b482
Parents: e373dff
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Mar 25 16:58:20 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Mar 25 16:58:20 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheSwapSelfTest.java | 10 ++---
 .../query/h2/GridH2IndexRebuildTest.java        | 42 ++++++++++----------
 2 files changed, 25 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/175e0f99/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
index d0a20fa..fb20604 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapSelfTest.java
@@ -447,7 +447,7 @@ public class GridCacheSwapSelfTest extends GridCommonAbstractTest {
         cache.localEvict(keys);
 
         for (int i = 0; i < ENTRY_CNT; i++)
-            assert cache.localPeek(i) == null;
+            assert cache.localPeek(i, CachePeekMode.ONHEAP) == null;
 
         assert swapCnt.get() == ENTRY_CNT;
         assert unswapCnt.get() == 0;
@@ -501,7 +501,7 @@ public class GridCacheSwapSelfTest extends GridCommonAbstractTest {
         assertEquals(0, unswapCnt.get());
 
         for (int i = lowerBound; i < upperBound; i++) {
-            assert cache.localPeek(i) == null;
+            assert cache.localPeek(i, CachePeekMode.ONHEAP) == null;
 
             cache.localPromote(Collections.singleton(i));
 
@@ -536,7 +536,7 @@ public class GridCacheSwapSelfTest extends GridCommonAbstractTest {
         Set<Integer> keys = new HashSet<>();
 
         for (int i = lowerBound; i < upperBound; i++) {
-            assert cache.localPeek(i) == null;
+            assert cache.localPeek(i, CachePeekMode.ONHEAP) == null;
 
             keys.add(i);
         }
@@ -564,7 +564,7 @@ public class GridCacheSwapSelfTest extends GridCommonAbstractTest {
         resetCounters();
 
         for (int i = lowerBound; i < upperBound; i++) {
-            assert cache.localPeek(i) == null;
+            assert cache.localPeek(i, CachePeekMode.ONHEAP) == null;
 
             CacheValue val = cache.get(i);
 
@@ -593,7 +593,7 @@ public class GridCacheSwapSelfTest extends GridCommonAbstractTest {
         resetCounters();
 
         for (int i = lowerBound; i < upperBound; i++) {
-            assert cache.localPeek(i) == null;
+            assert cache.localPeek(i, CachePeekMode.ONHEAP) == null;
 
             CacheValue val = cache.localPeek(i, CachePeekMode.SWAP);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/175e0f99/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
index 790b5de..39cf663 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexRebuildTest.java
@@ -28,7 +28,6 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.testframework.*;
 import org.jetbrains.annotations.*;
 
-import javax.cache.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -166,22 +165,21 @@ public class GridH2IndexRebuildTest extends GridCacheAbstractSelfTest
{
             cache2.put(ENTRY_CNT * 2 + i, new TestValue2(i, "val2-" + i));
         }
 
-        QueryCursor<Cache.Entry<Integer, TestValue1>> qry1 =
-            cache1.query(new SqlQuery(TestValue1.class, "val1 = 9000"));
+        SqlQuery<Integer, TestValue1> qry1 = new SqlQuery(TestValue1.class, "val1 =
9000");
 
-        QueryCursor<Cache.Entry<Integer, TestValue1>> qry2 =
-            cache1.query(new SqlQuery(TestValue1.class, "val2 = 'val2-9000'"));
+        SqlQuery<Integer, TestValue1> qry2 = new SqlQuery(TestValue1.class, "val2 =
'val2-9000'");
 
-        QueryCursor<Cache.Entry<Integer, TestValue1>> qry3 =
-            cache1.query(new SqlQuery(TestValue1.class, "val3 = 9000 and val4 = 9000"));
+        SqlQuery<Integer, TestValue1> qry3 = new SqlQuery(TestValue1.class, "val3 =
9000 and val4 = 9000");
 
-        QueryCursor<Cache.Entry<Integer, TestValue2>> qry4 =
-            cache2.query(new SqlQuery(TestValue2.class, "val1 = 9000"));
+        SqlQuery<Integer, TestValue2> qry4 = new SqlQuery(TestValue2.class, "val1 =
9000");
 
-        QueryCursor<Cache.Entry<Integer, TestValue2>> qry5 =
-            cache2.query(new SqlQuery(TestValue2.class, "val2 = 'val2-9000'"));
+        SqlQuery<Integer, TestValue2> qry5 = new SqlQuery(TestValue2.class, "val2 =
'val2-9000'");
 
-        checkQueryReturnsOneEntry(qry1, qry2, qry3, qry4, qry5);
+        assertEquals(1, cache1.query(qry1).getAll().size());
+        assertEquals(1, cache1.query(qry2).getAll().size());
+        assertEquals(1, cache1.query(qry3).getAll().size());
+        assertEquals(1, cache2.query(qry4).getAll().size());
+        assertEquals(1, cache2.query(qry5).getAll().size());
 
         for (int i = 0; i < ENTRY_CNT / 2; i++) {
             cache1.remove(i);
@@ -191,11 +189,19 @@ public class GridH2IndexRebuildTest extends GridCacheAbstractSelfTest
{
         cache().queries().rebuildIndexes(TestValue1.class).get();
         cache().queries().rebuildIndexes(TestValue2.class).get();
 
-        checkQueryReturnsOneEntry(qry1, qry2, qry3, qry4, qry5);
+        assertEquals(1, cache1.query(qry1).getAll().size());
+        assertEquals(1, cache1.query(qry2).getAll().size());
+        assertEquals(1, cache1.query(qry3).getAll().size());
+        assertEquals(1, cache2.query(qry4).getAll().size());
+        assertEquals(1, cache2.query(qry5).getAll().size());
 
         cache().queries().rebuildAllIndexes().get();
 
-        checkQueryReturnsOneEntry(qry1, qry2, qry3, qry4, qry5);
+        assertEquals(1, cache1.query(qry1).getAll().size());
+        assertEquals(1, cache1.query(qry2).getAll().size());
+        assertEquals(1, cache1.query(qry3).getAll().size());
+        assertEquals(1, cache2.query(qry4).getAll().size());
+        assertEquals(1, cache2.query(qry5).getAll().size());
     }
 
     /**
@@ -247,12 +253,4 @@ public class GridH2IndexRebuildTest extends GridCacheAbstractSelfTest
{
 
         assertTrue(spi.interrupted.await(5, TimeUnit.SECONDS));
     }
-
-    /**
-     * @throws Exception if failed.
-     */
-    private void checkQueryReturnsOneEntry(QueryCursor<?>... qrys) throws Exception
{
-        for (QueryCursor<?> qry : qrys)
-            assertEquals(1, qry.getAll().size());
-    }
 }


Mime
View raw message