You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/07/04 16:38:44 UTC

incubator-ignite git commit: # IGNITE-1094 Add test.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1094 [created] 658431e91


# IGNITE-1094 Add 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/658431e9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/658431e9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/658431e9

Branch: refs/heads/ignite-1094
Commit: 658431e912da008bee737e7c6f21d80502cddc34
Parents: f72b291
Author: sevdokimov <se...@jetbrains.com>
Authored: Sat Jul 4 17:38:36 2015 +0300
Committer: sevdokimov <se...@jetbrains.com>
Committed: Sat Jul 4 17:38:36 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteDynamicCacheStartSelfTest.java  | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/658431e9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
index 9c483ef..9451804 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
@@ -34,6 +35,7 @@ import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 
 import javax.cache.*;
+import javax.cache.configuration.*;
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
@@ -1142,4 +1144,33 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
 
         fut.get();
     }
+
+    
+    /**
+     *
+     */
+    public void testBrokenStoreFactory() {
+        final CacheConfiguration<Integer, String> cacheConfiguration = new CacheConfiguration<>();
+        
+        cacheConfiguration.setName("brokenCache");
+        cacheConfiguration.setCacheStoreFactory(new BrokenStoreFactory());
+
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                grid(0).createCache(cacheConfiguration);
+
+                return null;
+            }
+        }, CacheException.class, null);
+    }
+
+    /**
+     * 
+     */
+    private static class BrokenStoreFactory implements Factory<CacheStore<Integer, String>> {
+        /** {@inheritDoc} */
+        @Override public CacheStore<Integer, String> create() {
+            throw new RuntimeException("This store factory is broken");
+        }
+    }
 }