ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [30/35] incubator-ignite git commit: #IGNITE-96 Moving tests
Date Tue, 10 Feb 2015 16:16:14 GMT
#IGNITE-96 Moving 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/428eddef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/428eddef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/428eddef

Branch: refs/heads/ignite-96
Commit: 428eddeff692c3a21b99e0b1cceb75beb8133dda
Parents: ad0bd64
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Tue Feb 10 16:20:54 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Tue Feb 10 16:21:08 2015 +0300

----------------------------------------------------------------------
 ...achePartitionedMultiNodeFullApiSelfTest.java | 12 ++--
 ...ePartitionedMultiThreadedPutGetSelfTest.java | 14 ++--
 ...achePartitionedPreloadLifecycleSelfTest.java | 67 +++++++++-----------
 ...hePartitionedQueryMultiThreadedSelfTest.java |  2 +-
 .../GridCachePartitionedStorePutSelfTest.java   | 20 +++---
 .../near/GridCachePutArrayValueSelfTest.java    | 14 ++--
 ...idCacheRendezvousAffinityClientSelfTest.java |  5 +-
 .../near/IgniteTxReentryNearSelfTest.java       |  5 +-
 8 files changed, 67 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index c58b6ea..7f29194 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -101,8 +101,8 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
         for (int i = 0; i < size; i++)
             putMap.put(i, i);
 
-        GridCache<Object, Object> prj0 = grid(0).cache(null);
-        GridCache<Object, Object> prj1 = grid(1).cache(null);
+        IgniteCache<Object, Object> prj0 = grid(0).jcache(null);
+        IgniteCache<Object, Object> prj1 = grid(1).jcache(null);
 
         prj0.putAll(putMap);
 
@@ -135,12 +135,12 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
 
         int size = 10;
 
-        GridCache<Object, Object> prj0 = grid(0).cache(null);
+        IgniteCache<Object, Object> prj0 = grid(0).jcache(null);
 
         for (int i = 0; i < size; i++) {
             info("Putting value [i=" + i + ']');
 
-            assertNull(prj0.put(i, i));
+            prj0.put(i, i);
 
             info("Finished putting value [i=" + i + ']');
         }
