You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2015/07/31 11:34:33 UTC

[4/9] incubator-ignite git commit: ignite-946: added tests

ignite-946: added tests


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

Branch: refs/heads/ignite-946
Commit: 3d5cf6a1698c9a8624c8e878cd756662b8dfa4fd
Parents: 9fd86b1
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jul 30 16:03:18 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jul 31 12:33:06 2015 +0300

----------------------------------------------------------------------
 .../cache/version/CacheVersionedEntryImpl.java  |   2 -
 .../CacheVersionedEntryAbstractTest.java        | 184 +++++++++++++++++++
 .../CacheVersionedEntryLocalAtomicSelfTest.java |  40 ++++
 ...ersionedEntryLocalTransactionalSelfTest.java |  40 ++++
 ...edEntryPartitionedAtomicOffHeapSelfTest.java |  35 ++++
 ...VersionedEntryPartitionedAtomicSelfTest.java |  35 ++++
 ...PartitionedTransactionalOffHeapSelfTest.java |  36 ++++
 ...edEntryPartitionedTransactionalSelfTest.java |  35 ++++
 ...nedEntryReplicatedAtomicOffHeapSelfTest.java |  35 ++++
 ...eVersionedEntryReplicatedAtomicSelfTest.java |  35 ++++
 ...yReplicatedTransactionalOffHeapSelfTest.java |  36 ++++
 ...nedEntryReplicatedTransactionalSelfTest.java |  35 ++++
 .../testsuites/IgniteCacheTestSuite4.java       |  13 ++
 13 files changed, 559 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
