Reduced memory usage of CacheDataRegionConfigurationTest
@@ -734,18 +734,29 @@ public class CacheDataRegionConfigurationTest extends GridCommonAbstractTest {
* Verify that the eviction strategy can support large dataregion.
*/
@Test
- public void testLargeRegionsWithEviction() throws Exception {
- DataRegionConfiguration cfg1 = new DataRegionConfiguration()
- .setName("region-1")
- .setMaxSize(4 * 1024 * U.GB)
- .setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU);
+ public void testLargeRegionsWithRandomLRU() throws Exception {
+ doTestLargeRegionsWithEviction(DataPageEvictionMode.RANDOM_LRU);
+ }
- DataRegionConfiguration cfg2 = new DataRegionConfiguration()
- .setName("region-2")
+ /**
+ * Verify that the eviction strategy can support large dataregion.
+ */
+ @Test
+ public void testLargeRegionsWithRandom2LRU() throws Exception {
+ doTestLargeRegionsWithEviction(DataPageEvictionMode.RANDOM_2_LRU);
+ }
+
+ /**
+ * @param evictMode Page eviction mode.
+ * @throws Exception If failed.
+ */
+ private void doTestLargeRegionsWithEviction(DataPageEvictionMode evictMode) throws Exception {
+ DataRegionConfiguration cfg = new DataRegionConfiguration()
+ .setName("region-1")
.setMaxSize(4 * 1024 * U.GB)
- .setPageEvictionMode(DataPageEvictionMode.RANDOM_2_LRU);
+ .setPageEvictionMode(evictMode);
- memCfg = new DataStorageConfiguration().setDataRegionConfigurations(cfg1, cfg2);
+ memCfg = new DataStorageConfiguration().setDataRegionConfigurations(cfg);
startGrid();
}