@@ -148,11 +148,11 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
         for (int i = 0; i < gridCount(); i++) {
             assertEquals(0, context(i).tm().idMapSize());
 
-            GridCache<Object, Object> cache = grid(i).cache(null);
+            IgniteCache<Object, Object> cache = grid(i).jcache(null);
             ClusterNode node = grid(i).localNode();
 
             for (int k = 0; k < size; k++) {
-                if (cache.affinity().isPrimaryOrBackup(node, k))
+                if (affinity(cache).isPrimaryOrBackup(node, k))
                     assertEquals("Check failed for node: " + node.id(), k, cache.peek(k));
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiThreadedPutGetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiThreadedPutGetSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiThreadedPutGetSelfTest.java
index 0f53576..75d6a22 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiThreadedPutGetSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiThreadedPutGetSelfTest.java
@@ -102,12 +102,12 @@ public class GridCachePartitionedMultiThreadedPutGetSelfTest extends
GridCommonA
         super.afterTest();
 
         if (GRID_CNT > 0)
-            grid(0).cache(null).removeAll();
+            grid(0).jcache(null).removeAll();
 
         for (int i = 0; i < GRID_CNT; i++) {
-            grid(0).cache(null).clearLocally();
+            internalCache(i).clearLocally();
 
-            assert grid(i).cache(null).isEmpty();
+            assert internalCache(i).isEmpty();
         }
     }
 
@@ -178,20 +178,20 @@ public class GridCachePartitionedMultiThreadedPutGetSelfTest extends
GridCommonA
         multithreaded(new CAX() {
             @SuppressWarnings({"BusyWait"})
             @Override public void applyx() throws IgniteCheckedException {
-                GridCache<Integer, Integer> c = grid(0).cache(null);
+                IgniteCache<Integer, Integer> c = grid(0).jcache(null);
 
                 for (int i = 0; i < TX_CNT; i++) {
                     int kv = cntr.incrementAndGet();
 
-                    try (IgniteTx tx = c.txStart(concurrency, isolation)) {
+                    try (IgniteTx tx = grid(0).transactions().txStart(concurrency, isolation))
{
                         assertNull(c.get(kv));
 
-                        assert c.putx(kv, kv);
+                        c.put(kv, kv);
 
                         assertEquals(Integer.valueOf(kv), c.get(kv));
 
                         // Again.
-                        assert c.putx(kv, kv);
+                        c.put(kv, kv);
 
                         assertEquals(Integer.valueOf(kv), c.get(kv));
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/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 a2ee133..4a402b3 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
@@ -82,55 +82,48 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
             private Ignite ignite;
 
             @Override public void onLifecycleEvent(LifecycleEventType evt) {
-                try {
-                    switch (evt) {
-                        case AFTER_GRID_START: {
-                            GridCache<Object, MyValue> c1 = ignite.cache("one");
-                            GridCache<Object, MyValue> c2 = ignite.cache("two");
+                switch (evt) {
+                    case AFTER_GRID_START: {
+                        IgniteCache<Object, MyValue> c1 = ignite.jcache("one");
+                        IgniteCache<Object, MyValue> c2 = ignite.jcache("two");
 
-                            if (!ignite.name().contains("Test0")) {
-                                info("Keys already in cache:");
+                        if (!ignite.name().contains("Test0")) {
+                            info("Keys already in cache:");
 
-                                for (Object k : c1.keySet())
-                                    info("Cache1: " + k.toString());
+                            for (Object k : entrySet(c1))
+                                info("Cache1: " + k.toString());
 
-                                for (Object k : c2.keySet())
-                                    info("Cache2: " + k.toString());
+                            for (Object k : entrySet(c2))
+                                info("Cache2: " + k.toString());
 
-                                return;
-                            }
+                            return;
+                        }
 
-                            info("Populating cache data...");
+                        info("Populating cache data...");
 
-                            int i = 0;
+                        int i = 0;
 
-                            for (Object key : keys) {
-                                c1.put(key, new MyValue(value(key)));
+                        for (Object key : keys) {
+                            c1.put(key, new MyValue(value(key)));
 
-                                if (i++ % 2 == 0)
-                                    c2.put(key, new MyValue(value(key)));
-                            }
+                            if (i++ % 2 == 0)
+                                c2.put(key, new MyValue(value(key)));
+                        }
 
-                            assert c1.size() == keys.length : "Invalid cache1 size [size="
+ c1.size() +
-                                ", entries=" + c1.entrySet() + ']';
-                            assert c2.size() == keys.length / 2 : "Invalid cache2 size [size="
+ c2.size() +
-                                ", entries=" + c2.entrySet() + ']';
+                        assert c1.size() == keys.length : "Invalid cache1 size [size=" +
c1.size() + ']';
+                        assert c2.size() == keys.length / 2 : "Invalid cache2 size [size="
+ c2.size() + ']';
 
-                            break;
-                        }
+                        break;
+                    }
 
-                        case BEFORE_GRID_START:
-                        case BEFORE_GRID_STOP:
-                        case AFTER_GRID_STOP: {
-                            info("Lifecycle event: " + evt);
+                    case BEFORE_GRID_START:
+                    case BEFORE_GRID_STOP:
+                    case AFTER_GRID_STOP: {
+                        info("Lifecycle event: " + evt);
 
-                            break;
-                        }
+                        break;
                     }
                 }
-                catch (IgniteCheckedException e) {
-                    throw new IgniteException(e);
-                }
             }
         };
     }
@@ -150,8 +143,8 @@ public class GridCachePartitionedPreloadLifecycleSelfTest extends GridCachePrelo
             info("Checking '" + (i + 1) + "' nodes...");
 
             for (int j = 0; j < G.allGrids().size(); j++) {
-                GridCache<Object, MyValue> c1 = grid(j).cache("one");
-                GridCache<Object, MyValue> c2 = grid(j).cache("two");
+                IgniteCache<Object, MyValue> c1 = grid(j).jcache("one");
+                IgniteCache<Object, MyValue> c2 = grid(j).jcache("two");
 
                 int k = 0;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/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 92aa95e..e008926 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
@@ -101,7 +101,7 @@ public class GridCachePartitionedQueryMultiThreadedSelfTest extends GridCommonAb
 
         // Clean up all caches.
         for (int i = 0; i < GRID_CNT; i++)
-            grid(i).cache(null).removeAll();
+            grid(i).jcache(null).removeAll();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
index db7ace1..aefd5ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedStorePutSelfTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.near;
 
-import org.apache.ignite.cache.*;
+import org.apache.ignite.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
@@ -46,13 +46,13 @@ public class GridCachePartitionedStorePutSelfTest extends GridCommonAbstractTest
     private static final AtomicInteger CNT = new AtomicInteger(0);
 
     /** */
-    private GridCache<Integer, Integer> cache1;
+    private IgniteCache<Integer, Integer> cache1;
 
     /** */
-    private GridCache<Integer, Integer> cache2;
+    private IgniteCache<Integer, Integer> cache2;
 
     /** */
-    private GridCache<Integer, Integer> cache3;
+    private IgniteCache<Integer, Integer> cache3;
 
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
@@ -96,9 +96,9 @@ public class GridCachePartitionedStorePutSelfTest extends GridCommonAbstractTest
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
-        cache1 = startGrid(1).cache(null);
-        cache2 = startGrid(2).cache(null);
-        cache3 = startGrid(3).cache(null);
+        cache1 = startGrid(1).jcache(null);
+        cache2 = startGrid(2).jcache(null);
+        cache3 = startGrid(3).jcache(null);
     }
 
     /** {@inheritDoc} */
@@ -112,15 +112,15 @@ public class GridCachePartitionedStorePutSelfTest extends GridCommonAbstractTest
     public void testPutx() throws Throwable {
         info("Putting to the first node.");
 
-        cache1.putx(0, 1);
+        cache1.put(0, 1);
 
         info("Putting to the second node.");
 
-        cache2.putx(0, 2);
+        cache2.put(0, 2);
 
         info("Putting to the third node.");
 
-        cache3.putx(0, 3);
+        cache3.put(0, 3);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePutArrayValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePutArrayValueSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePutArrayValueSelfTest.java
index c753b87..94eb014 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePutArrayValueSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePutArrayValueSelfTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.near;
 
-import org.apache.ignite.cache.*;
+import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -51,20 +51,20 @@ public class GridCachePutArrayValueSelfTest extends GridCacheAbstractSelfTest
{
     public void testInternalKeys() throws Exception {
         assert gridCount() >= 2;
 
-        GridCache<InternalKey, Object> prj = grid(0).cache(null);
+        IgniteCache<InternalKey, Object> jcache = grid(0).jcache(null);
 
         final InternalKey key = new InternalKey(0); // Hangs on the first remote put.
 
         // Make key belongs to remote node.
-        while (prj.affinity().mapKeyToPrimaryAndBackups(key).iterator().next().isLocal())
+        while (affinity(jcache).mapKeyToPrimaryAndBackups(key).iterator().next().isLocal())
             key.key++;
 
         // Put bytes array(!), for integer numbers it works correctly.
-        prj.put(key, new byte[] {1});
-        assertNotNull(prj.get(key));
+        jcache.put(key, new byte[]{1});
+        assertNotNull(jcache.get(key));
 
-        prj.put(key, new byte[] {2});
-        assertNotNull(prj.get(key));
+        jcache.put(key, new byte[] {2});
+        assertNotNull(jcache.get(key));
     }
 
     /** Test key without {@link GridCacheInternal} parent interface. */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheRendezvousAffinityClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheRendezvousAffinityClientSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheRendezvousAffinityClientSelfTest.java
index ffe7c00..eb63655 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheRendezvousAffinityClientSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheRendezvousAffinityClientSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.near;
 
+import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.affinity.rendezvous.*;
@@ -71,9 +72,9 @@ public class GridCacheRendezvousAffinityClientSelfTest extends GridCommonAbstrac
             Map<Integer, Collection<UUID>> mapping = new HashMap<>();
 
             for (int i = 0; i < 4; i++) {
-                GridCache<Object, Object> cache = grid(i).cache(null);
+                IgniteCache<Object, Object> cache = grid(i).jcache(null);
 
-                CacheAffinity<Object> aff = cache.affinity();
+                CacheAffinity<Object> aff = affinity(cache);
 
                 int parts = aff.partitions();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/428eddef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxReentryNearSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxReentryNearSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxReentryNearSelfTest.java
index 8c42fbe..b874228 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxReentryNearSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxReentryNearSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.near;
 
+import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.processors.cache.*;
@@ -43,10 +44,10 @@ public class IgniteTxReentryNearSelfTest extends IgniteTxReentryAbstractSelfTest
     @Override protected int testKey() {
         int key = 0;
 
-        GridCache<Object, Object> cache = grid(0).cache(null);
+        IgniteCache<Object, Object> cache = grid(0).jcache(null);
 
         while (true) {
-            Collection<ClusterNode> nodes = cache.affinity().mapKeyToPrimaryAndBackups(key);
+            Collection<ClusterNode> nodes = affinity(cache).mapKeyToPrimaryAndBackups(key);
 
             if (nodes.contains(grid(0).localNode()))
                 key++;


Mime
View raw message