Repository: incubator-ignite
Updated Branches:
  refs/heads/sprint-3 3b036463b -> ab4806214


# sprint-3 failover 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/b9b82808
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b9b82808
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b9b82808

Branch: refs/heads/sprint-3
Commit: b9b828080b1cb5e0e000f8fc827dbd1b9efd1dc1
Parents: 25b92e2
Author: sboikov <sboi...@gridgain.com>
Authored: Fri Mar 27 16:18:51 2015 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Fri Mar 27 17:12:44 2015 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtTxPrepareFuture.java |   2 +-
 .../near/GridNearTxPrepareFuture.java           |   2 +-
 .../cache/transactions/IgniteTxManager.java     |   4 +-
 .../GridCacheAbstractFailoverSelfTest.java      | 134 +++++--------------
 .../GridCacheAbstractFailoverTxSelfTest.java    | 110 +++++++++++++++
 .../dht/GridCacheColocatedFailoverSelfTest.java |   2 +-
 .../atomic/GridCacheAtomicFailoverSelfTest.java |  52 +++++++
 ...AtomicPrimaryWriteOrderFailoverSelfTest.java |  36 +++++
 ...idCacheAtomicReplicatedFailoverSelfTest.java |  32 +++++
 .../GridCachePartitionedFailoverSelfTest.java   |   2 +-
 .../GridCacheReplicatedFailoverSelfTest.java    |   2 +-
 .../IgniteCacheFailoverTestSuite.java           |  13 +-
 12 files changed, 275 insertions(+), 116 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index db2742e..9e23742 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -257,7 +257,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends 
