ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [25/50] [abbrv] incubator-ignite git commit: # ignite-680 added test
Date Thu, 09 Apr 2015 08:59:50 GMT
# ignite-680 added test


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

Branch: refs/heads/ignite-gg-9991
Commit: 7e9f22ed4c80ecd3850accf0451c354e3ee687e8
Parents: b05c14f
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Apr 8 11:32:03 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Apr 8 11:32:03 2015 +0300

----------------------------------------------------------------------
 .../IgniteCacheConfigurationTemplateTest.java   | 53 ++++++++++++++++++++
 1 file changed, 53 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7e9f22ed/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
index 9dfa913..d0ffab2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
@@ -19,6 +19,8 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -79,6 +81,8 @@ public class IgniteCacheConfigurationTemplateTest extends GridCommonAbstractTest
 
         cfg.setClientMode(clientMode);
 
+        cfg.setIncludeEventTypes(EventType.EVT_CACHE_REBALANCE_STARTED, EventType.EVT_CACHE_REBALANCE_STOPPED);
+
         return cfg;
     }
 
@@ -253,6 +257,55 @@ public class IgniteCacheConfigurationTemplateTest extends GridCommonAbstractTest
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testNoPartitionExchangeForTemplate() throws Exception{
+        final int GRID_CNT = 3;
+
+        startGridsMultiThreaded(GRID_CNT);
+
+        final CountDownLatch evtLatch = new CountDownLatch(1);
+
+        log.info("Add templates.");
+
+        for (int i = 0; i < GRID_CNT; i++) {
+            Ignite ignite = ignite(i);
+
+            ignite.events().localListen(new IgnitePredicate<Event>() {
+                @Override public boolean apply(Event evt) {
+                    log.info("Event: " + evt);
+
+                    evtLatch.countDown();
+
+                    return true;
+                }
+            }, EventType.EVT_CACHE_REBALANCE_STARTED, EventType.EVT_CACHE_REBALANCE_STOPPED);
+        }
+
+        for (int i = 0; i < GRID_CNT; i++) {
+            Ignite ignite = ignite(i);
+
+            CacheConfiguration ccfg = new CacheConfiguration();
+
+            ccfg.setName("cfg-" + i);
+
+            ignite.addCacheConfiguration(ccfg);
+        }
+
+        boolean evt = evtLatch.await(3000, TimeUnit.MILLISECONDS);
+
+        assertFalse(evt);
+
+        log.info("Start cache.");
+
+        checkGetOrCreate(ignite(0), "cfg-0", 0);
+
+        evt = evtLatch.await(3000, TimeUnit.MILLISECONDS);
+
+        assertTrue(evt);
+    }
+
+    /**
      * @param ignite Ignite.
      * @param name Cache name.
      * @param expBackups Expected number of backups.


Mime
View raw message