http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java index 33937af,fa1677c..1e23e4f --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java @@@ -69,9 -70,14 +69,9 @@@ public abstract class IgniteCachePeekMo private static final int HEAP_ENTRIES = 30; /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); - cfg.setSwapSpaceSpi(spi()); - return cfg; }
http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheReadThroughEvictionSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartNoExchangeTimeoutTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java index 0000000,50107e4..9f98a90 mode 000000,100644..100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteMarshallerCacheClassNameConflictTest.java @@@ -1,0 -1,273 +1,278 @@@ + /* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + package org.apache.ignite.internal.processors.cache; + + import java.util.Collection; + import java.util.Map; + import java.util.concurrent.CountDownLatch; + import java.util.concurrent.ExecutorService; + import java.util.concurrent.TimeUnit; + import java.util.concurrent.atomic.AtomicInteger; + import org.apache.ignite.Ignite; + import org.apache.ignite.Ignition; + import org.apache.ignite.cache.CachePeekMode; + import org.apache.ignite.cluster.ClusterNode; + import org.apache.ignite.configuration.CacheConfiguration; + import org.apache.ignite.configuration.IgniteConfiguration; + import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage; + import org.apache.ignite.internal.util.typedef.internal.U; + import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage; + import org.apache.ignite.spi.discovery.DiscoverySpiListener; + import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; + import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; + import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; + import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; + import org.jetbrains.annotations.Nullable; + + import static org.apache.ignite.cache.CacheMode.REPLICATED; + import static org.apache.ignite.cache.CacheRebalanceMode.SYNC; + import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; + + /** + * Tests situation when two nodes in cluster simultaneously propose different classes with the same typeId + * (which is actually class name's <b>hashCode</b> ). + * + * In that case one of the propose requests should be rejected + * and {@link org.apache.ignite.internal.processors.marshaller.MappingProposedMessage} is sent + * with not-null <b>conflictingClsName</b> field. + */ + public class IgniteMarshallerCacheClassNameConflictTest extends GridCommonAbstractTest { + /** */ + private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); + + /** */ + private volatile boolean bbClsRejected; + + /** */ + private volatile boolean aaClsRejected; + + /** */ + private volatile boolean rejectObserved; + + /** + * Latch used to synchronize two nodes on sending mapping requests for classes with conflicting names. + */ + private static final CountDownLatch startLatch = new CountDownLatch(3); + + /** */ + private static volatile boolean busySpinFlag; + + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(gridName); + + TcpDiscoverySpi disco = new TestTcpDiscoverySpi(); + disco.setIpFinder(ipFinder); + + cfg.setDiscoverySpi(disco); + + CacheConfiguration ccfg = new CacheConfiguration(); + + ccfg.setCacheMode(REPLICATED); + ccfg.setRebalanceMode(SYNC); + ccfg.setWriteSynchronizationMode(FULL_SYNC); + + cfg.setCacheConfiguration(ccfg); + + return cfg; + } + + /** {@inheritDoc} */ + @Override protected void afterTest() throws Exception { + stopAllGrids(); + } + /** + * @throws Exception If failed. + */ + public void testCachePutGetClassesWithNameConflict() throws Exception { + Ignite srv1 = startGrid(0); + Ignite srv2 = startGrid(1); + ExecutorService exec1 = srv1.executorService(); + ExecutorService exec2 = srv2.executorService(); + + final AtomicInteger trickCompilerVar = new AtomicInteger(1); + + final Organization aOrg1 = new Organization(1, "Microsoft", "One Microsoft Way Redmond, WA 98052-6399, USA"); + final OrganizatioN bOrg2 = new OrganizatioN(2, "Apple", "1 Infinite Loop, Cupertino, CA 95014, USA"); + + exec1.submit(new Runnable() { + @Override public void run() { + startLatch.countDown(); + + try { + startLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + //busy spinning after waking up from startLatch.await + // to reduce probability that one thread starts significantly earlier than the other + while (!busySpinFlag) { + if (trickCompilerVar.get() < 0) + break; + } + + Ignition.localIgnite().cache(null).put(1, aOrg1); + } + }); + + exec2.submit(new Runnable() { + @Override public void run() { + startLatch.countDown(); + + try { + startLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + //busy spinning after waking up from startLatch.await + // to reduce probability that one thread starts significantly earlier than the other + while (!busySpinFlag) { + if (trickCompilerVar.get() < 0) + break; + } + + Ignition.localIgnite().cache(null).put(2, bOrg2); + } + }); + startLatch.countDown(); + + busySpinFlag = true; + + exec1.shutdown(); + exec2.shutdown(); + + exec1.awaitTermination(100, TimeUnit.MILLISECONDS); + exec2.awaitTermination(100, TimeUnit.MILLISECONDS); + + Ignite ignite = startGrid(2); + + int cacheSize = ignite.cache(null).size(CachePeekMode.PRIMARY); + + assertTrue("Expected cache size 1 but was " + cacheSize, cacheSize == 1); + + if (rejectObserved) + assertTrue(aaClsRejected || bbClsRejected); + } + + /** */ + private class TestTcpDiscoverySpi extends TcpDiscoverySpi { + + /** */ + private class DiscoverySpiListenerWrapper implements DiscoverySpiListener { + /** */ + private DiscoverySpiListener delegate; + + /** + * @param delegate Delegate. + */ + private DiscoverySpiListenerWrapper(DiscoverySpiListener delegate) { + this.delegate = delegate; + } + + /** {@inheritDoc} */ + @Override public void onDiscovery( + int type, + long topVer, + ClusterNode node, + Collection<ClusterNode> topSnapshot, + @Nullable Map<Long, Collection<ClusterNode>> topHist, + @Nullable DiscoverySpiCustomMessage spiCustomMsg + ) { + DiscoveryCustomMessage customMsg = spiCustomMsg == null ? null + : (DiscoveryCustomMessage) U.field(spiCustomMsg, "delegate"); + + if (customMsg != null) + //don't want to make this class public, using equality of class name instead of instanceof operator + if ("MappingProposedMessage".equals(customMsg.getClass().getSimpleName())) { + String conflClsName = U.field(customMsg, "conflictingClsName"); + if (conflClsName != null && !conflClsName.isEmpty()) { + rejectObserved = true; + if (conflClsName.contains("Organization")) + bbClsRejected = true; + else if (conflClsName.contains("OrganizatioN")) + aaClsRejected = true; + } + } + + delegate.onDiscovery(type, topVer, node, topSnapshot, topHist, spiCustomMsg); + } ++ ++ /** {@inheritDoc} */ ++ @Override public void onLocalNodeInitialized(ClusterNode locNode) { ++ // No-op. ++ } + } + + /** {@inheritDoc} */ + @Override public void setListener(@Nullable DiscoverySpiListener lsnr) { + super.setListener(new DiscoverySpiListenerWrapper(lsnr)); + } + } + + /** + * Class name is chosen to be in conflict with other class name this test put to cache. + */ + private static class Organization { + /** */ + private final int id; + + /** */ + private final String name; + + /** */ + private final String addr; + + /** + * @param id Id. + * @param name Name. + * @param addr Address. + */ + Organization(int id, String name, String addr) { + this.id = id; + this.name = name; + this.addr = addr; + } + } + + /** + * Class name is chosen to be in conflict with other class name this test put to cache. + */ + private static class OrganizatioN { + /** */ + private final int id; + + /** */ + private final String name; + + /** */ + private final String addr; + + /** + * @param id Id. + * @param name Name. + * @param addr Address. + */ + OrganizatioN(int id, String name, String addr) { + this.id = id; + this.name = name; + this.addr = addr; + } + } + } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxStoreExceptionAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/OffHeapTieredTransactionSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/GridDataStreamerImplSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLateAffinityAssignmentTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java index a9ff6b3,14e4af2..48e4c79 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java @@@ -76,11 -75,9 +76,11 @@@ public class CacheLoadingConcurrentGrid /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); + cfg.setLateAffinityAssignment(true); + ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); CacheConfiguration ccfg = new CacheConfiguration(); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractDistributedByteArrayValuesSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java index 796d3c9,5a464e4..ba412d7 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractPartitionedByteArrayValuesSelfTest.java @@@ -33,9 -33,8 +33,9 @@@ import static org.apache.ignite.cache.C */ public abstract class GridCacheAbstractPartitionedByteArrayValuesSelfTest extends GridCacheAbstractDistributedByteArrayValuesSelfTest { + /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); TransactionConfiguration tCfg = new TransactionConfiguration(); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheClientModesAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheMultithreadedFailoverAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePartitionNotLoadedEventSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCachePreloadRestartAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeChangingTopologyTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCachePrimarySyncTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxCacheWriteSynchronizationModesMultithreadedTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAbstractPartitionedOnlyByteArrayValuesSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java index 6df358e,2600e7b..c55cf52 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicNearCacheSelfTest.java @@@ -635,7 -638,7 +637,7 @@@ public class GridCacheAtomicNearCacheSe } IgniteCache<Integer, Integer> primaryCache = G.ignite( - (String)aff.mapKeyToNode(nearKey).attribute(ATTR_GRID_NAME)).cache(null); - (String) aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME)).cache(null); ++ (String)aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME)).cache(null); atomicClockModeDelay(cache0); @@@ -681,7 -684,7 +683,7 @@@ for (int i = 0; i < GRID_CNT; i++) checkEntry(grid(i), nearKey, null, i == 0); - Ignite primaryNode = G.ignite((String)aff.mapKeyToNode(nearKey).attribute(ATTR_GRID_NAME)); - Ignite primaryNode = G.ignite((String) aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME)); ++ Ignite primaryNode = G.ignite((String)aff.mapKeyToNode(nearKey).attribute(ATTR_IGNITE_INSTANCE_NAME)); IgniteCache<Integer, Integer> primaryCache = primaryNode.cache(null); @@@ -701,9 -704,13 +703,13 @@@ * @throws Exception If failed. */ @SuppressWarnings("ConstantConditions") - private void checkEntry(Ignite ignite, Integer key, @Nullable Integer val, boolean expectNear, UUID... expReaders) - throws Exception { + private void checkEntry(Ignite ignite, + Integer key, + @Nullable Integer val, + boolean expectNear, + final UUID... expReaders) throws Exception + { - GridCacheAdapter<Integer, Integer> near = ((IgniteKernal) ignite).internalCache(); + GridCacheAdapter<Integer, Integer> near = ((IgniteKernal)ignite).internalCache(); assertTrue(near.isNear()); @@@ -727,11 -734,22 +733,22 @@@ GridDhtCacheAdapter<Integer, Integer> dht = ((GridNearCacheAdapter<Integer, Integer>)near).dht(); - final GridDhtCacheEntry dhtEntry = (GridDhtCacheEntry)dht.peekEx(key); - if (expectDht) { - GridDhtCacheEntry dhtEntry = (GridDhtCacheEntry)dht.entryEx(key); ++ final GridDhtCacheEntry dhtEntry = (GridDhtCacheEntry)dht.entryEx(key); + assertNotNull("No dht entry for: " + key + ", grid: " + ignite.name(), dhtEntry); + GridTestUtils.waitForCondition(new GridAbsPredicate() { + @Override public boolean apply() { + try { + return dhtEntry.readers().size() == expReaders.length; + } + catch (Exception e) { + throw new RuntimeException(e); + } + } + }, 5000); + Collection<UUID> readers = dhtEntry.readers(); assertEquals(expReaders.length, readers.size()); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedOptimisticTransactionSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEntrySelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionNearReadersSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtEvictionsDisabledSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDisabledSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java index 01dd525,744623a..9309ea1 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadSelfTest.java @@@ -651,11 -651,10 +651,11 @@@ public class GridCacheDhtPreloadSelfTes boolean primary = primaryNode.equals(loc); - assertEquals("Key check failed [grid=" + ignite.name() + - assert Integer.toString(i).equals(val) : "Key check failed [igniteInstanceName=" + ignite.name() + ++ assertEquals("Key check failed [igniteInstanceName=" + ignite.name() + ", cache=" + cache.getName() + ", key=" + i + ", expected=" + i + ", actual=" + val + ", part=" + aff.partition(i) + ", primary=" + primary + ", affNodes=" + U.nodeIds(affNodes) + - ", locId=" + loc.id() + ", allNodes=" + U.nodeIds(nodes) + ", allParts=" + top2string(grids) + ']'; + ", locId=" + loc.id() + ", allNodes=" + U.nodeIds(nodes) + ", allParts=" + top2string(grids) + ']', + Integer.toString(i), val); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheTxNodeFailureSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java index a955e40,0a411f4..9a1aaff --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java @@@ -89,9 -90,11 +89,9 @@@ public class IgniteCacheCrossCacheTxFai ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER); - if (gridName.equals(getTestGridName(GRID_CNT - 1))) + if (igniteInstanceName.equals(getTestIgniteInstanceName(GRID_CNT - 1))) cfg.setClientMode(true); - cfg.setSwapSpaceSpi(new GridTestSwapSpaceSpi()); - ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); return cfg; http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheMultiTxLockSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePartitionedBackupNodeFailureRecoveryTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearMultiNodeSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java index 4dcb6ea,23fbf2f..93239e3 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java @@@ -91,11 -91,11 +91,11 @@@ public class GridCacheNearOnlyMultiNode } /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); - if (cnt.getAndIncrement() == 0) { + if (cnt.getAndIncrement() == 0 || (cnt.get() > gridCount() && cnt.get() % gridCount() == 0)) { - info("Use grid '" + gridName + "' as near-only."); + info("Use grid '" + igniteInstanceName + "' as near-only."); cfg.setClientMode(true); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java index 0915c0d,9505b24..faf9ba2 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearReadersSelfTest.java @@@ -210,7 -209,19 +212,21 @@@ public class GridCacheNearReadersSelfTe assertNotNull(cache1.getAndPut(1, "z1")); - assertTrue(e1.obsolete()); ++ final GridDhtCacheEntry e1f = e1; ++ + GridTestUtils.waitForCondition(new GridAbsPredicate() { + @Override public boolean apply() { + try { - return !e1.readers().contains(n2.id()); ++ return !e1f.readers().contains(n2.id()); + } + catch (Exception e) { + throw new RuntimeException(e); + } + } + }, 5000); + + // Node 1 still has node2 in readers map. + assertFalse(e1.readers().contains(n2.id())); } /** @throws Exception If failed. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedEvictionSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFullApiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java index 34ce103,9f0bdfb..403a770 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeCounterSelfTest.java @@@ -496,9 -496,9 +498,9 @@@ public class GridCachePartitionedMultiN IgniteCache<String, Integer> cache = grid(i).cache(null); - int cntr = nearThreads > 0 && nears.contains(g) ? cache.get(CNTR_KEY) : cache.localPeek(CNTR_KEY, CachePeekMode.ONHEAP); + int cntr = nearThreads > 0 && nears.contains(g) ? cache.get(CNTR_KEY) : cache.localPeek(CNTR_KEY); - X.println("*** Cache counter [grid=" + g.name() + ", cntr=" + cntr + ']'); + X.println("*** Cache counter [igniteInstanceName=" + g.name() + ", cntr=" + cntr + ']'); cntrs.put(g.name(), cntr); } @@@ -576,9 -574,9 +578,9 @@@ IgniteCache<String, Integer> cache = grid(i).cache(null); - int cntr = cache.localPeek(CNTR_KEY, CachePeekMode.ONHEAP); + int cntr = cache.localPeek(CNTR_KEY); - info("*** Cache counter [grid=" + g.name() + ", cntr=" + cntr + ']'); + info("*** Cache counter [igniteInstanceName=" + g.name() + ", cntr=" + cntr + ']'); assertEquals(RETRIES * gridCnt, cntr); } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiThreadedPutGetSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedPreloadLifecycleSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridPartitionedBackupLoadSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheNearOnlyTxTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/NearCachePutAllMultinodeTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/NoneRebalanceModeSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingSyncSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheAbstractReplicatedByteArrayValuesSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java index f820593,cc2a153..39e326a --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedUnswapAdvancedSelfTest.java @@@ -59,7 -60,10 +59,7 @@@ public class GridCacheReplicatedUnswapA cfg.setCacheConfiguration(cacheCfg); - if (getTestGridName(1).equals(gridName) || cfg.getMarshaller() instanceof BinaryMarshaller) - cfg.setSwapSpaceSpi(new FileSwapSpaceSpi()); - + if (getTestIgniteInstanceName(1).equals(igniteInstanceName) || cfg.getMarshaller() instanceof BinaryMarshaller) cfg.setClassLoader(getExternalClassLoader()); return cfg; http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadLifecycleSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/preloader/GridCacheReplicatedPreloadSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheBatchEvictUnswapSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionConsistencySelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java index 68f6070,5cc6cde..377afa0 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java @@@ -62,9 -62,10 +62,9 @@@ public class GridCacheSynchronousEvicti } /** {@inheritDoc} */ - @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { - CacheConfiguration ccfg = super.cacheConfiguration(gridName); + @Override protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception { + CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName); - ccfg.setSwapEnabled(false); ccfg.setEvictSynchronized(true); ccfg.setEvictSynchronizedKeyBufferSize(10); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheClientNearCacheExpiryTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyWithStoreAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoadAllAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalByteArrayValuesSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalFullApiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/LocalCacheOffHeapAndSwapMetricsSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/LocalCacheOffHeapAndSwapMetricsSelfTest.java index beec47e,83094cb..f6becd0 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/LocalCacheOffHeapAndSwapMetricsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/LocalCacheOffHeapAndSwapMetricsSelfTest.java @@@ -52,9 -53,11 +52,9 @@@ public class LocalCacheOffHeapAndSwapMe private IgniteCache<Integer, Integer> cache; /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); - cfg.setSwapSpaceSpi(new FileSwapSpaceSpi()); - return cfg; } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java index a14257a,9a27f12..17632de --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java @@@ -51,26 -52,14 +51,26 @@@ public abstract class GridCacheSwapScan private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); /** */ - protected static final String ATOMIC_CACHE_NAME = "atomicCache"; + protected static final String ATOMIC_PERSON_CACHE_NAME = "atomicPerson"; /** */ - protected static final String TRANSACTIONAL_CACHE_NAME = "transactionalCache"; + protected static final String ATOMIC_PRIMITIVE_CACHE_NAME = "atomicPrimitive"; + + /** */ + protected static final String ATOMIC_BYTREARR_CACHE_NAME = "atomicByteArr"; + + /** */ + protected static final String TRANSACTIONAL_PERSON_CACHE_NAME = "transactionalPerson"; + + /** */ + protected static final String TRANSACTIONAL_PRIMITIVE_CACHE_NAME = "transactionalPrimitive"; + + /** */ + protected static final String TRANSACTIONAL_BYTEARR_CACHE_NAME = "transactionalByteArr"; /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); TcpDiscoverySpi disco = new TcpDiscoverySpi(); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryAsyncFilterListenerTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java index a824fd7,716bb0d..f9130ae --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java @@@ -133,11 -133,9 +133,11 @@@ public abstract class CacheContinuousQu private int backups = 1; /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); + cfg.setLateAffinityAssignment(true); + ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true); ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryOrderingEventTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheKeepBinaryIterationTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryConcurrentTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryBackupQueueTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryNoUnsubscribeTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticDeadlockDetectionTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticDeadlockDetectionTest.java index 0be027d,212675b..b48c4ba --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticDeadlockDetectionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxOptimisticDeadlockDetectionTest.java @@@ -98,14 -95,12 +99,14 @@@ public class TxOptimisticDeadlockDetect /** {@inheritDoc} */ @SuppressWarnings("unchecked") - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); - if (isDebug()) { - TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); + TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); + + discoSpi.setIpFinder(IP_FINDER); + if (isDebug()) { discoSpi.failureDetectionTimeoutEnabled(false); cfg.setDiscoverySpi(discoSpi); @@@ -117,11 -112,6 +118,8 @@@ cfg.setClientMode(client); + cfg.setDiscoverySpi(discoSpi); + - // Test spi blocks message send, this can cause hang with striped pool. - cfg.setStripedPoolSize(-1); - return cfg; } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessorSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/IgniteDataStreamerPerformanceTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsProcessorSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java index d0cdddf,c07ff5a..3d21948 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/OdbcProcessorValidationSelfTest.java @@@ -154,20 -153,14 +154,20 @@@ public class OdbcProcessorValidationSel */ @SuppressWarnings("ThrowableResultOfMethodCallIgnored") private void check(OdbcConfiguration odbcCfg, boolean success) throws Exception { - final IgniteConfiguration cfg = new IgniteConfiguration(); + final IgniteConfiguration cfg = super.getConfiguration(); - cfg.setGridName(OdbcProcessorValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet()); + cfg.setIgniteInstanceName(OdbcProcessorValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet()); cfg.setLocalHost("127.0.0.1"); cfg.setOdbcConfiguration(odbcCfg); + cfg.setMarshaller(new BinaryMarshaller()); + + TcpDiscoverySpi spi = new TcpDiscoverySpi(); + spi.setIpFinder(new TcpDiscoveryVmIpFinder(true)); + + cfg.setDiscoverySpi(spi); if (success) - Ignition.start(cfg); + startGrid(cfg.getGridName(), cfg); else { GridTestUtils.assertThrows(log, new Callable<Void>() { @Override public Void call() throws Exception { http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceDynamicCachesSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/loadtests/GridCacheMultiNodeLoadTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/platform/plugin/PlatformTestPluginProvider.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/platform/plugin/PlatformTestPluginProvider.java index 0000000,c8de1a3..c34696f mode 000000,100644..100644 --- a/modules/core/src/test/java/org/apache/ignite/platform/plugin/PlatformTestPluginProvider.java +++ b/modules/core/src/test/java/org/apache/ignite/platform/plugin/PlatformTestPluginProvider.java @@@ -1,0 -1,97 +1,103 @@@ + /* + * 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.platform.plugin; + + import org.apache.ignite.IgniteCheckedException; + import org.apache.ignite.cluster.ClusterNode; + import org.apache.ignite.internal.IgniteEx; + import org.apache.ignite.internal.processors.platform.PlatformPluginExtension; ++import org.apache.ignite.platform.plugin.cache.PlatformTestCachePluginProvider; + import org.apache.ignite.plugin.*; + import org.jetbrains.annotations.Nullable; + + import java.io.Serializable; + import java.util.UUID; + + /** + * Plugin provider for platform tests. + */ + public class PlatformTestPluginProvider implements PluginProvider<PlatformTestPluginConfiguration> { + /** {@inheritDoc} */ + @Override public String name() { + return "TestPlatformPlugin"; + } + + /** {@inheritDoc} */ + @Override public String version() { + return "1.0"; + } + + /** {@inheritDoc} */ + @Override public String copyright() { + return "-"; + } + + /** {@inheritDoc} */ + @Override public void initExtensions(PluginContext ctx, ExtensionRegistry registry) { + registry.registerExtension(PlatformPluginExtension.class, + new PlatformTestPluginExtension((IgniteEx) ctx.grid())); + } + + /** {@inheritDoc} */ + @Override public void start(PluginContext ctx) throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void stop(boolean cancel) throws IgniteCheckedException { + // No-op. + } + + @Override public void onIgniteStart() throws IgniteCheckedException { + // No-op. + } + + @Override public void onIgniteStop(boolean cancel) { + // No-op. + } + + /** {@inheritDoc} */ + @Nullable @Override public Serializable provideDiscoveryData(UUID nodeId) { + return null; + } + + /** {@inheritDoc} */ + @Override public void receiveDiscoveryData(UUID nodeId, Serializable data) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void validateNewNode(ClusterNode node) throws PluginValidationException { + // No-op. + } + + /** {@inheritDoc} */ + @Nullable @Override public <T> T createComponent(PluginContext ctx, Class<T> cls) { + return null; + } + + /** {@inheritDoc} */ + @Override public <T extends IgnitePlugin> T plugin() { + return (T)new PlatformTestPlugin(); + } ++ ++ /** {@inheritDoc} */ ++ @Override public CachePluginProvider createCacheProvider(CachePluginContext ctx) { ++ return new PlatformTestCachePluginProvider(); ++ } + } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfiguration.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfiguration.java index 0000000,88a021a..9f1db88 mode 000000,100644..100644 --- a/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfiguration.java +++ b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginConfiguration.java @@@ -1,0 -1,60 +1,55 @@@ + /* + * 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.platform.plugin.cache; + + import org.apache.ignite.plugin.CachePluginConfiguration; + import org.apache.ignite.plugin.CachePluginContext; + import org.apache.ignite.plugin.CachePluginProvider; + + /** + * Test plugin configuration. + */ + public class PlatformTestCachePluginConfiguration implements CachePluginConfiguration { + /** */ + private String pluginProperty; + + /** + * Initializes a new instance of PlatformTestPluginConfiguration. + */ + PlatformTestCachePluginConfiguration() { + // No-op. + } + + /** + * Gets the plugin property. + * + * @return Plugin property. + */ + public String pluginProperty() { + return pluginProperty; + } + + /** + * Sets the plugin property. + * + * @param pluginProperty Value. + */ + void setPluginProperty(String pluginProperty) { + this.pluginProperty = pluginProperty; + } - - /** {@inheritDoc} */ - @Override public CachePluginProvider createProvider(CachePluginContext ctx) { - return new PlatformTestCachePluginProvider(); - } + } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginProvider.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginProvider.java index 0000000,1dcd81f..ba04411 mode 000000,100644..100644 --- a/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginProvider.java +++ b/modules/core/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformTestCachePluginProvider.java @@@ -1,0 -1,73 +1,72 @@@ + /* + * 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.platform.plugin.cache; + + import org.apache.ignite.IgniteCheckedException; + import org.apache.ignite.cluster.ClusterNode; + import org.apache.ignite.configuration.CacheConfiguration; + import org.apache.ignite.plugin.CachePluginConfiguration; + import org.apache.ignite.plugin.CachePluginProvider; + import org.jetbrains.annotations.Nullable; + + import javax.cache.Cache; + + /** + * Test cache plugin provider. + */ + public class PlatformTestCachePluginProvider implements CachePluginProvider { + /** {@inheritDoc} */ + @Override public void start() throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void stop(boolean cancel) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onIgniteStart() throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onIgniteStop(boolean cancel) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void validate() throws IgniteCheckedException { + // No-op. + } + - /** {@inheritDoc} */ - @Override public void validateRemote(CacheConfiguration locCfg, CachePluginConfiguration locPluginCcfg, - CacheConfiguration rmtCfg, ClusterNode rmtNode) throws IgniteCheckedException { ++ @Override public void validateRemote(CacheConfiguration locCfg, CacheConfiguration rmtCfg, ClusterNode rmtNode) ++ throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Nullable @Override public Object unwrapCacheEntry(Cache.Entry entry, Class cls) { + return null; + } + + /** {@inheritDoc} */ + @Nullable @Override public Object createComponent(Class cls) { + return null; + } + } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TestReconnectPluginProvider.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TestReconnectPluginProvider.java index 0000000,692774c..ccbf243 mode 000000,100644..100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TestReconnectPluginProvider.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TestReconnectPluginProvider.java @@@ -1,0 -1,111 +1,118 @@@ + /* + * 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.spi.discovery.tcp; + + import java.io.Serializable; + import java.util.UUID; + import org.apache.ignite.IgniteCheckedException; + import org.apache.ignite.cluster.ClusterNode; + import org.apache.ignite.internal.GridKernalContext; + import org.apache.ignite.internal.IgniteKernal; + import org.apache.ignite.internal.processors.security.GridSecurityProcessor; ++import org.apache.ignite.plugin.CachePluginContext; ++import org.apache.ignite.plugin.CachePluginProvider; + import org.apache.ignite.plugin.ExtensionRegistry; + import org.apache.ignite.plugin.IgnitePlugin; + import org.apache.ignite.plugin.PluginContext; + import org.apache.ignite.plugin.PluginProvider; + import org.apache.ignite.plugin.PluginValidationException; + import org.jetbrains.annotations.Nullable; + + /** + * Creates TestReconnectProcessor. + */ + public class TestReconnectPluginProvider implements PluginProvider { + /** */ + private GridKernalContext igniteCtx; + + /** */ + public static volatile boolean enabled; + + /** {@inheritDoc} */ + @Override public String name() { + return "TestReconnectPlugin"; + } + + /** {@inheritDoc} */ + @Override public String version() { + return "1.0"; + } + + /** {@inheritDoc} */ + @Override public String copyright() { + return ""; + } + + /** {@inheritDoc} */ + @Override public void initExtensions(PluginContext ctx, ExtensionRegistry registry) { + igniteCtx = ((IgniteKernal)ctx.grid()).context(); + } + + /** {@inheritDoc} */ + @Override public void start(PluginContext ctx) throws IgniteCheckedException { + // No-op + } + + /** {@inheritDoc} */ + @Override public void stop(boolean cancel) throws IgniteCheckedException { + // No-op + } + + /** {@inheritDoc} */ + @Override public void onIgniteStart() throws IgniteCheckedException { + // No-op + } + + /** {@inheritDoc} */ + @Override public void onIgniteStop(boolean cancel) { + // No-op + } + + /** {@inheritDoc} */ + @Nullable @Override public Serializable provideDiscoveryData(UUID nodeId) { + return null; + } + + /** {@inheritDoc} */ + @Override public void receiveDiscoveryData(UUID nodeId, Serializable data) { + // No-op + } + + /** {@inheritDoc} */ + @Override public void validateNewNode(ClusterNode node) throws PluginValidationException { + // No-op + } + + /** {@inheritDoc} */ + @Nullable @Override public Object createComponent(PluginContext ctx, Class cls) { + if (enabled && GridSecurityProcessor.class.equals(cls)) + return new TestReconnectProcessor(igniteCtx); + + return null; + } + + /** {@inheritDoc} */ + @Override public IgnitePlugin plugin() { + return new IgnitePlugin() {}; + } ++ ++ /** {@inheritDoc} */ ++ @Override public CachePluginProvider createCacheProvider(CachePluginContext ctx) { ++ return null; ++ } + } http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteCacheConfigVariationsAbstractTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java index f0b6621,7b41b6c..7d61763 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java @@@ -600,10 -507,10 +600,10 @@@ public abstract class GridCommonAbstrac GridDhtLocalPartition loc = top.localPartition(p, readyVer, false); - if (affNodes.size() != owners.size() || !affNodes.containsAll(owners) || + if (affNodesCnt != ownerNodesCnt || !affNodes.containsAll(owners) || (waitEvicts && loc != null && loc.state() != GridDhtPartitionState.OWNING)) { LT.warn(log(), "Waiting for topology map update [" + - "grid=" + g.name() + + "igniteInstanceName=" + g.name() + ", cache=" + cfg.getName() + ", cacheId=" + dht.context().cacheId() + ", topVer=" + top.topologyVersion() + @@@ -637,11 -544,8 +637,11 @@@ if (System.currentTimeMillis() - start > timeout) { U.dumpThreads(log); + if (printPartState) + printPartitionState(c); + throw new IgniteException("Timeout of waiting for topology map update [" + - "grid=" + g.name() + + "igniteInstanceName=" + g.name() + ", cache=" + cfg.getName() + ", cacheId=" + dht.context().cacheId() + ", topVer=" + top.topologyVersion() + http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java index 0870e2a,3b56b66..7d73737 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java @@@ -96,16 -96,37 +96,38 @@@ public class IgniteNodeRunner * @throws IOException If failed. * @see #readCfgFromFileAndDeleteFile(String) */ - public static String storeToFile(IgniteConfiguration cfg) throws IOException, IgniteCheckedException { - public static String storeToFile(IgniteConfiguration cfg, boolean resetDiscovery) throws IOException { ++ public static String storeToFile(IgniteConfiguration cfg, boolean resetDiscovery) throws IOException, IgniteCheckedException { String fileName = IGNITE_CONFIGURATION_FILE + cfg.getNodeId(); + storeToFile(cfg, fileName, true, resetDiscovery); + + return fileName; + } + + /** + * Stores {@link IgniteConfiguration} to file as xml. + * + * @param cfg Ignite Configuration. + * @param fileName A name of file where the configuration was stored. + * @param resetMarshaller Reset marshaller configuration to default. + * @param resetDiscovery Reset discovery configuration to default. + * @throws IOException If failed. + * @see #readCfgFromFileAndDeleteFile(String) + */ + public static void storeToFile(IgniteConfiguration cfg, String fileName, + boolean resetMarshaller, - boolean resetDiscovery) throws IOException { ++ boolean resetDiscovery) throws IOException, IgniteCheckedException { try(OutputStream out = new BufferedOutputStream(new FileOutputStream(fileName))) { IgniteConfiguration cfg0 = new IgniteConfiguration(cfg); + if (resetMarshaller) + cfg0.setMarshaller(null); + + if (resetDiscovery) + cfg0.setDiscoverySpi(null); + + cfg0.setWorkDirectory(U.defaultWorkDirectory()); cfg0.setMBeanServer(null); - cfg0.setMarshaller(null); - cfg0.setDiscoverySpi(null); cfg0.setGridLogger(null); new XStream().toXML(cfg0, out); http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java index 5dc30a9,4180151..9d58481 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java @@@ -304,18 -315,9 +320,18 @@@ public class IgniteProcessProxy impleme return id; } + /** + * @throws Exception If failed to kill. + */ + public void kill() throws Exception { + getProcess().kill(); + + gridProxies.remove(cfg.getGridName(), this); + } + /** {@inheritDoc} */ @Override public String name() { - return cfg.getGridName(); + return cfg.getIgniteInstanceName(); } /** {@inheritDoc} */ @@@ -627,33 -629,30 +643,35 @@@ } /** {@inheritDoc} */ + @Override public void resetLostPartitions(Collection<String> cacheNames) { + throw new UnsupportedOperationException("Operation isn't supported yet."); + } + + /** {@inheritDoc} */ @Override public void close() throws IgniteException { - final CountDownLatch rmtNodeStoppedLatch = new CountDownLatch(1); + if (locJvmGrid != null) { + final CountDownLatch rmtNodeStoppedLatch = new CountDownLatch(1); - locJvmGrid.events().localListen(new IgnitePredicateX<Event>() { - @Override public boolean applyx(Event e) { - if (((DiscoveryEvent)e).eventNode().id().equals(id)) { - rmtNodeStoppedLatch.countDown(); + locJvmGrid.events().localListen(new IgnitePredicateX<Event>() { + @Override public boolean applyx(Event e) { + if (((DiscoveryEvent)e).eventNode().id().equals(id)) { + rmtNodeStoppedLatch.countDown(); - return false; - } + return false; + } - return true; - } - }, EventType.EVT_NODE_LEFT, EventType.EVT_NODE_FAILED); + return true; + } + }, EventType.EVT_NODE_LEFT, EventType.EVT_NODE_FAILED); - compute().run(new StopGridTask(localJvmGrid().name(), true)); + compute().run(new StopGridTask(localJvmGrid().name(), true)); - try { - assert U.await(rmtNodeStoppedLatch, 15, TimeUnit.SECONDS) : "NodeId=" + id; - } - catch (IgniteInterruptedCheckedException e) { - throw new IgniteException(e); + try { + assert U.await(rmtNodeStoppedLatch, 15, TimeUnit.SECONDS) : "NodeId=" + id; + } + catch (IgniteInterruptedCheckedException e) { + throw new IgniteException(e); + } } try { http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java ---------------------------------------------------------------------- diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java index d721c69,6fc6846..934047d --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite5.java @@@ -18,14 -18,6 +18,15 @@@ package org.apache.ignite.testsuites; import junit.framework.TestSuite; +import org.apache.ignite.GridCacheAffinityBackupsSelfTest; +import org.apache.ignite.IgniteCacheAffinitySelfTest; +import org.apache.ignite.cache.affinity.AffinityClientNodeSelfTest; +import org.apache.ignite.cache.affinity.AffinityHistoryCleanupTest; +import org.apache.ignite.cache.affinity.fair.FairAffinityDynamicCacheSelfTest; +import org.apache.ignite.cache.affinity.fair.FairAffinityFunctionNodesSelfTest; +import org.apache.ignite.cache.affinity.fair.FairAffinityFunctionSelfTest; ++import org.apache.ignite.cache.affinity.fair.FairAffinityNodesRestart; +import org.apache.ignite.cache.affinity.local.LocalAffinityFunctionTest; import org.apache.ignite.internal.processors.cache.CacheNearReaderUpdateTest; import org.apache.ignite.internal.processors.cache.CacheRebalancingSelfTest; import org.apache.ignite.internal.processors.cache.CacheSerializableTransactionsTest; @@@ -39,9 -31,8 +40,10 @@@ import org.apache.ignite.internal.proce import org.apache.ignite.internal.processors.cache.distributed.CacheLateAffinityAssignmentFairAffinityTest; import org.apache.ignite.internal.processors.cache.distributed.CacheLateAffinityAssignmentNodeJoinValidationTest; import org.apache.ignite.internal.processors.cache.distributed.CacheLateAffinityAssignmentTest; +import org.apache.ignite.internal.processors.cache.distributed.IgniteActiveOnStartNodeJoinValidationSelfTest; +import org.apache.ignite.internal.processors.cache.distributed.IgniteCachePartitionLossPolicySelfTest; import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheTxIteratorSelfTest; + import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.IgniteCacheAtomicProtocolTest; import org.apache.ignite.internal.processors.cache.distributed.replicated.IgniteCacheSyncRebalanceModeSelfTest; import org.apache.ignite.internal.processors.cache.store.IgniteCacheWriteBehindNoUpdateSelfTest; @@@ -78,16 -67,8 +80,19 @@@ public class IgniteCacheTestSuite5 exte suite.addTestSuite(CacheRebalancingSelfTest.class); + // Affinity tests. + suite.addTestSuite(FairAffinityFunctionNodesSelfTest.class); + suite.addTestSuite(FairAffinityFunctionSelfTest.class); + suite.addTestSuite(FairAffinityDynamicCacheSelfTest.class); ++ suite.addTestSuite(FairAffinityNodesRestart.class); + suite.addTestSuite(GridCacheAffinityBackupsSelfTest.class); + suite.addTestSuite(IgniteCacheAffinitySelfTest.class); + suite.addTestSuite(AffinityClientNodeSelfTest.class); + suite.addTestSuite(LocalAffinityFunctionTest.class); + suite.addTestSuite(AffinityHistoryCleanupTest.class); + + suite.addTestSuite(IgniteCacheAtomicProtocolTest.class); + suite.addTestSuite(PartitionsExchangeOnDiscoveryHistoryOverflowTest.class); return suite; http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/81ae2d83/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java ----------------------------------------------------------------------
