Skip to content

Commit

Permalink
Merge pull request #70 from LinqToDB4iSeries/V4.4.1
Browse files Browse the repository at this point in the history
V4.4.1
  • Loading branch information
nsarris authored Feb 6, 2023
2 parents 5d304ce + ef1e0dd commit 71147f3
Show file tree
Hide file tree
Showing 230 changed files with 1,631 additions and 852 deletions.
2 changes: 1 addition & 1 deletion Build/linq2db.Default.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>4.3.0</Version>
<Version>4.4.1</Version>

<Description>LINQ to DB is a data access technology that provides a run-time infrastructure for managing relational data as objects. This package is a provider for DB2 on the IBM iSeries.</Description>
<Authors>Roy Chase, Nikos Sarris</Authors>
Expand Down
1 change: 1 addition & 0 deletions Build/linq2db.Tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<DefineConstants Condition="$(X86) != ''">$(DefineConstants);X86</DefineConstants>

<AssemblyOriginatorKeyFile>..\..\Build\linq2db.snk</AssemblyOriginatorKeyFile>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>

<ItemGroup>
Expand Down
21 changes: 12 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project>
<!--<PropertyGroup>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>-->
<!--
Known issues:
Expand All @@ -7,21 +10,21 @@
-->
<ItemGroup>
<!--as stated in issue 1 - packages in this item group shouldn't be duplicated in other groups-->
<PackageVersion Include="linq2db" Version="4.3.0" />
<PackageVersion Include="linq2db.Tools" Version="4.3.0" />
<PackageVersion Include="linq2db.AspNet" Version="4.3.0" />
<PackageVersion Include="linq2db.Remote.Grpc" Version="4.3.0" />
<PackageVersion Include="linq2db.Remote.Wcf" Version="4.3.0" />
<PackageVersion Include="linq2db" Version="4.4.1" />
<PackageVersion Include="linq2db.Tools" Version="4.4.1" />
<PackageVersion Include="linq2db.AspNet" Version="4.4.1" />
<PackageVersion Include="linq2db.Remote.Grpc" Version="4.4.1" />
<PackageVersion Include="linq2db.Remote.Wcf" Version="4.4.1" />
<PackageVersion Include="JetBrains.Annotations" Version="2022.1.0" />
<!--generic packages for source projects-->
<!--generic packages for source projects-->
<PackageVersion Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<!--build support-->
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Mono.TextTemplating" Version="2.2.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" />
Expand All @@ -47,7 +50,7 @@
<PackageVersion Include="Net.IBM.Data.Db2" Version="6.0.0.200" />
<PackageVersion Include="Net.IBM.Data.Db2-lnx" Version="6.0.0.200" />
<PackageVersion Include="Net.IBM.Data.Db2-osx" Version="6.0.0.200" />
<PackageVersion Include="Npgsql" Version="7.0.0-preview.7" />
<PackageVersion Include="Npgsql" Version="7.0.1" />
<PackageVersion Include="ClickHouse.Client" Version="5.0.4" />
<PackageVersion Include="Octonica.ClickHouseClient" Version="2.2.9" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="6.0.8" />
Expand Down Expand Up @@ -97,7 +100,7 @@
<ItemGroup>
<!--main version-->
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
</ItemGroup>

