ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1452
Date Wed, 16 Sep 2015 21:08:36 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1452 5b1b58ee6 -> 3986edfc4


ignite-1452


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

Branch: refs/heads/ignite-1452
Commit: 3986edfc451066ac1e6000a1c7981c6f496803df
Parents: 5b1b58e
Author: sboikov <semen.boikov@inria.fr>
Authored: Thu Sep 17 00:08:18 2015 +0300
Committer: sboikov <semen.boikov@inria.fr>
Committed: Thu Sep 17 00:08:18 2015 +0300

----------------------------------------------------------------------
 .../IgniteCacheEntryProcessorNodeJoinTest.java  | 24 ++++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3986edfc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
index 6b4d473..151167a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheEntryProcessorNodeJoinTest.java
@@ -25,6 +25,7 @@ import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import javax.cache.processor.EntryProcessor;
+import javax.cache.processor.EntryProcessorResult;
 import javax.cache.processor.MutableEntry;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheAtomicityMode;
@@ -184,20 +185,29 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
 
                     String val = "value-" + k;
 
-                    cache.invoke(key, new Processor(val));
+                    procs.put(key, new Processor(val));
                 }
 
-                cache.invokeAll(procs);
+                Map<String, EntryProcessorResult<Integer>> resMap = cache.invokeAll(procs);
+
+                for (String key : procs.keySet()) {
+                    EntryProcessorResult<Integer> res = resMap.get(key);
+
+                    assertNotNull(res);
+                    assertEquals(k + 1, (Object) res.get());
+                }
             }
             else {
+                IgniteCache<String, Set<String>> cache = ignite(0).cache(null);
+
                 for (int i = 0; i < NUM_SETS; i++) {
                     String key = "set-" + i;
 
                     String val = "value-" + k;
 
-                    IgniteCache<String, Set<String>> cache = ignite(0).cache(null);
+                    Integer valsCnt = cache.invoke(key, new Processor(val));
 
-                    cache.invoke(key, new Processor(val));
+                    assertEquals(k + 1, (Object)valsCnt);
                 }
             }
         }
@@ -275,7 +285,7 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
     }
 
     /** */
-    private static class Processor implements EntryProcessor<String, Set<String>,
Void>, Serializable {
+    private static class Processor implements EntryProcessor<String, Set<String>,
Integer>, Serializable {
         /** */
         private String val;
 
@@ -287,7 +297,7 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
         }
 
         /** {@inheritDoc} */
-        @Override public Void process(MutableEntry<String, Set<String>> e, Object...
args) {
+        @Override public Integer process(MutableEntry<String, Set<String>> e,
Object... args) {
             Set<String> vals = e.getValue();
 
             if (vals == null)
@@ -297,7 +307,7 @@ public class IgniteCacheEntryProcessorNodeJoinTest extends GridCommonAbstractTes
 
             e.setValue(vals);
 
-            return null;
+            return vals.size();
         }
     }
 }
\ No newline at end of file


Mime
View raw message