ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [42/46] ignite git commit: 2.1 Added test.
Date Fri, 07 Jul 2017 09:34:45 GMT
2.1 Added test.


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

Branch: refs/heads/ignite-2.1
Commit: 64d6c98d88656132e89977806ca0e9152eb62427
Parents: 9c6a65e
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jul 6 15:55:21 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jul 6 15:55:21 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheGroupsTest.java | 60 ++++++++++++++++++++
 1 file changed, 60 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/64d6c98d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
index 7b420cc..d3269c3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
@@ -3631,6 +3631,66 @@ public class IgniteCacheGroupsTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
+    public void testDataCleanup() throws Exception {
+        Ignite node = startGrid(0);
+
+        IgniteCache cache0 = node.createCache(cacheConfiguration(GROUP1, "c0", PARTITIONED,
ATOMIC, 1, false));
+
+        for (int i = 0; i < 100; i++)
+            assertNull(cache0.get(i));
+
+        for (int i = 0; i < 100; i++)
+            cache0.put(i, i);
+
+        List<CacheConfiguration> ccfgs = new ArrayList<>();
+
+        ccfgs.add(cacheConfiguration(GROUP1, "c1", PARTITIONED, ATOMIC, 1, false));
+        ccfgs.add(cacheConfiguration(GROUP1, "c1", PARTITIONED, ATOMIC, 1, true));
+        ccfgs.add(cacheConfiguration(GROUP1, "c1", PARTITIONED, TRANSACTIONAL, 1, false));
+        ccfgs.add(cacheConfiguration(GROUP1, "c1", PARTITIONED, TRANSACTIONAL, 1, true));
+
+        for (CacheConfiguration ccfg : ccfgs) {
+            IgniteCache cache = node.createCache(ccfg);
+
+            for (int i = 0; i < 100; i++)
+                assertNull(cache.get(i));
+
+            for (int i = 0; i < 100; i++)
+                cache.put(i, i);
+
+            for (int i = 0; i < 100; i++)
+                assertEquals(i, cache.get(i));
+
+            node.destroyCache(ccfg.getName());
+
+            cache = node.createCache(ccfg);
+
+            for (int i = 0; i < 100; i++)
+                assertNull(cache.get(i));
+
+            node.destroyCache(ccfg.getName());
+        }
+
+        for (int i = 0; i < 100; i++)
+            assertEquals(i, cache0.get(i));
+
+        node.destroyCache(cache0.getName());
+
+        cache0 = node.createCache(cacheConfiguration(GROUP1, "c0", PARTITIONED, ATOMIC, 1,
false));
+
+        for (int i = 0; i < 100; i++)
+            assertNull(cache0.get(i));
+
+        for (int i = 0; i < 100; i++)
+            cache0.put(i, i);
+
+        for (int i = 0; i < 100; i++)
+            assertEquals(i, cache0.get(i));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testRestartsAndCacheCreateDestroy() throws Exception {
         final int SRVS = 5;
 


Mime
View raw message