Skip to content

Commit

Permalink
Update PluginSpec so that it can accept ActorSystem and ActorSystemSe…
Browse files Browse the repository at this point in the history
…tup in its constructor (#4978)
  • Loading branch information
Arkatufus authored Apr 26, 2021
1 parent 101f5a2 commit a1fa221
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
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
/// on this class.
/// </summary>
public sealed class BootstrapSetup : Setup.Setup
Expand Down

0 comments on commit a1fa221

Please sign in to comment.