Repository: ignite Updated Branches: refs/heads/ignite-5075-cacheStart 3e6113bb0 -> 193b80580
ignite-5075 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/193b8058 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/193b8058 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/193b8058 Branch: refs/heads/ignite-5075-cacheStart Commit: 193b80580f2a5bdd84f0e73225afc6c59a5a12bd Parents: 3e6113b Author: sboikov <[email protected]> Authored: Tue May 2 16:47:29 2017 +0300 Committer: sboikov <[email protected]> Committed: Tue May 2 16:59:47 2017 +0300 ---------------------------------------------------------------------- ...ityFunctionBackupFilterAbstractSelfTest.java | 13 +++++++----- ...ePartitionedBasicStoreMultiNodeSelfTest.java | 22 +++++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/193b8058/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java index 2110c28..99e80ca 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/affinity/AffinityFunctionBackupFilterAbstractSelfTest.java @@ -78,13 +78,13 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC Map<String, Integer> backupAssignedAttribute = getAttributeStatistic(assigned); - String nodeAttributeValue = node.attribute(SPLIT_ATTRIBUTE_NAME); + String nodeAttributeVal = node.attribute(SPLIT_ATTRIBUTE_NAME); - if (FIRST_NODE_GROUP.equals(nodeAttributeValue) + if (FIRST_NODE_GROUP.equals(nodeAttributeVal) && backupAssignedAttribute.get(FIRST_NODE_GROUP) < 2) return true; - return backupAssignedAttribute.get(nodeAttributeValue).equals(0); + return backupAssignedAttribute.get(nodeAttributeVal).equals(0); } }; @@ -107,10 +107,11 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC String val = assignedNode.attribute(SPLIT_ATTRIBUTE_NAME); - Integer count = backupAssignedAttribute.get(val); + Integer cnt = backupAssignedAttribute.get(val); - backupAssignedAttribute.put(val, count + 1); + backupAssignedAttribute.put(val, cnt + 1); } + return backupAssignedAttribute; } @@ -157,6 +158,7 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC */ public void testPartitionDistribution() throws Exception { backups = 1; + try { for (int i = 0; i < 3; i++) { splitAttrVal = "A"; @@ -205,6 +207,7 @@ public abstract class AffinityFunctionBackupFilterAbstractSelfTest extends GridC */ public void testPartitionDistributionWithAffinityBackupFilter() throws Exception { backups = 3; + try { for (int i = 0; i < 2; i++) { splitAttrVal = FIRST_NODE_GROUP; http://git-wip-us.apache.org/repos/asf/ignite/blob/193b8058/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java index 372da32..a7128e0 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java @@ -22,7 +22,9 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.cache.configuration.Factory; import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.store.CacheStore; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.configuration.NearCacheConfiguration; @@ -102,11 +104,7 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA cc.setAtomicityMode(TRANSACTIONAL); cc.setBackups(1); - GridCacheTestStore store = new GridCacheTestStore(); - - stores.add(store); - - cc.setCacheStoreFactory(singletonFactory(store)); + cc.setCacheStoreFactory(new StoreFactory()); cc.setReadThrough(true); cc.setWriteThrough(true); cc.setLoadPreviousValue(true); @@ -269,4 +267,18 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA assertEquals(expPutAll, putAll); assertEquals(expTxs, txs); } + + /** + * + */ + static class StoreFactory implements Factory<CacheStore> { + /** {@inheritDoc} */ + @Override public CacheStore create() { + GridCacheTestStore store = new GridCacheTestStore(); + + stores.add(store); + + return store; + } + } } \ No newline at end of file