index 6d1e0c9..924eff9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
@@ -48,8 +48,6 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implemen
     public CacheVersionedEntryImpl(K key, V val, GridCacheVersion ver) {
         super(key, val);
 
-        assert val == null;
-
         this.ver = ver;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
new file mode 100644
index 0000000..951d05a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.version.*;
+import org.apache.ignite.internal.processors.cache.*;
+
+import javax.cache.*;
+import javax.cache.processor.*;
+import java.util.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * Versioned entry abstract test.
+ */
+public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractSelfTest {
+    /** Entries number to store in a cache. */
+    private static final int ENTRIES_NUM = 1000;
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 2;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
+        Cache<Integer, String> cache = grid(0).cache(null);
+
+        for (int i = 0 ; i < ENTRIES_NUM; i++)
+            cache.put(i, "value_" + i);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testInvoke() throws Exception {
+        Cache<Integer, String> cache = grid(0).cache(null);
+
+        final AtomicBoolean invoked = new AtomicBoolean(false);
+
+        cache.invoke(100, new EntryProcessor<Integer, String, Object>() {
+            @Override public Object process(MutableEntry<Integer, String> entry, Object... arguments)
+                throws EntryProcessorException {
+
+                invoked.set(true);
+
+                VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
+
+                checkVersionedEntry(verEntry);
+
+                return entry;
+            }
+        });
+
+        assertTrue(invoked.get());
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testInvokeAll() throws Exception {
+        Cache<Integer, String> cache = grid(0).cache(null);
+
+        Set<Integer> keys = new HashSet<>();
+
+        for (int i = 0; i < ENTRIES_NUM; i++)
+            keys.add(i);
+
+        final AtomicInteger invoked = new AtomicInteger();
+
+        cache.invokeAll(keys, new EntryProcessor<Integer, String, Object>() {
+            @Override public Object process(MutableEntry<Integer, String> entry, Object... arguments)
+                throws EntryProcessorException {
+
+                invoked.incrementAndGet();
+
+                VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
+
+                checkVersionedEntry(verEntry);
+
+                return null;
+            }
+        });
+
+        assert invoked.get() > 0;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testRandomEntry() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+        for (int i = 0; i < 5; i++)
+            checkVersionedEntry(cache.randomEntry().unwrap(VersionedEntry.class));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testIterator() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+        Iterator<Cache.Entry<Integer, String>> entries = cache.iterator();
+
+        while (entries.hasNext())
+            checkVersionedEntry(entries.next().unwrap(VersionedEntry.class));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLocalPeek() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+        Iterable<Cache.Entry<Integer, String>> entries = offheapTiered(cache) ?
+            cache.localEntries(CachePeekMode.SWAP, CachePeekMode.OFFHEAP) :
+            cache.localEntries(CachePeekMode.ONHEAP);
+
+        for (Cache.Entry<Integer, String> entry : entries)
+            checkVersionedEntry(entry.unwrap(VersionedEntry.class));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testVersionComparision() throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).cache(null);
+
+        VersionedEntry<String, Integer> ver1 = cache.invoke(100,
+            new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
+                @Override public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+                    Object... arguments) throws EntryProcessorException {
+                        return entry.unwrap(VersionedEntry.class);
+                    }
+            });
+
+        cache.put(100, "new value 100");
+
+        VersionedEntry<String, Integer> ver2 = cache.invoke(100,
+            new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
+                @Override public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+                    Object... arguments) throws EntryProcessorException {
+                        return entry.unwrap(VersionedEntry.class);
+                    }
+            });
+
+        assert VersionedEntry.VERSIONS_COMPARATOR.compare(ver1, ver2) < 0;
+    }
+
+    /**
+     * @param entry Versioned entry.
+     */
+    private void checkVersionedEntry(VersionedEntry<Integer, String> entry) {
+        assertNotNull(entry);
+
+        assert entry.topologyVersion() > 0;
+        assert entry.order() > 0;
+        assert entry.nodeOrder() > 0;
+        assert entry.globalTime() > 0;
+
+        assertNotNull(entry.getKey());
+        assertNotNull(entry.getValue());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java
new file mode 100644
index 0000000..a340413
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalAtomicSelfTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryLocalAtomicSelfTest extends CacheVersionedEntryAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.LOCAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java
new file mode 100644
index 0000000..4833c2c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryLocalTransactionalSelfTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryLocalTransactionalSelfTest extends CacheVersionedEntryAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.LOCAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.TRANSACTIONAL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java
new file mode 100644
index 0000000..2f33d84
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryPartitionedAtomicOffHeapSelfTest extends CacheVersionedEntryPartitionedAtomicSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+        CacheConfiguration cfg = super.cacheConfiguration(gridName);
+
+        cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java
new file mode 100644
index 0000000..f2197ad
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedAtomicSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryPartitionedAtomicSelfTest extends CacheVersionedEntryAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java
new file mode 100644
index 0000000..7494690
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest extends
+    CacheVersionedEntryPartitionedTransactionalSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+        CacheConfiguration cfg = super.cacheConfiguration(gridName);
+
+        cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java
new file mode 100644
index 0000000..95a63c8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryPartitionedTransactionalSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryPartitionedTransactionalSelfTest extends CacheVersionedEntryAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.TRANSACTIONAL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java
new file mode 100644
index 0000000..dd3fd0c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryReplicatedAtomicOffHeapSelfTest extends CacheVersionedEntryReplicatedAtomicSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+        CacheConfiguration cfg = super.cacheConfiguration(gridName);
+
+        cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java
new file mode 100644
index 0000000..fd9617d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedAtomicSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryReplicatedAtomicSelfTest extends CacheVersionedEntryAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.REPLICATED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java
new file mode 100644
index 0000000..d1bc5c3
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest extends
+    CacheVersionedEntryReplicatedTransactionalSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+        CacheConfiguration cfg = super.cacheConfiguration(gridName);
+
+        cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java
new file mode 100644
index 0000000..8d37e7b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryReplicatedTransactionalSelfTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.version;
+
+import org.apache.ignite.cache.*;
+
+/**
+ *
+ */
+public class CacheVersionedEntryReplicatedTransactionalSelfTest extends CacheVersionedEntryAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return CacheMode.REPLICATED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.TRANSACTIONAL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d5cf6a1/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 18b2409..dd9c799 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
 import org.apache.ignite.internal.processors.cache.integration.*;
+import org.apache.ignite.internal.processors.cache.version.*;
 
 /**
  * Test suite.
@@ -153,6 +154,18 @@ public class IgniteCacheTestSuite4 extends TestSuite {
         suite.addTestSuite(CacheReadThroughLocalAtomicRestartSelfTest.class);
         suite.addTestSuite(CacheReadThroughAtomicRestartSelfTest.class);
 
+        // Versioned entry tests
+        suite.addTestSuite(CacheVersionedEntryLocalAtomicSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryLocalTransactionalSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryPartitionedAtomicSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryPartitionedAtomicOffHeapSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryReplicatedAtomicSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.class);
+
         return suite;
     }
 }