ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/5] incubator-ignite git commit: # ignite-41
Date Wed, 17 Dec 2014 15:11:58 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d84da7d0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalExpiryPolicyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalExpiryPolicyTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalExpiryPolicyTest.java
new file mode 100644
index 0000000..91aa263
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxLocalExpiryPolicyTest.java
@@ -0,0 +1,41 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.apache.ignite.internal.processors.cache.expiry;
+
+import org.gridgain.grid.cache.*;
+
+import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
+import static org.gridgain.grid.cache.GridCacheDistributionMode.*;
+import static org.gridgain.grid.cache.GridCacheMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheTxLocalExpiryPolicyTest extends IgniteCacheExpiryPolicyAbstractTest
{
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected GridCacheMode cacheMode() {
+        return LOCAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected GridCacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected GridCacheDistributionMode distributionMode() {
+        return PARTITIONED_ONLY;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d84da7d0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxReplicatedExpiryPolicyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxReplicatedExpiryPolicyTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxReplicatedExpiryPolicyTest.java
new file mode 100644
index 0000000..b637b59
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheTxReplicatedExpiryPolicyTest.java
@@ -0,0 +1,26 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.apache.ignite.internal.processors.cache.expiry;
+
+import org.gridgain.grid.cache.*;
+
+import static org.gridgain.grid.cache.GridCacheAtomicityMode.*;
+import static org.gridgain.grid.cache.GridCacheDistributionMode.*;
+import static org.gridgain.grid.cache.GridCacheMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheTxReplicatedExpiryPolicyTest extends IgniteCacheTxExpiryPolicyTest
{
+    /** {@inheritDoc} */
+    @Override protected GridCacheMode cacheMode() {
+        return REPLICATED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d84da7d0/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
index dac28ee..16e5b25 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheTestEntryEx.java
@@ -421,9 +421,18 @@ public class GridCacheTestEntryEx<K, V> extends GridMetadataAwareAdapter
impleme
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteBiTuple<Boolean, V> innerUpdateLocal(GridCacheVersion ver,
GridCacheOperation op,
-        @Nullable Object writeObj, boolean writeThrough, boolean retval, long ttl, boolean
evt, boolean metrics,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter, boolean intercept,
UUID subjId, String taskName)
+    @Override public IgniteBiTuple<Boolean, V> innerUpdateLocal(GridCacheVersion ver,
+        GridCacheOperation op,
+        @Nullable Object writeObj,
+        boolean writeThrough,
+        boolean retval,
+        ExpiryPolicy expiryPlc,
+        boolean evt,
+        boolean metrics,
+        @Nullable IgnitePredicate<GridCacheEntry<K, V>>[] filter,
+        boolean intercept,
+        UUID subjId,
+        String taskName)
         throws IgniteCheckedException, GridCacheEntryRemovedException {
         return new IgniteBiTuple<>(false, null);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d84da7d0/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
b/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
index 570bc77..3c56237 100644
--- a/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/testframework/junits/GridAbstractTest.java
@@ -794,6 +794,14 @@ public abstract class GridAbstractTest extends TestCase {
     }
 
     /**
+     * @param idx Index.
+     * @return Ignite instance.
+     */
+    protected Ignite ignite(int idx) {
+        return G.ignite(getTestGridName(idx));
+    }
+
+    /**
      * Gets grid for given test.
      *
      * @return Grid for given test.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d84da7d0/modules/core/src/test/java/org/gridgain/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testframework/junits/common/GridCommonAbstractTest.java
b/modules/core/src/test/java/org/gridgain/testframework/junits/common/GridCommonAbstractTest.java
index 095d05a..8e858da 100644
--- a/modules/core/src/test/java/org/gridgain/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/testframework/junits/common/GridCommonAbstractTest.java
@@ -15,7 +15,6 @@ import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.lang.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.cache.*;
 import org.gridgain.grid.cache.affinity.*;
 import org.gridgain.grid.kernal.*;
@@ -278,7 +277,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is primary.
      * @throws IgniteCheckedException If failed.
      */
-    protected Integer primaryKey(GridCacheProjection<Integer, ?> cache)
+    protected Integer primaryKey(GridCacheProjection<?, ?> cache)
         throws IgniteCheckedException {
         return primaryKeys(cache, 1, 1).get(0);
     }
@@ -289,7 +288,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is primary.
      * @throws IgniteCheckedException If failed.
      */
-    protected List<Integer> primaryKeys(GridCacheProjection<Integer, ?> cache,
int cnt)
+    protected List<Integer> primaryKeys(GridCacheProjection<?, ?> cache, int
cnt)
         throws IgniteCheckedException {
         return primaryKeys(cache, cnt, 1);
     }
@@ -301,8 +300,10 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is primary.
      * @throws IgniteCheckedException If failed.
      */
-    protected List<Integer> primaryKeys(GridCacheProjection<Integer, ?> cache,
int cnt, int startFrom)
+    protected List<Integer> primaryKeys(GridCacheProjection<?, ?> cache, int
cnt, int startFrom)
         throws IgniteCheckedException {
+        assert cnt > 0 : cnt;
+
         List<Integer> found = new ArrayList<>(cnt);
 
         ClusterNode locNode = cache.gridProjection().ignite().cluster().localNode();
@@ -328,7 +329,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is backup.
      * @throws IgniteCheckedException If failed.
      */
-    protected Integer backupKey(GridCacheProjection<Integer, ?> cache)
+    protected Integer backupKey(GridCacheProjection<?, ?> cache)
         throws IgniteCheckedException {
         return backupKeys(cache, 1, 1).get(0);
     }
@@ -339,7 +340,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is backup.
      * @throws IgniteCheckedException If failed.
      */
-    protected List<Integer> backupKeys(GridCacheProjection<Integer, ?> cache,
int cnt)
+    protected List<Integer> backupKeys(GridCacheProjection<?, ?> cache, int cnt)
         throws IgniteCheckedException {
         return backupKeys(cache, cnt, 1);
     }
@@ -351,8 +352,10 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is backup.
      * @throws IgniteCheckedException If failed.
      */
-    protected List<Integer> backupKeys(GridCacheProjection<Integer, ?> cache,
int cnt, int startFrom)
+    protected List<Integer> backupKeys(GridCacheProjection<?, ?> cache, int cnt,
int startFrom)
         throws IgniteCheckedException {
+        assert cnt > 0 : cnt;
+
         List<Integer> found = new ArrayList<>(cnt);
 
         ClusterNode locNode = cache.gridProjection().ignite().cluster().localNode();
@@ -378,7 +381,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is neither primary nor backup.
      * @throws IgniteCheckedException If failed.
      */
-    protected Integer nearKey(GridCacheProjection<Integer, ?> cache)
+    protected Integer nearKey(GridCacheProjection<?, ?> cache)
         throws IgniteCheckedException {
         return nearKeys(cache, 1, 1).get(0);
     }
@@ -389,7 +392,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is neither primary nor backup.
      * @throws IgniteCheckedException If failed.
      */
-    protected List<Integer> nearKeys(GridCacheProjection<Integer, ?> cache, int
cnt)
+    protected List<Integer> nearKeys(GridCacheProjection<?, ?> cache, int cnt)
         throws IgniteCheckedException {
         return nearKeys(cache, cnt, 1);
     }
@@ -401,8 +404,10 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @return Collection of keys for which given cache is neither primary nor backup.
      * @throws IgniteCheckedException If failed.
      */
-    protected List<Integer> nearKeys(GridCacheProjection<Integer, ?> cache, int
cnt, int startFrom)
+    protected List<Integer> nearKeys(GridCacheProjection<?, ?> cache, int cnt,
int startFrom)
         throws IgniteCheckedException {
+        assert cnt > 0 : cnt;
+
         List<Integer> found = new ArrayList<>(cnt);
 
         ClusterNode locNode = cache.gridProjection().ignite().cluster().localNode();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d84da7d0/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
b/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
index 3059c4e..cab96bd 100644
--- a/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
+++ b/modules/core/src/test/java/org/gridgain/testsuites/bamboo/GridDataGridTestSuite.java
@@ -37,7 +37,7 @@ public class GridDataGridTestSuite extends TestSuite {
     public static TestSuite suite() throws Exception {
         TestSuite suite = new TestSuite("Gridgain In-Memory Data Grid Test Suite");
 
-        suite.addTestSuite(IgniteCacheTest.class);
+        suite.addTestSuite(IgniteCacheAbstractTest.class);
 
         // Affinity tests.
         suite.addTestSuite(GridCachePartitionFairAffinityNodesSelfTest.class);


Mime
View raw message