GridCompoundIdentityFutu
                 MiniFuture f = (MiniFuture)fut;
 
                 if (f.node().id().equals(nodeId)) {
-                    f.onResult(new ClusterTopologyCheckedException("Remote 
node left grid (will retry): " + nodeId));
+                    f.onResult(new ClusterTopologyCheckedException("Remote 
node left grid: " + nodeId));
 
                     return true;
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
index a659b3d..2da78fb 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
@@ -175,7 +175,7 @@ public final class GridNearTxPrepareFuture<K, V> extends 
GridCompoundIdentityFut
                 MiniFuture f = (MiniFuture)fut;
 
                 if (f.node().id().equals(nodeId)) {
-                    f.onResult(new ClusterTopologyCheckedException("Remote 
node left grid (will retry): " + nodeId));
+                    f.onResult(new ClusterTopologyCheckedException("Remote 
node left grid: " + nodeId));
 
                     found = true;
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 7ea6e3a..adba9a6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -2052,8 +2052,8 @@ public class IgniteTxManager extends 
GridCacheSharedManagerAdapter {
          */
         private void commitIfPrepared(IgniteInternalTx tx) {
             assert tx instanceof GridDhtTxLocal || tx instanceof 
GridDhtTxRemote  : tx;
-            assert !F.isEmpty(tx.transactionNodes());
-            assert tx.nearXidVersion() != null;
+            assert !F.isEmpty(tx.transactionNodes()) : tx;
+            assert tx.nearXidVersion() != null : tx;
 
             GridCacheOptimisticCheckPreparedTxFuture fut = new 
GridCacheOptimisticCheckPreparedTxFuture<>(
                 cctx,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
index c31d235..42b3293 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
@@ -31,8 +31,6 @@ import javax.cache.*;
 import java.util.*;
 
 import static org.apache.ignite.cache.CacheRebalanceMode.*;
-import static org.apache.ignite.transactions.TransactionConcurrency.*;
-import static org.apache.ignite.transactions.TransactionIsolation.*;
 
 /**
  * Failover tests for cache.
@@ -113,100 +111,16 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
     /**
      * @throws Exception If failed.
      */
-    public void testOptimisticReadCommittedTxTopologyChange() throws Exception 
{
-        testTopologyChange(OPTIMISTIC, READ_COMMITTED);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticRepeatableReadTxTopologyChange() throws 
Exception {
-        testTopologyChange(OPTIMISTIC, REPEATABLE_READ);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticSerializableTxTopologyChange() throws Exception {
-        testTopologyChange(OPTIMISTIC, SERIALIZABLE);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticReadCommittedTxTopologyChange() throws 
Exception {
-        testTopologyChange(PESSIMISTIC, READ_COMMITTED);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticRepeatableReadTxTopologyChange() throws 
Exception {
-        testTopologyChange(PESSIMISTIC, REPEATABLE_READ);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticSerializableTxTopologyChange() throws Exception 
{
-        testTopologyChange(PESSIMISTIC, SERIALIZABLE);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testConstantTopologyChange() throws Exception {
         testConstantTopologyChange(null, null);
     }
 
     /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticReadCommittedTxConstantTopologyChange() throws 
Exception {
-        testConstantTopologyChange(OPTIMISTIC, READ_COMMITTED);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticRepeatableReadTxConstantTopologyChange() throws 
Exception {
-        testConstantTopologyChange(OPTIMISTIC, REPEATABLE_READ);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticSerializableTxConstantTopologyChange() throws 
Exception {
-        testConstantTopologyChange(OPTIMISTIC, SERIALIZABLE);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticReadCommittedTxConstantTopologyChange() throws 
Exception {
-        testConstantTopologyChange(PESSIMISTIC, READ_COMMITTED);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticRepeatableReadTxConstantTopologyChange() throws 
Exception {
-        testConstantTopologyChange(PESSIMISTIC, REPEATABLE_READ);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticSerializableTxConstantTopologyChange() throws 
Exception {
-        testConstantTopologyChange(PESSIMISTIC, SERIALIZABLE);
-    }
-
-    /**
      * @param concurrency Concurrency control.
      * @param isolation Isolation level.
      * @throws Exception If failed.
      */
-    private void testTopologyChange(@Nullable TransactionConcurrency 
concurrency,
+    protected void testTopologyChange(@Nullable TransactionConcurrency 
concurrency,
         @Nullable TransactionIsolation isolation) throws Exception {
         boolean tx = concurrency != null && isolation != null;
 
@@ -240,7 +154,7 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
      * @param isolation Isolation level.
      * @throws Exception If failed.
      */
-    private void testConstantTopologyChange(@Nullable final 
TransactionConcurrency concurrency,
+    protected void testConstantTopologyChange(@Nullable final 
TransactionConcurrency concurrency,
         @Nullable final TransactionIsolation isolation) throws Exception {
         final boolean tx = concurrency != null && isolation != null;
 
@@ -275,21 +189,30 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
                     }
                 }
                 catch (Exception e) {
+                    log.error("Unexpected exception in topology-change-thread: 
" + e, e);
+
                     throw F.wrap(e);
                 }
             }
         }, TOP_CHANGE_THREAD_CNT, "topology-change-thread");
 
-        while (!fut.isDone()) {
-            if (tx) {
-                remove(grid(0), jcache(), half, concurrency, isolation);
-                put(grid(0), jcache(), half, concurrency, isolation);
-            }
-            else {
-                remove(jcache(), half);
-                put(jcache(), half);
+        try {
+            while (!fut.isDone()) {
+                if (tx) {
+                    remove(grid(0), jcache(), half, concurrency, isolation);
+                    put(grid(0), jcache(), half, concurrency, isolation);
+                }
+                else {
+                    remove(jcache(), half);
+                    put(jcache(), half);
+                }
             }
         }
+        catch (Exception e) {
+            log.error("Unexpected exception: " + e, e);
+
+            throw e;
+        }
 
         fut.get();
     }
@@ -312,14 +235,20 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
     }
 
     /**
+     * @param ignite Ignite.
      * @param cache Cache.
      * @param cnt Entry count.
      * @param concurrency Concurrency control.
      * @param isolation Isolation level.
      * @throws IgniteCheckedException If failed.
      */
-    private void put(Ignite ignite, IgniteCache<String, Integer> cache, final 
int cnt,
-        TransactionConcurrency concurrency, TransactionIsolation isolation) 
throws Exception {
+    private void put(Ignite ignite,
+        IgniteCache<String, Integer> cache,
+        final int cnt,
+        TransactionConcurrency concurrency,
+        TransactionIsolation isolation)
+        throws Exception
+    {
         try {
             info("Putting values to cache [0," + cnt + ')');
 
@@ -330,7 +259,7 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
                 }
             });
         }
-        catch (IgniteCheckedException e) {
+        catch (Exception e) {
             // It is ok to fail with topology exception.
             if (!X.hasCause(e, ClusterTopologyCheckedException.class))
                 throw e;
@@ -357,25 +286,26 @@ public abstract class GridCacheAbstractFailoverSelfTest 
extends GridCacheAbstrac
     }
 
     /**
+     * @param ignite Ignite.
      * @param cache Cache.
      * @param cnt Entry count.
      * @param concurrency Concurrency control.
      * @param isolation Isolation level.
      * @throws IgniteCheckedException If failed.
      */
-    private void remove(Ignite g, IgniteCache<String, Integer> cache, final 
int cnt,
+    private void remove(Ignite ignite, IgniteCache<String, Integer> cache, 
final int cnt,
         TransactionConcurrency concurrency, TransactionIsolation isolation) 
throws Exception {
         try {
             info("Removing values form cache [0," + cnt + ')');
 
-            CU.inTx(g, cache, concurrency, isolation, new 
CIX1<IgniteCache<String, Integer>>() {
+            CU.inTx(ignite, cache, concurrency, isolation, new 
CIX1<IgniteCache<String, Integer>>() {
                 @Override public void applyx(IgniteCache<String, Integer> 
cache) {
                     for (int i = 0; i < cnt; i++)
                         cache.remove("key" + i);
                 }
             });
         }
-        catch (IgniteCheckedException e) {
+        catch (Exception e) {
             // It is ok to fail with topology exception.
             if (!X.hasCause(e, ClusterTopologyCheckedException.class))
                 throw e;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverTxSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverTxSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverTxSelfTest.java
new file mode 100644
index 0000000..fb8ac74
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverTxSelfTest.java
@@ -0,0 +1,110 @@
+/*
+ * 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;
+
+import static org.apache.ignite.transactions.TransactionConcurrency.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ *
+ */
+public abstract class GridCacheAbstractFailoverTxSelfTest extends 
GridCacheAbstractFailoverSelfTest {
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOptimisticReadCommittedTxConstantTopologyChange() throws 
Exception {
+        testConstantTopologyChange(OPTIMISTIC, READ_COMMITTED);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOptimisticRepeatableReadTxConstantTopologyChange() throws 
Exception {
+        testConstantTopologyChange(OPTIMISTIC, REPEATABLE_READ);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOptimisticSerializableTxConstantTopologyChange() throws 
Exception {
+        testConstantTopologyChange(OPTIMISTIC, SERIALIZABLE);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPessimisticReadCommittedTxConstantTopologyChange() throws 
Exception {
+        testConstantTopologyChange(PESSIMISTIC, READ_COMMITTED);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPessimisticRepeatableReadTxConstantTopologyChange() throws 
Exception {
+        testConstantTopologyChange(PESSIMISTIC, REPEATABLE_READ);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPessimisticSerializableTxConstantTopologyChange() throws 
Exception {
+        testConstantTopologyChange(PESSIMISTIC, SERIALIZABLE);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOptimisticReadCommittedTxTopologyChange() throws Exception 
{
+        testTopologyChange(OPTIMISTIC, READ_COMMITTED);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOptimisticRepeatableReadTxTopologyChange() throws 
Exception {
+        testTopologyChange(OPTIMISTIC, REPEATABLE_READ);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOptimisticSerializableTxTopologyChange() throws Exception {
+        testTopologyChange(OPTIMISTIC, SERIALIZABLE);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPessimisticReadCommittedTxTopologyChange() throws 
Exception {
+        testTopologyChange(PESSIMISTIC, READ_COMMITTED);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPessimisticRepeatableReadTxTopologyChange() throws 
Exception {
+        testTopologyChange(PESSIMISTIC, REPEATABLE_READ);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPessimisticSerializableTxTopologyChange() throws Exception 
{
+        testTopologyChange(PESSIMISTIC, SERIALIZABLE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
index 6f2032f..568b08f 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.cache.CacheMode.*;
 /**
  * Failover tests for colocated cache.
  */
-public class GridCacheColocatedFailoverSelfTest extends 
GridCacheAbstractFailoverSelfTest {
+public class GridCacheColocatedFailoverSelfTest extends 
GridCacheAbstractFailoverTxSelfTest {
     /** {@inheritDoc} */
     @Override protected CacheMode cacheMode() {
         return PARTITIONED;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicFailoverSelfTest.java
new file mode 100644
index 0000000..e8266c0
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicFailoverSelfTest.java
@@ -0,0 +1,52 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class GridCacheAtomicFailoverSelfTest extends 
GridCacheAbstractFailoverSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) 
throws Exception {
+        CacheConfiguration ccfg = super.cacheConfiguration(gridName);
+
+        ccfg.setAtomicWriteOrderMode(CLOCK);
+
+        assertEquals(CacheWriteSynchronizationMode.FULL_SYNC, 
ccfg.getWriteSynchronizationMode());
+
+        return ccfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.java
new file mode 100644
index 0000000..558f4d4
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.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.distributed.dht.atomic;
+
+import org.apache.ignite.configuration.*;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+
+/**
+ *
+ */
+public class GridCacheAtomicPrimaryWriteOrderFailoverSelfTest extends 
GridCacheAtomicFailoverSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) 
throws Exception {
+        CacheConfiguration ccfg = super.cacheConfiguration(gridName);
+
+        ccfg.setAtomicWriteOrderMode(PRIMARY);
+
+        return ccfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicReplicatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicReplicatedFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicReplicatedFailoverSelfTest.java
new file mode 100644
index 0000000..0a2781b
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicReplicatedFailoverSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class GridCacheAtomicReplicatedFailoverSelfTest extends 
GridCacheAtomicFailoverSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return REPLICATED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
index 0c2dec7..553d748 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
@@ -25,7 +25,7 @@ import static org.apache.ignite.cache.CacheMode.*;
 /**
  * Failover tests for partitioned cache.
  */
-public class GridCachePartitionedFailoverSelfTest extends 
GridCacheAbstractFailoverSelfTest {
+public class GridCachePartitionedFailoverSelfTest extends 
GridCacheAbstractFailoverTxSelfTest {
     /** {@inheritDoc} */
     @Override protected CacheMode cacheMode() {
         return PARTITIONED;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
index cb389be..326f57d 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
@@ -25,7 +25,7 @@ import static org.apache.ignite.cache.CacheMode.*;
 /**
  * Failover tests for replicated cache.
  */
-public class GridCacheReplicatedFailoverSelfTest extends 
GridCacheAbstractFailoverSelfTest {
+public class GridCacheReplicatedFailoverSelfTest extends 
GridCacheAbstractFailoverTxSelfTest {
     /** {@inheritDoc} */
     @Override protected CacheMode cacheMode() {
         return REPLICATED;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9b82808/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index 1c23bb6..17f2458 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -36,11 +36,6 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
 
         
suite.addTestSuite(GridCacheAtomicInvalidPartitionHandlingSelfTest.class);
 
-        // Group lock failover.
-        // TODO: IGNITE-80.
-        //suite.addTestSuite(GridCacheGroupLockFailoverSelfTest.class);
-        
//suite.addTestSuite(GridCacheGroupLockFailoverOptimisticTxSelfTest.class);
-
         suite.addTestSuite(GridCacheIncrementTransformTest.class);
 
         // Failure consistency tests.
@@ -53,8 +48,12 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
         //suite.addTestSuite(GridCacheAtomicNearRemoveFailureTest.class); TODO 
IGNITE-560
         
suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderNearRemoveFailureTest.class);
 
-        //suite.addTest(new 
TestSuite(GridCachePartitionedFailoverSelfTest.class));  TODO-gg-4813
-        //suite.addTest(new 
TestSuite(GridCacheColocatedFailoverSelfTest.class)); TODO-gg-4813
+        suite.addTestSuite(GridCacheAtomicFailoverSelfTest.class);
+        
suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicReplicatedFailoverSelfTest.class);
+
+        //suite.addTestSuite(GridCachePartitionedFailoverSelfTest.class);  
TODO-gg-4813
+        //suite.addTestSuite(GridCacheColocatedFailoverSelfTest.class); 
TODO-gg-4813
         //suite.addTestSuite(GridCacheReplicatedFailoverSelfTest.class); 
TODO-gg-4813
 
         return suite;

Reply via email to