ignite-commits mailing list archives

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

Branch: refs/heads/sprint-3
Commit: 8ad18f747b72901977a5f78c51699fb5f2ec59a6
Parents: 00a5581
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Mar 25 16:15:34 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Mar 25 16:15:34 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractFieldsQuerySelfTest.java   | 40 ++++++++++----------
 .../cache/GridCacheCrossCacheQuerySelfTest.java |  4 +-
 .../cache/GridCacheOffHeapAndSwapSelfTest.java  |  2 +-
 .../cache/GridCacheQueryMetricsSelfTest.java    |  6 ++-
 ...GridCachePartitionedFieldsQuerySelfTest.java |  7 +++-
 .../GridCacheReplicatedFieldsQuerySelfTest.java |  2 +-
 ...dCacheAbstractReduceFieldsQuerySelfTest.java | 16 ++++----
 7 files changed, 43 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ad18f74/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 7dad58c..48569d3 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
@@ -96,6 +96,8 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
         cache.setAtomicityMode(atomicityMode());
         cache.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         cache.setRebalanceMode(SYNC);
+        cache.setIndexedTypes(String.class, Organization.class,
+            Integer.class, Integer.class);
 
         if (cacheMode() == PARTITIONED)
             cache.setBackups(1);
@@ -122,38 +124,38 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
         startGrid(gridCount());
 
-        GridCache<String, Organization> orgCache = ((IgniteKernal)grid(0)).getCache(null);
+        IgniteCache<String, Organization> orgCache = grid(0).cache(null);
 
         assert orgCache != null;
 
-        assert orgCache.putx("o1", new Organization(1, "A"));
-        assert orgCache.putx("o2", new Organization(2, "B"));
+        orgCache.put("o1", new Organization(1, "A"));
+        orgCache.put("o2", new Organization(2, "B"));
 
-        GridCache<AffinityKey<String>, Person> personCache = ((IgniteKernal)grid(0)).getCache(null);
+        IgniteCache<AffinityKey<String>, Person> personCache = grid(0).cache(null);
 
         assert personCache != null;
 
-        assert personCache.putx(new AffinityKey<>("p1", "o1"), new Person("John White",
25, 1));
-        assert personCache.putx(new AffinityKey<>("p2", "o1"), new Person("Joe Black",
35, 1));
-        assert personCache.putx(new AffinityKey<>("p3", "o2"), new Person("Mike Green",
40, 2));
+        personCache.put(new AffinityKey<>("p1", "o1"), new Person("John White", 25,
1));
+        personCache.put(new AffinityKey<>("p2", "o1"), new Person("Joe Black", 35,
1));
+        personCache.put(new AffinityKey<>("p3", "o2"), new Person("Mike Green", 40,
2));
 
-        GridCache<String, String> strCache = ((IgniteKernal)grid(0)).getCache(null);
+        IgniteCache<String, String> strCache = grid(0).cache(null);
 
         assert strCache != null;
 
-        assert strCache.putx("key", "val");
+        strCache.put("key", "val");
 
-        GridCache<Integer, Integer> intCache = ((IgniteKernal)grid(0)).getCache(null);
+        IgniteCache<Integer, Integer> intCache = grid(0).cache(null);
 
         assert intCache != null;
 
         for (int i = 0; i < 200; i++)
-            assert intCache.putx(i, i);
+            intCache.put(i, i);
 
-        GridCache<Integer, Integer> namedCache = ((IgniteKernal)grid(0)).getCache(CACHE);
+        IgniteCache<Integer, Integer> namedCache = grid(0).cache(null);
 
         for (int i = 0; i < 200; i++)
-            assert namedCache.putx(i, i);
+            namedCache.put(i, i);
     }
 
     /** {@inheritDoc} */
