diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java index 8784dd9e65c1b..74d2da18abcc7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheLifecycleAwareSelfTest.java @@ -17,7 +17,6 @@ package org.apache.ignite.internal.processors.cache; -import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -32,14 +31,11 @@ import org.apache.ignite.cache.affinity.AffinityFunction; import org.apache.ignite.cache.affinity.AffinityFunctionContext; import org.apache.ignite.cache.affinity.AffinityKeyMapper; -import org.apache.ignite.cache.eviction.EvictableEntry; import org.apache.ignite.cache.eviction.EvictionFilter; -import org.apache.ignite.cache.eviction.EvictionPolicy; import org.apache.ignite.cache.store.CacheStore; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.configuration.NearCacheConfiguration; import org.apache.ignite.configuration.TopologyValidator; import org.apache.ignite.lang.IgniteBiInClosure; import org.apache.ignite.lang.IgniteBiTuple; @@ -60,9 +56,6 @@ public class GridCacheLifecycleAwareSelfTest extends GridAbstractLifecycleAwareS /** */ private static final String CACHE_NAME = "cache"; - /** */ - private boolean near; - /** */ private boolean writeBehind; @@ -175,21 +168,6 @@ public List nodes(int part, Collection nodes) { } } - /** - */ - public static class TestEvictionPolicy extends TestLifecycleAware implements EvictionPolicy, Serializable { - /** - */ - public TestEvictionPolicy() { - super(CACHE_NAME); - } - - /** {@inheritDoc} */ - @Override public void onEntryAccessed(boolean rmv, EvictableEntry entry) { - // No-op. - } - } - /** */ private static class TestEvictionFilter extends TestLifecycleAware implements EvictionFilter { @@ -318,31 +296,10 @@ public TestTopologyValidator() { lifecycleAwares.add(affinity); - TestEvictionPolicy evictionPlc = new TestEvictionPolicy(); - - ccfg.setEvictionPolicy(evictionPlc); - ccfg.setOnheapCacheEnabled(true); - - lifecycleAwares.add(evictionPlc); - - if (near) { - TestEvictionPolicy nearEvictionPlc = new TestEvictionPolicy(); - - NearCacheConfiguration nearCfg = new NearCacheConfiguration(); - - nearCfg.setNearEvictionPolicy(nearEvictionPlc); - - ccfg.setNearConfiguration(nearCfg); - - lifecycleAwares.add(nearEvictionPlc); - } - TestEvictionFilter evictionFilter = new TestEvictionFilter(); ccfg.setEvictionFilter(evictionFilter); - lifecycleAwares.add(evictionFilter); - TestAffinityKeyMapper mapper = new TestAffinityKeyMapper(); ccfg.setAffinityMapper(mapper); @@ -351,8 +308,6 @@ public TestTopologyValidator() { TestInterceptor interceptor = new TestInterceptor(); - lifecycleAwares.add(interceptor); - ccfg.setInterceptor(interceptor); TestTopologyValidator topValidator = new TestTopologyValidator(); @@ -370,28 +325,22 @@ public TestTopologyValidator() { @SuppressWarnings("ErrorNotRethrown") @Test @Override public void testLifecycleAware() throws Exception { - for (boolean nearEnabled : new boolean[] {true, false}) { - near = nearEnabled; - - writeBehind = false; - - try { - super.testLifecycleAware(); - } - catch (AssertionError e) { - throw new AssertionError("Failed for [near=" + near + ", writeBehind=" + writeBehind + ']', - e); - } - - writeBehind = true; - - try { - super.testLifecycleAware(); - } - catch (AssertionError e) { - throw new AssertionError("Failed for [near=" + near + ", writeBehind=" + writeBehind + ']', - e); - } + writeBehind = false; + + try { + super.testLifecycleAware(); + } + catch (AssertionError e) { + throw new AssertionError("Failed for [writeBehind=" + writeBehind + ']', e); + } + + writeBehind = true; + + try { + super.testLifecycleAware(); + } + catch (AssertionError e) { + throw new AssertionError("Failed for [writeBehind=" + writeBehind + ']', e); } } } diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridAbstractLifecycleAwareSelfTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridAbstractLifecycleAwareSelfTest.java index 12c63b5b44f05..f3725dd96467e 100644 --- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridAbstractLifecycleAwareSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridAbstractLifecycleAwareSelfTest.java @@ -17,6 +17,7 @@ package org.apache.ignite.testframework.junits.common; +import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.atomic.AtomicInteger; @@ -35,7 +36,7 @@ public abstract class GridAbstractLifecycleAwareSelfTest extends GridCommonAbstr /** */ @SuppressWarnings("PublicInnerClass") - public static class TestLifecycleAware implements LifecycleAware { + public static class TestLifecycleAware implements LifecycleAware, Serializable { /** */ private AtomicInteger startCnt = new AtomicInteger();