You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/02/01 14:18:51 UTC
[2/3] incubator-ignite git commit: # IGNITE-56 Use IgniteCache in
ignite-core module (1).
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreMultithreadedAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreMultithreadedAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreMultithreadedAbstractTest.java
index e832d59..584cdc1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreMultithreadedAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheBasicStoreMultithreadedAbstractTest.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.cache;
+import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.GridCache;
import org.apache.ignite.cache.store.*;
@@ -47,10 +48,10 @@ public abstract class GridCacheBasicStoreMultithreadedAbstractTest extends GridC
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
- GridCache<?, ?> cache = cache();
+ IgniteCache<?, ?> cache = jcache();
if (cache != null)
- cache.clearAll();
+ cache.clear();
stopAllGrids();
}
@@ -111,7 +112,7 @@ public abstract class GridCacheBasicStoreMultithreadedAbstractTest extends GridC
startGrid();
- final GridCache<Integer, Integer> cache = cache();
+ final IgniteCache<Integer, Integer> cache = jcache();
int threads = 2;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEntrySetIterationPreloadingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEntrySetIterationPreloadingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEntrySetIterationPreloadingSelfTest.java
index bb96c69..6d429d8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEntrySetIterationPreloadingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEntrySetIterationPreloadingSelfTest.java
@@ -17,9 +17,11 @@
package org.apache.ignite.internal.processors.cache.distributed;
+import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.internal.processors.cache.*;
+import javax.cache.*;
import java.util.*;
/**
@@ -59,7 +61,7 @@ public class GridCacheEntrySetIterationPreloadingSelfTest extends GridCacheAbstr
*/
public void testIteration() throws Exception {
try {
- final GridCache<String, Integer> cache = cache();
+ final IgniteCache<String, Integer> cache = jcache();
final int entryCnt = 1000;
@@ -69,7 +71,7 @@ public class GridCacheEntrySetIterationPreloadingSelfTest extends GridCacheAbstr
Collection<CacheEntry<String, Integer>> entries = new ArrayList<>(10_000);
for (int i = 0; i < 10_000; i++)
- entries.add(cache.randomEntry());
+ entries.add((CacheEntry<String, Integer>)cache.randomEntry());
startGrid(1);
startGrid(2);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
index 48e69aa..8b5ade2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheEventAbstractTest.java
@@ -678,7 +678,7 @@ public abstract class GridCacheEventAbstractTest extends GridCacheAbstractSelfTe
public void testFilteredPutRemovexTx1() throws Exception {
runTest(new TestCacheRunnable() {
@Override public void run(GridCache<String, Integer> cache) throws IgniteCheckedException {
- assert cache.keySet().isEmpty() : "Key set is not empty: " + cache().keySet();
+ assert cache.keySet().isEmpty() : "Key set is not empty.";
Map.Entry<String, Integer> e = F.first(pairs(1).entrySet());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
index a9cc2e7..6ec88b9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheAtomicFullApiSelfTest.java
@@ -17,9 +17,9 @@
package org.apache.ignite.internal.processors.cache.distributed.dht;
+import com.google.common.collect.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.testframework.*;
import java.util.*;
@@ -73,8 +73,8 @@ public class GridCacheAtomicFullApiSelfTest extends GridCachePartitionedFullApiS
* @throws Exception In case of error.
*/
@Override public void testGetAll() throws Exception {
- cache().put("key1", 1);
- cache().put("key2", 2);
+ jcache().put("key1", 1);
+ jcache().put("key2", 2);
GridTestUtils.assertThrows(log, new Callable<Void>() {
@Override public Void call() throws Exception {
@@ -84,9 +84,9 @@ public class GridCacheAtomicFullApiSelfTest extends GridCachePartitionedFullApiS
}
}, NullPointerException.class, null);
- assert cache().getAll(Collections.<String>emptyList()).isEmpty();
+ assert jcache().getAll(Collections.<String>emptySet()).isEmpty();
- Map<String, Integer> map1 = cache().getAll(F.asList("key1", "key2", "key9999"));
+ Map<String, Integer> map1 = jcache().getAll(ImmutableSet.of("key1", "key2", "key9999"));
info("Retrieved map1: " + map1);
@@ -96,7 +96,7 @@ public class GridCacheAtomicFullApiSelfTest extends GridCachePartitionedFullApiS
assertEquals(2, (int)map1.get("key2"));
assertNull(map1.get("key9999"));
- Map<String, Integer> map2 = cache().getAll(F.asList("key1", "key2", "key9999"));
+ Map<String, Integer> map2 = jcache().getAll(ImmutableSet.of("key1", "key2", "key9999"));
info("Retrieved map2: " + map2);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedOnlyProjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedOnlyProjectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedOnlyProjectionSelfTest.java
deleted file mode 100644
index f32be78..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedOnlyProjectionSelfTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.distributed.dht;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.internal.processors.cache.distributed.near.*;
-
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-
-/**
- * Tests cache with near cache disabled.
- */
-public class GridCachePartitionedOnlyProjectionSelfTest extends GridCachePartitionedProjectionSelfTest {
- @Override protected CacheDistributionMode distributionMode() {
- return PARTITIONED_ONLY;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
index 42ee84e..a4a21dc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
+import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.events.*;
import org.apache.ignite.lang.*;
@@ -70,7 +71,7 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
/** {@inheritDoc} */
@Override public void testSize() throws Exception {
- GridCache<String, Integer> cache = cache();
+ IgniteCache<String, Integer> cache = jcache();
int size = 10;
@@ -87,10 +88,6 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
checkSize(map.keySet());
- assertEquals("Primary keys found in client-only cache [" +
- "primaryEntries=" + cache.primaryEntrySet() + ", dht=" + cache(nearIdx).entrySet() + "]",
- 0, cache.primarySize());
-
int fullCacheSize = 0;
for (int i = 0; i < gridCount(); i++)
@@ -101,12 +98,12 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
/** {@inheritDoc} */
@Override public void testClear() throws Exception {
- GridCache<String, Integer> nearCache = cache();
+ IgniteCache<String, Integer> nearCache = jcache();
GridCache<String, Integer> primary = fullCache();
Collection<String> keys = primaryKeysForCache(primary, 3);
- Map<String, Integer> vals = new HashMap<>(keys.size());
+ Map<String, Integer> vals = new HashMap<>();
int i = 0;
@@ -119,62 +116,24 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
}
for (String key : keys)
- assertEquals(null, nearCache.peek(key));
+ assertEquals(null, nearCache.localPeek(key));
- nearCache.clearAll();
+ nearCache.clear();
for (String key : keys)
- assertNull(nearCache.peek(key));
+ assertNull(nearCache.localPeek(key));
for (Map.Entry<String, Integer> entry : vals.entrySet())
nearCache.put(entry.getKey(), entry.getValue());
for (String key : keys)
- assertEquals(null, nearCache.peek(key));
-
- String first = F.first(keys);
-
- nearCache.projection(gte100).clear(first);
-
- assertEquals(null, nearCache.peek(first));
- assertEquals(vals.get(first), primary.peek(first));
-
- nearCache.put(first, 101);
-
- nearCache.projection(gte100).clear(first);
-
- assertTrue(nearCache.isEmpty());
- assertFalse(primary.isEmpty());
-
- i = 0;
-
- for (String key : keys) {
- nearCache.put(key, i);
-
- vals.put(key, i);
-
- i++;
- }
-
- nearCache.put(first, 101);
- vals.put(first, 101);
-
- nearCache.projection(gte100).clear(first);
-
- for (String key : keys)
- assertEquals(vals.get(key), primary.peek(key));
+ assertEquals(null, nearCache.localPeek(key));
- for (String key : keys) {
- if (first.equals(key))
- assertNull(nearCache.peek(key));
- else
- assertEquals(null, nearCache.peek(key));
- }
}
/** {@inheritDoc} */
@Override public void testClearKeys() throws Exception {
- GridCache<String, Integer> nearCache = cache();
+ IgniteCache<String, Integer> nearCache = jcache();
GridCache<String, Integer> primary = fullCache();
Collection<String> keys = primaryKeysForCache(primary, 3);
@@ -198,28 +157,14 @@ public class GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest extends GridCache
nearCache.putAll(vals);
for (String subKey : subKeys)
- nearCache.clear(subKey);
+ nearCache.clear(Collections.singleton(subKey));
for (String key : subKeys) {
- assertNull(nearCache.peek(key));
+ assertNull(nearCache.localPeek(key));
assertNotNull(primary.peek(key));
}
- assertEquals(null, nearCache.peek(lastKey));
-
- nearCache.clearAll();
-
- vals.put(lastKey, 102);
-
- nearCache.putAll(vals);
-
- for (String key : keys)
- nearCache.projection(gte100).clear(key);
-
- assertNull(nearCache.peek(lastKey));
-
- for (String key : subKeys)
- assertEquals(null, nearCache.peek(key));
+ assertEquals(null, nearCache.localPeek(lastKey));
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
index 075476b..8515b08 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
@@ -17,8 +17,8 @@
package org.apache.ignite.internal.processors.cache.distributed.near;
+import org.apache.ignite.*;
import org.apache.ignite.cache.*;
-import org.apache.ignite.internal.util.typedef.*;
import javax.cache.expiry.*;
import java.util.*;
@@ -75,12 +75,12 @@ public class GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest extends GridCacheNe
/** {@inheritDoc} */
@Override public void testClear() throws Exception {
- GridCache<String, Integer> nearCache = cache();
+ IgniteCache<String, Integer> nearCache = jcache();
GridCache<String, Integer> primary = fullCache();
Collection<String> keys = primaryKeysForCache(primary, 3);
- Map<String, Integer> vals = new HashMap<>(keys.size());
+ Map<String, Integer> vals = new HashMap<>();
int i = 0;
@@ -95,12 +95,12 @@ public class GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest extends GridCacheNe
i = 0;
for (String key : keys)
- assertEquals((Integer)i++, nearCache.peek(key));
+ assertEquals((Integer)i++, nearCache.localPeek(key));
- nearCache.clearAll();
+ nearCache.clear();
for (String key : keys)
- assertNull(nearCache.peek(key));
+ assertNull(nearCache.localPeek(key));
for (Map.Entry<String, Integer> entry : vals.entrySet())
nearCache.put(entry.getKey(), entry.getValue());
@@ -108,46 +108,8 @@ public class GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest extends GridCacheNe
i = 0;
for (String key : keys)
- assertEquals((Integer)i++, nearCache.peek(key));
+ assertEquals((Integer)i++, nearCache.localPeek(key));
- String first = F.first(keys);
-
- nearCache.projection(gte100).clear(first);
-
- assertEquals((Integer)0, nearCache.peek(first));
- assertEquals(vals.get(first), primary.peek(first));
-
- nearCache.put(first, 101);
-
- nearCache.projection(gte100).clear(first);
-
- assertNull(nearCache.peek(first));
- assertFalse(primary.isEmpty());
-
- i = 0;
-
- for (String key : keys) {
- nearCache.put(key, i);
-
- vals.put(key, i);
-
- i++;
- }
-
- nearCache.put(first, 101);
- vals.put(first, 101);
-
- nearCache.projection(gte100).clear(first);
-
- for (String key : keys)
- assertEquals(vals.get(key), primary.peek(key));
-
- for (String key : keys) {
- if (first.equals(key))
- assertNull(nearCache.peek(key));
- else
- assertEquals(vals.get(key), nearCache.peek(key));
- }
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
index 45207ca..532ef3e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicPartitionedTckMetricsSelfTestImpl.java
@@ -34,11 +34,11 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
* @throws Exception If failed.
*/
public void testEntryProcessorRemove() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
- jcache.put(1, 20);
+ cache.put(1, 20);
- int result = jcache.invoke(1, new EntryProcessor<Integer, Integer, Integer>() {
+ int result = cache.invoke(1, new EntryProcessor<Integer, Integer, Integer>() {
@Override public Integer process(MutableEntry<Integer, Integer> entry, Object... arguments)
throws EntryProcessorException {
Integer result = entry.getValue();
@@ -49,135 +49,135 @@ public class GridCacheAtomicPartitionedTckMetricsSelfTestImpl extends GridCacheA
}
});
- assertEquals(1L, cache().metrics().getCachePuts());
+ assertEquals(1L, cache.metrics().getCachePuts());
assertEquals(20, result);
- assertEquals(1L, cache().metrics().getCacheHits());
- assertEquals(100.0f, cache().metrics().getCacheHitPercentage());
- assertEquals(0L, cache().metrics().getCacheMisses());
- assertEquals(0f, cache().metrics().getCacheMissPercentage());
- assertEquals(1L, cache().metrics().getCachePuts());
- assertEquals(1L, cache().metrics().getCacheRemovals());
- assertEquals(0L, cache().metrics().getCacheEvictions());
- assert cache().metrics().getAveragePutTime() >= 0;
- assert cache().metrics().getAverageGetTime() >= 0;
- assert cache().metrics().getAverageRemoveTime() >= 0;
+ assertEquals(1L, cache.metrics().getCacheHits());
+ assertEquals(100.0f, cache.metrics().getCacheHitPercentage());
+ assertEquals(0L, cache.metrics().getCacheMisses());
+ assertEquals(0f, cache.metrics().getCacheMissPercentage());
+ assertEquals(1L, cache.metrics().getCachePuts());
+ assertEquals(1L, cache.metrics().getCacheRemovals());
+ assertEquals(0L, cache.metrics().getCacheEvictions());
+ assert cache.metrics().getAveragePutTime() >= 0;
+ assert cache.metrics().getAverageGetTime() >= 0;
+ assert cache.metrics().getAverageRemoveTime() >= 0;
}
/**
* @throws Exception If failed.
*/
public void testCacheStatistics() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
- jcache.put(1, 10);
+ cache.put(1, 10);
- assertEquals(0, cache().metrics().getCacheRemovals());
- assertEquals(1, cache().metrics().getCachePuts());
+ assertEquals(0, cache.metrics().getCacheRemovals());
+ assertEquals(1, cache.metrics().getCachePuts());
- jcache.remove(1);
+ cache.remove(1);
- assertEquals(0, cache().metrics().getCacheHits());
- assertEquals(1, cache().metrics().getCacheRemovals());
- assertEquals(1, cache().metrics().getCachePuts());
+ assertEquals(0, cache.metrics().getCacheHits());
+ assertEquals(1, cache.metrics().getCacheRemovals());
+ assertEquals(1, cache.metrics().getCachePuts());
- jcache.remove(1);
+ cache.remove(1);
- assertEquals(0, cache().metrics().getCacheHits());
- assertEquals(0, cache().metrics().getCacheMisses());
- assertEquals(1, cache().metrics().getCacheRemovals());
- assertEquals(1, cache().metrics().getCachePuts());
+ assertEquals(0, cache.metrics().getCacheHits());
+ assertEquals(0, cache.metrics().getCacheMisses());
+ assertEquals(1, cache.metrics().getCacheRemovals());
+ assertEquals(1, cache.metrics().getCachePuts());
- jcache.put(1, 10);
- assertTrue(jcache.remove(1, 10));
+ cache.put(1, 10);
+ assertTrue(cache.remove(1, 10));
- assertEquals(1, cache().metrics().getCacheHits());
- assertEquals(0, cache().metrics().getCacheMisses());
- assertEquals(2, cache().metrics().getCacheRemovals());
- assertEquals(2, cache().metrics().getCachePuts());
+ assertEquals(1, cache.metrics().getCacheHits());
+ assertEquals(0, cache.metrics().getCacheMisses());
+ assertEquals(2, cache.metrics().getCacheRemovals());
+ assertEquals(2, cache.metrics().getCachePuts());
- assertFalse(jcache.remove(1, 10));
+ assertFalse(cache.remove(1, 10));
- assertEquals(1, cache().metrics().getCacheHits());
- assertEquals(1, cache().metrics().getCacheMisses());
- assertEquals(2, cache().metrics().getCacheRemovals());
- assertEquals(2, cache().metrics().getCachePuts());
+ assertEquals(1, cache.metrics().getCacheHits());
+ assertEquals(1, cache.metrics().getCacheMisses());
+ assertEquals(2, cache.metrics().getCacheRemovals());
+ assertEquals(2, cache.metrics().getCachePuts());
}
/**
* @throws Exception If failed.
*/
public void testConditionReplace() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
long hitCount = 0;
long missCount = 0;
long putCount = 0;
- boolean result = jcache.replace(1, 0, 10);
+ boolean result = cache.replace(1, 0, 10);
++missCount;
assertFalse(result);
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- assertFalse(jcache.containsKey(1));
+ assertFalse(cache.containsKey(1));
- jcache.put(1, 10);
+ cache.put(1, 10);
++putCount;
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- assertTrue(jcache.containsKey(1));
+ assertTrue(cache.containsKey(1));
- result = jcache.replace(1, 10, 20);
+ result = cache.replace(1, 10, 20);
assertTrue(result);
++hitCount;
++putCount;
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- result = jcache.replace(1, 40, 50);
+ result = cache.replace(1, 40, 50);
assertFalse(result);
++hitCount;
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
- assertEquals(missCount, cache().metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
}
/**
* @throws Exception If failed.
*/
public void testPutIfAbsent() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
long hitCount = 0;
long missCount = 0;
long putCount = 0;
- boolean result = jcache.putIfAbsent(1, 1);
+ boolean result = cache.putIfAbsent(1, 1);
++putCount;
assertTrue(result);
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- result = jcache.putIfAbsent(1, 1);
+ result = cache.putIfAbsent(1, 1);
assertFalse(result);
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
- assertEquals(missCount, cache().metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedProjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedProjectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedProjectionSelfTest.java
deleted file mode 100644
index bbfb552..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedProjectionSelfTest.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.distributed.near;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.util.typedef.*;
-
-import java.util.*;
-
-import static org.apache.ignite.internal.processors.cache.CacheFlag.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Projection tests for partitioned cache.
- */
-public class GridCachePartitionedProjectionSelfTest extends GridCacheAbstractProjectionSelfTest {
- /** {@inheritDoc} */
- @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
- CacheConfiguration cc = super.cacheConfiguration(gridName);
-
- cc.setEvictSynchronized(false);
- cc.setEvictNearSynchronized(false);
-
- return cc;
- }
-
- /** {@inheritDoc} */
- @Override protected CacheMode cacheMode() {
- return PARTITIONED;
- }
-
- /**
- * @throws Exception In case of error.
- */
- public void testInvalidateFlag() throws Exception {
- long topVer = ((IgniteKernal)grid(0)).context().discovery().topologyVersion();
-
- try {
- // Top ver + 2.
- startGridsMultiThreaded(1, 2);
-
- awaitPartitionMapExchange();
-
- String key = "1";
- Integer val = Integer.valueOf(key);
-
- Ignite primary = G.ignite(cache(0).affinity().mapKeyToNode(key).id());
-
- Collection<ClusterNode> affNodes = cache(0).affinity().mapKeyToPrimaryAndBackups(key);
-
- Ignite near = G.ignite(F.first(F.view(grid(0).nodes(), F.notIn(affNodes))).id());
-
- assert primary != null;
- assert near != null;
-
- // Populate near cache.
- near.cache(null).flagsOn(INVALIDATE).put(key, val);
-
- // The entry is either in near cache, or otherwise it is in
- // DHT primary or backup caches. Since we have 3 nodes, all
- // peek operations should return non-null value.
- for (int i = 0; i < 3; i++) {
- if (grid(i) != near)
- assertNotNull(grid(i).<String, Integer>cache(null).peek(key));
- else {
- if (nearEnabled())
- assertNotNull(grid(i).<String, Integer>cache(null).peek(key));
- else
- assertNull(grid(i).<String, Integer>cache(null).peek(key));
- }
- }
-
- // Invalidate near.
- primary.cache(null).flagsOn(INVALIDATE).put(key, val);
-
- for (int i = 0; i < 3; i++) {
- if (grid(i) != near)
- assertNotNull(grid(i).<String, Integer>cache(null).peek(key));
- else
- assertNull(grid(i).<String, Integer>cache(null).peek(key));
- }
- }
- finally {
- // Top ver + 2.
- for (int i = 1; i < 3; i++)
- stopGrid(i);
-
- for (Ignite g : G.allGrids()) {
- IgniteKernal grid = (IgniteKernal)g;
-
- // Wait until all nodes get topology version event.
- grid.context().discovery().topologyFuture(topVer + 4).get();
- }
- }
- }
-
- /** {@inheritDoc} */
- @Override public void testSkipSwapFlag() throws Exception {
- cache().put("key", 1);
-
- cache().evict("key");
-
- assert cache().peek("key") == null;
-
- Integer one = 1;
-
- assertEquals(one, cache().get("key"));
-
- cache().evict("key");
-
- assertEquals(one, cache().reload("key"));
-
- cache().remove("key");
-
- assertFalse(cache().containsKey("key"));
- assertNull(cache().get("key"));
-
- CacheProjection<String, Integer> prj = cache().flagsOn(SKIP_SWAP, SKIP_STORE);
-
- prj.put("key", 1);
-
- assertEquals(one, prj.get("key"));
- assertEquals(one, prj.peek("key"));
-
- // Entry will be evicted since evictions are not synchronized.
- assert prj.evict("key");
-
- assertNull(prj.peek("key"));
- assertNull(prj.get("key"));
-
- assertNull(prj.remove("key"));
-
- assert prj.peek("key") == null;
- assert prj.get("key") == null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java
deleted file mode 100644
index 53f0902..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedProjectionSelfTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.distributed.replicated;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.internal.processors.cache.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.internal.processors.cache.CacheFlag.*;
-
-/**
- * Projection tests for replicated cache.
- */
-public class GridCacheReplicatedProjectionSelfTest extends GridCacheAbstractProjectionSelfTest {
- /** {@inheritDoc} */
- @Override protected CacheMode cacheMode() {
- return REPLICATED;
- }
-
- /**
- * @throws Exception In case of error.
- */
- public void testInvalidateFlag() throws Exception {
- try {
- for (int i = 1; i < 3; i++)
- startGrid(i);
-
- String key = "1";
- Integer val = Integer.valueOf(key);
-
- // Put value into cache.
- cache(0).put(key, val);
-
- for (int i = 0; i < 3; i++)
- assertEquals(val, grid(i).cache(null).peek(key));
-
- // Put value again, remote nodes are backups and should not be invalidated.
- cache(0).flagsOn(INVALIDATE).put(key, val);
-
- for (int i = 0; i < 3; i++) {
- Object peeked = grid(i).cache(null).peek(key);
-
- assertEquals(val, peeked);
- }
- }
- finally {
- for (int i = 1; i < 3; i++)
- stopGrid(i);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
index ae671ce..dc154f2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheAtomicLocalTckMetricsSelfTestImpl.java
@@ -12,11 +12,11 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
* @throws Exception If failed.
*/
public void testEntryProcessorRemove() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
- jcache.put(1, 20);
+ cache.put(1, 20);
- int result = jcache.invoke(1, new EntryProcessor<Integer, Integer, Integer>() {
+ int result = cache.invoke(1, new EntryProcessor<Integer, Integer, Integer>() {
@Override public Integer process(MutableEntry<Integer, Integer> entry, Object... arguments)
throws EntryProcessorException {
Integer result = entry.getValue();
@@ -27,135 +27,135 @@ public class GridCacheAtomicLocalTckMetricsSelfTestImpl extends GridCacheAtomicL
}
});
- assertEquals(1L, cache().metrics().getCachePuts());
+ assertEquals(1L, cache.metrics().getCachePuts());
assertEquals(20, result);
- assertEquals(1L, cache().metrics().getCacheHits());
- assertEquals(100.0f, cache().metrics().getCacheHitPercentage());
- assertEquals(0L, cache().metrics().getCacheMisses());
- assertEquals(0f, cache().metrics().getCacheMissPercentage());
- assertEquals(1L, cache().metrics().getCachePuts());
- assertEquals(1L, cache().metrics().getCacheRemovals());
- assertEquals(0L, cache().metrics().getCacheEvictions());
- assert cache().metrics().getAveragePutTime() >= 0;
- assert cache().metrics().getAverageGetTime() >= 0;
- assert cache().metrics().getAverageRemoveTime() >= 0;
+ assertEquals(1L, cache.metrics().getCacheHits());
+ assertEquals(100.0f, cache.metrics().getCacheHitPercentage());
+ assertEquals(0L, cache.metrics().getCacheMisses());
+ assertEquals(0f, cache.metrics().getCacheMissPercentage());
+ assertEquals(1L, cache.metrics().getCachePuts());
+ assertEquals(1L, cache.metrics().getCacheRemovals());
+ assertEquals(0L, cache.metrics().getCacheEvictions());
+ assert cache.metrics().getAveragePutTime() >= 0;
+ assert cache.metrics().getAverageGetTime() >= 0;
+ assert cache.metrics().getAverageRemoveTime() >= 0;
}
/**
* @throws Exception If failed.
*/
public void testCacheStatistics() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
- jcache.put(1, 10);
+ cache.put(1, 10);
- assertEquals(0, cache().metrics().getCacheRemovals());
- assertEquals(1, cache().metrics().getCachePuts());
+ assertEquals(0, cache.metrics().getCacheRemovals());
+ assertEquals(1, cache.metrics().getCachePuts());
- jcache.remove(1);
+ cache.remove(1);
- assertEquals(0, cache().metrics().getCacheHits());
- assertEquals(1, cache().metrics().getCacheRemovals());
- assertEquals(1, cache().metrics().getCachePuts());
+ assertEquals(0, cache.metrics().getCacheHits());
+ assertEquals(1, cache.metrics().getCacheRemovals());
+ assertEquals(1, cache.metrics().getCachePuts());
- jcache.remove(1);
+ cache.remove(1);
- assertEquals(0, cache().metrics().getCacheHits());
- assertEquals(0, cache().metrics().getCacheMisses());
- assertEquals(1, cache().metrics().getCacheRemovals());
- assertEquals(1, cache().metrics().getCachePuts());
+ assertEquals(0, cache.metrics().getCacheHits());
+ assertEquals(0, cache.metrics().getCacheMisses());
+ assertEquals(1, cache.metrics().getCacheRemovals());
+ assertEquals(1, cache.metrics().getCachePuts());
- jcache.put(1, 10);
- assertTrue(jcache.remove(1, 10));
+ cache.put(1, 10);
+ assertTrue(cache.remove(1, 10));
- assertEquals(1, cache().metrics().getCacheHits());
- assertEquals(0, cache().metrics().getCacheMisses());
- assertEquals(2, cache().metrics().getCacheRemovals());
- assertEquals(2, cache().metrics().getCachePuts());
+ assertEquals(1, cache.metrics().getCacheHits());
+ assertEquals(0, cache.metrics().getCacheMisses());
+ assertEquals(2, cache.metrics().getCacheRemovals());
+ assertEquals(2, cache.metrics().getCachePuts());
- assertFalse(jcache.remove(1, 10));
+ assertFalse(cache.remove(1, 10));
- assertEquals(1, cache().metrics().getCacheHits());
- assertEquals(1, cache().metrics().getCacheMisses());
- assertEquals(2, cache().metrics().getCacheRemovals());
- assertEquals(2, cache().metrics().getCachePuts());
+ assertEquals(1, cache.metrics().getCacheHits());
+ assertEquals(1, cache.metrics().getCacheMisses());
+ assertEquals(2, cache.metrics().getCacheRemovals());
+ assertEquals(2, cache.metrics().getCachePuts());
}
/**
* @throws Exception If failed.
*/
public void testConditionReplace() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
long hitCount = 0;
long missCount = 0;
long putCount = 0;
- boolean result = jcache.replace(1, 0, 10);
+ boolean result = cache.replace(1, 0, 10);
++missCount;
assertFalse(result);
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- assertFalse(jcache.containsKey(1));
+ assertFalse(cache.containsKey(1));
- jcache.put(1, 10);
+ cache.put(1, 10);
++putCount;
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- assertTrue(jcache.containsKey(1));
+ assertTrue(cache.containsKey(1));
- result = jcache.replace(1, 10, 20);
+ result = cache.replace(1, 10, 20);
assertTrue(result);
++hitCount;
++putCount;
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- result = jcache.replace(1, 40, 50);
+ result = cache.replace(1, 40, 50);
assertFalse(result);
++hitCount;
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
- assertEquals(missCount, cache().metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
}
/**
* @throws Exception If failed.
*/
public void testPutIfAbsent() throws Exception {
- IgniteCache<Integer, Integer> jcache = grid(0).jcache(null);
+ IgniteCache<Integer, Integer> cache = grid(0).jcache(null);
long hitCount = 0;
long missCount = 0;
long putCount = 0;
- boolean result = jcache.putIfAbsent(1, 1);
+ boolean result = cache.putIfAbsent(1, 1);
++putCount;
assertTrue(result);
- assertEquals(missCount, cache().metrics().getCacheMisses());
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
- result = jcache.putIfAbsent(1, 1);
+ result = cache.putIfAbsent(1, 1);
assertFalse(result);
- assertEquals(hitCount, cache().metrics().getCacheHits());
- assertEquals(putCount, cache().metrics().getCachePuts());
- assertEquals(missCount, cache().metrics().getCacheMisses());
+ assertEquals(hitCount, cache.metrics().getCacheHits());
+ assertEquals(putCount, cache.metrics().getCachePuts());
+ assertEquals(missCount, cache.metrics().getCacheMisses());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicProjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicProjectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicProjectionSelfTest.java
deleted file mode 100644
index 464e862..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalAtomicProjectionSelfTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.local;
-
-import org.apache.ignite.cache.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-
-/**
- * Projection tests for local cache in atomic mode.
- */
-public class GridCacheLocalAtomicProjectionSelfTest extends GridCacheLocalProjectionSelfTest {
- /** {@inheritDoc} */
- @Override protected CacheAtomicityMode atomicityMode() {
- return ATOMIC;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalProjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalProjectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalProjectionSelfTest.java
deleted file mode 100644
index 682bda0..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheLocalProjectionSelfTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.local;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.internal.processors.cache.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Projection tests for local cache.
- */
-public class GridCacheLocalProjectionSelfTest extends GridCacheAbstractProjectionSelfTest {
- /** {@inheritDoc} */
- @Override protected CacheMode cacheMode() {
- return LOCAL;
- }
-
- /** {@inheritDoc} */
- @Override public void testSkipSwapFlagMultinode() throws Exception {
- // No-op. Makes no sense for LOCAL cache.
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 3dc8f85..7e6b845 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -36,6 +36,7 @@ import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.*;
import org.jetbrains.annotations.*;
+import javax.cache.*;
import javax.net.ssl.*;
import java.util.*;
@@ -99,6 +100,19 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
}
/**
+ * @param cache Cache.
+ */
+ @SuppressWarnings("TypeMayBeWeakened")
+ protected <K> Set<K> keySet(IgniteCache<K, ?> cache) {
+ Set<K> res = new HashSet<>();
+
+ for (Cache.Entry<K, ?> entry : cache)
+ res.add(entry.getKey());
+
+ return res;
+ }
+
+ /**
* @return Cache.
*/
protected <K, V> GridLocalCache<K, V> local() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d4002ae/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 8f885fb..3e85c62 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -124,8 +124,6 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTestSuite(GridCacheGlobalLoadTest.class);
// Local cache.
- suite.addTestSuite(GridCacheLocalProjectionSelfTest.class);
- suite.addTestSuite(GridCacheLocalAtomicProjectionSelfTest.class);
suite.addTestSuite(GridCacheLocalBasicApiSelfTest.class);
suite.addTestSuite(GridCacheLocalBasicStoreSelfTest.class);
suite.addTestSuite(GridCacheLocalAtomicBasicStoreSelfTest.class);
@@ -147,8 +145,6 @@ public class IgniteCacheTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridCachePartitionedBasicApiTest.class));
suite.addTest(new TestSuite(GridCacheNearMultiGetSelfTest.class));
suite.addTest(new TestSuite(GridCacheNearJobExecutionSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedProjectionSelfTest.class));
- suite.addTest(new TestSuite(GridCachePartitionedOnlyProjectionSelfTest.class));
suite.addTest(new TestSuite(GridCacheNearOneNodeSelfTest.class));
suite.addTest(new TestSuite(GridCacheNearMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCacheAtomicNearMultiNodeSelfTest.class));
@@ -250,7 +246,6 @@ public class IgniteCacheTestSuite extends TestSuite {
//suite.addTestSuite(GridCacheReplicatedMultiNodeLockSelfTest.class);
//suite.addTestSuite(GridCacheReplicatedMultiNodeSelfTest.class);
suite.addTestSuite(GridCacheReplicatedNodeFailureSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedProjectionSelfTest.class);
suite.addTestSuite(GridCacheReplicatedTxSingleThreadedSelfTest.class);
suite.addTestSuite(GridCacheReplicatedTxTimeoutSelfTest.class);
suite.addTestSuite(GridCacheReplicatedPreloadSelfTest.class);