@@ -762,10 +764,10 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testNamedCache() throws Exception {
-        GridCache<Integer, Integer> cache = ((IgniteKernal)grid(0)).getCache(CACHE);
+        GridCacheAdapter<Integer, Integer> cache = ((IgniteKernal)grid(0)).internalCache(CACHE);
 
         for (int i = 0; i < 200; i++)
-            assert cache.putx(i, i);
+            cache.put(i, i);
 
         CacheQuery<List<?>> qry =
             cache.queries().createSqlFieldsQuery("select * from Integer").projection(grid(0).cluster());
@@ -778,9 +780,9 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void _testNoPrimitives() throws Exception { // TODO
-        GridCache<Object, Object> cache = ((IgniteKernal)grid(0)).getCache(CACHE_NO_PRIMITIVES);
+        GridCacheAdapter<Object, Object> cache = ((IgniteKernal)grid(0)).internalCache(CACHE_NO_PRIMITIVES);
 
-        assert cache.putx("key", "val");
+        cache.put("key", "val");
 
         Collection<GridCacheSqlMetadata> metas = ((GridCacheQueriesEx<?, ?>)cache.queries()).sqlMetadata();
 
@@ -797,14 +799,14 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void _testComplexKeys() throws Exception { // TODO
-        GridCache<PersonKey, Person> cache = ((IgniteKernal)grid(0)).getCache(CACHE_COMPLEX_KEYS);
+        GridCacheAdapter<PersonKey, Person> cache = ((IgniteKernal)grid(0)).internalCache(CACHE_COMPLEX_KEYS);
 
         UUID id = UUID.randomUUID();
 
         PersonKey key = new PersonKey(id);
         Person val = new Person("John", 20, 1);
 
-        assert cache.putx(key, val);
+        cache.put(key, val);
 
         Collection<GridCacheSqlMetadata> metas = ((GridCacheQueriesEx<?, ?>)cache.queries()).sqlMetadata();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ad18f74/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
index 50ca5b4..5f2fc0e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
@@ -294,7 +294,7 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest
{
     private void fillCaches() throws IgniteCheckedException {
         int idGen = 0;
 
-        GridCache<Integer, Object> dimCache = ((IgniteKernal)ignite).getCache("replicated");
+        GridCacheAdapter<Integer, Object> dimCache = ((IgniteKernal)ignite).internalCache("replicated");
 
         for (int i = 0; i < 2; i++) {
             int id = idGen++;
@@ -311,7 +311,7 @@ public class GridCacheCrossCacheQuerySelfTest extends GridCommonAbstractTest
{
         CacheProjection<Integer, DimStore> stores = dimCache.projection(Integer.class,
DimStore.class);
         CacheProjection<Integer, DimProduct> prods = dimCache.projection(Integer.class,
DimProduct.class);
 
-        GridCache<Integer, FactPurchase> factCache = ((IgniteKernal)ignite).getCache("partitioned");
+        GridCacheAdapter<Integer, FactPurchase> factCache = ((IgniteKernal)ignite).internalCache("partitioned");
 
         List<DimStore> dimStores = new ArrayList<>(stores.values());
         Collections.sort(dimStores, new Comparator<DimStore>() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ad18f74/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
index fc18054..226f0fc 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapAndSwapSelfTest.java
@@ -471,7 +471,7 @@ public class GridCacheOffHeapAndSwapSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * Tests {@link GridCache#peek(Object)} behavior on offheaped entries.
+     * Tests {@link IgniteCache#localPeek(Object, CachePeekMode...)} behavior on offheaped
entries.
      *
      * @throws Exception If failed.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ad18f74/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
index 0ce77f9..45d605c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache;
 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.query.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -68,6 +69,7 @@ public class GridCacheQueryMetricsSelfTest extends GridCommonAbstractTest
{
 
         cacheCfg.setCacheMode(CACHE_MODE);
         cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
+        cacheCfg.setIndexedTypes(String.class, Integer.class);
 
         cfg.setCacheConfiguration(cacheCfg);
 
@@ -80,7 +82,7 @@ public class GridCacheQueryMetricsSelfTest extends GridCommonAbstractTest
{
      * @throws Exception In case of error.
      */
     public void testAccumulativeMetrics() throws Exception {
-        GridCache<String, Integer> cache = cache(0);
+        GridCacheAdapter<String, Integer> cache = ((IgniteKernal)grid(0)).internalCache();
 
         CacheQuery<Map.Entry<String, Integer>> qry = cache.queries().createSqlQuery(Integer.class,
"_val >= 0")
             .projection(grid(0).cluster());
@@ -122,7 +124,7 @@ public class GridCacheQueryMetricsSelfTest extends GridCommonAbstractTest
{
      * @throws Exception In case of error.
      */
     public void testSingleQueryMetrics() throws Exception {
-        GridCache<String, Integer> cache = cache(0);
+        GridCacheAdapter<String, Integer> cache = ((IgniteKernal)grid(0)).internalCache();
 
         CacheQuery<Map.Entry<String, Integer>> qry = cache.queries().createSqlQuery(Integer.class,
"_val >= 0")
             .projection(grid(0).cluster());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ad18f74/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFieldsQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFieldsQuerySelfTest.java
index ecb566b..19b2d5a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFieldsQuerySelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.store.jdbc.model.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
@@ -56,6 +57,10 @@ public class GridCachePartitionedFieldsQuerySelfTest extends GridCacheAbstractFi
 
         cc.setNearConfiguration(nearConfiguration());
 
+        cc.setIndexedTypes(String.class, Organization.class,
+            Integer.class, Integer.class,
+            AffinityKey.class, Person.class);
+
         return cc;
     }
 
@@ -63,7 +68,7 @@ public class GridCachePartitionedFieldsQuerySelfTest extends GridCacheAbstractFi
      * @throws Exception If failed.
      */
     public void testIncludeBackups() throws Exception {
-        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).queries().createSqlFieldsQuery(
+        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).internalCache(null).queries().createSqlFieldsQuery(
             "select _KEY, name, age from Person");
 
         qry.includeBackups(true);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ad18f74/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFieldsQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFieldsQuerySelfTest.java
index b0434f9..a3f7606 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFieldsQuerySelfTest.java
@@ -68,7 +68,7 @@ public class GridCacheReplicatedFieldsQuerySelfTest extends GridCacheAbstractFie
 
             Ignite g = startGrid();
 
-            GridCache<Integer, Integer> cache = ((IgniteKernal)g).getCache(null);
+            GridCacheAdapter<Integer, Integer> cache = ((IgniteKernal)g).internalCache(null);
 
             CacheQuery<List<?>> q = cache.queries().createSqlFieldsQuery("select
_key from Integer where _key >= " +
                 "0 order by _key");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ad18f74/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
index 8703343..14b265c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
@@ -17,12 +17,12 @@
 
 package org.apache.ignite.internal.processors.cache.reducefields;
 
+import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.query.annotations.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.query.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
@@ -119,20 +119,20 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends
GridCom
 
         startGrid(gridCount());
 
-        GridCache<String, Organization> orgCache = ((IgniteKernal)grid(0)).getCache(null);
+        IgniteCache<String, Organization> orgCache = grid(0).cache(null);
 
         assert orgCache != null;
 
-        assert orgCache.putx("o1", new Organization(1, "A"));
-        assert orgCache.putx("o2", new Organization(2, "B"));
+        orgCache.put("o1", new Organization(1, "A"));
+        orgCache.put("o2", new Organization(2, "B"));
 
-        GridCache<AffinityKey<String>, Person> personCache = ((IgniteKernal)grid(0)).getCache(null);
+        IgniteCache<AffinityKey<String>, Person> personCache = grid(0).cache(null);
 
         assert personCache != null;
 
-        assert personCache.putx(new AffinityKey<>("p1", "o1"), new Person("John White",
25, 1));
-        assert personCache.putx(new AffinityKey<>("p2", "o1"), new Person("Joe Black",
35, 1));
-        assert personCache.putx(new AffinityKey<>("p3", "o2"), new Person("Mike Green",
40, 2));
+        personCache.put(new AffinityKey<>("p1", "o1"), new Person("John White", 25,
1));
+        personCache.put(new AffinityKey<>("p2", "o1"), new Person("Joe Black", 35,
1));
+        personCache.put(new AffinityKey<>("p3", "o2"), new Person("Mike Green", 40,
2));
     }
 
     /** {@inheritDoc} */


Mime
View raw message