ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [08/50] [abbrv] incubator-ignite git commit: # Removed cache iterator serialization test.
Date Tue, 10 Feb 2015 03:11:30 GMT
# Removed cache iterator serialization 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/870935d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/870935d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/870935d9

Branch: refs/heads/ignite-82
Commit: 870935d9c9df040e8d8fc3dd7cc5425dc286e404
Parents: e3afc71
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Feb 9 12:50:57 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Feb 9 12:50:57 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractIteratorsSelfTest.java     |  2 -
 .../local/GridCacheLocalIteratorsSelfTest.java  | 80 --------------------
 2 files changed, 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/870935d9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
index 502194f..46d053b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractIteratorsSelfTest.java
@@ -17,13 +17,11 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import org.apache.ignite.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.testframework.*;
 
 import javax.cache.*;
-import java.util.*;
 
 /**
  * Tests for cache iterators.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/870935d9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIteratorsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIteratorsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIteratorsSelfTest.java
index e845884..56e050e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIteratorsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalIteratorsSelfTest.java
@@ -20,9 +20,6 @@ package org.apache.ignite.internal.processors.cache.local;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.internal.processors.cache.*;
 
-import java.io.*;
-import java.util.*;
-
 import static org.apache.ignite.cache.CacheMode.*;
 
 /**
@@ -43,81 +40,4 @@ public class GridCacheLocalIteratorsSelfTest extends GridCacheAbstractIteratorsS
     @Override protected int entryCount() {
         return 1000;
     }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testCacheIteratorSerialization() throws Exception {
-        testIteratorSerialization(jcache().iterator(), entryCount());
-    }
-
-    /**
-     * @param it Iterator.
-     * @param bound Value bound.
-     * @throws Exception If failed.
-     */
-    private void testIteratorSerialization(Iterator<?> it, int bound) throws Exception
{
-        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
-
-        try (ObjectOutputStream out = new ObjectOutputStream(byteOut)) {
-            out.writeObject(it);
-        }
-
-        byte[] bytes = byteOut.toByteArray();
-
-        ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
-
-        Iterator<?> it0 = (Iterator<?>)in.readObject();
-
-        int cnt = 0;
-
-        while (it0.hasNext()) {
-            Object obj = it0.next();
-
-            if (obj instanceof CacheEntry)
-                checkEntry((CacheEntry<String, Integer>)obj, bound);
-            else if (obj instanceof String)
-                checkKey((String)obj);
-            else if (obj instanceof Integer)
-                checkValue((Integer)obj, bound);
-            else
-                assert false : "Wrong type.";
-
-            cnt++;
-        }
-
-        assert cnt == bound;
-    }
-
-    /**
-     * @param entry Entry.
-     * @param bound Value bound.
-     * @throws Exception If failed.
-     */
-    private void checkEntry(CacheEntry<String, Integer> entry, int bound) throws Exception
{
-        assert entry != null;
-
-        checkKey(entry.getKey());
-        checkValue(entry.getValue(), bound);
-        checkValue(entry.get(), bound);
-    }
-
-    /**
-     * @param key Key.
-     * @throws Exception If failed.
-     */
-    private void checkKey(String key) throws Exception {
-        assert key != null;
-        assert key.contains(KEY_PREFIX);
-    }
-
-    /**
-     * @param value Value.
-     * @param bound Value bound.
-     * @throws Exception If failed.
-     */
-    private void checkValue(Integer value, int bound) throws Exception {
-        assert value != null;
-        assert value >= 0 && value < bound;
-    }
 }


Mime
View raw message