ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [03/50] incubator-ignite git commit: #ignite-180: Fix review comments.
Date Thu, 09 Apr 2015 14:28:02 GMT
#ignite-180: Fix review comments.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d3b10ab4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d3b10ab4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d3b10ab4

Branch: refs/heads/ignite-696
Commit: d3b10ab49ad22026e8aae46740f4495a58f5507d
Parents: 627cf05
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Apr 7 13:32:51 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Apr 7 13:32:51 2015 +0300

----------------------------------------------------------------------
 .../datastructures/IgniteQueueExample.java      |  27 +---
 .../datastructures/IgniteSetExample.java        |  28 +---
 .../configuration/CollectionConfiguration.java  |  24 ++--
 .../datastructures/DataStructuresProcessor.java |  62 ++++----
 ...actQueueFailoverDataConsistencySelfTest.java |   4 +-
 .../GridCacheQueueCleanupSelfTest.java          |   5 +-
 ...dCacheQueueMultiNodeConsistencySelfTest.java |   5 +-
 .../GridCacheSetAbstractSelfTest.java           |   4 +-
 .../IgniteCollectionAbstractTest.java           | 140 +------------------
 ...dCachePartitionedQueueEntryMoveSelfTest.java |   4 +-
 .../IgnitePartitionedSetNoBackupsSelfTest.java  |   5 +-
 11 files changed, 82 insertions(+), 226 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteQueueExample.java
b/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteQueueExample.java
index 96cca7c..af2cf09 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteQueueExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteQueueExample.java
@@ -56,24 +56,16 @@ public class IgniteQueueExample {
             System.out.println();
             System.out.println(">>> Ignite queue example started.");
 
-            CacheConfiguration<Object, Object> cfg = new CacheConfiguration<>();
+            // Make queue name.
+            String queueName = UUID.randomUUID().toString();
 
-            cfg.setCacheMode(CacheMode.PARTITIONED);
-            cfg.setName(CACHE_NAME);
-            cfg.setAtomicWriteOrderMode(CacheAtomicWriteOrderMode.PRIMARY);
+            queue = initializeQueue(ignite, queueName);
 
-            try (IgniteCache<Object, Object> cache = ignite.createCache(cfg)) {
-                // Make queue name.
-                String queueName = UUID.randomUUID().toString();
+            readFromQueue(ignite);
 
-                queue = initializeQueue(ignite, queueName);
+            writeToQueue(ignite);
 
-                readFromQueue(ignite);
-
-                writeToQueue(ignite);
-
-                clearAndRemoveQueue();
-            }
+            clearAndRemoveQueue();
         }
 
         System.out.println("Cache queue example finished.");
