# sprint-45 added tests without near cache
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8aff704a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8aff704a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8aff704a Branch: refs/heads/sprint-2 Commit: 8aff704a9ed5b0509bc1a59bbfae2eb0fead4938 Parents: 1628f67 Author: sboikov <sboi...@gridgain.com> Authored: Tue Mar 24 10:29:10 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Tue Mar 24 10:29:10 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheProcessor.java | 2 +- ...tomicPrimaryWriteOrderRemoveFailureTest.java | 56 ++++++++++++++++++++ .../GridCacheAtomicRemoveFailureTest.java | 56 ++++++++++++++++++++ .../IgniteCacheFailoverTestSuite.java | 3 ++ 4 files changed, 116 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aff704a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index 6633356..26091f3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -250,7 +250,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { perf.add(msg, true); if (cfg.getCacheMode() == PARTITIONED) { - perf.add("Disable near cache (set 'nearEnabled' to false)", cfg.getNearConfiguration() != null); + perf.add("Disable near cache (set 'nearConfiguration' to null)", cfg.getNearConfiguration() == null); if (cfg.getAffinity() != null) perf.add("Decrease number of backups (set 'keyBackups' to 0)", cfg.getBackups() == 0); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aff704a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderRemoveFailureTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderRemoveFailureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderRemoveFailureTest.java new file mode 100644 index 0000000..30a4dbf --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicPrimaryWriteOrderRemoveFailureTest.java @@ -0,0 +1,56 @@ +/* + * 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.*; + +/** + * Tests that removes are not lost when topology changes. + */ +public class GridCacheAtomicPrimaryWriteOrderRemoveFailureTest extends GridCacheAbstractRemoveFailureTest { + /** {@inheritDoc} */ + @Override protected CacheMode cacheMode() { + return PARTITIONED; + } + + /** {@inheritDoc} */ + @Override protected CacheAtomicityMode atomicityMode() { + return ATOMIC; + } + + /** {@inheritDoc} */ + @Override protected NearCacheConfiguration nearConfiguration() { + return null; + } + + /** {@inheritDoc} */ + @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { + CacheConfiguration cfg = super.cacheConfiguration(gridName); + + cfg.setBackups(1); + cfg.setAtomicWriteOrderMode(PRIMARY); + + return cfg; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aff704a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicRemoveFailureTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicRemoveFailureTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicRemoveFailureTest.java new file mode 100644 index 0000000..57369ba --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicRemoveFailureTest.java @@ -0,0 +1,56 @@ +/* + * 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.*; + +/** + * Tests that removes are not lost when topology changes. + */ +public class GridCacheAtomicRemoveFailureTest extends GridCacheAbstractRemoveFailureTest { + /** {@inheritDoc} */ + @Override protected CacheMode cacheMode() { + return PARTITIONED; + } + + /** {@inheritDoc} */ + @Override protected CacheAtomicityMode atomicityMode() { + return ATOMIC; + } + + /** {@inheritDoc} */ + @Override protected NearCacheConfiguration nearConfiguration() { + return null; + } + + /** {@inheritDoc} */ + @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { + CacheConfiguration cfg = super.cacheConfiguration(gridName); + + cfg.setBackups(1); + cfg.setAtomicWriteOrderMode(CLOCK); + + return cfg; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8aff704a/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 94c7588..df5bc67 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 @@ -41,6 +41,9 @@ public class IgniteCacheFailoverTestSuite extends TestSuite { //suite.addTestSuite(GridCacheGroupLockFailoverOptimisticTxSelfTest.class); // Failure consistency tests. + suite.addTestSuite(GridCacheAtomicRemoveFailureTest.class); + suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderRemoveFailureTest.class); + suite.addTestSuite(GridCacheDhtAtomicRemoveFailureTest.class); suite.addTestSuite(GridCacheDhtRemoveFailureTest.class); // TODO: IGNITE-80.