ptupitsyn commented on a change in pull request #6011: IGNITE-9998 .NET 
Partition preload API implementation.
URL: https://github.com/apache/ignite/pull/6011#discussion_r253537774
 
 

 ##########
 File path: 
modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/PartitionPreloadTest.cs
 ##########
 @@ -0,0 +1,294 @@
+/*
+ * 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.
+ */
+
+namespace Apache.Ignite.Core.Tests.Cache
+{
+    using System;
+    using System.Collections.Generic;
+    using System.IO;
+    using System.Linq;
+    using System.Threading;
+    using Apache.Ignite.Core.Cache;
+    using Apache.Ignite.Core.Cache.Affinity.Rendezvous;
+    using Apache.Ignite.Core.Cache.Configuration;
+    using Apache.Ignite.Core.Configuration;
+    using Apache.Ignite.Core.Impl;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests partition preload API.
+    /// </summary>
+    [Category(TestUtils.CategoryIntensive)]
+    public class PartitionPreloadTest
+    {
+        /** Temp dir for PDS. */
+        private static readonly string TempDir = 
IgniteUtils.GetTempDirectoryName();
+
+        /** */
+        private const string MemoryRegionName = "mem-region";
+        
+        /** */
+        private const string PersistenceRegionName = "pds-region";
+
+        /** */
+        private const int GridCount = 3;
+
+        /** */
+        private const string MemCacheName = "mem-cache";
+
+        /** */
+        private const string PersistenceCacheName = "pds-cache";
+
+        /** */
+        private const int EntriesCount = 1000;
+
+        /// <summary>
+        /// Tests that preloading partition on client locally returns 
<code>false</code>.
+        /// </summary>
+        [Test]
+        public void TestLocalPreloadPartitionClient()
+        {          
+            var cache = GetClient.GetCache<int, int>(MemCacheName);
+            
+            Assert.IsFalse(cache.LocalPreloadPartition(0));
+        }
+        
+        /// <summary>
+        /// Preload partitions synchronously.
+        /// </summary>
+        [Test]
+        public void TestPreloadPartition()
+        {
+            PerformPreloadTest(GetGrid(0), GetClient, PreloadMode.Sync);
+        }
+
+        /// <summary>
+        /// Tests that incorrect usage of API throws exceptions.
+        /// </summary>
+        [Test]
+        public void TestPreloadPartitionInMemoryFail()
+        {
+            var cache = GetClient.GetCache<int, int>(MemCacheName);
+
+            Assert.Throws<CacheException>(() => cache.PreloadPartition(0));
 
 Review comment:
   Please check the exception message as well to ensure it makes sense

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to