You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2019/03/30 19:57:08 UTC
[ignite] 01/02: Suppress compiler warnings
This is an automated email from the ASF dual-hosted git repository.
ptupitsyn pushed a commit to branch ignite-11525
in repository https://gitbox.apache.org/repos/asf/ignite.git
commit 318780013f06352ad2ae2e2bee357b8e69442405
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Sat Mar 30 22:54:38 2019 +0300
Suppress compiler warnings
---
.../Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs | 2 ++
.../Cache/Query/CacheQueriesCodeConfigurationTest.cs | 4 ++++
.../Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs | 8 +++++++-
.../dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs | 2 ++
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs
index 005488a..4d523ba 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs
@@ -99,7 +99,9 @@ namespace Apache.Ignite.Core.Tests.Binary.Serializable
};
// Test SQL.
+#pragma warning disable 618
var res = cache.Query(new SqlQuery(typeof(SimpleSerializable), "where Int = 2")).GetAll().Single();
+#pragma warning restore 618
Assert.AreEqual(2, res.Key);
Assert.AreEqual(2, res.Value.Int);
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
index 1d03c68..1e760e6 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesCodeConfigurationTest.cs
@@ -85,7 +85,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
cache[1] = new QueryPerson("Arnold", 10);
cache[2] = new QueryPerson("John", 20);
+#pragma warning disable 618
using (var cursor = cache.Query(new SqlQuery(typeof (QueryPerson), "age > ? and birthday < ?",
+#pragma warning restore 618
10, DateTime.UtcNow)))
{
Assert.AreEqual(2, cursor.GetAll().Single().Key);
@@ -176,6 +178,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
cache[2] = new AttributeQueryPerson("John", 20);
+#pragma warning disable 618
using (var cursor = cache.Query(new SqlQuery(typeof(AttributeQueryPerson),
"age > ? and age < ? and birthday > ? and birthday < ?", 10, 30,
DateTime.UtcNow.AddYears(-21), DateTime.UtcNow.AddYears(-19))))
@@ -197,6 +200,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
{
Assert.AreEqual(1, cursor.GetAll().Single().Key);
}
+#pragma warning restore 618
using (var cursor = cache.Query(new TextQuery(typeof(AttributeQueryPerson), "Ar*")))
{
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index bee6ffd..110fa1e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -139,6 +139,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
[Test]
public void TestValidationSql()
{
+#pragma warning disable 618
// 1. No sql.
Assert.Throws<ArgumentException>(() =>
{ Cache().Query(new SqlQuery(typeof(QueryPerson), null)); });
@@ -146,6 +147,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
// 2. No type.
Assert.Throws<ArgumentException>(() =>
{ Cache().Query(new SqlQuery((string)null, "age >= 50")); });
+#pragma warning restore 618
}
/// <summary>
@@ -184,7 +186,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
Cache().Put(1, new QueryPerson("Petrov", 40));
Cache().Put(1, new QueryPerson("Sidorov", 50));
+#pragma warning disable 618
SqlQuery qry = new SqlQuery(typeof(QueryPerson), "age >= 20");
+#pragma warning restore 618
// 1. Test GetAll().
using (IQueryCursor<ICacheEntry<int, QueryPerson>> cursor = Cache().Query(qry))
@@ -212,6 +216,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
[SuppressMessage("ReSharper", "UnusedVariable")]
public void TestEnumerator()
{
+#pragma warning disable 618
Cache().Put(1, new QueryPerson("Ivanov", 30));
Cache().Put(2, new QueryPerson("Petrov", 40));
Cache().Put(3, new QueryPerson("Sidorov", 50));
@@ -219,7 +224,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
// 1. Empty result set.
using (IQueryCursor<ICacheEntry<int, QueryPerson>> cursor =
- Cache().Query(new SqlQuery(typeof(QueryPerson), "age = 100")))
+ Cache().Query(new SqlQuery(typeof(QueryPerson), "age = 100")))
{
IEnumerator<ICacheEntry<int, QueryPerson>> e = cursor.GetEnumerator();
@@ -251,6 +256,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
// 4. Page size if less than result set.
qry.PageSize = 2;
CheckEnumeratorQuery(qry);
+#pragma warning restore 618
}
/// <summary>
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs
index d930b51..99b4f34 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/Cache/CacheClient.cs
@@ -206,6 +206,7 @@ namespace Apache.Ignite.Core.Impl.Client.Cache
}
/** <inheritDoc /> */
+ [Obsolete]
public IQueryCursor<ICacheEntry<TK, TV>> Query(SqlQuery sqlQuery)
{
IgniteArgumentCheck.NotNull(sqlQuery, "sqlQuery");
@@ -671,6 +672,7 @@ namespace Apache.Ignite.Core.Impl.Client.Cache
/// <summary>
/// Writes the SQL query.
/// </summary>
+ [Obsolete]
private static void WriteSqlQuery(IBinaryRawWriter writer, SqlQuery qry)
{
Debug.Assert(qry != null);