You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2017/04/28 06:57:23 UTC
[02/59] [abbrv] ignite git commit: IGNITE-3488: Prohibited null as
cache name. This closes #1790.
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
index 290185e..2011684 100644
--- a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
+++ b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
@@ -121,7 +121,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
*/
@After
public void afterTest() throws Exception {
- grid().cache(null).clear();
+ grid().cache(DEFAULT_CACHE_NAME).clear();
broker.stop();
broker.deleteAllMessages();
@@ -136,7 +136,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce messages into the queue
produceObjectMessages(dest, false);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
jmsStreamer.setDestinationType(Queue.class);
jmsStreamer.setDestinationName(QUEUE_NAME);
@@ -165,7 +165,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// should not produced messages until subscribed to the topic; otherwise they will be missed because this is not
// a durable subscriber (for which a dedicated test exists)
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
jmsStreamer.setDestinationType(Topic.class);
jmsStreamer.setDestinationName(TOPIC_NAME);
@@ -197,7 +197,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce messages into the queue
produceObjectMessages(dest, false);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
@@ -226,7 +226,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// should not produced messages until subscribed to the topic; otherwise they will be missed because this is not
// a durable subscriber (for which a dedicated test exists)
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
@@ -257,7 +257,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce A SINGLE MESSAGE, containing all data, into the queue
produceStringMessages(dest, true);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
@@ -282,7 +282,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
public void testDurableSubscriberStartStopStart() throws Exception {
Destination dest = new ActiveMQTopic(TOPIC_NAME);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
jmsStreamer.setDurableSubscription(true);
@@ -325,7 +325,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce multiple messages into the queue
produceStringMessages(dest, false);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
jmsStreamer.setBatched(true);
@@ -364,7 +364,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce multiple messages into the queue
produceStringMessages(dest, false);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
jmsStreamer.setBatched(true);
@@ -414,7 +414,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce multiple messages into the queue
produceStringMessages(dest, false);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
// override the transformer with one that generates no cache entries
jmsStreamer.setTransformer(TestTransformers.generateNoEntries());
@@ -442,7 +442,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce multiple messages into the queue
produceStringMessages(dest, false);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
jmsStreamer.setTransacted(true);
jmsStreamer.setDestination(dest);
@@ -471,7 +471,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
// produce messages into the queue
produceObjectMessages(dest, false);
- try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
jmsStreamer.setDestination(dest);
jmsStreamer.setThreads(5);
@@ -504,7 +504,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
*/
private void assertAllCacheEntriesLoaded() {
// Get the cache and check that the entries are present
- IgniteCache<String, String> cache = grid().cache(null);
+ IgniteCache<String, String> cache = grid().cache(DEFAULT_CACHE_NAME);
for (Map.Entry<String, String> entry : TEST_DATA.entrySet())
assertEquals(entry.getValue(), cache.get(entry.getKey()));
}
@@ -545,7 +545,7 @@ public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
}
};
- ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(cb, null, EVT_CACHE_OBJECT_PUT);
+ ignite.events(ignite.cluster().forCacheNodes(DEFAULT_CACHE_NAME)).remoteListen(cb, null, EVT_CACHE_OBJECT_PUT);
return latch;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaConfigurationValidationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaConfigurationValidationSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaConfigurationValidationSelfTest.java
index b2a9b69..c7b7fed 100644
--- a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaConfigurationValidationSelfTest.java
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaConfigurationValidationSelfTest.java
@@ -37,7 +37,7 @@ public class GridCacheJtaConfigurationValidationSelfTest extends GridCommonAbstr
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
- CacheConfiguration ccfg = new CacheConfiguration();
+ CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setAtomicityMode(ATOMIC);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaFactoryConfigValidationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaFactoryConfigValidationSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaFactoryConfigValidationSelfTest.java
index d39e14b..bb12d5e 100644
--- a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaFactoryConfigValidationSelfTest.java
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaFactoryConfigValidationSelfTest.java
@@ -41,7 +41,7 @@ public class GridCacheJtaFactoryConfigValidationSelfTest extends GridCommonAbstr
cfg.getTransactionConfiguration().setTxManagerFactory(factory);
- CacheConfiguration ccfg = new CacheConfiguration();
+ CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setAtomicityMode(ATOMIC);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
index 1efbda6..bb1e89c 100644
--- a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridPartitionedCacheJtaLookupClassNameSelfTest.java
@@ -44,7 +44,7 @@ public class GridPartitionedCacheJtaLookupClassNameSelfTest extends AbstractCach
public void testUncompatibleTmLookup() {
final IgniteEx ignite = grid(0);
- final CacheConfiguration cacheCfg = new CacheConfiguration();
+ final CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cacheCfg.setName("Foo");
cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
index 102b647..00cb4fc 100644
--- a/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
+++ b/modules/kafka/src/test/java/org/apache/ignite/stream/kafka/KafkaIgniteStreamerSelfTest.java
@@ -81,7 +81,7 @@ public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
- grid().cache(null).clear();
+ grid().cache(DEFAULT_CACHE_NAME).clear();
embeddedBroker.shutdown();
}
@@ -150,7 +150,7 @@ public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
Ignite ignite = grid();
- try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(null)) {
+ try (IgniteDataStreamer<String, String> stmr = ignite.dataStreamer(DEFAULT_CACHE_NAME)) {
stmr.allowOverwrite(true);
stmr.autoFlushFrequency(10);
@@ -158,7 +158,7 @@ public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
kafkaStmr = new KafkaStreamer<>();
// Get the cache.
- IgniteCache<String, String> cache = ignite.cache(null);
+ IgniteCache<String, String> cache = ignite.cache(DEFAULT_CACHE_NAME);
// Set Ignite instance.
kafkaStmr.setIgnite(ignite);
@@ -210,7 +210,7 @@ public class KafkaIgniteStreamerSelfTest extends GridCommonAbstractTest {
}
};
- ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
+ ignite.events(ignite.cluster().forCacheNodes(DEFAULT_CACHE_NAME)).remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
// Checks all events successfully processed in 10 seconds.
assertTrue(latch.await(10, TimeUnit.SECONDS));
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java
----------------------------------------------------------------------
diff --git a/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java b/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java
index 49e1f71..d8c15ea 100644
--- a/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java
+++ b/modules/mqtt/src/test/java/org/apache/ignite/stream/mqtt/IgniteMqttStreamerTest.java
@@ -145,7 +145,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest {
client.connect();
// create mqtt streamer
- dataStreamer = grid().dataStreamer(null);
+ dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME);
streamer = createMqttStreamer(dataStreamer);
}
@@ -164,7 +164,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest {
dataStreamer.close();
- grid().cache(null).clear();
+ grid().cache(DEFAULT_CACHE_NAME).clear();
broker.stop();
broker.deleteAllMessages();
@@ -441,7 +441,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest {
Thread.sleep(3000);
- assertNull(grid().cache(null).get(50));
+ assertNull(grid().cache(DEFAULT_CACHE_NAME).get(50));
}
/**
@@ -570,7 +570,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest {
}
};
- remoteLsnr = ignite.events(ignite.cluster().forCacheNodes(null))
+ remoteLsnr = ignite.events(ignite.cluster().forCacheNodes(DEFAULT_CACHE_NAME))
.remoteListen(cb, null, EVT_CACHE_OBJECT_PUT);
return latch;
@@ -581,7 +581,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest {
*/
private void assertCacheEntriesLoaded(int cnt) {
// get the cache and check that the entries are present
- IgniteCache<Integer, String> cache = grid().cache(null);
+ IgniteCache<Integer, String> cache = grid().cache(DEFAULT_CACHE_NAME);
// for each key from 0 to count from the TEST_DATA (ordered by key), check that the entry is present in cache
for (Integer key : new ArrayList<>(new TreeSet<>(TEST_DATA.keySet())).subList(0, cnt))
@@ -591,7 +591,7 @@ public class IgniteMqttStreamerTest extends GridCommonAbstractTest {
assertEquals(cnt, cache.size(CachePeekMode.ALL));
// remove the event listener
- grid().events(grid().cluster().forCacheNodes(null)).stopRemoteListen(remoteLsnr);
+ grid().events(grid().cluster().forCacheNodes(DEFAULT_CACHE_NAME)).stopRemoteListen(remoteLsnr);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryCompactFooterInteropTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryCompactFooterInteropTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryCompactFooterInteropTest.cs
index 2ee7cad..735cfff 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryCompactFooterInteropTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryCompactFooterInteropTest.cs
@@ -115,7 +115,7 @@ namespace Apache.Ignite.Core.Tests.Binary
{
var grid = client ? _clientGrid : _grid;
- var cache = grid.GetCache<int, PlatformComputeBinarizable>(null);
+ var cache = grid.GetCache<int, PlatformComputeBinarizable>("default");
// Populate cache in .NET
for (var i = 0; i < 100; i++)
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
index 687b1f5..549e453 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/BinaryDynamicRegistrationTest.cs
@@ -102,7 +102,7 @@ namespace Apache.Ignite.Core.Tests.Binary
BinaryConfiguration = new BinaryConfiguration {CompactFooter = false},
CacheConfiguration = new[]
{
- new CacheConfiguration
+ new CacheConfiguration("default")
{
CacheStoreFactory = new StoreFactory(),
ReadThrough = true,
@@ -138,14 +138,14 @@ namespace Apache.Ignite.Core.Tests.Binary
using (var ignite = Ignition.Start(cfg))
{
// Put through statically started cache
- var staticCache = ignite.GetCache<int, Foo>(null);
+ var staticCache = ignite.GetCache<int, Foo>("default");
staticCache[1] = new Foo {Str = "test", Int = 2};
}
using (var ignite = Ignition.Start(cfg))
{
- var foo = ignite.GetCache<int, Foo>(null)[1];
- var foo2 = ignite.GetCache<int, Foo>(null)[2];
+ var foo = ignite.GetCache<int, Foo>("default")[1];
+ var foo2 = ignite.GetCache<int, Foo>("default")[2];
Assert.AreEqual("test", foo.Str);
Assert.AreEqual(2, foo.Int);
@@ -160,8 +160,8 @@ namespace Apache.Ignite.Core.Tests.Binary
IgniteInstanceName = "grid2"
}))
{
- var fooClient = igniteClient.GetCache<int, Foo>(null)[1];
- var fooClient2 = igniteClient.GetCache<int, Foo>(null)[2];
+ var fooClient = igniteClient.GetCache<int, Foo>("default")[1];
+ var fooClient2 = igniteClient.GetCache<int, Foo>("default")[2];
Assert.AreEqual("test", fooClient.Str);
Assert.AreEqual(2, fooClient.Int);
@@ -176,7 +176,7 @@ namespace Apache.Ignite.Core.Tests.Binary
using (var ignite = Ignition.Start(cfg))
{
- var ex = Assert.Throws<BinaryObjectException>(() => ignite.GetCache<int, Foo>(null).Get(1));
+ var ex = Assert.Throws<BinaryObjectException>(() => ignite.GetCache<int, Foo>("default").Get(1));
Assert.IsTrue(ex.Message.Contains("Unknown pair"));
}
@@ -192,7 +192,7 @@ namespace Apache.Ignite.Core.Tests.Binary
{
CacheConfiguration = new[]
{
- new CacheConfiguration
+ new CacheConfiguration("default")
{
CacheStoreFactory = new StoreFactory {StringProp = "test", IntProp = 9},
ReadThrough = true,
@@ -303,7 +303,7 @@ namespace Apache.Ignite.Core.Tests.Binary
using (var ignite = Ignition.Start(cfg))
{
- var cacheCfg = new CacheConfiguration(null, new QueryEntity(typeof(PlatformComputeBinarizable))
+ var cacheCfg = new CacheConfiguration("default", new QueryEntity(typeof(PlatformComputeBinarizable))
{
Fields = new[] {new QueryField("Field", typeof(int))}
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/JavaBinaryInteropTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/JavaBinaryInteropTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/JavaBinaryInteropTest.cs
index 9af5c35..9343799 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/JavaBinaryInteropTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/JavaBinaryInteropTest.cs
@@ -36,7 +36,7 @@ namespace Apache.Ignite.Core.Tests.Binary
{
using (var ignite = Ignition.Start(TestUtils.GetTestConfiguration()))
{
- ignite.CreateCache<int, object>((string) null);
+ ignite.CreateCache<int, object>("default");
// Basic types.
// Types which map directly to Java are returned properly when retrieved as object.
@@ -95,7 +95,7 @@ namespace Apache.Ignite.Core.Tests.Binary
/// </summary>
private static void CheckValueCaching<T>(T val, bool asObject = true, bool asArray = true)
{
- var cache = Ignition.GetIgnite(null).GetCache<int, T>(null);
+ var cache = Ignition.GetIgnite().GetCache<int, T>("default");
cache[1] = val;
Assert.AreEqual(val, cache[1]);
@@ -117,7 +117,7 @@ namespace Apache.Ignite.Core.Tests.Binary
/// </summary>
private static void CheckValueCachingAsObject<T>(T val)
{
- var cache = Ignition.GetIgnite(null).GetCache<int, object>(null);
+ var cache = Ignition.GetIgnite().GetCache<int, object>("default");
cache[1] = val;
Assert.AreEqual(val, (T) cache[1]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/BinaryConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/BinaryConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/BinaryConfigurationTest.cs
index 496f46f..d549d1d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/BinaryConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/BinaryConfigurationTest.cs
@@ -75,7 +75,7 @@ namespace Apache.Ignite.Core.Tests
BinaryConfiguration = binaryConfiguration
});
- _cache = grid.GetCache<int, TestGenericBinarizableBase>(null);
+ _cache = grid.GetCache<int, TestGenericBinarizableBase>("default");
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFieldTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFieldTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFieldTest.cs
index 71883b1..31326b7 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFieldTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityFieldTest.cs
@@ -48,11 +48,11 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
var grid1 = Ignition.Start(GetConfig());
var grid2 = Ignition.Start(GetConfig("grid2"));
- _cache1 = grid1.CreateCache<object, string>(new CacheConfiguration
+ _cache1 = grid1.CreateCache<object, string>(new CacheConfiguration("default")
{
CacheMode = CacheMode.Partitioned
});
- _cache2 = grid2.GetCache<object, string>(null);
+ _cache2 = grid2.GetCache<object, string>("default");
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityTest.cs
index 1ae46c5..a3b8c03 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityTest.cs
@@ -62,7 +62,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
{
IIgnite g = Ignition.GetIgnite("grid-0");
- ICacheAffinity aff = g.GetAffinity(null);
+ ICacheAffinity aff = g.GetAffinity("default");
IClusterNode node = aff.MapKeyToNode(new AffinityTestKey(0, 1));
@@ -78,7 +78,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Affinity
{
IIgnite g = Ignition.GetIgnite("grid-0");
- ICacheAffinity aff = g.GetAffinity(null);
+ ICacheAffinity aff = g.GetAffinity("default");
IBinaryObject affKey = g.GetBinary().ToBinary<IBinaryObject>(new AffinityTestKey(0, 1));
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
index 67184a6..70fd473 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs
@@ -43,6 +43,9 @@ namespace Apache.Ignite.Core.Tests.Cache
private const string CacheName = "cacheName";
/** */
+ private const string DefaultCacheName = "default";
+
+ /** */
private const string CacheName2 = "cacheName2";
/** */
@@ -59,7 +62,7 @@ namespace Apache.Ignite.Core.Tests.Cache
{
CacheConfiguration = new List<CacheConfiguration>
{
- new CacheConfiguration(),
+ new CacheConfiguration(DefaultCacheName),
GetCustomCacheConfiguration(),
GetCustomCacheConfiguration2()
},
@@ -96,11 +99,11 @@ namespace Apache.Ignite.Core.Tests.Cache
[Test]
public void TestDefaultConfiguration()
{
- AssertConfigIsDefault(new CacheConfiguration());
+ AssertConfigIsDefault(new CacheConfiguration(DefaultCacheName));
- AssertConfigIsDefault(_ignite.GetCache<int, int>(null).GetConfiguration());
+ AssertConfigIsDefault(_ignite.GetCache<int, int>(DefaultCacheName).GetConfiguration());
- AssertConfigIsDefault(_ignite.GetConfiguration().CacheConfiguration.Single(c => c.Name == null));
+ AssertConfigIsDefault(_ignite.GetConfiguration().CacheConfiguration.Single(c => c.Name == DefaultCacheName));
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheForkedTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheForkedTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheForkedTest.cs
index 3401b79..0dc214f 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheForkedTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheForkedTest.cs
@@ -73,7 +73,7 @@ namespace Apache.Ignite.Core.Tests.Cache
[Test]
public void TestClearCache()
{
- _grid.GetCache<object, object>(null).Clear();
+ _grid.GetCache<object, object>("default").Clear();
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheNearTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheNearTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheNearTest.cs
index 24dc971..285f635 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheNearTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheNearTest.cs
@@ -29,6 +29,9 @@ namespace Apache.Ignite.Core.Tests.Cache
public class CacheNearTest : IEventListener<CacheEvent>
{
/** */
+ private const string DefaultCacheName = "default";
+
+ /** */
private IIgnite _grid;
/** */
@@ -49,10 +52,12 @@ namespace Apache.Ignite.Core.Tests.Cache
NearConfiguration = new NearCacheConfiguration
{
EvictionPolicy = new FifoEvictionPolicy {MaxSize = 5}
- }
+ },
+ Name = DefaultCacheName
}
},
- IncludedEventTypes = new[] { EventType.CacheEntryCreated }
+ IncludedEventTypes = new[] { EventType.CacheEntryCreated },
+ IgniteInstanceName = "server"
};
_grid = Ignition.Start(cfg);
@@ -73,15 +78,15 @@ namespace Apache.Ignite.Core.Tests.Cache
[Test]
public void TestExistingNearCache()
{
- var cache = _grid.GetCache<int, string>(null);
+ var cache = _grid.GetCache<int, string>(DefaultCacheName);
cache[1] = "1";
- var nearCache = _grid.GetOrCreateNearCache<int, string>(null, new NearCacheConfiguration());
+ var nearCache = _grid.GetOrCreateNearCache<int, string>(DefaultCacheName, new NearCacheConfiguration());
Assert.AreEqual("1", nearCache[1]);
// GetOrCreate when exists
- nearCache = _grid.GetOrCreateNearCache<int, string>(null, new NearCacheConfiguration());
+ nearCache = _grid.GetOrCreateNearCache<int, string>(DefaultCacheName, new NearCacheConfiguration());
Assert.AreEqual("1", nearCache[1]);
}
@@ -93,15 +98,22 @@ namespace Apache.Ignite.Core.Tests.Cache
{
const string cacheName = "dyn_cache";
- var cache = _grid.CreateCache<int, string>(cacheName);
+ var cache = _grid.CreateCache<int, string>(new CacheConfiguration(cacheName));
cache[1] = "1";
- var nearCache = _grid.CreateNearCache<int, string>(cacheName, new NearCacheConfiguration());
- Assert.AreEqual("1", nearCache[1]);
+ using (var client = Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration())
+ {
+ ClientMode = true,
+ IgniteInstanceName = "client"
+ }))
+ {
+ var nearCache = client.CreateNearCache<int, string>(cacheName, new NearCacheConfiguration());
+ Assert.AreEqual("1", nearCache[1]);
- // Create when exists
- nearCache = _grid.CreateNearCache<int, string>(cacheName, new NearCacheConfiguration());
- Assert.AreEqual("1", nearCache[1]);
+ // Create when exists.
+ nearCache = client.CreateNearCache<int, string>(cacheName, new NearCacheConfiguration());
+ Assert.AreEqual("1", nearCache[1]);
+ }
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
index c638449..ab661cf 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheLinqTest.cs
@@ -46,7 +46,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
public class CacheLinqTest
{
/** Cache name. */
- private const string PersonOrgCacheName = null;
+ private const string PersonOrgCacheName = "person_org";
/** Cache name. */
private const string PersonSecondCacheName = "person_cache";
@@ -1280,7 +1280,8 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
Assert.AreEqual(cache.Ignite, query.Ignite);
var fq = query.GetFieldsQuery();
- Assert.AreEqual("select _T0._key, _T0._val from \"\".Person as _T0 where (_T0._key > ?)", fq.Sql);
+ Assert.AreEqual("select _T0._key, _T0._val from \"person_org\".Person as _T0 where (_T0._key > ?)",
+ fq.Sql);
Assert.AreEqual(new[] {10}, fq.Arguments);
Assert.IsTrue(fq.Local);
Assert.AreEqual(PersonCount - 11, cache.QueryFields(fq).GetAll().Count);
@@ -1289,8 +1290,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
Assert.IsTrue(fq.EnforceJoinOrder);
var str = query.ToString();
- Assert.AreEqual("CacheQueryable [CacheName=, TableName=Person, Query=SqlFieldsQuery [Sql=select " +
- "_T0._key, _T0._val from \"\".Person as _T0 where (_T0._key > ?), Arguments=[10], " +
+ Assert.AreEqual("CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " +
+ "[Sql=select _T0._key, _T0._val from \"person_org\".Person as _T0 where " +
+ "(_T0._key > ?), Arguments=[10], " +
"Local=True, PageSize=999, EnableDistributedJoins=False, EnforceJoinOrder=True]]", str);
// Check fields query
@@ -1300,16 +1302,16 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
Assert.AreEqual(cache.Ignite, fieldsQuery.Ignite);
fq = fieldsQuery.GetFieldsQuery();
- Assert.AreEqual("select _T0.Name from \"\".Person as _T0", fq.Sql);
+ Assert.AreEqual("select _T0.Name from \"person_org\".Person as _T0", fq.Sql);
Assert.IsFalse(fq.Local);
Assert.AreEqual(SqlFieldsQuery.DefaultPageSize, fq.PageSize);
Assert.IsFalse(fq.EnableDistributedJoins);
Assert.IsFalse(fq.EnforceJoinOrder);
str = fieldsQuery.ToString();
- Assert.AreEqual("CacheQueryable [CacheName=, TableName=Person, Query=SqlFieldsQuery [Sql=select " +
- "_T0.Name from \"\".Person as _T0, Arguments=[], Local=False, PageSize=1024, " +
- "EnableDistributedJoins=False, EnforceJoinOrder=False]]", str);
+ Assert.AreEqual("CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " +
+ "[Sql=select _T0.Name from \"person_org\".Person as _T0, Arguments=[], Local=False, " +
+ "PageSize=1024, EnableDistributedJoins=False, EnforceJoinOrder=False]]", str);
// Check distributed joins flag propagation
var distrQuery = cache.AsCacheQueryable(new QueryOptions {EnableDistributedJoins = true})
@@ -1320,8 +1322,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
Assert.IsTrue(query.GetFieldsQuery().EnableDistributedJoins);
str = distrQuery.ToString();
- Assert.AreEqual("CacheQueryable [CacheName=, TableName=Person, Query=SqlFieldsQuery [Sql=select " +
- "_T0._key, _T0._val from \"\".Person as _T0 where (((_T0._key > ?) and (_T0.age1 > ?)) " +
+ Assert.AreEqual("CacheQueryable [CacheName=person_org, TableName=Person, Query=SqlFieldsQuery " +
+ "[Sql=select _T0._key, _T0._val from \"person_org\".Person as _T0 where " +
+ "(((_T0._key > ?) and (_T0.age1 > ?)) " +
"and (_T0.Name like \'%\' || ? || \'%\') ), Arguments=[10, 20, x], Local=False, " +
"PageSize=1024, EnableDistributedJoins=True, EnforceJoinOrder=False]]", str);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/CancellationTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/CancellationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/CancellationTest.cs
index 19bb40d..a8a99ce 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/CancellationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/CancellationTest.cs
@@ -71,7 +71,7 @@ namespace Apache.Ignite.Core.Tests.Compute
TestClosure((c, t) => c.BroadcastAsync(new ComputeFunc(), t));
TestClosure((c, t) => c.BroadcastAsync(new ComputeBiFunc(), 10, t));
- TestClosure((c, t) => c.AffinityRunAsync(null, 0, new ComputeAction(), t));
+ TestClosure((c, t) => c.AffinityRunAsync("default", 0, new ComputeAction(), t));
TestClosure((c, t) => c.RunAsync(new ComputeAction(), t));
TestClosure((c, t) => c.RunAsync(Enumerable.Range(1, 10).Select(x => new ComputeAction()), t));
@@ -81,7 +81,7 @@ namespace Apache.Ignite.Core.Tests.Compute
TestClosure((c, t) => c.CallAsync(Enumerable.Range(1, 10).Select(x => new ComputeFunc()),
new ComputeReducer(), t));
- TestClosure((c, t) => c.AffinityCallAsync(null, 0, new ComputeFunc(), t));
+ TestClosure((c, t) => c.AffinityCallAsync("default", 0, new ComputeFunc(), t));
TestClosure((c, t) => c.ApplyAsync(new ComputeBiFunc(), 10, t));
TestClosure((c, t) => c.ApplyAsync(new ComputeBiFunc(), Enumerable.Range(1, 100), t));
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
index d675d14..02eb266 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Compute/ComputeApiTest.cs
@@ -122,6 +122,9 @@ namespace Apache.Ignite.Core.Tests.Compute
/** Echo type: IgniteUuid. */
private const int EchoTypeIgniteUuid = 22;
+ /** */
+ private const string DefaultCacheName = "default";
+
/** First node. */
private IIgnite _grid1;
@@ -195,21 +198,6 @@ namespace Apache.Ignite.Core.Tests.Compute
}
/// <summary>
- /// Test getting cache with default (null) name.
- /// </summary>
- [Test]
- public void TestCacheDefaultName()
- {
- var cache = _grid1.GetCache<int, int>(null);
-
- Assert.IsNotNull(cache);
-
- cache.GetAndPut(1, 1);
-
- Assert.AreEqual(1, cache.Get(1));
- }
-
- /// <summary>
/// Test non-existent cache.
/// </summary>
[Test]
@@ -954,7 +942,7 @@ namespace Apache.Ignite.Core.Tests.Compute
[Test]
public void TestEchoTaskEnumFromCache()
{
- var cache = _grid1.GetCache<int, PlatformComputeEnum>(null);
+ var cache = _grid1.GetCache<int, PlatformComputeEnum>(DefaultCacheName);
foreach (PlatformComputeEnum val in Enum.GetValues(typeof(PlatformComputeEnum)))
{
@@ -988,7 +976,7 @@ namespace Apache.Ignite.Core.Tests.Compute
[Test]
public void TestEchoTaskEnumArrayFromCache()
{
- var cache = _grid1.GetCache<int, PlatformComputeEnum[]>(null);
+ var cache = _grid1.GetCache<int, PlatformComputeEnum[]>(DefaultCacheName);
foreach (var val in new[]
{
@@ -1015,7 +1003,7 @@ namespace Apache.Ignite.Core.Tests.Compute
{
var enumVal = PlatformComputeEnum.Baz;
- _grid1.GetCache<int, InteropComputeEnumFieldTest>(null)
+ _grid1.GetCache<int, InteropComputeEnumFieldTest>(DefaultCacheName)
.Put(EchoTypeEnumField, new InteropComputeEnumFieldTest {InteropEnum = enumVal});
var res = _grid1.GetCompute().ExecuteJavaTask<PlatformComputeEnum>(EchoTask, EchoTypeEnumField);
@@ -1037,7 +1025,7 @@ namespace Apache.Ignite.Core.Tests.Compute
{
var guid = Guid.NewGuid();
- _grid1.GetCache<int, object>(null)[EchoTypeIgniteUuid] = new IgniteGuid(guid, 25);
+ _grid1.GetCache<int, object>(DefaultCacheName)[EchoTypeIgniteUuid] = new IgniteGuid(guid, 25);
var res = _grid1.GetCompute().ExecuteJavaTask<IgniteGuid>(EchoTask, EchoTypeIgniteUuid);
@@ -1161,7 +1149,7 @@ namespace Apache.Ignite.Core.Tests.Compute
[Test]
public void TestAffinityRun()
{
- const string cacheName = null;
+ const string cacheName = DefaultCacheName;
// Test keys for non-client nodes
var nodes = new[] {_grid1, _grid2}.Select(x => x.GetCluster().GetLocalNode());
@@ -1188,7 +1176,7 @@ namespace Apache.Ignite.Core.Tests.Compute
[Test]
public void TestAffinityCall()
{
- const string cacheName = null;
+ const string cacheName = DefaultCacheName;
// Test keys for non-client nodes
var nodes = new[] { _grid1, _grid2 }.Select(x => x.GetCluster().GetLocalNode());
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml
index f01bd57..aa4c4e8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-grid1.xml
@@ -42,6 +42,7 @@
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="default"/>
<property name="startSize" value="10"/>
<property name="queryEntities">
<list>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml
index 3990e3b..b428776 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Compute/compute-standalone.xml
@@ -29,7 +29,9 @@
<property name="cacheConfiguration">
<list>
- <bean class="org.apache.ignite.configuration.CacheConfiguration" />
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="default"/>
+ </bean>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="cache1"/>
</bean>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml
index 97ec97e..a8309e5 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-binarizables.xml
@@ -56,7 +56,9 @@
<property name="cacheConfiguration">
<list>
- <bean class="org.apache.ignite.configuration.CacheConfiguration" />
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="default"/>
+ </bean>
</list>
</property>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml
index 9c7bfb0..610d1dd 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-affinity.xml
@@ -48,6 +48,7 @@
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="cacheMode" value="PARTITIONED"/>
+ <property name="name" value="default"/>
</bean>
</list>
</property>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
index 545a5c5..7578475 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/EventsTest.cs
@@ -42,6 +42,9 @@ namespace Apache.Ignite.Core.Tests
public class EventsTest
{
/** */
+ public const string CacheName = "eventsTest";
+
+ /** */
private IIgnite _grid1;
/** */
@@ -240,7 +243,7 @@ namespace Apache.Ignite.Core.Tests
{
EventType = EventType.CacheAll,
EventObjectType = typeof (CacheEvent),
- GenerateEvent = g => g.GetCache<int, int>(null).Put(TestUtils.GetPrimaryKey(g), 1),
+ GenerateEvent = g => g.GetCache<int, int>(CacheName).Put(TestUtils.GetPrimaryKey(g, CacheName), 1),
VerifyEvents = (e, g) => VerifyCacheEvents(e, g),
EventCount = 3
};
@@ -699,7 +702,7 @@ namespace Apache.Ignite.Core.Tests
{
IgniteInstanceName = name,
EventStorageSpi = new MemoryEventStorageSpi(),
- CacheConfiguration = new [] {new CacheConfiguration() },
+ CacheConfiguration = new [] {new CacheConfiguration(CacheName) },
ClientMode = client
};
}
@@ -730,11 +733,11 @@ namespace Apache.Ignite.Core.Tests
/// </summary>
private static void GenerateCacheQueryEvent(IIgnite g)
{
- var cache = g.GetCache<int, int>(null);
+ var cache = g.GetCache<int, int>(CacheName);
cache.Clear();
- cache.Put(TestUtils.GetPrimaryKey(g), 1);
+ cache.Put(TestUtils.GetPrimaryKey(g, CacheName), 1);
cache.Query(new ScanQuery<int, int>()).GetAll();
}
@@ -748,7 +751,7 @@ namespace Apache.Ignite.Core.Tests
foreach (var cacheEvent in e)
{
- Assert.AreEqual(null, cacheEvent.CacheName);
+ Assert.AreEqual(CacheName, cacheEvent.CacheName);
Assert.AreEqual(null, cacheEvent.ClosureClassName);
Assert.AreEqual(null, cacheEvent.TaskName);
Assert.AreEqual(grid.GetCluster().GetLocalNode(), cacheEvent.EventNode);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs
index 2c9a63b..486878a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteStartStopTest.cs
@@ -67,7 +67,7 @@ namespace Apache.Ignite.Core.Tests
{
var cfg = new IgniteConfiguration
{
- SpringConfigUrl = "config/default-config.xml",
+ SpringConfigUrl = "config\\start-test-grid1.xml",
JvmClasspath = TestUtils.CreateTestClasspath()
};
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MarshallerTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MarshallerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MarshallerTest.cs
index 7def56f..030916b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MarshallerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/MarshallerTest.cs
@@ -32,9 +32,9 @@ namespace Apache.Ignite.Core.Tests
[Test]
public void TestDefaultMarhsaller()
{
- using (var grid = Ignition.Start("config\\marshaller-default.xml"))
+ using (var grid = StartIgnite("config\\marshaller-default.xml"))
{
- var cache = grid.GetOrCreateCache<int, int>((string) null);
+ var cache = grid.GetOrCreateCache<int, int>("default");
cache.Put(1, 1);
@@ -49,9 +49,9 @@ namespace Apache.Ignite.Core.Tests
[Test]
public void TestExplicitMarhsaller()
{
- using (var grid = Ignition.Start("config\\marshaller-explicit.xml"))
+ using (var grid = StartIgnite("config\\marshaller-explicit.xml"))
{
- var cache = grid.GetOrCreateCache<int, int>((string) null);
+ var cache = grid.GetOrCreateCache<int, int>("default");
cache.Put(1, 1);
@@ -65,7 +65,21 @@ namespace Apache.Ignite.Core.Tests
[Test]
public void TestInvalidMarshaller()
{
- Assert.Throws<IgniteException>(() => Ignition.Start("config\\marshaller-invalid.xml"));
+ var ex = Assert.Throws<IgniteException>(() => StartIgnite("config\\marshaller-invalid.xml"));
+ Assert.AreEqual("Unsupported marshaller (only org.apache.ignite.internal.binary.BinaryMarshaller " +
+ "can be used when running Apache Ignite.NET): org.apache.ignite.internal." +
+ "marshaller.optimized.OptimizedMarshaller", ex.Message);
+ }
+
+ /// <summary>
+ /// Starts the ignite.
+ /// </summary>
+ private static IIgnite StartIgnite(string xml)
+ {
+ return Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration())
+ {
+ SpringConfigUrl = xml
+ });
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
index ed12efd..6e0a497 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/TestUtils.cs
@@ -387,7 +387,7 @@ namespace Apache.Ignite.Core.Tests
/// <summary>
/// Gets the primary keys.
/// </summary>
- public static IEnumerable<int> GetPrimaryKeys(IIgnite ignite, string cacheName = null,
+ public static IEnumerable<int> GetPrimaryKeys(IIgnite ignite, string cacheName,
IClusterNode node = null)
{
var aff = ignite.GetAffinity(cacheName);
@@ -399,7 +399,7 @@ namespace Apache.Ignite.Core.Tests
/// <summary>
/// Gets the primary key.
/// </summary>
- public static int GetPrimaryKey(IIgnite ignite, string cacheName = null, IClusterNode node = null)
+ public static int GetPrimaryKey(IIgnite ignite, string cacheName, IClusterNode node = null)
{
return GetPrimaryKeys(ignite, cacheName, node).First();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs b/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs
index 573cfb3..05a8ae3 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IIgnite.cs
@@ -252,7 +252,8 @@ namespace Apache.Ignite.Core
IgniteConfiguration GetConfiguration();
/// <summary>
- /// Starts a near cache on local node if cache with specified was previously started.
+ /// Starts a near cache on local client node if cache with specified was previously started.
+ /// This method does not work on server nodes.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="configuration">The configuration.</param>
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
index 300e944..efe5905 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/Compute.cs
@@ -196,12 +196,16 @@ namespace Apache.Ignite.Core.Impl.Compute
/** <inheritDoc /> */
public TJobRes AffinityCall<TJobRes>(string cacheName, object affinityKey, IComputeFunc<TJobRes> clo)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
return _compute.AffinityCall(cacheName, affinityKey, clo).Get();
}
/** <inheritDoc /> */
public Task<TRes> AffinityCallAsync<TRes>(string cacheName, object affinityKey, IComputeFunc<TRes> clo)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
return _compute.AffinityCall(cacheName, affinityKey, clo).Task;
}
@@ -209,6 +213,8 @@ namespace Apache.Ignite.Core.Impl.Compute
public Task<TRes> AffinityCallAsync<TRes>(string cacheName, object affinityKey, IComputeFunc<TRes> clo,
CancellationToken cancellationToken)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
return GetTaskIfAlreadyCancelled<TRes>(cancellationToken) ??
_compute.AffinityCall(cacheName, affinityKey, clo).GetTask(cancellationToken);
}
@@ -341,12 +347,16 @@ namespace Apache.Ignite.Core.Impl.Compute
/** <inheritDoc /> */
public void AffinityRun(string cacheName, object affinityKey, IComputeAction action)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
_compute.AffinityRun(cacheName, affinityKey, action).Get();
}
/** <inheritDoc /> */
public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
return _compute.AffinityRun(cacheName, affinityKey, action).Task;
}
@@ -354,6 +364,8 @@ namespace Apache.Ignite.Core.Impl.Compute
public Task AffinityRunAsync(string cacheName, object affinityKey, IComputeAction action,
CancellationToken cancellationToken)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
return GetTaskIfAlreadyCancelled<object>(cancellationToken) ??
_compute.AffinityRun(cacheName, affinityKey, action).GetTask(cancellationToken);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
index d36caf3..66e5339 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Compute/ComputeImpl.cs
@@ -445,6 +445,7 @@ namespace Apache.Ignite.Core.Impl.Compute
/// <param name="action">Job to execute.</param>
public Future<object> AffinityRun(string cacheName, object affinityKey, IComputeAction action)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
IgniteArgumentCheck.NotNull(action, "action");
return ExecuteClosures0(new ComputeSingleClosureTask<object, object, object>(),
@@ -463,6 +464,7 @@ namespace Apache.Ignite.Core.Impl.Compute
/// <typeparam name="TJobRes">Type of job result.</typeparam>
public Future<TJobRes> AffinityCall<TJobRes>(string cacheName, object affinityKey, IComputeFunc<TJobRes> clo)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
IgniteArgumentCheck.NotNull(clo, "clo");
return ExecuteClosures0(new ComputeSingleClosureTask<object, TJobRes, TJobRes>(),
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
index a795459..8fa1f6a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
@@ -386,12 +386,16 @@ namespace Apache.Ignite.Core.Impl
/** <inheritdoc /> */
public ICache<TK, TV> GetCache<TK, TV>(string name)
{
+ IgniteArgumentCheck.NotNull(name, "name");
+
return Cache<TK, TV>(UU.ProcessorCache(_proc, name));
}
/** <inheritdoc /> */
public ICache<TK, TV> GetOrCreateCache<TK, TV>(string name)
{
+ IgniteArgumentCheck.NotNull(name, "name");
+
return Cache<TK, TV>(UU.ProcessorGetOrCreateCache(_proc, name));
}
@@ -406,6 +410,7 @@ namespace Apache.Ignite.Core.Impl
NearCacheConfiguration nearConfiguration)
{
IgniteArgumentCheck.NotNull(configuration, "configuration");
+ IgniteArgumentCheck.NotNull(configuration.Name, "CacheConfiguration.Name");
configuration.Validate(Logger);
using (var stream = IgniteManager.Memory.Allocate().GetStream())
@@ -431,6 +436,8 @@ namespace Apache.Ignite.Core.Impl
/** <inheritdoc /> */
public ICache<TK, TV> CreateCache<TK, TV>(string name)
{
+ IgniteArgumentCheck.NotNull(name, "name");
+
return Cache<TK, TV>(UU.ProcessorCreateCache(_proc, name));
}
@@ -445,6 +452,7 @@ namespace Apache.Ignite.Core.Impl
NearCacheConfiguration nearConfiguration)
{
IgniteArgumentCheck.NotNull(configuration, "configuration");
+ IgniteArgumentCheck.NotNull(configuration.Name, "CacheConfiguration.Name");
configuration.Validate(Logger);
using (var stream = IgniteManager.Memory.Allocate().GetStream())
@@ -471,6 +479,8 @@ namespace Apache.Ignite.Core.Impl
/** <inheritdoc /> */
public void DestroyCache(string name)
{
+ IgniteArgumentCheck.NotNull(name, "name");
+
UU.ProcessorDestroyCache(_proc, name);
}
@@ -528,6 +538,8 @@ namespace Apache.Ignite.Core.Impl
/** <inheritdoc /> */
public IDataStreamer<TK, TV> GetDataStreamer<TK, TV>(string cacheName)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
return new DataStreamerImpl<TK, TV>(UU.ProcessorDataStreamer(_proc, cacheName, false),
_marsh, cacheName, false);
}
@@ -541,6 +553,8 @@ namespace Apache.Ignite.Core.Impl
/** <inheritdoc /> */
public ICacheAffinity GetAffinity(string cacheName)
{
+ IgniteArgumentCheck.NotNull(cacheName, "cacheName");
+
return new CacheAffinityImpl(UU.ProcessorAffinity(_proc, cacheName), _marsh, false, this);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala b/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
index 0101e25..35c95fc 100644
--- a/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
+++ b/modules/scalar/src/main/scala/org/apache/ignite/scalar/scalar.scala
@@ -258,20 +258,11 @@ object scalar extends ScalarConversions {
}
/**
- * Gets default cache.
- *
- * Note that you always need to provide types when calling
- * this function - otherwise Scala will create `Cache[Nothing, Nothing]`
- * typed instance that cannot be used.
- */
- @inline def cache$[K, V]: Option[IgniteCache[K, V]] = Option(Ignition.ignite.cache[K, V](null))
-
- /**
* Gets named cache from default grid.
*
* @param cacheName Name of the cache to get.
*/
- @inline def cache$[K, V](@Nullable cacheName: String): Option[IgniteCache[K, V]] =
+ @inline def cache$[K, V](cacheName: String): Option[IgniteCache[K, V]] =
Option(Ignition.ignite.cache(cacheName))
/**
@@ -279,7 +270,7 @@ object scalar extends ScalarConversions {
*
* @param cacheName Name of the cache to get.
*/
- @inline def createCache$[K, V](@Nullable cacheName: String, cacheMode: CacheMode = CacheMode.PARTITIONED,
+ @inline def createCache$[K, V](cacheName: String, cacheMode: CacheMode = CacheMode.PARTITIONED,
indexedTypes: Seq[Class[_]] = Seq.empty): IgniteCache[K, V] = {
val cfg = new CacheConfiguration[K, V]()
@@ -295,7 +286,7 @@ object scalar extends ScalarConversions {
*
* @param cacheName Name of the cache to destroy.
*/
- @inline def destroyCache$(@Nullable cacheName: String) = {
+ @inline def destroyCache$(cacheName: String) = {
Ignition.ignite.destroyCache(cacheName)
}
@@ -306,7 +297,7 @@ object scalar extends ScalarConversions {
* @param cacheName Name of the cache to get.
*/
@inline def cache$[K, V](@Nullable igniteInstanceName: String,
- @Nullable cacheName: String): Option[IgniteCache[K, V]] =
+ cacheName: String): Option[IgniteCache[K, V]] =
ignite$(igniteInstanceName) match {
case Some(g) => Option(g.cache(cacheName))
case None => None
@@ -320,7 +311,7 @@ object scalar extends ScalarConversions {
* @return New instance of data streamer.
*/
@inline def dataStreamer$[K, V](
- @Nullable cacheName: String,
+ cacheName: String,
bufSize: Int): IgniteDataStreamer[K, V] = {
val dl = ignite$.dataStreamer[K, V](cacheName)
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/scalar/src/test/resources/spring-cache.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/resources/spring-cache.xml b/modules/scalar/src/test/resources/spring-cache.xml
index 7c6adc0..210335e0 100644
--- a/modules/scalar/src/test/resources/spring-cache.xml
+++ b/modules/scalar/src/test/resources/spring-cache.xml
@@ -26,6 +26,7 @@
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="default"/>
<property name="cacheMode" value="PARTITIONED"/>
<property name="atomicityMode" value="TRANSACTIONAL"/>
<property name="nearConfiguration">
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
----------------------------------------------------------------------
diff --git a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
index 2a11e5e..52ddf23 100644
--- a/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
+++ b/modules/scalar/src/test/scala/org/apache/ignite/scalar/tests/ScalarCacheQueriesSpec.scala
@@ -51,7 +51,7 @@ class ScalarCacheQueriesSpec extends FunSpec with ShouldMatchers with BeforeAndA
override def beforeAll() {
n = start("modules/scalar/src/test/resources/spring-cache.xml").cluster().localNode
- c = cache$[Int, ObjectValue].get
+ c = cache$[Int, ObjectValue]("default").get
(1 to ENTRY_CNT).foreach(i => c.put(i, ObjectValue(i, "str " + WORDS(i))))
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java
index 59dbbfa..49bb1ac 100644
--- a/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java
+++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaEmbeddedIgniteRDDSelfTest.java
@@ -305,7 +305,7 @@ public class JavaEmbeddedIgniteRDDSelfTest extends GridCommonAbstractTest {
* @return Cache configuration.
*/
private static CacheConfiguration<Object, Object> cacheConfiguration() {
- CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg.setBackups(1);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java b/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
index 7f5c252..87da627 100644
--- a/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
+++ b/modules/spark/src/test/java/org/apache/ignite/spark/JavaStandaloneIgniteRDDSelfTest.java
@@ -334,7 +334,7 @@ public class JavaStandaloneIgniteRDDSelfTest extends GridCommonAbstractTest {
* @return cache Configuration.
*/
private static CacheConfiguration<Object, Object> cacheConfiguration(String name, Class<?> clsK, Class<?> clsV) {
- CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg.setBackups(1);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerSelfTest.java
index 158f898..5a0e759 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/spring/GridSpringCacheManagerSelfTest.java
@@ -66,7 +66,7 @@ public class GridSpringCacheManagerSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
- CacheConfiguration cache = new CacheConfiguration();
+ CacheConfiguration cache = new CacheConfiguration(DEFAULT_CACHE_NAME);
cache.setName(CACHE_NAME);
@@ -390,7 +390,7 @@ public class GridSpringCacheManagerSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testDynamicCacheEvict() throws Exception {
- CacheConfiguration<Integer, String> cacheCfg = new CacheConfiguration<>();
+ CacheConfiguration<Integer, String> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
cacheCfg.setName(DYNAMIC_CACHE_NAME);
@@ -417,7 +417,7 @@ public class GridSpringCacheManagerSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testDynamicCacheEvictAll() throws Exception {
- CacheConfiguration<Integer, String> cacheCfg = new CacheConfiguration<>();
+ CacheConfiguration<Integer, String> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
cacheCfg.setName(DYNAMIC_CACHE_NAME);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
index 6ecf67f..bc4f268 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -92,7 +92,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
* @return Cache configuration with store.
*/
private CacheConfiguration<Integer, String> cacheConfiguration() {
- CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
CacheJdbcBlobStoreFactory<Integer, String> factory = new CacheJdbcBlobStoreFactory();
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
index e354935..9389646 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
@@ -84,7 +84,7 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest {
* @return Cache configuration with store.
*/
private CacheConfiguration<Integer, String> cacheConfiguration() {
- CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
CacheJdbcPojoStoreFactory<Integer, String> factory = new CacheJdbcPojoStoreFactory<>();
@@ -101,7 +101,7 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest {
* @return Cache configuration with store.
*/
private CacheConfiguration<Integer, String> cacheConfigurationH2Dialect() {
- CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
CacheJdbcPojoStoreFactory<Integer, String> factory = new CacheJdbcPojoStoreFactory<>();
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java
index ff23dc8..6dad1f4 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/IgniteDynamicCacheConfigTest.java
@@ -74,7 +74,7 @@ public class IgniteDynamicCacheConfigTest extends GridCommonAbstractTest {
cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE_NAME, testAttribute));
- CacheConfiguration cacheCfg = new CacheConfiguration();
+ CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cacheCfg.setCacheMode(CacheMode.REPLICATED);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridTransformSpringInjectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridTransformSpringInjectionSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridTransformSpringInjectionSelfTest.java
index 09ff15c..dcf42c0 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridTransformSpringInjectionSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/processors/resource/GridTransformSpringInjectionSelfTest.java
@@ -99,7 +99,7 @@ public class GridTransformSpringInjectionSelfTest extends GridCacheAbstractSelfT
* @return Cache configuration.
*/
private CacheConfiguration<String, Integer> cacheConfiguration(CacheAtomicityMode atomicityMode) {
- CacheConfiguration<String, Integer> ccfg = new CacheConfiguration<>();
+ CacheConfiguration<String, Integer> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg.setName(getClass().getSimpleName());
ccfg.setAtomicityMode(atomicityMode);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
index dbc5b25..b861e19 100644
--- a/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/p2p/GridP2PUserVersionChangeSelfTest.java
@@ -102,7 +102,7 @@ public class GridP2PUserVersionChangeSelfTest extends GridCommonAbstractTest {
cfg.setDiscoverySpi(discoSpi);
if (igniteInstanceName.contains("testCacheRedeployVersionChangeContinuousMode")) {
- CacheConfiguration cacheCfg = new CacheConfiguration();
+ CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
cacheCfg.setCacheMode(CacheMode.REPLICATED);
@@ -299,13 +299,13 @@ public class GridP2PUserVersionChangeSelfTest extends GridCommonAbstractTest {
Class rcrsCls = ldr.loadClass(TEST_RCRS_NAME);
- IgniteCache<Long, Object> cache1 = ignite1.cache(null);
+ IgniteCache<Long, Object> cache1 = ignite1.cache(DEFAULT_CACHE_NAME);
assertNotNull(cache1);
cache1.put(1L, rcrsCls.newInstance());
- final IgniteCache<Long, Object> cache2 = ignite2.cache(null);
+ final IgniteCache<Long, Object> cache2 = ignite2.cache(DEFAULT_CACHE_NAME);
assertNotNull(cache2);
@@ -325,7 +325,7 @@ public class GridP2PUserVersionChangeSelfTest extends GridCommonAbstractTest {
ignite1 = startGrid("testCacheRedeployVersionChangeContinuousMode1");
- cache1 = ignite1.cache(null);
+ cache1 = ignite1.cache(DEFAULT_CACHE_NAME);
assertNotNull(cache1);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartFromStreamConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartFromStreamConfigurationTest.java b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartFromStreamConfigurationTest.java
index 421011f..2307a35 100644
--- a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartFromStreamConfigurationTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteStartFromStreamConfigurationTest.java
@@ -41,9 +41,9 @@ public class IgniteStartFromStreamConfigurationTest extends GridCommonAbstractTe
URL cfgLocation = U.resolveIgniteUrl(cfg);
try (Ignite grid = Ignition.start(new FileInputStream(cfgLocation.getFile()))) {
- grid.cache(null).put("1", "1");
+ grid.cache(DEFAULT_CACHE_NAME).put("1", "1");
- assert grid.cache(null).get("1").equals("1");
+ assert grid.cache(DEFAULT_CACHE_NAME).get("1").equals("1");
IgniteConfiguration icfg = Ignition.loadSpringBean(new FileInputStream(cfgLocation.getFile()), "ignite.cfg");
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/spring/src/test/java/org/apache/ignite/transactions/spring/GridSpringTransactionManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/transactions/spring/GridSpringTransactionManagerSelfTest.java b/modules/spring/src/test/java/org/apache/ignite/transactions/spring/GridSpringTransactionManagerSelfTest.java
index e119d81..3014706 100644
--- a/modules/spring/src/test/java/org/apache/ignite/transactions/spring/GridSpringTransactionManagerSelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/transactions/spring/GridSpringTransactionManagerSelfTest.java
@@ -50,7 +50,7 @@ public class GridSpringTransactionManagerSelfTest extends GridCommonAbstractTest
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
- CacheConfiguration cache = new CacheConfiguration();
+ CacheConfiguration cache = new CacheConfiguration(DEFAULT_CACHE_NAME);
cache.setName(CACHE_NAME);
cache.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/twitter/src/test/java/org/apache/ignite/stream/twitter/IgniteTwitterStreamerTest.java
----------------------------------------------------------------------
diff --git a/modules/twitter/src/test/java/org/apache/ignite/stream/twitter/IgniteTwitterStreamerTest.java b/modules/twitter/src/test/java/org/apache/ignite/stream/twitter/IgniteTwitterStreamerTest.java
index f6d51a7..2210a27 100644
--- a/modules/twitter/src/test/java/org/apache/ignite/stream/twitter/IgniteTwitterStreamerTest.java
+++ b/modules/twitter/src/test/java/org/apache/ignite/stream/twitter/IgniteTwitterStreamerTest.java
@@ -93,7 +93,7 @@ public class IgniteTwitterStreamerTest extends GridCommonAbstractTest {
* @throws Exception Test exception.
*/
public void testStatusesFilterEndpointOAuth1() throws Exception {
- try (IgniteDataStreamer<Long, String> dataStreamer = grid().dataStreamer(null)) {
+ try (IgniteDataStreamer<Long, String> dataStreamer = grid().dataStreamer(DEFAULT_CACHE_NAME)) {
TwitterStreamerImpl streamer = newStreamerInstance(dataStreamer);
Map<String, String> params = new HashMap<>();
@@ -153,7 +153,7 @@ public class IgniteTwitterStreamerTest extends GridCommonAbstractTest {
Status status = TwitterObjectFactory.createStatus(tweet);
- IgniteCache<Long, String> cache = grid().cache(null);
+ IgniteCache<Long, String> cache = grid().cache(DEFAULT_CACHE_NAME);
String cachedValue = cache.get(status.getId());
@@ -173,7 +173,7 @@ public class IgniteTwitterStreamerTest extends GridCommonAbstractTest {
// Listen to cache PUT events and expect as many as messages as test data items.
CacheListener listener = new CacheListener();
- ignite.events(ignite.cluster().forCacheNodes(null)).localListen(listener, EVT_CACHE_OBJECT_PUT);
+ ignite.events(ignite.cluster().forCacheNodes(DEFAULT_CACHE_NAME)).localListen(listener, EVT_CACHE_OBJECT_PUT);
return listener;
}
@@ -184,7 +184,7 @@ public class IgniteTwitterStreamerTest extends GridCommonAbstractTest {
private void unsubscribeToPutEvents(CacheListener listener) {
Ignite ignite = grid();
- ignite.events(ignite.cluster().forCacheNodes(null)).stopLocalListen(listener, EVT_CACHE_OBJECT_PUT);
+ ignite.events(ignite.cluster().forCacheNodes(DEFAULT_CACHE_NAME)).stopLocalListen(listener, EVT_CACHE_OBJECT_PUT);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheClearCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheClearCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheClearCommandSpec.scala
index fb2f8cb..59e6b39 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheClearCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheClearCommandSpec.scala
@@ -17,17 +17,15 @@
package org.apache.ignite.visor.commands.cache
-import org.apache.ignite.cache.{CacheMode, CacheAtomicityMode}
+import org.apache.ignite.cache.{CacheAtomicityMode, CacheMode}
import CacheAtomicityMode._
import CacheMode._
import org.apache.ignite.visor.{VisorRuntimeBaseSpec, visor}
-
import org.apache.ignite.Ignition
import org.apache.ignite.configuration.{CacheConfiguration, IgniteConfiguration}
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder
-import org.jetbrains.annotations.Nullable
-
+import org.jetbrains.annotations.{NotNull, Nullable}
import org.apache.ignite.visor.commands.cache.VisorCacheCommand._
import scala.collection.JavaConversions._
@@ -50,7 +48,7 @@ class VisorCacheClearCommandSpec extends VisorRuntimeBaseSpec(2) {
cfg.setIgniteInstanceName(name)
cfg.setLocalHost("127.0.0.1")
- cfg.setCacheConfiguration(cacheConfig(null), cacheConfig("cache"))
+ cfg.setCacheConfiguration(cacheConfig("cache"))
val discoSpi = new TcpDiscoverySpi()
@@ -65,7 +63,7 @@ class VisorCacheClearCommandSpec extends VisorRuntimeBaseSpec(2) {
* @param name Cache name.
* @return Cache Configuration.
*/
- def cacheConfig(@Nullable name: String): CacheConfiguration[Object, Object] = {
+ def cacheConfig(@NotNull name: String): CacheConfiguration[Object, Object] = {
val cfg = new CacheConfiguration[Object, Object]
cfg.setCacheMode(REPLICATED)
@@ -76,20 +74,6 @@ class VisorCacheClearCommandSpec extends VisorRuntimeBaseSpec(2) {
}
describe("An 'cclear' visor command") {
- it("should show correct result for default cache") {
- Ignition.ignite("node-1").cache[Int, Int](null).putAll(Map(1 -> 1, 2 -> 2, 3 -> 3))
-
- val lock = Ignition.ignite("node-1").cache[Int, Int](null).lock(1)
-
- lock.lock()
-
- VisorCacheClearCommand().clear(Nil, None)
-
- lock.unlock()
-
- VisorCacheClearCommand().clear(Nil, None)
- }
-
it("should show correct result for named cache") {
Ignition.ignite("node-1").cache[Int, Int]("cache").putAll(Map(1 -> 1, 2 -> 2, 3 -> 3))
http://git-wip-us.apache.org/repos/asf/ignite/blob/8f9edebf/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommandSpec.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommandSpec.scala b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommandSpec.scala
index 5aff431..384aae0 100644
--- a/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommandSpec.scala
+++ b/modules/visor-console/src/test/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommandSpec.scala
@@ -44,7 +44,7 @@ class VisorCacheCommandSpec extends VisorRuntimeBaseSpec(1) {
* @param name Cache name.
* @return Cache Configuration.
*/
- def cacheConfig(@Nullable name: String): CacheConfiguration[Object, Object] = {
+ def cacheConfig(@NotNull name: String): CacheConfiguration[Object, Object] = {
val cfg = new CacheConfiguration[Object, Object]
cfg.setCacheMode(REPLICATED)