<!--test dependencies-->
Expand Down
4 changes: 3 additions & 1 deletion Tests/Base/BaselinesWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Tests
{
internal class BaselinesWriter
internal sealed class BaselinesWriter
{
// used to detect baseline overwrites by another test(case)
// case-insensitive to support windoze file system
Expand All @@ -24,6 +24,8 @@ internal static void Write(string baselinesPath, string baseline)
var target = "core31";
#elif NET6_0
var target = "net60";
#elif NET7_0
var target = "net70";
#else
#error "Build Target must be specified here."
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/Base/CustomTestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Tests
{
internal class CustomTestContext
internal sealed class CustomTestContext
{
public static string BASELINE = "key-baseline";
public static string TRACE = "key-trace";
Expand Down
2 changes: 2 additions & 0 deletions Tests/Base/CustomizationSupport/Db2iInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public override IEnumerable<string> InterceptTestDataSources(DataSourcesBaseAttr
case ("SqlRowTests", "UpdateRowSelect"):
// Test case uses alias name assertion from generated sql, name sanitization breaks test assertion - Copied to custom tests
case ("TableIDTests", "TableTest"):
// Test case uses guid conversion with custom conversion expression
case ("ConvertExpressionTests", "Issue3791Test"):
return Enumerable.Empty<string>();

//Access client throws a different exception so it is excluded
Expand Down
2 changes: 1 addition & 1 deletion Tests/Base/Remote/TestGrpcLinqService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Tests.Remote

using LinqToDB.Remote.Grpc;

internal class TestGrpcLinqService : GrpcLinqService
internal sealed class TestGrpcLinqService : GrpcLinqService
{
private readonly LinqService _linqService;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Base/Remote/TestWcfLinqService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Tests.Remote

using LinqToDB.Remote.Wcf;

internal class TestWcfLinqService : WcfLinqService
internal sealed class TestWcfLinqService : WcfLinqService
{
private readonly LinqService _linqService;

Expand Down
26 changes: 18 additions & 8 deletions Tests/Base/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using System.Linq;
using System.Linq.Expressions;
using System.Text;

using LinqToDB;
using LinqToDB.Common;
using LinqToDB.Configuration;
using LinqToDB.Data;
using LinqToDB.Data.RetryPolicy;
using LinqToDB.DataProvider.Informix;
Expand All @@ -19,11 +19,9 @@
using LinqToDB.Reflection;
using LinqToDB.Tools;
using LinqToDB.Tools.Comparers;

using Tests.Remote.ServerContainer;

using NUnit.Framework;
using NUnit.Framework.Internal;
using Tests.Remote.ServerContainer;

namespace Tests
{
Expand Down Expand Up @@ -162,6 +160,8 @@ static TestBase()
var configName = "CORE31";
#elif NET6_0
var configName = "NET60";
#elif NET7_0
var configName = "NET70";
#elif NET472
var configName = "NET472";
#else
Expand Down Expand Up @@ -444,6 +444,20 @@ protected TestDataConnection GetDataConnection(
return res;
}

protected TestDataConnection GetDataConnection(LinqToDBConnectionOptions options)
{
if (options.ConfigurationString?.EndsWith(".LinqService") == true)
{
throw new InvalidOperationException($"Call {nameof(GetDataContext)} for remote context creation");
}

Debug.WriteLine(options.ConfigurationString, "Provider ");

var res = new TestDataConnection(options);

return res;
}

private static readonly MappingSchema _sequentialAccessSchema = new ();
private static readonly MappingSchema _fecSchema = new ();

Expand Down Expand Up @@ -1442,10 +1456,6 @@ protected virtual BulkCopyOptions GetDefaultBulkCopyOptions(string configuration
{
var options = new BulkCopyOptions();

// https://github.com/DarkWanderer/ClickHouse.Client/issues/152
if (configuration.IsAnyOf(ProviderName.ClickHouseClient))
options.WithoutSession = true;

return options;
}
}
Expand Down
14 changes: 7 additions & 7 deletions Tests/Base/TestProviders/TestNoopProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected override void Dispose(bool disposing)
}
}

internal class TestNoopDataReader : DbDataReader
internal sealed class TestNoopDataReader : DbDataReader
{
public override object this[int ordinal] => throw new NotImplementedException();
public override object this[string name] => throw new NotImplementedException();
Expand Down Expand Up @@ -92,7 +92,7 @@ internal class TestNoopDataReader : DbDataReader
public override bool Read () => throw new NotImplementedException();
}

internal class TestNoopDbCommand : DbCommand
internal sealed class TestNoopDbCommand : DbCommand
{
private readonly DbParameterCollection _parameters = new TestNoopDbParameterCollection();

Expand Down Expand Up @@ -141,7 +141,7 @@ protected override DbTransaction? DbTransaction
protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) => new TestNoopDbDataReader();
}

internal class TestNoopDbParameter : DbParameter
internal sealed class TestNoopDbParameter : DbParameter
{
public override DbType DbType { get; set; }

Expand Down Expand Up @@ -190,7 +190,7 @@ public override DataRowVersion SourceVersion
public override void ResetDbType() => throw new NotImplementedException();
}

internal class TestNoopDbDataReader : DbDataReader
internal sealed class TestNoopDbDataReader : DbDataReader
{
public override int Depth => throw new NotImplementedException();
public override int FieldCount => throw new NotImplementedException();
Expand Down Expand Up @@ -230,7 +230,7 @@ public override void Close() { }
public override bool Read ( ) => false;
}

internal class TestNoopDbParameterCollection : DbParameterCollection
internal sealed class TestNoopDbParameterCollection : DbParameterCollection
{
private List<TestNoopDbParameter> _parameters = new ();

Expand Down Expand Up @@ -302,7 +302,7 @@ public static void Init()
public override TableOptions SupportedTableOptions => TableOptions.None;
}

internal class TestNoopSqlBuilder : BasicSqlBuilder
internal sealed class TestNoopSqlBuilder : BasicSqlBuilder
{
public TestNoopSqlBuilder(IDataProvider provider, MappingSchema mappingSchema)
: base(provider, mappingSchema, TestNoopSqlOptimizer.Instance, new SqlProviderFlags())
Expand All @@ -317,7 +317,7 @@ protected override void BuildInsertOrUpdateQuery(SqlInsertOrUpdateStatement inse
}
}

internal class TestNoopSqlOptimizer : BasicSqlOptimizer
internal sealed class TestNoopSqlOptimizer : BasicSqlOptimizer
{
public static ISqlOptimizer Instance = new TestNoopSqlOptimizer();

Expand Down
4 changes: 2 additions & 2 deletions Tests/Base/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public static bool ProviderNeedsTimeFix(this IDataContext db, string context)
var match = new Regex(@"^\d+\.\d+.\d+").Match(version);
if (match.Success)
{
var versionParts = match.Value.Split('.').Select(_ => int.Parse(_)).ToArray();
var versionParts = match.Value.Split('.').Select(int.Parse).ToArray();

return (versionParts[0] * 10000 + versionParts[1] * 100 + versionParts[2] < 50604);
}
Expand All @@ -190,7 +190,7 @@ public static DateTime StripMilliseconds(DateTime value, bool fix)
return fix ? new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second) : value;
}

class FirebirdTempTable<T> : TempTable<T>
sealed class FirebirdTempTable<T> : TempTable<T>
where T : notnull
{
public FirebirdTempTable(IDataContext db, string? tableName = null, string? databaseName = null, string? schemaName = null, TableOptions tableOptions = TableOptions.NotSet)
Expand Down
4 changes: 2 additions & 2 deletions Tests/Base/TxtSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ namespace Tests
{
public class TxtSettings : ILinqToDBSettings
{
class DataProviderSettings : IDataProviderSettings
sealed class DataProviderSettings : IDataProviderSettings
{
public string TypeName { get; set; } = null!;
public string? Name { get; set; }
public bool Default { get; set; }
public IEnumerable<NamedValue> Attributes => Array<NamedValue>.Empty;
}

class ConnectionStringSettings : IConnectionStringSettings
sealed class ConnectionStringSettings : IConnectionStringSettings
{
public string ConnectionString { get; set; } = null!;
public string Name { get; set; } = null!;
Expand Down
10 changes: 6 additions & 4 deletions Tests/Linq/Common/ConnectionBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Tests.Common
[TestFixture]
public class ConnectionBuilderTests : TestBase
{
private class TestLoggerFactory : ILoggerFactory
private sealed class TestLoggerFactory : ILoggerFactory
{
public List<TestLogger> Loggers = new ();

Expand All @@ -33,7 +33,7 @@ public void AddProvider(ILoggerProvider provider)
}
}

private class TestLogger : ILogger
private sealed class TestLogger : ILogger
{
public List<string> Messages = new ();

Expand All @@ -52,9 +52,11 @@ public bool IsEnabled(LogLevel logLevel)
return false;
}

public IDisposable BeginScope<TState>(TState state) => new Disposable();
public IDisposable BeginScope<TState>(TState state)
where TState : notnull
=> new Disposable();

private class Disposable : IDisposable
private sealed class Disposable : IDisposable
{
void IDisposable.Dispose()
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/Linq/Common/ConvertTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void Ctor()
Assert.AreEqual(10m, Convert<int,decimal>.From(10));
}

class TestData1
sealed class TestData1
{
public int Value;

Expand All @@ -85,7 +85,7 @@ public static implicit operator TestData1(int i)
}
}

class TestData2
sealed class TestData2
{
public int Value;

Expand Down
2 changes: 1 addition & 1 deletion Tests/Linq/Common/ExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private class BaseEntity
public virtual int PropVirtual { get; set; }
}

private class DerivedEntity : BaseEntity
private sealed class DerivedEntity : BaseEntity
{
public new Guid PropVirtual { get; set; }
public new Guid PropNonVirtual { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Tests/Linq/Common/ValueComparerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Tests.Common
[TestFixture]
public class ValueComparerTests
{
class TestObject
sealed class TestObject
{
public int Id { get; set; }
}
Expand Down
Loading

0 comments on commit 71147f3

Please sign in to comment.