Repository: ignite
Updated Branches:
  refs/heads/ignite-1607 93a84da04 -> 14564ff12


ignite-1607


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

Branch: refs/heads/ignite-1607
Commit: 14564ff12917e107ef9f11b7b5b0456807008913
Parents: 93a84da
Author: sboikov <[email protected]>
Authored: Fri Oct 30 14:12:20 2015 +0300
Committer: sboikov <[email protected]>
Committed: Fri Oct 30 14:12:20 2015 +0300

----------------------------------------------------------------------
 .../CacheSerializableTransactionsTest.java      | 95 ++++++++++----------
 1 file changed, 46 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/14564ff1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java
index b19622e..958a9f6 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java
@@ -109,9 +109,6 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
     /** */
     private boolean client;
 
-    /** */
-    private static int cacheId;
-
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -133,8 +130,6 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
     @Override protected void beforeTestsStarted() throws Exception {
         super.beforeTestsStarted();
 
-        cacheId = 0;
-
         startGridsMultiThreaded(SRVS);
 
         client = true;
@@ -196,7 +191,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 txStreamerLoad(ignite(SRVS), 10_000, cache.getName(), 
allowOverwrite);
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -299,7 +294,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -357,7 +352,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -423,7 +418,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -504,7 +499,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -571,7 +566,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -618,7 +613,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                     checkValue(key, null, cache.getName());
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -649,7 +644,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -727,7 +722,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -830,7 +825,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -923,7 +918,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1016,7 +1011,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1110,7 +1105,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1196,7 +1191,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1282,7 +1277,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1407,7 +1402,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1532,7 +1527,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1669,7 +1664,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1806,7 +1801,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -1977,7 +1972,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -2127,7 +2122,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                     checkValue(i, rmv ? null : i, cache.getName());
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -2217,7 +2212,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -2276,7 +2271,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -2349,7 +2344,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 checkValue(key2, 2, cache.getName());
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -2398,7 +2393,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             }
         }
         finally {
-            ignite0.destroyCache(cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -2484,7 +2479,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             checkValue(key3, key3, cacheName);
         }
         finally {
-            ignite0.destroyCache(cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -2564,7 +2559,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             checkValue(key3, key3, cacheName);
         }
         finally {
-            ignite0.destroyCache(cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -2826,8 +2821,8 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             }
         }
         finally {
-            ignite0.destroyCache(CACHE1);
-            ignite0.destroyCache(CACHE2);
+            destroyCache(CACHE1);
+            destroyCache(CACHE2);
         }
     }
 
@@ -2885,7 +2880,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
                 }
             }
             finally {
-                destroyCache(ignite0, ccfg.getName());
+                destroyCache(ccfg.getName());
             }
         }
     }
@@ -3069,7 +3064,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
         finally {
             stop.set(true);
 
-            destroyCache(srv, cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -3205,7 +3200,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
         finally {
             stop.set(true);
 
-            destroyCache(srv, cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -3334,7 +3329,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             }
         }
         finally {
-            ignite0.destroyCache(cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -3658,7 +3653,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             }
         }
         finally {
-            srv.destroyCache(cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -3805,7 +3800,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             finished.set(true);
 
             for (String cacheName : cacheNames)
-                srv.destroyCache(cacheName);
+                destroyCache(cacheName);
         }
     }
 
@@ -3862,7 +3857,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             }
         }
         finally {
-            ignite.destroyCache(cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -4109,7 +4104,7 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
             }
         }
         finally {
-            destroyCache(srv, cacheName);
+            destroyCache(cacheName);
         }
     }
 
@@ -4304,16 +4299,20 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
     }
 
     /**
-     * @param ignite Node.
      * @param cacheName Cache name.
      */
-    private void destroyCache(Ignite ignite, String cacheName) {
+    private void destroyCache(String cacheName) {
         storeMap.clear();
 
-        ignite.destroyCache(cacheName);
+        for (Ignite ignite : G.allGrids()) {
+            try {
+                ignite.destroyCache(cacheName);
+            }
+            catch (IgniteException ignore) {
+                // No-op.                
+            }
 
-        for (Ignite ignite0 : G.allGrids()) {
-            GridTestSwapSpaceSpi spi = 
(GridTestSwapSpaceSpi)ignite0.configuration().getSwapSpaceSpi();
+            GridTestSwapSpaceSpi spi = 
(GridTestSwapSpaceSpi)ignite.configuration().getSwapSpaceSpi();
 
             spi.clearAll();
         }
@@ -4335,8 +4334,6 @@ public class CacheSerializableTransactionsTest extends 
GridCommonAbstractTest {
         boolean nearCache) {
         CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>();
 
-        ccfg.setName("testCache-" + cacheId++);
-
         ccfg.setCacheMode(cacheMode);
         ccfg.setAtomicityMode(TRANSACTIONAL);
         ccfg.setWriteSynchronizationMode(syncMode);

Reply via email to