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 2015/05/08 11:13:42 UTC

[42/50] incubator-ignite git commit: Minor tests fix

Minor tests fix


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

Branch: refs/heads/ignite-286
Commit: 29da67ce0bbee3c7837126423a6290a6cc2a22cf
Parents: 61808ed
Author: agura <ag...@gridgain.com>
Authored: Thu May 7 15:18:34 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Thu May 7 15:18:34 2015 +0300

----------------------------------------------------------------------
 ...CacheLoadingConcurrentGridStartSelfTest.java | 49 ++++++++++++--------
 1 file changed, 29 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/29da67ce/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
index 74273d1..798494f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
@@ -30,6 +30,7 @@ import org.jetbrains.annotations.*;
 import javax.cache.*;
 import javax.cache.configuration.*;
 import javax.cache.integration.*;
+import java.io.*;
 import java.util.concurrent.*;
 
 import static org.apache.ignite.cache.CacheMode.*;
@@ -55,26 +56,7 @@ public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractT
 
         ccfg.setBackups(1);
 
-        CacheStore<Integer, String> store = new CacheStoreAdapter<Integer, String>() {
-            @Override public void loadCache(IgniteBiInClosure<Integer, String> f, Object... args) {
-                for (int i = 0; i < KEYS_CNT; i++)
-                    f.apply(i, Integer.toString(i));
-            }
-
-            @Nullable @Override public String load(Integer i) throws CacheLoaderException {
-                return null;
-            }
-
-            @Override public void write(Cache.Entry<? extends Integer, ? extends String> entry) throws CacheWriterException {
-                // No-op.
-            }
-
-            @Override public void delete(Object o) throws CacheWriterException {
-                // No-op.
-            }
-        };
-
-        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
+        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestCacheStoreAdapter()));
 
         cfg.setCacheConfiguration(ccfg);
 
@@ -151,4 +133,31 @@ public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractT
 
         assertEquals(KEYS_CNT, total);
     }
+
+    /**
+     * Cache store adapter.
+     */
+    private static class TestCacheStoreAdapter extends CacheStoreAdapter<Integer, String> implements Serializable {
+        /** {@inheritDoc} */
+        @Override public void loadCache(IgniteBiInClosure<Integer, String> f, Object... args) {
+            for (int i = 0; i < KEYS_CNT; i++)
+                f.apply(i, Integer.toString(i));
+        }
+
+        /** {@inheritDoc} */
+        @Nullable @Override public String load(Integer i) throws CacheLoaderException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void write(Cache.Entry<? extends Integer, ? extends String> entry)
+            throws CacheWriterException {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void delete(Object o) throws CacheWriterException {
+            // No-op.
+        }
+    }
 }