http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java deleted file mode 100644 index 574642e..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMetricsSelfTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.*; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * Replicated cache metrics test. - */ -public class GridCacheReplicatedMetricsSelfTest extends GridCacheTransactionalAbstractMetricsSelfTest { - /** */ - private static final int GRID_CNT = 2; - - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - c.getTransactionsConfiguration().setTxSerializableEnabled(true); - - return c; - } - - /** {@inheritDoc} */ - @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { - CacheConfiguration cfg = super.cacheConfiguration(gridName); - - cfg.setCacheMode(REPLICATED); - - return cfg; - } - - /** {@inheritDoc} */ - @Override protected int gridCount() { - return GRID_CNT; - } -}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeFullApiSelfTest.java deleted file mode 100644 index cbd04bd..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeFullApiSelfTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -/** - * Multi-node tests for replicated cache. - */ -public class GridCacheReplicatedMultiNodeFullApiSelfTest extends GridCacheReplicatedFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected int gridCount() { - return 3; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java deleted file mode 100644 index 497d35c..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeLockSelfTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * Test cases for multi-threaded tests. - */ -public class GridCacheReplicatedMultiNodeLockSelfTest extends GridCacheMultiNodeLockAbstractTest { - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration() throws Exception { - IgniteConfiguration cfg = super.getConfiguration(); - - CacheConfiguration cacheCfg = defaultCacheConfiguration(); - - cacheCfg.setCacheMode(REPLICATED); - - cfg.setCacheConfiguration(cacheCfg); - - return cfg; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest.java deleted file mode 100644 index 91a27a9..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.configuration.*; - -/** - * Multi-node tests for replicated cache. - */ -public class GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest - extends GridCacheReplicatedMultiNodeFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - c.setPeerClassLoadingEnabled(false); - - return c; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java deleted file mode 100644 index 48f5b25..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedMultiNodeSelfTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * Test cases for multi-threaded tests. - */ -public class GridCacheReplicatedMultiNodeSelfTest extends GridCacheMultiNodeAbstractTest { - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); - - CacheConfiguration cacheCfg = defaultCacheConfiguration(); - - cacheCfg.setCacheMode(REPLICATED); - - cfg.setCacheConfiguration(cacheCfg); - - return cfg; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlyMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlyMultiNodeFullApiSelfTest.java deleted file mode 100644 index 6efe389..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlyMultiNodeFullApiSelfTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.internal.processors.cache.distributed.near.*; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * - */ -public class GridCacheReplicatedNearOnlyMultiNodeFullApiSelfTest extends GridCacheNearOnlyMultiNodeFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected GridCacheMode cacheMode() { - return REPLICATED; - } - - // TODO: remove when GG-7437 is fixed. - /** {@inheritDoc} */ - @Override protected boolean lockingEnabled() { - return false; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlySelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlySelfTest.java deleted file mode 100644 index eb66553..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNearOnlySelfTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.internal.processors.cache.distributed.near.*; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * Near only test for REPLICATED cache. - */ -public class GridCacheReplicatedNearOnlySelfTest extends GridCacheNearOnlySelfTest { - /** {@inheritDoc} */ - @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { - CacheConfiguration cfg = super.cacheConfiguration(gridName); - - cfg.setAffinity(null); - - return cfg; - } - - /** {@inheritDoc} */ - @Override protected GridCacheMode cacheMode() { - return REPLICATED; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeFailureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeFailureSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeFailureSelfTest.java deleted file mode 100644 index eec1987..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeFailureSelfTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Tests for node failure in transactions. - */ -public class GridCacheReplicatedNodeFailureSelfTest extends GridCacheNodeFailureAbstractTest { - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - c.getTransactionsConfiguration().setTxSerializableEnabled(true); - - CacheConfiguration cc = defaultCacheConfiguration(); - - cc.setCacheMode(REPLICATED); - cc.setWriteSynchronizationMode(FULL_SYNC); - - c.setCacheConfiguration(cc); - - return c; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java deleted file mode 100644 index d10d51a..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedNodeRestartSelfTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCachePreloadMode.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Tests node restart. - */ -public class GridCacheReplicatedNodeRestartSelfTest extends GridCacheAbstractNodeRestartSelfTest { - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - CacheConfiguration cc = defaultCacheConfiguration(); - - cc.setName(CACHE_NAME); - - cc.setCacheMode(REPLICATED); - - cc.setWriteSynchronizationMode(FULL_SYNC); - - cc.setStartSize(20); - - cc.setPreloadMode(SYNC); - - cc.setPreloadBatchSize(20); - - c.setCacheConfiguration(cc); - - return c; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java deleted file mode 100644 index 5cd0227..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapFullApiSelfTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -/** - * Tests replicated cache with values being stored off-heap. - */ -public class GridCacheReplicatedOffHeapFullApiSelfTest extends GridCacheReplicatedFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java deleted file mode 100644 index 68a9a1c..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -/** - * Tests replicated cache with values being stored off-heap. - */ -public class GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected boolean offHeapValues() { - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.java deleted file mode 100644 index 944851d..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -/** - * Tests for byte array values in REPLICATED caches with P2P disabled. - */ -public class GridCacheReplicatedP2PDisabledByteArrayValuesSelfTest extends - GridCacheAbstractReplicatedByteArrayValuesSelfTest { - /** {@inheritDoc} */ - @Override protected boolean peerClassLoading() { - return false; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.java deleted file mode 100644 index 1821dd8..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -/** - * Tests for byte array values in REPLICATED caches with P2P enabled. - */ -public class GridCacheReplicatedP2PEnabledByteArrayValuesSelfTest extends - GridCacheAbstractReplicatedByteArrayValuesSelfTest { - /** {@inheritDoc} */ - @Override protected boolean peerClassLoading() { - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedPreloadEventsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedPreloadEventsSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedPreloadEventsSelfTest.java deleted file mode 100644 index ddeeeb6..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedPreloadEventsSelfTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.GridCacheMode; -import org.gridgain.grid.kernal.processors.cache.distributed.GridCachePreloadEventsAbstractSelfTest; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - */ -public class GridCacheReplicatedPreloadEventsSelfTest extends GridCachePreloadEventsAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected GridCacheMode getCacheMode() { - return REPLICATED; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java deleted file mode 100644 index 74de7a4..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.gridgain.grid.kernal.processors.cache.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCacheFlag.*; - -/** - * Projection tests for replicated cache. - */ -public class GridCacheReplicatedProjectionSelfTest extends GridCacheAbstractProjectionSelfTest { - /** {@inheritDoc} */ - @Override protected GridCacheMode cacheMode() { - return REPLICATED; - } - - /** - * @throws Exception In case of error. - */ - public void testInvalidateFlag() throws Exception { - try { - for (int i = 1; i < 3; i++) - startGrid(i); - - String key = "1"; - Integer val = Integer.valueOf(key); - - // Put value into cache. - cache(0).put(key, val); - - for (int i = 0; i < 3; i++) - assertEquals(val, grid(i).cache(null).peek(key)); - - // Put value again, remote nodes are backups and should not be invalidated. - cache(0).flagsOn(INVALIDATE).put(key, val); - - for (int i = 0; i < 3; i++) { - Object peeked = grid(i).cache(null).peek(key); - - assertEquals(val, peeked); - } - } - finally { - for (int i = 1; i < 3; i++) - stopGrid(i); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedRendezvousAffinityMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedRendezvousAffinityMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedRendezvousAffinityMultiNodeFullApiSelfTest.java deleted file mode 100644 index cc86155..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedRendezvousAffinityMultiNodeFullApiSelfTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.cache.affinity.rendezvous.*; - -/** - * Multi-node tests for replicated cache with {@link org.apache.ignite.cache.affinity.rendezvous.GridCacheRendezvousAffinityFunction}. - */ -public class GridCacheReplicatedRendezvousAffinityMultiNodeFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest { - /** {@inheritDoc} */ - @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { - CacheConfiguration cfg = super.cacheConfiguration(gridName); - - cfg.setAffinity(new GridCacheRendezvousAffinityFunction()); - - return cfg; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxConcurrentGetTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxConcurrentGetTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxConcurrentGetTest.java deleted file mode 100644 index 131a4ae..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxConcurrentGetTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Checks multithreaded put/get replicated cache operations on one node. - */ -public class GridCacheReplicatedTxConcurrentGetTest extends IgniteTxConcurrentGetAbstractTest { - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); - - // Default cache configuration. - CacheConfiguration cacheCfg = defaultCacheConfiguration(); - - cacheCfg.setCacheMode(REPLICATED); - cacheCfg.setWriteSynchronizationMode(FULL_SYNC); - - cfg.setCacheConfiguration(cacheCfg); - - return cfg; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java deleted file mode 100644 index ce256cb..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxExceptionSelfTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.gridgain.grid.kernal.processors.cache.*; - -import static org.apache.ignite.cache.GridCacheDistributionMode.*; -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * Tests replicated cache. - */ -public class GridCacheReplicatedTxExceptionSelfTest extends IgniteTxExceptionAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected GridCacheMode cacheMode() { - return REPLICATED; - } - - /** {@inheritDoc} */ - @Override protected GridCacheDistributionMode distributionMode() { - return PARTITIONED_ONLY; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiNodeBasicTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiNodeBasicTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiNodeBasicTest.java deleted file mode 100644 index d2ff875..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiNodeBasicTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Test basic cache operations in transactions. - */ -public class GridCacheReplicatedTxMultiNodeBasicTest extends IgniteTxMultiNodeAbstractTest { - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); - - // Default cache configuration. - CacheConfiguration ccfg = defaultCacheConfiguration(); - - ccfg.setCacheMode(REPLICATED); - ccfg.setWriteSynchronizationMode(FULL_SYNC); - - cfg.setCacheConfiguration(ccfg); - - return cfg; - } - - /** {@inheritDoc} */ - @Override public void testPutOneEntryInTx() throws Exception { - super.testPutOneEntryInTx(); - } - - /** {@inheritDoc} */ - @Override public void testPutTwoEntriesInTx() throws Exception { - super.testPutTwoEntriesInTx(); - } - - /** {@inheritDoc} */ - @Override public void testPutOneEntryInTxMultiThreaded() throws Exception { - super.testPutOneEntryInTxMultiThreaded(); - } - - /** {@inheritDoc} */ - @Override public void testPutTwoEntryInTxMultiThreaded() throws Exception { - super.testPutTwoEntryInTxMultiThreaded(); - } - - /** {@inheritDoc} */ - @Override public void testRemoveInTxQueried() throws Exception { - super.testRemoveInTxQueried(); - } - - /** {@inheritDoc} */ - @Override public void testRemoveInTxSimple() throws Exception { - super.testRemoveInTxSimple(); - } - - /** {@inheritDoc} */ - @Override public void testRemoveInTxQueriedMultiThreaded() throws Exception { - super.testRemoveInTxQueriedMultiThreaded(); - } -} - http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiThreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiThreadedSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiThreadedSelfTest.java deleted file mode 100644 index bf52185..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxMultiThreadedSelfTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.apache.log4j.*; -import org.gridgain.grid.kernal.processors.cache.*; -import org.apache.ignite.spi.discovery.tcp.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Tests for replicated transactions. - */ -public class GridCacheReplicatedTxMultiThreadedSelfTest extends IgniteTxMultiThreadedAbstractTest { - /** Cache debug flag. */ - private static final boolean CACHE_DEBUG = false; - - /** Log to file flag. */ - private static final boolean LOG_TO_FILE = true; - - /** */ - private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); - - /** {@inheritDoc} */ - @SuppressWarnings({"unchecked"}) - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - TransactionsConfiguration tCfg = new TransactionsConfiguration(); - - tCfg.setTxSerializableEnabled(true); - - c.setTransactionsConfiguration(tCfg); - - CacheConfiguration cc = defaultCacheConfiguration(); - - cc.setCacheMode(REPLICATED); - - cc.setEvictionPolicy(null); - - cc.setWriteSynchronizationMode(FULL_SYNC); - - c.setCacheConfiguration(cc); - - TcpDiscoverySpi spi = new TcpDiscoverySpi(); - - spi.setIpFinder(ipFinder); - - c.setDiscoverySpi(spi); - - if (CACHE_DEBUG) - resetLog4j(Level.DEBUG, LOG_TO_FILE, GridCacheProcessor.class.getPackage().getName()); - - return c; - } - - /** {@inheritDoc} */ - @Override protected int gridCount() { - return 3; - } - - /** {@inheritDoc} */ - @Override protected int keyCount() { - return 3; - } - - /** {@inheritDoc} */ - @Override protected int maxKeyValue() { - return 3; - } - - /** {@inheritDoc} */ - @Override protected int threadCount() { - return 5; - } - - /** {@inheritDoc} */ - @Override protected int iterations() { - return 1000; - } - - /** {@inheritDoc} */ - @Override protected boolean isTestDebug() { - return false; - } - - /** {@inheritDoc} */ - @Override protected boolean printMemoryStats() { - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxOriginatingNodeFailureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxOriginatingNodeFailureSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxOriginatingNodeFailureSelfTest.java deleted file mode 100644 index 46fa156..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxOriginatingNodeFailureSelfTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; - -/** - * Tests originating node failure in REPLICATED cache. - */ -public class GridCacheReplicatedTxOriginatingNodeFailureSelfTest extends - IgniteTxOriginatingNodeFailureAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected GridCacheMode cacheMode() { - return GridCacheMode.REPLICATED; - } - - /** {@inheritDoc} */ - @Override protected Class<?> ignoreMessageClass() { - return GridDistributedTxPrepareRequest.class; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxPessimisticOriginatingNodeFailureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxPessimisticOriginatingNodeFailureSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxPessimisticOriginatingNodeFailureSelfTest.java deleted file mode 100644 index 28281db..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxPessimisticOriginatingNodeFailureSelfTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; - -import java.util.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCacheDistributionMode.*; - -/** - * - */ -public class GridCacheReplicatedTxPessimisticOriginatingNodeFailureSelfTest extends - IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected Collection<Class<?>> ignoreMessageClasses() { - return Collections.<Class<?>>singletonList(GridDistributedTxFinishRequest.class); - } - - /** {@inheritDoc} */ - @Override protected GridCacheMode cacheMode() { - return REPLICATED; - } - - /** {@inheritDoc} */ - @Override protected GridCacheDistributionMode distributionMode() { - return NEAR_PARTITIONED; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxReadTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxReadTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxReadTest.java deleted file mode 100644 index 9014f75..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxReadTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.GridCacheMode; -import org.gridgain.grid.kernal.processors.cache.GridCacheAbstractTxReadTest; - -/** - * Checks transactional reads for local cache. - */ -public class GridCacheReplicatedTxReadTest extends GridCacheAbstractTxReadTest { - /** - * @return {@code LOCAL} for this test. - */ - @Override protected GridCacheMode cacheMode() { - return GridCacheMode.REPLICATED; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxSingleThreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxSingleThreadedSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxSingleThreadedSelfTest.java deleted file mode 100644 index 27ed7c4..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxSingleThreadedSelfTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.apache.log4j.*; -import org.gridgain.grid.kernal.processors.cache.*; -import org.apache.ignite.spi.discovery.tcp.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Tests for replicated transactions. - */ -public class GridCacheReplicatedTxSingleThreadedSelfTest extends IgniteTxSingleThreadedAbstractTest { - /** Cache debug flag. */ - private static final boolean CACHE_DEBUG = false; - - /** Log to file flag. */ - private static final boolean LOG_TO_FILE = true; - - /** */ - private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); - - /** {@inheritDoc} */ - @SuppressWarnings({"unchecked"}) - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - c.getTransactionsConfiguration().setTxSerializableEnabled(true); - - CacheConfiguration cc = defaultCacheConfiguration(); - - cc.setCacheMode(REPLICATED); - - cc.setEvictionPolicy(null); - - cc.setWriteSynchronizationMode(FULL_SYNC); - - c.setCacheConfiguration(cc); - - TcpDiscoverySpi spi = new TcpDiscoverySpi(); - - spi.setIpFinder(ipFinder); - - c.setDiscoverySpi(spi); - - if (CACHE_DEBUG) - resetLog4j(Level.DEBUG, LOG_TO_FILE, GridCacheProcessor.class.getPackage().getName()); - - return c; - } - - /** {@inheritDoc} */ - @Override protected int gridCount() { - return 3; - } - - /** {@inheritDoc} */ - @Override protected int keyCount() { - return 3; - } - - /** {@inheritDoc} */ - @Override protected int maxKeyValue() { - return 3; - } - - /** {@inheritDoc} */ - @Override protected int iterations() { - return 20; - } - - /** {@inheritDoc} */ - @Override protected boolean isTestDebug() { - return false; - } - - /** {@inheritDoc} */ - @Override protected boolean printMemoryStats() { - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxTimeoutSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxTimeoutSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxTimeoutSelfTest.java deleted file mode 100644 index e3c43f5..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedTxTimeoutSelfTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; -import org.apache.ignite.spi.discovery.tcp.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * Simple cache test. - */ -public class GridCacheReplicatedTxTimeoutSelfTest extends IgniteTxTimeoutAbstractTest { - /** Transaction timeout. */ - private static final long TIMEOUT = 50; - - /** */ - private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); - - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - c.getTransactionsConfiguration().setDefaultTxTimeout(TIMEOUT); - c.getTransactionsConfiguration().setTxSerializableEnabled(true); - - CacheConfiguration cc = defaultCacheConfiguration(); - - cc.setCacheMode(REPLICATED); - - c.setCacheConfiguration(cc); - - TcpDiscoverySpi spi = new TcpDiscoverySpi(); - - spi.setIpFinder(ipFinder); - - c.setDiscoverySpi(spi); - - return c; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java deleted file mode 100644 index 768d955..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.*; -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.apache.ignite.events.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.spi.discovery.tcp.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; -import org.apache.ignite.spi.swapspace.file.*; -import org.apache.ignite.internal.util.typedef.internal.*; -import org.gridgain.testframework.*; -import org.gridgain.testframework.junits.common.*; - -import java.io.*; -import java.util.concurrent.*; - -import static java.util.concurrent.TimeUnit.*; -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.events.IgniteEventType.*; - -/** - * Advanced promote test for replicated cache. - */ -public class GridCacheReplicatedUnswapAdvancedSelfTest extends GridCommonAbstractTest { - /** IP finder. */ - private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true); - - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); - - cfg.setPeerClassLoadingLocalClassPathExclude(GridCacheReplicatedUnswapAdvancedSelfTest.class.getName(), - TestClass.class.getName()); - - TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); - - discoSpi.setIpFinder(IP_FINDER); - - cfg.setDiscoverySpi(discoSpi); - - CacheConfiguration cacheCfg = defaultCacheConfiguration(); - - cacheCfg.setCacheMode(REPLICATED); - cacheCfg.setSwapEnabled(true); - - cfg.setCacheConfiguration(cacheCfg); - - cfg.setSwapSpaceSpi(new FileSwapSpaceSpi()); - - return cfg; - } - - /** - * @throws Exception If failed. - */ - public void testUnswapAdvanced() throws Exception { - Ignite g1 = startGrid(1); - Ignite g2 = startGrid(2); - - assert g1.cluster().nodes().size() > 1 : "This test needs at least two grid nodes started."; - - GridCache<Object, Object> cache1 = g1.cache(null); - GridCache<Object, Object> cache2 = g2.cache(null); - - try { - ClassLoader ldr = new GridTestClassLoader( - GridCacheReplicatedUnswapAdvancedSelfTest.class.getName(), - TestClass.class.getName()); - - Object v = ldr.loadClass(TestClass.class.getName()).newInstance(); - - info("v loader: " + v.getClass().getClassLoader()); - - final CountDownLatch putLatch = new CountDownLatch(1); - - g2.events().localListen(new IgnitePredicate<IgniteEvent>() { - @Override public boolean apply(IgniteEvent evt) { - assert evt.type() == EVT_CACHE_OBJECT_PUT; - - putLatch.countDown(); - - return true; - } - }, EVT_CACHE_OBJECT_PUT); - - String key = null; - - for (int i = 0; i < 1000; i++) { - String k = "key-" + i; - - if (cache1.affinity().isPrimary(g1.cluster().localNode(), k)) { - key = k; - - break; - } - } - - assertNotNull(key); - - // Put value into cache of the first grid. - cache1.put(key, v); - - assert putLatch.await(10, SECONDS); - - assert cache2.containsKey(key); - - Object v2 = cache2.get(key); - - info("v2 loader: " + v2.getClass().getClassLoader()); - - assert v2 != null; - assert v2.toString().equals(v.toString()); - assert !v2.getClass().getClassLoader().equals(getClass().getClassLoader()); - assert v2.getClass().getClassLoader().getClass().getName().contains("GridDeploymentClassLoader"); - - // To swap storage. - cache2.evict(key); - - v2 = cache2.promote(key); - - log.info("Unswapped entry value: " + v2); - - assert v2 != null; - - assert v2.getClass().getClassLoader().getClass().getName().contains("GridDeploymentClassLoader"); - } - finally { - stopGrid(1); - stopGrid(2); - } - } - /** - * Test class. - */ - @SuppressWarnings("PublicInnerClass") - public static class TestClass implements Serializable { - /** String value. */ - private String s = "Test string"; - - /** - * @return String value. - */ - public String getStr() { - return s; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(TestClass.class, this); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheSyncReplicatedPreloadSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheSyncReplicatedPreloadSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheSyncReplicatedPreloadSelfTest.java deleted file mode 100644 index 237324c..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheSyncReplicatedPreloadSelfTest.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.*; -import org.apache.ignite.cache.*; -import org.apache.ignite.configuration.*; -import org.apache.ignite.spi.discovery.tcp.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.*; -import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; -import org.gridgain.testframework.junits.common.*; -import org.jetbrains.annotations.*; - -import java.util.concurrent.*; -import java.util.concurrent.atomic.*; - -import static org.apache.ignite.configuration.IgniteDeploymentMode.*; -import static org.apache.ignite.cache.GridCacheDistributionMode.*; -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCachePreloadMode.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Multithreaded tests for replicated cache preloader. - */ -public class GridCacheSyncReplicatedPreloadSelfTest extends GridCommonAbstractTest { - /** */ - private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); - - /** */ - private static final boolean DISCO_DEBUG_MODE = false; - - - /** - * Constructs test. - */ - public GridCacheSyncReplicatedPreloadSelfTest() { - super(false /* don't start grid. */); - } - - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); - - TcpDiscoverySpi disco = new TcpDiscoverySpi(); - - disco.setIpFinder(ipFinder); - disco.setDebugMode(DISCO_DEBUG_MODE); - - cfg.setDiscoverySpi(disco); - - CacheConfiguration cacheCfg = defaultCacheConfiguration(); - - cacheCfg.setCacheMode(REPLICATED); - cacheCfg.setDistributionMode(PARTITIONED_ONLY); - cacheCfg.setWriteSynchronizationMode(FULL_SYNC); - - // This property is essential for this test. - cacheCfg.setPreloadMode(SYNC); - - cacheCfg.setPreloadBatchSize(10000); - - cfg.setCacheConfiguration(cacheCfg); - cfg.setDeploymentMode(CONTINUOUS); - - return cfg; - } - - /** {@inheritDoc} */ - @Override protected void afterTest() throws Exception { - super.afterTest(); - - stopAllGrids(); - } - - /** - * @throws Exception If test failed. - */ - @SuppressWarnings({"TooBroadScope"}) - public void testNodeRestart() throws Exception { - int keyCnt = 1000; - int retries = 20; - - Ignite g0 = startGrid(0); - Ignite g1 = startGrid(1); - - for (int i = 0; i < keyCnt; i++) - g0.cache(null).putx(i, i); - - assertEquals(keyCnt, g0.cache(null).size()); - assertEquals(keyCnt, g1.cache(null).size()); - - for (int n = 0; n < retries; n++) { - info("Starting additional grid node..."); - - Ignite g2 = startGrid(2); - - assertEquals(keyCnt, g2.cache(null).size()); - - info("Stopping additional grid node..."); - - stopGrid(2); - } - } - - /** - * @throws Exception If test failed. - */ - @SuppressWarnings({"TooBroadScope"}) - public void testNodeRestartMultithreaded() throws Exception { - final int keyCnt = 1000; - final int retries = 300; - int threadCnt = 5; - - Ignite g0 = startGrid(0); - Ignite g1 = startGrid(1); - - for (int i = 0; i < keyCnt; i++) - g0.cache(null).putx(i, i); - - assertEquals(keyCnt, g0.cache(null).size()); - assertEquals(keyCnt, g1.cache(null).size()); - - final AtomicInteger cnt = new AtomicInteger(); - - multithreaded( - new Callable() { - @Nullable @Override public Object call() throws Exception { - while (true) { - int c = cnt.incrementAndGet(); - - if (c > retries) - break; - - int idx = c + 1; - - info("Starting additional grid node with index: " + idx); - - startGrid(idx); - - info("Stopping additional grid node with index: " + idx); - - stopGrid(idx); - } - - return null; - } - }, - threadCnt); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java deleted file mode 100644 index dd2eb0a..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridReplicatedTxPreloadTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated; - -import org.apache.ignite.cache.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; - -import static org.apache.ignite.cache.GridCacheMode.*; - -/** - * Tests cache transaction during preloading. - */ -public class GridReplicatedTxPreloadTest extends IgniteTxPreloadAbstractTest { - /** {@inheritDoc} */ - @Override protected GridCacheMode cacheMode() { - return REPLICATED; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b89b472d/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java deleted file mode 100644 index 8edf19b..0000000 --- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * 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.gridgain.grid.kernal.processors.cache.distributed.replicated.preloader; - -import org.apache.ignite.*; -import org.apache.ignite.cache.*; -import org.apache.ignite.cache.query.*; -import org.apache.ignite.configuration.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.lifecycle.*; -import org.apache.ignite.resources.*; -import org.gridgain.grid.kernal.processors.cache.distributed.*; -import org.apache.ignite.internal.util.typedef.*; - -import java.util.*; - -import static org.apache.ignite.cache.GridCacheMode.*; -import static org.apache.ignite.cache.GridCachePreloadMode.*; -import static org.apache.ignite.transactions.IgniteTxConcurrency.*; -import static org.apache.ignite.transactions.IgniteTxIsolation.*; -import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*; - -/** - * Tests for replicated cache preloader. - */ -@SuppressWarnings({"PublicInnerClass"}) -public class GridCacheReplicatedPreloadLifecycleSelfTest extends GridCachePreloadLifecycleAbstractTest { - /** */ - private static boolean quiet = true; - - /** Grid count. */ - private int gridCnt = 5; - - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration c = super.getConfiguration(gridName); - - c.getTransactionsConfiguration().setDefaultTxConcurrency(OPTIMISTIC); - c.getTransactionsConfiguration().setDefaultTxIsolation(READ_COMMITTED); - - CacheConfiguration cc1 = defaultCacheConfiguration(); - - cc1.setName("one"); - cc1.setCacheMode(REPLICATED); - cc1.setWriteSynchronizationMode(FULL_SYNC); - cc1.setPreloadMode(preloadMode); - cc1.setEvictionPolicy(null); - cc1.setSwapEnabled(false); - cc1.setCacheStoreFactory(null); - - // Identical configuration. - CacheConfiguration cc2 = new CacheConfiguration(cc1); - - cc2.setName("two"); - - c.setCacheConfiguration(cc1, cc2); - - return c; - } - - /** - * @param keys Keys. - * @return Lifecycle bean. - */ - private LifecycleBean lifecycleBean(final Object[] keys) { - return new LifecycleBean() { - @IgniteInstanceResource - private Ignite ignite; - - @Override public void onLifecycleEvent(LifecycleEventType evt) throws IgniteCheckedException { - switch (evt) { - case AFTER_GRID_START: { - GridCache<Object, MyValue> c1 = ignite.cache("one"); - GridCache<Object, MyValue> c2 = ignite.cache("two"); - - if (!ignite.name().contains("Test0")) { - if (!quiet) { - info("Keys already in cache:"); - - for (Object k : c1.keySet()) - info("Cache1: " + k.toString()); - - for (Object k : c2.keySet()) - info("Cache2: " + k.toString()); - } - - return; - } - - info("Populating cache data..."); - - int i = 0; - - for (Object key : keys) { - c1.put(key, new MyValue(value(key))); - - if (i++ % 2 == 0) - c2.put(key, new MyValue(value(key))); - } - - assert c1.size() == keys.length : "Invalid cache1 size [size=" + c1.size() + - ", entries=" + c1.entrySet() + ']'; - assert c2.size() == keys.length / 2 : "Invalid cache2 size [size=" + c2.size() + - ", entries=" + c2.entrySet() + ']'; - - break; - } - - case BEFORE_GRID_START: - case BEFORE_GRID_STOP: - case AFTER_GRID_STOP: { - info("Lifecycle event: " + evt); - - break; - } - } - } - }; - } - - /** - * @param keys Keys. - * @throws Exception If failed. - */ - public void checkCache(Object[] keys) throws Exception { - preloadMode = SYNC; - - lifecycleBean = lifecycleBean(keys); - - for (int i = 0; i < gridCnt; i++) { - startGrid(i); - - info("Checking '" + (i + 1) + "' nodes..."); - - for (int j = 0; j < G.allGrids().size(); j++) { - GridCache<String, MyValue> c1 = grid(j).cache("one"); - GridCache<String, MyValue> c2 = grid(j).cache("two"); - - int size1 = c1.size(); - int size2 = c2.size(); - - assert size1 == keys.length : " Invalid cache1 size [i=" + i + ", j=" + j + ", size=" + size1 + - ", cache=" + c1.entrySet() + ']'; - assert size2 == keys.length / 2 : " Invalid cache2 size [i=" + i + ", j=" + j + ", size=" + size2 + - ", cache=" + c2.entrySet() + ']'; - } - } - } - - - /** - * @param keys Keys. - * @throws Exception If failed. - */ - public void checkScanQuery(Object[] keys) throws Exception { - preloadMode = SYNC; - - lifecycleBean = lifecycleBean(keys); - - for (int i = 0; i < gridCnt; i++) { - startGrid(i); - - info("Checking '" + (i + 1) + "' nodes..."); - - for (int j = 0; j < G.allGrids().size(); j++) { - GridCache<Object, MyValue> c2 = grid(j).cache("two"); - - GridCacheQuery<Map.Entry<Object, MyValue>> qry = c2.queries().createScanQuery(null); - - final int i0 = j; - final int j0 = i; - - qry = qry.projection(grid(j)); - - int totalCnt = F.sumInt(qry.execute(new IgniteReducer<Map.Entry<Object, MyValue>, Integer>() { - @IgniteInstanceResource - private Ignite grid; - - @IgniteLoggerResource - private IgniteLogger log0; - - private int cnt; - - @Override public boolean collect(Map.Entry<Object, MyValue> e) { - if (!quiet && log0.isInfoEnabled()) - log0.info("Collecting entry: " + e); - - Object key = e.getKey(); - - assertNotNull(e.getValue()); - - try { - Object v1 = e.getValue(); - Object v2 = grid.cache("one").get(key); - - assertNotNull("Cache c1 misses value for key [i=" + j0 + ", j=" + i0 + - ", missedKey=" + key + ", cache=" + grid.cache("one").values() + ']', v2); - assertEquals(v1, v2); - } - catch (IgniteCheckedException e1) { - e1.printStackTrace(); - - assert false; - } - - cnt++; - - return true; - } - - @Override public Integer reduce() { - return cnt; - } - }).get()); - - info("Total entry count [grid=" + j + ", totalCnt=" + totalCnt + ']'); - - assertEquals(keys.length * (i + 1) / 2, totalCnt); - } - } - } - - /** - * @throws Exception If failed. - */ - public void testLifecycleBean1() throws Exception { - checkCache(keys(true, DFLT_KEYS.length, DFLT_KEYS)); - } - - /** - * @throws Exception If failed. - */ - public void testLifecycleBean2() throws Exception { - checkCache(keys(false, DFLT_KEYS.length, DFLT_KEYS)); - } - - /** - * @throws Exception If failed. - */ - public void testLifecycleBean3() throws Exception { - checkCache(keys(true, 500)); - } - - /** - * @throws Exception If failed. - */ - public void testLifecycleBean4() throws Exception { - checkCache(keys(false, 500)); - } - - /** - * @throws Exception If failed. - */ - public void testScanQuery1() throws Exception { - checkScanQuery(keys(true, DFLT_KEYS.length, DFLT_KEYS)); - } - - /** - * @throws Exception If failed. - */ - public void testScanQuery2() throws Exception { - checkScanQuery(keys(false, DFLT_KEYS.length, DFLT_KEYS)); - } - - /** - * @throws Exception If failed. - */ - public void testScanQuery3() throws Exception { - checkScanQuery(keys(true, 500)); - } - - /** - * @throws Exception If failed. - */ - public void testScanQuery4() throws Exception { - checkScanQuery(keys(false, 500)); - } -}