ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [2/2] incubator-ignite git commit: # IGNITE-56 Get rid Ignite.cache(), use ((IgniteKernal)ignite).cache() instead.
Date Sat, 14 Feb 2015 12:15:14 GMT
# IGNITE-56 Get rid Ignite.cache(), use ((IgniteKernal)ignite).cache() instead.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e06e9734
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e06e9734
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e06e9734

Branch: refs/heads/sprint-1
Commit: e06e97345be8b573f3d8fbe190c1baa446fc5b43
Parents: 40a95cc
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Sat Feb 14 15:14:42 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Sat Feb 14 15:15:00 2015 +0300

----------------------------------------------------------------------
 .../GridCacheConcurrentTxMultiNodeTest.java     |  4 +-
 ...CacheFullTextQueryMultithreadedSelfTest.java |  2 +-
 .../cache/GridCacheLuceneQueryIndexTest.java    | 16 ++--
 .../cache/GridCacheOffHeapSelfTest.java         |  2 +-
 .../cache/GridCacheP2PUndeploySelfTest.java     |  2 +-
 .../cache/GridCacheQueryIndexSelfTest.java      |  5 +-
 .../GridCacheQueryInternalKeysSelfTest.java     |  2 +-
 .../cache/GridCacheSwapPreloadSelfTest.java     |  2 +-
 .../GridCacheVariableTopologySelfTest.java      |  2 +-
 .../cache/IgniteTxMultiNodeAbstractTest.java    |  6 +-
 .../GridCacheQueueCleanupSelfTest.java          |  8 +-
 .../GridCacheAbstractJobExecutionTest.java      |  7 +-
 .../GridCacheClientModesAbstractSelfTest.java   |  9 ++-
 ...ePartitionedNearDisabledMetricsSelfTest.java |  2 +-
 ...achePartitionedPreloadLifecycleSelfTest.java |  8 +-
 ...hePartitionedQueryMultiThreadedSelfTest.java |  2 +-
 ...CacheReplicatedPreloadLifecycleSelfTest.java |  7 +-
 .../GridCacheSwapScanQueryAbstractSelfTest.java | 13 ++--
 ...ridCacheContinuousQueryAbstractSelfTest.java | 44 +++++------
 ...dCacheContinuousQueryReplicatedSelfTest.java |  9 ++-
 ...dCacheAbstractReduceFieldsQuerySelfTest.java | 11 +--
 ...cheReduceFieldsQueryPartitionedSelfTest.java |  3 +-
 .../GridContinuousOperationsLoadTest.java       |  2 +-
 .../query/h2/GridH2IndexingGeoSelfTest.java     |  8 +-
 .../GridHibernateAccessStrategyAdapter.java     |  3 +-
 .../hibernate/GridHibernateRegionFactory.java   |  7 +-
 .../GridCacheAbstractFieldsQuerySelfTest.java   | 47 +++++------
 .../cache/GridCacheAbstractQuerySelfTest.java   | 82 ++++++++++----------
 .../cache/GridCacheCrossCacheQuerySelfTest.java |  5 +-
 .../cache/GridCacheOffHeapAndSwapSelfTest.java  |  4 +-
 .../GridCacheQueryMultiThreadedSelfTest.java    | 30 +++----
 .../GridCacheSqlQueryMultiThreadedSelfTest.java |  3 +-
 .../processors/cache/GridCacheSwapSelfTest.java |  7 +-
 .../cache/GridIndexingWithNoopSwapSelfTest.java |  3 +-
 .../GridCacheAtomicFieldsQuerySelfTest.java     |  3 +-
 ...GridCachePartitionedFieldsQuerySelfTest.java |  3 +-
 ...idCachePartitionedHitsAndMissesSelfTest.java |  2 +-
 .../near/GridCachePartitionedQuerySelfTest.java | 23 +++---
 .../near/GridCacheQueryNodeRestartSelfTest.java |  2 +-
 .../GridCacheReplicatedFieldsQuerySelfTest.java |  4 +-
 .../GridCacheReplicatedQuerySelfTest.java       |  6 +-
 .../local/GridCacheLocalQuerySelfTest.java      |  5 +-
 .../query/h2/GridH2IndexRebuildTest.java        | 16 ++--
 .../query/h2/sql/GridQueryParsingTest.java      |  2 +-
 .../tcp/GridOrderedMessageCancelSelfTest.java   |  2 +-
 .../org/apache/ignite/IgniteSpringBean.java     |  3 +-
 .../ignite/cache/spring/SpringCacheManager.java |  3 +-
 .../cache/spring/SpringDynamicCacheManager.java |  2 +-
 48 files changed, 233 insertions(+), 210 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
