Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PluginSpec so that it can accept ActorSystem and ActorSystemSetup in its constructor #4978

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Collections.Immutable;
using System.Linq;
using Akka.Actor;
using Akka.Actor.Setup;
using Akka.Configuration;
using Akka.Persistence.TCK.Serialization;
using Akka.TestKit;
Expand Down Expand Up @@ -52,6 +53,18 @@ protected JournalSpec(Config config = null, string actorSystemName = null, ITest
{
}

protected JournalSpec(ActorSystemSetup setup, string actorSystemName = null, ITestOutputHelper output = null)
: base(setup, actorSystemName ?? "SnapshotStoreSpec", output)
{
_senderProbe = CreateTestProbe();
}

protected JournalSpec(ActorSystem system = null, ITestOutputHelper output = null)
: base(system, output)
{
_senderProbe = CreateTestProbe();
}

protected override bool SupportsSerialization => true;

/// <summary>
Expand Down
17 changes: 17 additions & 0 deletions src/core/Akka.Persistence.TCK/PluginSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

using System;
using Akka.Actor;
using Akka.Actor.Setup;
using Akka.Configuration;
using Akka.Util.Internal;
using Xunit.Abstractions;
Expand All @@ -27,6 +28,22 @@ protected PluginSpec(Config config = null, string actorSystemName = null, ITestO
WriterGuid = Guid.NewGuid().ToString();
}

protected PluginSpec(ActorSystemSetup setup, string actorSystemName = null, ITestOutputHelper output = null)
: base(setup, actorSystemName, output)
{
Extension = Persistence.Instance.Apply(Sys as ExtendedActorSystem);
Pid = "p-" + Counter.IncrementAndGet();
WriterGuid = Guid.NewGuid().ToString();
}

protected PluginSpec(ActorSystem system = null, ITestOutputHelper output = null)
: base(system, output)
{
Extension = Persistence.Instance.Apply(Sys as ExtendedActorSystem);
Pid = "p-" + Counter.IncrementAndGet();
WriterGuid = Guid.NewGuid().ToString();
}

protected static Config FromConfig(Config config = null)
{
return config.IsNullOrEmpty()
Expand Down
13 changes: 13 additions & 0 deletions src/core/Akka.Persistence.TCK/Snapshot/SnapshotStoreSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Collections.Generic;
using System.Linq;
using Akka.Actor;
using Akka.Actor.Setup;
using Akka.Configuration;
using Akka.Persistence.Fsm;
using Akka.Persistence.TCK.Serialization;
Expand Down Expand Up @@ -56,6 +57,18 @@ protected SnapshotStoreSpec(Config config = null, string actorSystemName = null,
_senderProbe = CreateTestProbe();
}

protected SnapshotStoreSpec(ActorSystemSetup setup, string actorSystemName = null, ITestOutputHelper output = null)
: base(setup, actorSystemName ?? "SnapshotStoreSpec", output)
{
_senderProbe = CreateTestProbe();
}

protected SnapshotStoreSpec(ActorSystem system = null, ITestOutputHelper output = null)
: base(system, output)
{
_senderProbe = CreateTestProbe();
}

protected SnapshotStoreSpec(Type snapshotStoreType, string actorSystemName = null)
: base(ConfigFromTemplate(snapshotStoreType), actorSystemName)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka/Actor/ActorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ internal static ProviderSelection GetProvider(string providerClass)
}

/// <summary>
/// Core boostrap settings for the <see cref="ActorSystem"/>, which can be created using one of the static factory methods
/// Core bootstrap settings for the <see cref="ActorSystem"/>, which can be created using one of the static factory methods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh - nice catch

/// on this class.
/// </summary>
public sealed class BootstrapSetup : Setup.Setup
Expand Down