ignite-1088 Implemented store for multi jvm tests (fixed NPE) (cherry picked from commit d31a476)
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ade57eaf Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ade57eaf Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ade57eaf Branch: refs/heads/ignite-1232-1 Commit: ade57eaf5b77f779642be424d8cdf858a327ce2d Parents: 2f78346 Author: sboikov <[email protected]> Authored: Tue Jul 5 07:43:51 2016 +0300 Committer: sboikov <[email protected]> Committed: Fri Jul 15 16:21:21 2016 +0300 ---------------------------------------------------------------------- .../cache/GridCacheAbstractSelfTest.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/ade57eaf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java index dcf5d98..d58e560 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java @@ -220,16 +220,18 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest { protected CacheConfiguration cacheConfiguration(String gridName) throws Exception { CacheConfiguration cfg = defaultCacheConfiguration(); - Factory<? extends CacheStore<Object, Object>> storeFactory = storeStgy.getStoreFactory(); + if (storeStgy != null) { + Factory<? extends CacheStore<Object, Object>> storeFactory = storeStgy.getStoreFactory(); - CacheStore<?, ?> store = storeFactory.create(); + CacheStore<?, ?> store = storeFactory.create(); - if (store != null) { - cfg.setCacheStoreFactory(storeFactory); - cfg.setReadThrough(true); - cfg.setWriteThrough(true); - cfg.setLoadPreviousValue(true); - storeStgy.updateCacheConfiguration(cfg); + if (store != null) { + cfg.setCacheStoreFactory(storeFactory); + cfg.setReadThrough(true); + cfg.setWriteThrough(true); + cfg.setLoadPreviousValue(true); + storeStgy.updateCacheConfiguration(cfg); + } } cfg.setSwapEnabled(swapEnabled());