@@ -90,12 +82,7 @@ public class IgniteQueueExample {
     private static IgniteQueue<String> initializeQueue(Ignite ignite, String queueName)
throws IgniteException {
         CollectionConfiguration colCfg = new CollectionConfiguration();
 
-        CacheConfiguration cfg = ignite.cache(CACHE_NAME).getConfiguration(CacheConfiguration.class);
-        colCfg.atomicityMode(cfg.getAtomicityMode());
-        colCfg.memoryMode(cfg.getMemoryMode());
-        colCfg.cacheMode(cfg.getCacheMode());
-        colCfg.backups(cfg.getBackups());
-        colCfg.offHeapMaxMem(cfg.getOffHeapMaxMemory());
+        colCfg.setCacheMode(CacheMode.PARTITIONED);
 
         // Initialize new FIFO queue.
         IgniteQueue<String> queue = ignite.queue(queueName, 0, colCfg);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteSetExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteSetExample.java
b/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteSetExample.java
index 2ce70fa..02f043c 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteSetExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datastructures/IgniteSetExample.java
@@ -52,24 +52,14 @@ public class IgniteSetExample {
             System.out.println();
             System.out.println(">>> Ignite set example started.");
 
-            CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+            // Make set name.
+            String setName = UUID.randomUUID().toString();
 
-            cfg.setCacheMode(CacheMode.PARTITIONED);
-            cfg.setName(CACHE_NAME);
-            cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+            set = initializeSet(ignite, setName);
 
-            NearCacheConfiguration<Integer, String> nearCacheCfg = new NearCacheConfiguration<>();
+            writeToSet(ignite);
 
-            try (IgniteCache<Integer, String> cache = ignite.createCache(cfg, nearCacheCfg))
{
-                // Make set name.
-                String setName = UUID.randomUUID().toString();
-
-                set = initializeSet(ignite, setName);
-
-                writeToSet(ignite);
-
-                clearAndRemoveSet();
-            }
+            clearAndRemoveSet();
         }
 
         System.out.println("Ignite set example finished.");
@@ -86,12 +76,8 @@ public class IgniteSetExample {
     private static IgniteSet<String> initializeSet(Ignite ignite, String setName) throws
IgniteException {
         CollectionConfiguration setCfg = new CollectionConfiguration();
 
-        CacheConfiguration cfg = ignite.cache(CACHE_NAME).getConfiguration(CacheConfiguration.class);
-        setCfg.atomicityMode(cfg.getAtomicityMode());
-        setCfg.memoryMode(cfg.getMemoryMode());
-        setCfg.cacheMode(cfg.getCacheMode());
-        setCfg.backups(cfg.getBackups());
-        setCfg.offHeapMaxMem(cfg.getOffHeapMaxMemory());
+        setCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+        setCfg.setCacheMode(CacheMode.PARTITIONED);
 
         // Initialize new set.
         IgniteSet<String> set = ignite.set(setName, setCfg);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
index 81711ee..85daadb 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CollectionConfiguration.java
@@ -70,71 +70,71 @@ public class CollectionConfiguration implements Serializable {
     /**
      * @return Cache atomicity mode.
      */
-    public CacheAtomicityMode atomicityMode() {
+    public CacheAtomicityMode getAtomicityMode() {
         return atomicityMode;
     }
 
     /**
      * @param atomicityMode Cache atomicity mode.
      */
-    public void atomicityMode(CacheAtomicityMode atomicityMode) {
+    public void setAtomicityMode(CacheAtomicityMode atomicityMode) {
         this.atomicityMode = atomicityMode;
     }
 
     /**
      * @return Cache mode.
      */
-    public CacheMode cacheMode() {
+    public CacheMode getCacheMode() {
         return cacheMode;
     }
 
     /**
      * @param cacheMode Cache mode.
      */
-    public void cacheMode(CacheMode cacheMode) {
+    public void setCacheMode(CacheMode cacheMode) {
         this.cacheMode = cacheMode;
     }
 
     /**
      * @return Cache memory mode.
      */
-    public CacheMemoryMode memoryMode() {
+    public CacheMemoryMode getMemoryMode() {
         return memoryMode;
     }
 
     /**
      * @param memoryMode Memory mode.
      */
-    public void memoryMode(CacheMemoryMode memoryMode) {
+    public void setMemoryMode(CacheMemoryMode memoryMode) {
         this.memoryMode = memoryMode;
     }
 
     /**
      * @return Number of backups.
      */
-    public int backups() {
+    public int getBackups() {
         return backups;
     }
 
     /**
      * @param backups Cache number of backups.
      */
-    public void backups(int backups) {
+    public void setBackups(int backups) {
         this.backups = backups;
     }
 
     /**
      * @return Off-heap memory size.
      */
-    public long offHeapMaxMem() {
+    public long getOffHeapMaxMemory() {
         return offHeapMaxMem;
     }
 
     /**
-     * @param offHeapMaxMem Off-heap memory size.
+     * @param offHeapMaxMemory Off-heap memory size.
      */
-    public void offHeapMaxMem(long offHeapMaxMem) {
-        this.offHeapMaxMem = offHeapMaxMem;
+    public void setOffHeapMaxMemory(long offHeapMaxMemory) {
+        this.offHeapMaxMem = offHeapMaxMemory;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
index 96dfbfa..5150bcd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
@@ -721,10 +721,10 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
         CacheConfiguration ccfg = new CacheConfiguration();
 
         ccfg.setName(name);
-        ccfg.setBackups(cfg.backups());
-        ccfg.setCacheMode(cfg.cacheMode());
-        ccfg.setMemoryMode(cfg.memoryMode());
-        ccfg.setOffHeapMaxMemory(cfg.offHeapMaxMem());
+        ccfg.setBackups(cfg.getBackups());
+        ccfg.setCacheMode(cfg.getCacheMode());
+        ccfg.setMemoryMode(cfg.getMemoryMode());
+        ccfg.setOffHeapMaxMemory(cfg.getOffHeapMaxMemory());
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
         ccfg.setAtomicWriteOrderMode(PRIMARY);
 
@@ -736,15 +736,12 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
      * @return Cache name.
      */
     private String compatibleConfiguration(CollectionConfiguration cfg) throws IgniteCheckedException
{
-        T2<String, IgniteCheckedException> res =
-            utilityDataCache.invoke(DATA_STRUCTURES_CACHE_KEY, new AddDataCacheProcessor(cfg)).get();
+        List<CacheCollectionInfo> caches = utilityDataCache.localPeek(DATA_STRUCTURES_CACHE_KEY,
null, null);
 
-        IgniteCheckedException err = res.get2();
+        String cacheName = findCompatibleConfiguration(cfg, caches);
 
-        if (err != null)
-            throw err;
-
-        String cacheName = res.get1();
+        if (cacheName == null)
+            cacheName = utilityDataCache.invoke(DATA_STRUCTURES_CACHE_KEY, new AddDataCacheProcessor(cfg)).get();
 
         assert cacheName != null;
 
@@ -1240,6 +1237,24 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
     }
 
     /**
+     * @param cfg Collection configuration.
+     * @param infos Data structure caches.
+     * @return Name of the cache with compatible configuration or null.
+     */
+    private static String findCompatibleConfiguration(CollectionConfiguration cfg, List<CacheCollectionInfo>
infos) {
+        for (CacheCollectionInfo col : infos) {
+            if (col.cfg.getAtomicityMode() == cfg.getAtomicityMode() &&
+                col.cfg.getMemoryMode() == cfg.getMemoryMode() &&
+                col.cfg.getCacheMode() == cfg.getCacheMode() &&
+                col.cfg.getBackups() == cfg.getBackups() &&
+                col.cfg.getOffHeapMaxMemory() == cfg.getOffHeapMaxMemory())
+                return col.cacheName;
+        }
+
+        return null;
+    }
+
+    /**
      *
      */
     static enum DataStructureType {
@@ -1692,8 +1707,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
      *
      */
     static class AddDataCacheProcessor implements
-        EntryProcessor<CacheDataStructuresCacheKey, List<CacheCollectionInfo>,
-            T2<String, IgniteCheckedException>>, Externalizable {
+        EntryProcessor<CacheDataStructuresCacheKey, List<CacheCollectionInfo>, String>,
Externalizable {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -1715,7 +1729,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
         }
 
         /** {@inheritDoc} */
-        @Override public T2<String, IgniteCheckedException> process(
+        @Override public String process(
             MutableEntry<CacheDataStructuresCacheKey, List<CacheCollectionInfo>>
entry,
             Object... args)
         {
@@ -1724,21 +1738,19 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
             if (list == null) {
                 list = new ArrayList<>();
 
-                list.add(new CacheCollectionInfo("datastructeres_0", cfg));
+                String newName = "datastructeres_" + 0;
+
+                list.add(new CacheCollectionInfo(newName, cfg));
 
                 entry.setValue(list);
 
-                return new T2<>("datastructeres_0", null);
+                return newName;
             }
 
-            for (CacheCollectionInfo col : list) {
-                if (col.cfg.atomicityMode() == cfg.atomicityMode() &&
-                    col.cfg.memoryMode() == cfg.memoryMode() &&
-                    col.cfg.cacheMode() == cfg.cacheMode() &&
-                    col.cfg.backups() == cfg.backups() &&
-                    col.cfg.offHeapMaxMem() == cfg.offHeapMaxMem())
-                    return new T2<>(col.cacheName, null);
-            }
+            String oldName = findCompatibleConfiguration(cfg, list);
+
+            if (oldName != null)
+                return oldName;
 
             String newName = "datastructeres_" + list.size();
 
@@ -1746,7 +1758,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter
{
 
             newList.add(new CacheCollectionInfo(newName, cfg));
 
-            return new T2<>(newName, null);
+            return newName;
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
index bf77732..d495295 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheAbstractQueueFailoverDataConsistencySelfTest.java
@@ -86,8 +86,8 @@ public abstract class GridCacheAbstractQueueFailoverDataConsistencySelfTest
exte
     }
 
     /** {@inheritDoc} */
-    @Override protected TestCollectionConfiguration collectionConfiguration() {
-        TestCollectionConfiguration colCfg = super.collectionConfiguration();
+    @Override protected CollectionConfiguration collectionConfiguration() {
+        CollectionConfiguration colCfg = super.collectionConfiguration();
 
         colCfg.setBackups(1);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
index 8d221ab..e0b6094 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueCleanupSelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.datastructures;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.datastructures.*;
@@ -59,8 +60,8 @@ public class GridCacheQueueCleanupSelfTest extends IgniteCollectionAbstractTest
     }
 
     /** {@inheritDoc} */
-    @Override protected TestCollectionConfiguration collectionConfiguration() {
-        TestCollectionConfiguration colCfg = super.collectionConfiguration();
+    @Override protected CollectionConfiguration collectionConfiguration() {
+        CollectionConfiguration colCfg = super.collectionConfiguration();
 
         colCfg.setBackups(0);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
index 80eca72..36d7758 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache.datastructures;
 import org.apache.commons.collections.*;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.resources.*;
 
@@ -72,8 +73,8 @@ public class GridCacheQueueMultiNodeConsistencySelfTest extends IgniteCollection
     }
 
     /** {@inheritDoc} */
-    @Override protected TestCollectionConfiguration collectionConfiguration() {
-        TestCollectionConfiguration colCfg = super.collectionConfiguration();
+    @Override protected CollectionConfiguration collectionConfiguration() {
+        CollectionConfiguration colCfg = super.collectionConfiguration();
 
         colCfg.setBackups(backups);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
index 45f8acc..8da3234 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheSetAbstractSelfTest.java
@@ -58,8 +58,8 @@ public abstract class GridCacheSetAbstractSelfTest extends IgniteCollectionAbstr
     }
 
     /** {@inheritDoc} */
-    @Override protected TestCollectionConfiguration collectionConfiguration() {
-        TestCollectionConfiguration colCfg = super.collectionConfiguration();
+    @Override protected CollectionConfiguration collectionConfiguration() {
+        CollectionConfiguration colCfg = super.collectionConfiguration();
 
         if (colCfg.getCacheMode() == PARTITIONED)
             colCfg.setBackups(1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java
index 7fd5755..92a94dd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCollectionAbstractTest.java
@@ -38,9 +38,6 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes
     /** */
     protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
-    /** */
-    private static final String COL_CACHE_NAME = "TEST_COLLECTION_CACHE";
-
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -51,24 +48,6 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes
 
         cfg.setDiscoverySpi(spi);
 
-        // TODO IGNITE-180: remove cache configuration when dynamic cache start is implemented.
-        TestCollectionConfiguration colCfg = collectionConfiguration();
-
-        assertNotNull(colCfg);
-
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        ccfg.setName(COL_CACHE_NAME);
-        ccfg.setCacheMode(colCfg.getCacheMode());
-        ccfg.setAtomicityMode(colCfg.getAtomicityMode());
-        ccfg.setAtomicWriteOrderMode(PRIMARY);
-        ccfg.setBackups(colCfg.getBackups());
-        ccfg.setMemoryMode(colCfg.getMemoryMode());
-        ccfg.setWriteSynchronizationMode(FULL_SYNC);
-        ccfg.setRebalanceMode(SYNC);
-
-        cfg.setCacheConfiguration(ccfg);
-
         return cfg;
     }
 
@@ -77,14 +56,8 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes
      * @return Collection configuration.
      */
     protected final CollectionConfiguration config(boolean collocated) {
-        CollectionConfiguration cfg = new CollectionConfiguration();
-
-        TestCollectionConfiguration colCfg = collectionConfiguration();
-        cfg.atomicityMode(colCfg.getAtomicityMode());
-        cfg.memoryMode(colCfg.getMemoryMode());
-        cfg.backups(colCfg.getBackups());
-        cfg.offHeapMaxMem(colCfg.getOffHeapMaxMemory());
-        cfg.cacheMode(colCfg.getCacheMode());
+        CollectionConfiguration cfg = collectionConfiguration();
+
         cfg.setCollocated(collocated);
 
         return cfg;
@@ -93,8 +66,8 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes
     /**
      * @return Collection configuration.
      */
-    protected TestCollectionConfiguration collectionConfiguration() {
-        TestCollectionConfiguration colCfg = new TestCollectionConfiguration();
+    protected CollectionConfiguration collectionConfiguration() {
+        CollectionConfiguration colCfg = new CollectionConfiguration();
 
         colCfg.setCacheMode(collectionCacheMode());
         colCfg.setAtomicityMode(collectionCacheAtomicityMode());
@@ -129,109 +102,4 @@ public abstract class IgniteCollectionAbstractTest extends GridCommonAbstractTes
     @Override protected void afterTestsStopped() throws Exception {
         stopAllGrids();
     }
-
-    /**
-     * TODO IGNITE-180: move properties to CollectionConfiguration.
-     */
-    public static class TestCollectionConfiguration {
-        /** Default backups number. */
-        public static final int DFLT_BACKUPS = 0;
-
-        /** Default cache mode. */
-        public static final CacheMode DFLT_CACHE_MODE = PARTITIONED;
-
-        /** Default atomicity mode. */
-        public static final CacheAtomicityMode DFLT_ATOMICITY_MODE = ATOMIC;
-
-        /** Default memory mode. */
-        public static final CacheMemoryMode DFLT_MEMORY_MODE = ONHEAP_TIERED;
-
-        /** Default off-heap storage size is {@code -1} which means that off-heap storage
is disabled. */
-        public static final long DFLT_OFFHEAP_MEMORY = -1;
-
-        /** Off-heap memory size. */
-        private long offHeapMaxMem = DFLT_OFFHEAP_MEMORY;
-
-        /** Cache mode. */
-        private CacheMode cacheMode = DFLT_CACHE_MODE;
-
-        /** Number of backups. */
-        private int backups = DFLT_BACKUPS;
-
-        /** Atomicity mode. */
-        private CacheAtomicityMode atomicityMode = DFLT_ATOMICITY_MODE;
-
-        /** Memory mode. */
-        private CacheMemoryMode memMode = DFLT_MEMORY_MODE;
-
-        /**
-         * @return Number of cache backups.
-         */
-        public int getBackups() {
-            return backups;
-        }
-
-        /**
-         * @param backups Number of cache backups.
-         */
-        public void setBackups(int backups) {
-            this.backups = backups;
-        }
-
-        /**
-         * @return Cache mode.
-         */
-        public CacheMode getCacheMode() {
-            return cacheMode;
-        }
-
-        /**
-         * @param cacheMode Cache mode.
-         */
-        public void setCacheMode(CacheMode cacheMode) {
-            this.cacheMode = cacheMode;
-        }
-
-        /**
-         * @return Cache atomicity mode.
-         */
-        public CacheAtomicityMode getAtomicityMode() {
-            return atomicityMode;
-        }
-
-        /**
-         * @param atomicityMode Cache atomicity mode.
-         */
-        public void setAtomicityMode(CacheAtomicityMode atomicityMode) {
-            this.atomicityMode = atomicityMode;
-        }
-
-        /**
-         * @return Cache memory mode.
-         */
-        public CacheMemoryMode getMemoryMode() {
-            return memMode;
-        }
-
-        /**
-         * @param memMode Cache memory mode.
-         */
-        public void setMemoryMode(CacheMemoryMode memMode) {
-            this.memMode = memMode;
-        }
-
-        /**
-         * @param offHeapMaxMem Maximum memory in bytes available to off-heap memory space.
-         */
-        public void setOffHeapMaxMemory(long offHeapMaxMem) {
-            this.offHeapMaxMem = offHeapMaxMem;
-        }
-
-        /**
-         * @return Maximum memory in bytes available to off-heap memory space.
-         */
-        public long getOffHeapMaxMemory() {
-            return offHeapMaxMem;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
index 5cd967f..66e5e89 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
@@ -67,8 +67,8 @@ public class GridCachePartitionedQueueEntryMoveSelfTest extends IgniteCollection
     }
 
     /** {@inheritDoc} */
-    @Override protected TestCollectionConfiguration collectionConfiguration() {
-        TestCollectionConfiguration colCfg = super.collectionConfiguration();
+    @Override protected CollectionConfiguration collectionConfiguration() {
+        CollectionConfiguration colCfg = super.collectionConfiguration();
 
         colCfg.setBackups(BACKUP_CNT);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d3b10ab4/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/IgnitePartitionedSetNoBackupsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/IgnitePartitionedSetNoBackupsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/IgnitePartitionedSetNoBackupsSelfTest.java
index 3228788..d71f5af 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/IgnitePartitionedSetNoBackupsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/IgnitePartitionedSetNoBackupsSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.datastructures.partitioned;
 
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.testframework.*;
@@ -28,8 +29,8 @@ import java.util.*;
  */
 public class IgnitePartitionedSetNoBackupsSelfTest extends GridCachePartitionedSetSelfTest
{
     /** {@inheritDoc} */
-    @Override protected TestCollectionConfiguration collectionConfiguration() {
-        TestCollectionConfiguration colCfg = super.collectionConfiguration();
+    @Override protected CollectionConfiguration collectionConfiguration() {
+        CollectionConfiguration colCfg = super.collectionConfiguration();
 
         colCfg.setBackups(0);
 


Mime
View raw message