You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/07/07 08:07:29 UTC
[17/18] ignite git commit: 2.1 Added test.
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-gg-12306-1
Commit: 64d6c98d88656132e89977806ca0e9152eb62427
Parents: 9c6a65e
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jul 6 15:55:21 2017 +0300
Committer: sboikov <sb...@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;