index 5cfbacf..3a79755 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentTxMultiNodeTest.java
@@ -677,7 +677,7 @@ public class GridCacheConcurrentTxMultiNodeTest extends GridCommonAbstractTest {
          * @return Request.
          */
         private Request findRequestWithMessageId(Long msgId) {
-            CacheProjection<Object, Request> cache = ignite.cache(null).projection(Object.class, Request.class);
+            CacheProjection<Object, Request> cache = ((IgniteKernal)ignite).cache(null).projection(Object.class, Request.class);
 
             CacheQuery<Map.Entry<Object, Request>> qry = cache.queries().createSqlQuery(
                 Request.class, "messageId = ?");
@@ -707,7 +707,7 @@ public class GridCacheConcurrentTxMultiNodeTest extends GridCommonAbstractTest {
          * @throws IgniteCheckedException If failed.
          */
         private void put(Object o, String cacheKey, String terminalId) throws IgniteCheckedException {
-//            GridCache<CacheAffinityKey<String>, Object> cache = ignite.cache(null);
+//            GridCache<CacheAffinityKey<String>, Object> cache = ((IgniteKernal)ignite).cache(null);
 //
 //            CacheAffinityKey<String> affinityKey = new CacheAffinityKey<>(cacheKey, terminalId);
 //

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
index 6d49795..4977b38 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
@@ -74,7 +74,7 @@ public class GridCacheFullTextQueryMultithreadedSelfTest extends GridCacheAbstra
         final int logFreq = 50;
         final String txt = "Value";
 
-        final GridCache<Integer, H2TextValue> c = grid(0).cache(null);
+        final GridCache<Integer, H2TextValue> c = ((IgniteKernal)grid(0)).cache(null);
 
         IgniteInternalFuture<?> fut1 = multithreadedAsync(new Callable() {
                 @Override public Object call() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
index 8831cd7..c608f87 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLuceneQueryIndexTest.java
@@ -102,8 +102,8 @@ public class GridCacheLuceneQueryIndexTest extends GridCommonAbstractTest {
     public void testLuceneIndex() throws Exception {
         final Ignite g = startGrid(0);
 
-        final GridCache<Integer, ObjectValue> cache1 = g.cache("local1");
-        final GridCache<Integer, ObjectValue> cache2 = g.cache("local2");
+        final GridCache<Integer, ObjectValue> cache1 = ((IgniteKernal)g).cache("local1");
+        final GridCache<Integer, ObjectValue> cache2 = ((IgniteKernal)g).cache("local2");
 
         final AtomicInteger threadIdxGen = new AtomicInteger();
 
@@ -159,8 +159,8 @@ public class GridCacheLuceneQueryIndexTest extends GridCommonAbstractTest {
     public void testLuceneIndex1() throws Exception {
         final Ignite g = startGrid(0);
 
-        final GridCache<Integer, ObjectValue> cache1 = g.cache("local1");
-        final GridCache<Integer, ObjectValue> cache2 = g.cache("local2");
+        final GridCache<Integer, ObjectValue> cache1 = ((IgniteKernal)g).cache("local1");
+        final GridCache<Integer, ObjectValue> cache2 = ((IgniteKernal)g).cache("local2");
 
         final AtomicInteger threadIdxGen = new AtomicInteger();
 
@@ -230,8 +230,8 @@ public class GridCacheLuceneQueryIndexTest extends GridCommonAbstractTest {
     public void testLuceneIndex2() throws Exception {
         final Ignite g = startGrid(0);
 
-        final GridCache<Integer, ObjectValue> cache1 = g.cache("local1");
-        final GridCache<Integer, ObjectValue> cache2 = g.cache("local2");
+        final GridCache<Integer, ObjectValue> cache1 = ((IgniteKernal)g).cache("local1");
+        final GridCache<Integer, ObjectValue> cache2 = ((IgniteKernal)g).cache("local2");
 
         final AtomicInteger threadIdxGen = new AtomicInteger();
 
@@ -303,8 +303,8 @@ public class GridCacheLuceneQueryIndexTest extends GridCommonAbstractTest {
     public void testLuceneIndex3() throws Exception {
         final Ignite g = startGrid(0);
 
-        final GridCache<ObjectKey, ObjectValue> cache1 = g.cache("local1");
-        final GridCache<ObjectKey, ObjectValue> cache2 = g.cache("local2");
+        final GridCache<ObjectKey, ObjectValue> cache1 = ((IgniteKernal)g).cache("local1");
+        final GridCache<ObjectKey, ObjectValue> cache2 = ((IgniteKernal)g).cache("local2");
 
         final AtomicInteger threadIdxGen = new AtomicInteger();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
index 99d7578..2087849 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapSelfTest.java
@@ -287,7 +287,7 @@ public class GridCacheOffHeapSelfTest extends GridCommonAbstractTest {
 
             grid(0);
 
-            GridCache<Integer, Integer> cache = grid(0).cache(null);
+            GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
             for (int i = 0; i < 100; i++) {
                 info("Putting: " + i);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
index 7dd0105..ea99af2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheP2PUndeploySelfTest.java
@@ -187,7 +187,7 @@ public class GridCacheP2PUndeploySelfTest extends GridCommonAbstractTest {
      */
     private long size(String cacheName, IgniteKernal g) throws IgniteCheckedException {
         if (offheap)
-            return g.cache(cacheName).offHeapEntriesCount();
+            return ((IgniteKernal)g).cache(cacheName).offHeapEntriesCount();
 
         return g.context().swap().swapSize(swapSpaceName(cacheName, g));
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexSelfTest.java
index dcd2acf..0ead33c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.query.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 
 import java.util.*;
@@ -49,7 +50,7 @@ public class GridCacheQueryIndexSelfTest extends GridCacheAbstractSelfTest {
      * @throws Exception If failed.
      */
     public void testWithoutStoreLoad() throws Exception {
-        GridCache<Integer, CacheValue> cache = grid(0).cache(null);
+        GridCache<Integer, CacheValue> cache = ((IgniteKernal)grid(0)).cache(null);
 
         for (int i = 0; i < ENTRY_CNT; i++)
             cache.put(i, new CacheValue(i));
@@ -65,7 +66,7 @@ public class GridCacheQueryIndexSelfTest extends GridCacheAbstractSelfTest {
         for (int i = 0; i < ENTRY_CNT; i++)
             putToStore(i, new CacheValue(i));
 
-        GridCache<Integer, CacheValue> cache0 = grid(0).cache(null);
+        GridCache<Integer, CacheValue> cache0 = ((IgniteKernal)grid(0)).cache(null);
 
         cache0.loadCache(null, 0);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
index f78dfda..6c0c583 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
@@ -68,7 +68,7 @@ public class GridCacheQueryInternalKeysSelfTest extends GridCacheAbstractSelfTes
     @SuppressWarnings("unchecked")
     public void testInternalKeysPreloading() throws Exception {
         try {
-            GridCache<Object, Object> cache = grid(0).cache(null);
+            GridCache<Object, Object> cache = ((IgniteKernal)grid(0)).cache(null);
 
             for (int i = 0; i < ENTRY_CNT; i++)
                 cache.put(new GridCacheQueueHeaderKey("queue" + i), 1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
index be093af..cb5b616 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
@@ -161,7 +161,7 @@ public class GridCacheSwapPreloadSelfTest extends GridCommonAbstractTest {
         try {
             startGrid(0);
 
-            final GridCache<Integer, Integer> cache = grid(0).cache(null);
+            final GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
             assertNotNull(cache);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java
index 0df39c5..a3d519d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java
@@ -165,7 +165,7 @@ public class GridCacheVariableTopologySelfTest extends GridCommonAbstractTest {
         GridFuture<?> debugFut = GridTestUtils.runMultiThreadedAsync(new Runnable() {
             @SuppressWarnings({"UnusedDeclaration"})
             @Override public void run() {
-                Cache<Object, Object> cache = grid(0).cache(null);
+                Cache<Object, Object> cache = ((IgniteKernal)grid(0)).cache(null);
 
                 try {
                     Thread.sleep(15000);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiNodeAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiNodeAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiNodeAbstractTest.java
index 1fa5984..d22c422 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiNodeAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiNodeAbstractTest.java
@@ -629,7 +629,7 @@ public abstract class IgniteTxMultiNodeAbstractTest extends GridCommonAbstractTe
         startGrids(GRID_CNT);
 
         try {
-            GridCache<String, Integer> cache = grid(0).cache(null);
+            GridCache<String, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
             cache.put(RMVD_CNTR_KEY, 0);
 
@@ -670,7 +670,7 @@ public abstract class IgniteTxMultiNodeAbstractTest extends GridCommonAbstractTe
         startGrids(GRID_CNT);
 
         try {
-            GridCache<String, Integer> cache = grid(0).cache(null);
+            GridCache<String, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
             cache.put(RMVD_CNTR_KEY, 0);
 
@@ -721,7 +721,7 @@ public abstract class IgniteTxMultiNodeAbstractTest extends GridCommonAbstractTe
         try {
             startGrids(GRID_CNT);
 
-            GridCache<String, Integer> cache = grid(0).cache(null);
+            GridCache<String, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
             // Store counter.
             cache.put(RMVD_CNTR_KEY, 0);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
index e5015db..e61d15b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
@@ -101,7 +101,7 @@ public class GridCacheQueueCleanupSelfTest extends IgniteCollectionAbstractTest
 
         stopGrid(killGridName);
 
-        assertNull(grid.cache(null).dataStructures().queue(QUEUE_NAME1, 0, false, false));
+        assertNull(((IgniteKernal)grid).cache(null).dataStructures().queue(QUEUE_NAME1, 0, false, false));
 
         final AtomicBoolean stop = new AtomicBoolean(false);
 
@@ -122,8 +122,8 @@ public class GridCacheQueueCleanupSelfTest extends IgniteCollectionAbstractTest
         fut1.get();
         fut2.get();
 
-        grid.cache(null).dataStructures().removeQueue(QUEUE_NAME1);
-        grid.cache(null).dataStructures().removeQueue(QUEUE_NAME2);
+        ((IgniteKernal)grid).cache(null).dataStructures().removeQueue(QUEUE_NAME1);
+        ((IgniteKernal)grid).cache(null).dataStructures().removeQueue(QUEUE_NAME2);
 
         assertTrue(GridTestUtils.waitForCondition(new PAX() {
             @Override public boolean applyx() {
@@ -148,7 +148,7 @@ public class GridCacheQueueCleanupSelfTest extends IgniteCollectionAbstractTest
         startGrid(killGridName);
 
         // Create queue again.
-        queue = grid.cache(null).dataStructures().queue(QUEUE_NAME1, 0, false, true);
+        queue = ((IgniteKernal)grid).cache(null).dataStructures().queue(QUEUE_NAME1, 0, false, true);
         */
 
         assertEquals(0, queue.size());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
index ae7d871..1bc59ea 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractJobExecutionTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.resources.*;
@@ -77,7 +78,7 @@ public abstract class GridCacheAbstractJobExecutionTest extends GridCommonAbstra
 
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
-        CacheProjection<String, int[]> cache = grid(0).cache(null).flagsOn(SYNC_COMMIT).
+        CacheProjection<String, int[]> cache = ((IgniteKernal)grid(0)).cache(null).flagsOn(SYNC_COMMIT).
             projection(String.class, int[].class);
 
         cache.removeAll();
@@ -85,7 +86,7 @@ public abstract class GridCacheAbstractJobExecutionTest extends GridCommonAbstra
         for (int i = 0; i < GRID_CNT; i++) {
             Ignite g = grid(i);
 
-            GridCache<String, int[]> c = g.cache(null);
+            GridCache<String, int[]> c = ((IgniteKernal)g).cache(null);
 
             assertEquals("Cache is not empty: " + c.entrySet(), 0, c.size());
         }
@@ -131,7 +132,7 @@ public abstract class GridCacheAbstractJobExecutionTest extends GridCommonAbstra
                 private Ignite ignite;
 
                 @Override public Void applyx(final Integer i) throws IgniteCheckedException {
-                    GridCache<String, int[]> cache = this.ignite.cache(null);
+                    GridCache<String, int[]> cache = ((IgniteKernal)this.ignite).cache(null);
 
                     try (IgniteTx tx = cache.txStart(concur, isolation)) {
                         int[] arr = cache.get("TestKey");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
index d0b86c1..7cb50b8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.consistenthash.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.typedef.*;
 
@@ -153,14 +154,14 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
 
             if (F.eq(g.name(), nearOnlyGridName)) {
                 for (int k = 0; k < 10000; k++) {
-                    GridCache<Object, Object> cache = g.cache(null);
+                    IgniteCache<Object, Object> cache = g.jcache(null);
 
                     String key = "key" + k;
 
                     if (cacheMode() == PARTITIONED)
-                        assertFalse(cache.affinity().isPrimaryOrBackup(g.cluster().localNode(), key));
+                        assertFalse(affinity(cache).isPrimaryOrBackup(g.cluster().localNode(), key));
 
-                    assertFalse(cache.affinity().mapKeyToPrimaryAndBackups(key).contains(g.cluster().localNode()));
+                    assertFalse(affinity(cache).mapKeyToPrimaryAndBackups(key).contains(g.cluster().localNode()));
                 }
             }
             else {
@@ -168,7 +169,7 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
                 boolean foundAffinityNode = false;
 
                 for (int k = 0; k < 10000; k++) {
-                    GridCache<Object, Object> cache = g.cache(null);
+                    GridCache<Object, Object> cache = ((IgniteKernal)g).cache(null);
 
                     String key = "key" + k;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
index 9a33e21..f0a7be7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedNearDisabledMetricsSelfTest.java
@@ -88,7 +88,7 @@ public class GridCachePartitionedNearDisabledMetricsSelfTest extends GridCacheAb
             g.jcache(null).removeAll();
 
             // TODO: getting of removed key will produce inner write and 4 inner read operations.
-            //g.cache(null).remove(0);
+            //((IgniteKernal)g).cache(null).remove(0);
 
             assert g.jcache(null).localSize() == 0;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
index 4a402b3..606f36e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
@@ -28,6 +29,7 @@ import org.apache.ignite.lifecycle.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.transactions.*;
 
+import javax.cache.*;
 import java.util.*;
 
 import static org.apache.ignite.cache.CacheMode.*;
@@ -173,7 +175,7 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
             info("Checking '" + (i + 1) + "' nodes...");
 
             for (int j = 0; j < G.allGrids().size(); j++) {
-                GridCache<Object, MyValue> c2 = grid(j).cache("two");
+                GridCache<Object, MyValue> c2 = ((IgniteKernal)grid(j)).cache("two");
 
                 CacheQuery<Map.Entry<Object, MyValue>> qry = c2.queries().createScanQuery(null);
 
@@ -190,12 +192,12 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
 
                         try {
                             Object v1 = e.getValue();
-                            Object v2 = grid.cache("one").get(key);
+                            Object v2 = grid.jcache("one").get(key);
 
                             assertNotNull(v2);
                             assertEquals(v1, v2);
                         }
-                        catch (IgniteCheckedException e1) {
+                        catch (CacheException e1) {
                             e1.printStackTrace();
 
                             assert false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedQueryMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedQueryMultiThreadedSelfTest.java
index b76e0f2..2bf9eeb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedQueryMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedQueryMultiThreadedSelfTest.java
@@ -128,7 +128,7 @@ public class GridCachePartitionedQueryMultiThreadedSelfTest extends GridCommonAb
         final Person p3 = new Person("Mike", 1800, "Bachelor");
         final Person p4 = new Person("Bob", 1900, "Bachelor");
 
-        final GridCache<UUID, Person> cache0 = grid(0).cache(null);
+        final GridCache<UUID, Person> cache0 = ((IgniteKernal)grid(0)).cache(null);
 
         cache0.put(p1.id(), p1);
         cache0.put(p2.id(), p2);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
index a30658b..f15f35e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
@@ -175,7 +176,7 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
             info("Checking '" + (i + 1) + "' nodes...");
 
             for (int j = 0; j < G.allGrids().size(); j++) {
-                GridCache<Object, MyValue> c2 = grid(j).cache("two");
+                GridCache<Object, MyValue> c2 = ((IgniteKernal)grid(j)).cache("two");
 
                 CacheQuery<Map.Entry<Object, MyValue>> qry = c2.queries().createScanQuery(null);
 
@@ -203,10 +204,10 @@ public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloa
 
                         try {
                             Object v1 = e.getValue();
-                            Object v2 = grid.cache("one").get(key);
+                            Object v2 = ((IgniteKernal)grid).cache("one").get(key);
 
                             assertNotNull("Cache c1 misses value for key [i=" + j0 + ", j=" + i0 +
-                                ", missedKey=" + key + ", cache=" + grid.cache("one").values() + ']', v2);
+                                ", missedKey=" + key + ", cache=" + ((IgniteKernal)grid).cache("one").values() + ']', v2);
                             assertEquals(v1, v2);
                         }
                         catch (IgniteCheckedException e1) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
index b676d86..a08db4d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.query;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -114,9 +115,9 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
      * @throws Exception If failed.
      */
     public void testQuery() throws Exception {
-        checkQuery(grid(0).cache(ATOMIC_CACHE_NAME));
+        checkQuery(((IgniteKernal)grid(0)).cache(ATOMIC_CACHE_NAME));
 
-        checkQuery(grid(0).cache(TRANSACTIONAL_CACHE_NAME));
+        checkQuery(((IgniteKernal)grid(0)).cache(TRANSACTIONAL_CACHE_NAME));
     }
 
     /**
@@ -206,9 +207,9 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
      * @throws Exception If failed.
      */
     public void testQueryPrimitives() throws Exception {
-        checkQueryPrimitives(grid(0).cache(ATOMIC_CACHE_NAME));
+        checkQueryPrimitives(((IgniteKernal)grid(0)).cache(ATOMIC_CACHE_NAME));
 
-        checkQueryPrimitives(grid(0).cache(TRANSACTIONAL_CACHE_NAME));
+        checkQueryPrimitives(((IgniteKernal)grid(0)).cache(TRANSACTIONAL_CACHE_NAME));
     }
 
     /**
@@ -262,9 +263,9 @@ public abstract class GridCacheSwapScanQueryAbstractSelfTest extends GridCommonA
      * @throws Exception If failed.
      */
     public void testQueryValueByteArray() throws Exception {
-        checkQueryValueByteArray(grid(0).cache(ATOMIC_CACHE_NAME));
+        checkQueryValueByteArray(((IgniteKernal)grid(0)).cache(ATOMIC_CACHE_NAME));
 
-        checkQueryValueByteArray(grid(0).cache(TRANSACTIONAL_CACHE_NAME));
+        checkQueryValueByteArray(((IgniteKernal)grid(0)).cache(TRANSACTIONAL_CACHE_NAME));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 1c3d9c6..d7da11c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -144,7 +144,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
         for (int i = 0; i < gridCount(); i++) {
             for (int j = 0; j < 5; j++) {
                 try {
-                    grid(i).cache(null).removeAll();
+                    ((IgniteKernal)grid(i)).cache(null).removeAll();
 
                     break;
                 }
@@ -161,7 +161,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
         }
 
         for (int i = 0; i < gridCount(); i++)
-            assertEquals("Cache is not empty: " + grid(i).cache(null).entrySet(), 0, grid(i).cache(null).size());
+            assertEquals("Cache is not empty: " + ((IgniteKernal)grid(i)).cache(null).entrySet(), 0, ((IgniteKernal)grid(i)).cache(null).size());
 
         for (int i = 0; i < gridCount(); i++) {
             GridContinuousProcessor proc = ((IgniteKernal)grid(i)).context().continuous();
@@ -203,7 +203,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      */
     @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
     public void testApi() throws Exception {
-        final CacheContinuousQuery<Object, Object> q = grid(0).cache(null).queries().createContinuousQuery();
+        final CacheContinuousQuery<Object, Object> q = ((IgniteKernal)grid(0)).cache(null).queries().createContinuousQuery();
 
         GridTestUtils.assertThrows(
             log,
@@ -354,7 +354,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testAllEntries() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -428,7 +428,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testEntriesByFilter() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -523,7 +523,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testProjection() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         // Queries for non-partitioned caches always run locally.
         if (cache.configuration().getCacheMode() != PARTITIONED)
@@ -602,7 +602,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testLocalNodeOnly() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         // Queries for non-partitioned caches always run locally.
         if (cache.configuration().getCacheMode() != PARTITIONED)
@@ -681,7 +681,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testStopByCallback() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -755,7 +755,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testBuffering() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         // Buffering make sense only for remote nodes, so test only for partitioned cache.
         if (cache.configuration().getCacheMode() != PARTITIONED)
@@ -848,7 +848,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testTimeInterval() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         // Buffering make sense only for remote nodes, so test only for partitioned cache.
         if (cache.configuration().getCacheMode() != PARTITIONED)
@@ -936,7 +936,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testIteration() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -978,7 +978,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testIterationAndUpdates() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -1022,7 +1022,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testLoadCache() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -1045,7 +1045,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
             qry.execute();
 
             for (int i = 0; i < gridCount(); i++)
-                grid(i).cache(null).loadCache(null, 0);
+                ((IgniteKernal)grid(i)).cache(null).loadCache(null, 0);
 
             assert latch.await(LATCH_TIMEOUT, MILLISECONDS) : "Count: " + latch.getCount();
 
@@ -1063,7 +1063,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testTypedProjection() throws Exception {
-        GridCache<Object, Object> cache = grid(0).cache(null);
+        GridCache<Object, Object> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry =
             cache.projection(Integer.class, Integer.class).queries().createContinuousQuery();
@@ -1112,7 +1112,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testEntryFilterProjection() throws Exception {
-        CacheProjection<Integer, Integer> cache = grid(0).cache(null);
+        CacheProjection<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.projection(
             new P1<Cache.Entry<Integer, Integer>>() {
@@ -1170,7 +1170,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testKeyValueFilterProjection() throws Exception {
-        CacheProjection<Integer, Integer> cache = grid(0).cache(null);
+        CacheProjection<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.projection(
             new P2<Integer, Integer>() {
@@ -1227,7 +1227,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
         if (atomicityMode() == ATOMIC)
             return;
 
-        GridCache<Object, Object> cache = grid(0).cache(null);
+        GridCache<Object, Object> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Object, Object> qry = cache.queries().createContinuousQuery();
 
@@ -1271,7 +1271,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testNodeJoin() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -1314,7 +1314,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
      * @throws Exception If failed.
      */
     public void testCallbackForPreload() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
         if (cache.configuration().getCacheMode() == LOCAL)
             return;
@@ -1331,7 +1331,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
         Ignite ignite = startGrid("anotherGrid");
 
         try {
-            cache = ignite.cache(null);
+            cache = ((IgniteKernal)ignite).cache(null);
 
             CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery();
 
@@ -1426,7 +1426,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
                 grid(i).events().localListen(execLsnr, EVT_CACHE_QUERY_EXECUTED);
             }
 
-            GridCache<Integer, Integer> cache = grid(0).cache(null);
+            GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(null);
 
             try (CacheContinuousQuery<Integer, Integer> qry = cache.queries().createContinuousQuery()) {
                 qry.localCallback(new IgniteBiPredicate<UUID, Collection<CacheContinuousQueryEntry<Integer, Integer>>>() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryReplicatedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryReplicatedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryReplicatedSelfTest.java
index f9c7ee2..ce81e09 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryReplicatedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryReplicatedSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.query.continuous;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.query.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
 
@@ -48,9 +49,9 @@ public class GridCacheContinuousQueryReplicatedSelfTest extends GridCacheContinu
      */
     @SuppressWarnings("unchecked")
     public void testRemoteNodeCallback() throws Exception {
-        GridCache<Integer, Integer> cache1 = grid(0).cache(null);
+        GridCache<Integer, Integer> cache1 = ((IgniteKernal)grid(0)).cache(null);
 
-        GridCache<Integer, Integer> cache2 = grid(1).cache(null);
+        GridCache<Integer, Integer> cache2 = ((IgniteKernal)grid(1)).cache(null);
 
         CacheContinuousQuery<Integer, Integer> qry = cache2.queries().createContinuousQuery();
 
@@ -90,8 +91,8 @@ public class GridCacheContinuousQueryReplicatedSelfTest extends GridCacheContinu
     @SuppressWarnings("unchecked")
     public void testCrossCallback() throws Exception {
         // Prepare.
-        GridCache<Integer, Integer> cache1 = grid(0).cache(null);
-        GridCache<Integer, Integer> cache2 = grid(1).cache(null);
+        GridCache<Integer, Integer> cache1 = ((IgniteKernal)grid(0)).cache(null);
+        GridCache<Integer, Integer> cache2 = ((IgniteKernal)grid(1)).cache(null);
 
         final int key1 = primaryKey(jcache(0));
         final int key2 = primaryKey(jcache(1));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
index 40e1bd5..75a7129 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.optimized.*;
@@ -113,14 +114,14 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
 
         startGrid(gridCount());
 
-        GridCache<String, Organization> orgCache = grid(0).cache(null);
+        GridCache<String, Organization> orgCache = ((IgniteKernal)grid(0)).cache(null);
 
         assert orgCache != null;
 
         assert orgCache.putx("o1", new Organization(1, "A"));
         assert orgCache.putx("o2", new Organization(2, "B"));
 
-        GridCache<CacheAffinityKey<String>, Person> personCache = grid(0).cache(null);
+        GridCache<CacheAffinityKey<String>, Person> personCache = ((IgniteKernal)grid(0)).cache(null);
 
         assert personCache != null;
 
@@ -167,7 +168,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
      * @throws Exception If failed.
      */
     public void testAverageQuery() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery("select age from Person");
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select age from Person");
 
         Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer()).get();
 
@@ -178,7 +179,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
      * @throws Exception If failed.
      */
     public void testAverageQueryWithArguments() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery(
             "select age from Person where orgId = ?");
 
         Collection<IgniteBiTuple<Integer, Integer>> res = qry.execute(new AverageRemoteReducer(), 1).get();
@@ -190,7 +191,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
 //     * @throws Exception If failed.
 //     */
 //    public void testFilters() throws Exception {
-//        GridCacheReduceFieldsQuery<Object, Object, GridBiTuple<Integer, Integer>, Integer> qry = grid(0).cache(null)
+//        GridCacheReduceFieldsQuery<Object, Object, GridBiTuple<Integer, Integer>, Integer> qry = ((IgniteKernal)grid(0)).cache(null)
 //            .queries().createReduceFieldsQuery("select age from Person");
 //
 //        qry = qry.remoteKeyFilter(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
index a2c3209..14b7149 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/reducefields/GridCacheReduceFieldsQueryPartitionedSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.query.reducefields;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.query.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.lang.*;
 
 import java.util.*;
@@ -43,7 +44,7 @@ public class GridCacheReduceFieldsQueryPartitionedSelfTest extends GridCacheAbst
      * @throws Exception If failed.
      */
     public void testIncludeBackups() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery("select age from Person");
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select age from Person");
 
         qry.includeBackups(true);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/core/src/test/java/org/apache/ignite/loadtests/continuous/GridContinuousOperationsLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/continuous/GridContinuousOperationsLoadTest.java b/modules/core/src/test/java/org/apache/ignite/loadtests/continuous/GridContinuousOperationsLoadTest.java
index d06d53f..7ae8c12 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/continuous/GridContinuousOperationsLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/continuous/GridContinuousOperationsLoadTest.java
@@ -79,7 +79,7 @@ public class GridContinuousOperationsLoadTest {
         dumpProperties(System.out);
 
         try (Ignite ignite = Ignition.start(cfgPath)) {
-            final GridCache<Object, Object> cache = ignite.cache(cacheName);
+            final GridCache<Object, Object> cache = ((IgniteKernal)ignite).cache(cacheName);
 
             if (cache == null)
                 throw new IgniteCheckedException("Cache is not configured: " + cacheName);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
index 71705d9..13ac462 100644
--- a/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
+++ b/modules/geospatial/src/test/java/org/apache/ignite/internal/processors/query/h2/GridH2IndexingGeoSelfTest.java
@@ -57,7 +57,7 @@ public class GridH2IndexingGeoSelfTest extends GridCacheAbstractSelfTest {
      */
     @SuppressWarnings("unchecked")
     public void testGeo() throws Exception {
-        GridCache<Integer, EnemyCamp> cache = grid(0).cache(null);
+        GridCache<Integer, EnemyCamp> cache = ((IgniteKernal)grid(0)).cache(null);
 
         WKTReader r = new WKTReader();
 
@@ -113,9 +113,9 @@ public class GridH2IndexingGeoSelfTest extends GridCacheAbstractSelfTest {
      */
     @SuppressWarnings("unchecked")
     public void testGeoMultithreaded() throws Exception {
-        final GridCache<Integer, EnemyCamp> cache1 = grid(0).cache(null);
-        final GridCache<Integer, EnemyCamp> cache2 = grid(1).cache(null);
-        final GridCache<Integer, EnemyCamp> cache3 = grid(2).cache(null);
+        final GridCache<Integer, EnemyCamp> cache1 = ((IgniteKernal)grid(0)).cache(null);
+        final GridCache<Integer, EnemyCamp> cache2 = ((IgniteKernal)grid(1)).cache(null);
+        final GridCache<Integer, EnemyCamp> cache3 = ((IgniteKernal)grid(2)).cache(null);
 
         final String[] points = new String[CNT];
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateAccessStrategyAdapter.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateAccessStrategyAdapter.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateAccessStrategyAdapter.java
index af7b8d9..eaea273 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateAccessStrategyAdapter.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateAccessStrategyAdapter.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.hibernate;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.resources.*;
@@ -342,7 +343,7 @@ public abstract class GridHibernateAccessStrategyAdapter {
 
         /** {@inheritDoc} */
         @Override public Void call() throws IgniteCheckedException {
-            GridCache<Object, Object> cache = ignite.cache(cacheName);
+            GridCache<Object, Object> cache = ((IgniteKernal)ignite).cache(cacheName);
 
             assert cache != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateRegionFactory.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateRegionFactory.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateRegionFactory.java
index 5cfaf75..358dcd4 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateRegionFactory.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/hibernate/GridHibernateRegionFactory.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.hibernate;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.hibernate.cache.*;
 import org.hibernate.cache.spi.*;
@@ -124,7 +125,7 @@ public class GridHibernateRegionFactory implements RegionFactory {
 
                 String cacheName = prop.getValue().toString();
 
-                if (ignite.cache(cacheName) == null)
+                if (((IgniteKernal)ignite).cache(cacheName) == null)
                     throw new CacheException("Cache '" + cacheName + "' specified for region '" + regionName + "' " +
                         "is not configured.");
 
@@ -135,7 +136,7 @@ public class GridHibernateRegionFactory implements RegionFactory {
         String dfltCacheName = props.getProperty(DFLT_CACHE_NAME_PROPERTY);
 
         if (dfltCacheName != null) {
-            dfltCache = ignite.cache(dfltCacheName);
+            dfltCache = ((IgniteKernal)ignite).cache(dfltCacheName);
 
             if (dfltCache == null)
                 throw new CacheException("Cache specified as default is not configured: " + dfltCacheName);
@@ -220,7 +221,7 @@ public class GridHibernateRegionFactory implements RegionFactory {
             cacheName = regionName;
         }
 
-        GridCache<Object, Object> cache = ignite.cache(cacheName);
+        GridCache<Object, Object> cache = ((IgniteKernal)ignite).cache(cacheName);
 
         if (cache == null)
             throw new CacheException("Cache '" + cacheName + "' for region '" + regionName + "' is not configured.");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e06e9734/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
index 5a973bb..551fbf1 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.query.*;
 import org.apache.ignite.internal.processors.datastructures.*;
 import org.apache.ignite.internal.processors.query.*;
@@ -127,14 +128,14 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
         startGrid(gridCount());
 
-        GridCache<String, Organization> orgCache = grid(0).cache(null);
+        GridCache<String, Organization> orgCache = ((IgniteKernal)grid(0)).cache(null);
 
         assert orgCache != null;
 
         assert orgCache.putx("o1", new Organization(1, "A"));
         assert orgCache.putx("o2", new Organization(2, "B"));
 
-        GridCache<CacheAffinityKey<String>, Person> personCache = grid(0).cache(null);
+        GridCache<CacheAffinityKey<String>, Person> personCache = ((IgniteKernal)grid(0)).cache(null);
 
         assert personCache != null;
 
@@ -142,20 +143,20 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
         assert personCache.putx(new CacheAffinityKey<>("p2", "o1"), new Person("Joe Black", 35, 1));
         assert personCache.putx(new CacheAffinityKey<>("p3", "o2"), new Person("Mike Green", 40, 2));
 
-        GridCache<String, String> strCache = grid(0).cache(null);
+        GridCache<String, String> strCache = ((IgniteKernal)grid(0)).cache(null);
 
         assert strCache != null;
 
         assert strCache.putx("key", "val");
 
-        GridCache<Integer, Integer> intCache = grid(0).cache(null);
+        GridCache<Integer, Integer> intCache = ((IgniteKernal)grid(0)).cache(null);
 
         assert intCache != null;
 
         for (int i = 0; i < 200; i++)
             assert intCache.putx(i, i);
 
-        GridCache<Integer, Integer> namedCache = grid(0).cache(CACHE);
+        GridCache<Integer, Integer> namedCache = ((IgniteKernal)grid(0)).cache(CACHE);
 
         for (int i = 0; i < 200; i++)
             assert namedCache.putx(i, i);
@@ -180,11 +181,11 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
     /** @throws Exception If failed. */
     public void testCacheMetaData() throws Exception {
         // Put internal key to test filtering of internal objects.
-        grid(0).cache(null).put(new GridCacheInternalKeyImpl("LONG"), new GridCacheAtomicLongValue(0));
+        ((IgniteKernal)grid(0)).cache(null).put(new GridCacheInternalKeyImpl("LONG"), new GridCacheAtomicLongValue(0));
 
         try {
             Collection<GridCacheSqlMetadata> metas =
-                ((GridCacheQueriesEx<?, ?>)grid(0).cache(null).queries()).sqlMetadata();
+                ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).cache(null).queries()).sqlMetadata();
 
             assert metas != null;
             assertEquals("Invalid meta: " + metas, 3, metas.size());
@@ -265,13 +266,13 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
             assert wasEmpty;
         }
         finally {
-            grid(0).cache(null).removex(new GridCacheInternalKeyImpl("LONG"));
+            ((IgniteKernal)grid(0)).cache(null).removex(new GridCacheInternalKeyImpl("LONG"));
         }
     }
 
     /** @throws Exception If failed. */
     public void testExecute() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery(
             "select _KEY, name, age from Person");
 
         CacheQueryFuture<List<?>> fut = qry.execute();
@@ -321,7 +322,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testExecuteWithArguments() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery(
             "select _KEY, name, age from Person where age > ?");
 
         CacheQueryFuture<List<?>> fut = qry.execute(30);
@@ -366,7 +367,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testExecuteWithMetaData() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)grid(0).cache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).cache(null).queries()).createSqlFieldsQuery(
             "select p._KEY, p.name, p.age, o.name " +
                 "from Person p, Organization o where p.orgId = o.id",
             true);
@@ -467,7 +468,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testSelectAllJoined() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)grid(0).cache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).cache(null).queries()).createSqlFieldsQuery(
             "select * from Person p, Organization o where p.orgId = o.id",
             true);
 
@@ -632,7 +633,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testEmptyResult() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)grid(0).cache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).cache(null).queries()).createSqlFieldsQuery(
             "select name from Person where age = 0", true);
 
         CacheQueryFuture<List<?>> fut = qry.execute();
@@ -660,7 +661,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testQueryString() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery("select * from String");
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select * from String");
 
         Collection<List<?>> res = qry.execute().get();
 
@@ -677,7 +678,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testQueryIntegersWithJoin() throws Exception {
-        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)grid(0).cache(null).queries()).createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((GridCacheQueriesEx<?, ?>)((IgniteKernal)grid(0)).cache(null).queries()).createSqlFieldsQuery(
             "select i._KEY, i._VAL, j._KEY, j._VAL from Integer i join Integer j where i._VAL >= 100", true)
             .projection(grid(0));
 
@@ -745,7 +746,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testPagination() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery("select * from Integer");
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select * from Integer");
 
         qry.pageSize(20);
 
@@ -767,7 +768,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testNamedCache() throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(CACHE);
+        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).cache(CACHE);
 
         for (int i = 0; i < 200; i++)
             assert cache.putx(i, i);
@@ -782,7 +783,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void _testNoPrimitives() throws Exception { // TODO
-        GridCache<Object, Object> cache = grid(0).cache(CACHE_NO_PRIMITIVES);
+        GridCache<Object, Object> cache = ((IgniteKernal)grid(0)).cache(CACHE_NO_PRIMITIVES);
 
         assert cache.putx("key", "val");
 
@@ -801,7 +802,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void _testComplexKeys() throws Exception { // TODO
-        GridCache<PersonKey, Person> cache = grid(0).cache(CACHE_COMPLEX_KEYS);
+        GridCache<PersonKey, Person> cache = ((IgniteKernal)grid(0)).cache(CACHE_COMPLEX_KEYS);
 
         UUID id = UUID.randomUUID();
 
@@ -904,7 +905,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
      * @throws Exception If failed.
      */
     private void testPaginationIterator(@Nullable String cacheName) throws Exception {
-        CacheQuery<List<?>> q = grid(0).cache(cacheName).queries().createSqlFieldsQuery("select _key, _val from " +
+        CacheQuery<List<?>> q = ((IgniteKernal)grid(0)).cache(cacheName).queries().createSqlFieldsQuery("select _key, _val from " +
             "Integer")
             .projection(grid(0));
 
@@ -937,7 +938,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testPaginationIteratorKeepAll() throws Exception {
-        CacheQuery<List<?>> q = grid(0).cache(null).queries().createSqlFieldsQuery(
+        CacheQuery<List<?>> q = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery(
             "select _key, _val from Integer");
 
         q.pageSize(10);
@@ -996,7 +997,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
      * @throws Exception If failed.
      */
     private void testPaginationGet(@Nullable String cacheName) throws Exception {
-        CacheQuery<List<?>> q = grid(0).cache(cacheName).queries().createSqlFieldsQuery("select _key, _val from " +
+        CacheQuery<List<?>> q = ((IgniteKernal)grid(0)).cache(cacheName).queries().createSqlFieldsQuery("select _key, _val from " +
             "Integer");
 
         q.pageSize(10);
@@ -1024,7 +1025,7 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testEmptyGrid() throws Exception {
-        CacheQuery<List<?>> qry = grid(0).cache(null).queries().createSqlFieldsQuery("select name, " +
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).cache(null).queries().createSqlFieldsQuery("select name, " +
             "age from Person where age = 25");
 
         List<?> res = F.first(qry.execute().get());


Mime
View raw message