Skip to content

Commit

Permalink
modernized tests and upgraded to Akka.NET v1.5.0-beta3 (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored Feb 27, 2023
1 parent 402d33e commit 884a270
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerAllEventsSpec : AllEventsSpec, IDisposable
public class BatchingSqlServerAllEventsSpec : AllEventsSpec
{
public BatchingSqlServerAllEventsSpec(ITestOutputHelper output, SqlServerFixture fixture) : base(
InitConfig(fixture),
Expand All @@ -42,15 +43,11 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerCurrentAllEventsSpec : CurrentAllEventsSpec, IDisposable
public class BatchingSqlServerCurrentAllEventsSpec : CurrentAllEventsSpec
{
public BatchingSqlServerCurrentAllEventsSpec(ITestOutputHelper output, SqlServerFixture fixture) : base(
InitConfig(fixture),
Expand All @@ -42,15 +43,11 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerCurrentEventsByPersistenceIdSpec : CurrentEventsByPersistenceIdSpec, IDisposable
public class BatchingSqlServerCurrentEventsByPersistenceIdSpec : CurrentEventsByPersistenceIdSpec
{
public BatchingSqlServerCurrentEventsByPersistenceIdSpec(ITestOutputHelper output, SqlServerFixture fixture)
: base(InitConfig(fixture), nameof(BatchingSqlServerCurrentEventsByPersistenceIdSpec), output)
Expand Down Expand Up @@ -44,15 +45,11 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
return conf.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerCurrentEventsByTagSpec : EventsByTagSpec, IDisposable
public class BatchingSqlServerCurrentEventsByTagSpec : EventsByTagSpec
{
public BatchingSqlServerCurrentEventsByTagSpec(ITestOutputHelper output, SqlServerFixture fixture)
: base(InitConfig(fixture), nameof(BatchingSqlServerCurrentEventsByTagSpec), output)
Expand Down Expand Up @@ -50,15 +51,11 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
return conf.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerCurrentPersistenceIdsSpec : CurrentPersistenceIdsSpec, IDisposable
public class BatchingSqlServerCurrentPersistenceIdsSpec : CurrentPersistenceIdsSpec
{
public BatchingSqlServerCurrentPersistenceIdsSpec(ITestOutputHelper output, SqlServerFixture fixture)
: base(InitConfig(fixture), nameof(BatchingSqlServerCurrentPersistenceIdsSpec), output)
Expand Down Expand Up @@ -44,15 +45,11 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
return conf.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerEventsByPersistenceIdSpec : EventsByPersistenceIdSpec, IDisposable
public class BatchingSqlServerEventsByPersistenceIdSpec : EventsByPersistenceIdSpec
{
public BatchingSqlServerEventsByPersistenceIdSpec(ITestOutputHelper output, SqlServerFixture fixture)
: base(InitConfig(fixture), nameof(BatchingSqlServerEventsByPersistenceIdSpec), output)
Expand Down Expand Up @@ -44,15 +45,11 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
return conf.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerEventsByTagSpec : EventsByTagSpec, IDisposable
public class BatchingSqlServerEventsByTagSpec : EventsByTagSpec
{
public BatchingSqlServerEventsByTagSpec(ITestOutputHelper output, SqlServerFixture fixture)
: base(InitConfig(fixture), nameof(BatchingSqlServerEventsByTagSpec), output)
Expand Down Expand Up @@ -50,15 +51,11 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
return conf.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.TestKit.Performance;
using Xunit;
Expand All @@ -13,7 +14,7 @@
namespace Akka.Persistence.SqlServer.Tests
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerJournalPerfSpec : JournalPerfSpec, IDisposable
public class BatchingSqlServerJournalPerfSpec : JournalPerfSpec
{
public BatchingSqlServerJournalPerfSpec(ITestOutputHelper output, SqlServerFixture fixture)
: base(InitConfig(fixture), "BatchingSqlServerJournalPerfSpec", output)
Expand Down Expand Up @@ -47,15 +48,11 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
return ConfigurationFactory.ParseString(specString);
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Batching
{
[Collection("SqlServerSpec")]
public class BatchingSqlServerPersistenceIdsSpec : PersistenceIdsSpec, IDisposable
public class BatchingSqlServerPersistenceIdsSpec : PersistenceIdsSpec
{
public BatchingSqlServerPersistenceIdsSpec(ITestOutputHelper output, SqlServerFixture fixture)
: base(InitConfig(fixture), nameof(BatchingSqlServerPersistenceIdsSpec), output)
Expand Down Expand Up @@ -44,15 +45,11 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
return conf.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// -----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Akka.Configuration;
using Akka.Persistence.Query;
using Akka.Persistence.Query.Sql;
Expand All @@ -15,7 +16,7 @@
namespace Akka.Persistence.SqlServer.Tests.Query
{
[Collection("SqlServerSpec")]
public class SqlServerAllEventsSpec : AllEventsSpec, IDisposable
public class SqlServerAllEventsSpec : AllEventsSpec
{
public SqlServerAllEventsSpec(ITestOutputHelper output, SqlServerFixture fixture) : base(InitConfig(fixture),
nameof(SqlServerAllEventsSpec), output)
Expand Down Expand Up @@ -48,15 +49,11 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected void Dispose(bool disposing)
{
DbUtils.Clean();
}

public void Dispose()
public override Task DisposeAsync()
{
GC.SuppressFinalize(this);
Dispose(true);
DbUtils.Clean();
return base.DisposeAsync();
}
}
}
Loading

0 comments on commit 884a270

Please sign in to comment.