-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add EventsByPersistenceId persistence query back (#133)
* Refactor namespace from Test to Tests * Add EventsByPersistenceIdSpec and CurrentEventsByPersistenceIdSpec unit tests back * Replace Source based EventsByPersistenceIdSource with ActorPublisher based EventsByPersistenceIdPublisher * Add RedisReadJournalProvider back (accidentally deleted in dev) * Cleanup RedisJournal class from all the leftover commented query support code.
- Loading branch information
Showing
21 changed files
with
804 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/Akka.Persistence.Redis.Cluster.Tests/Query/RedisCurrentEventsByPersistenceIdSpec.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Akka.Configuration; | ||
using Akka.Persistence.Query; | ||
using Akka.Persistence.Redis.Query; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit; | ||
using Xunit.Abstractions; //----------------------------------------------------------------------- | ||
// <copyright file="RedisCurrentEventsByPersistenceIdSpec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2017 Akka.NET Contrib <https://github.com/AkkaNetContrib/Akka.Persistence.Redis> | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
|
||
namespace Akka.Persistence.Redis.Cluster.Tests.Query | ||
{ | ||
[Collection("RedisClusterSpec")] | ||
public class RedisCurrentEventsByPersistenceIdSpec : CurrentEventsByPersistenceIdSpec | ||
{ | ||
public static Config Config(RedisClusterFixture fixture) | ||
{ | ||
DbUtils.Initialize(fixture); | ||
|
||
return ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.redis"" | ||
akka.persistence.journal.redis {{ | ||
class = ""Akka.Persistence.Redis.Journal.RedisJournal, Akka.Persistence.Redis"" | ||
plugin-dispatcher = ""akka.actor.default-dispatcher"" | ||
configuration-string = ""{fixture.ConnectionString}"" | ||
}} | ||
akka.test.single-expect-default = 3s") | ||
.WithFallback(RedisPersistence.DefaultConfig()); | ||
} | ||
|
||
public RedisCurrentEventsByPersistenceIdSpec(ITestOutputHelper output, RedisClusterFixture fixture) | ||
: base(Config(fixture), nameof(RedisCurrentEventsByPersistenceIdSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
DbUtils.Clean(); | ||
base.Dispose(disposing); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/Akka.Persistence.Redis.Cluster.Tests/Query/RedisEventsByPersistenceIdSpec.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="RedisEventsByPersistenceIdSpec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2017 Akka.NET Contrib <https://github.com/AkkaNetContrib/Akka.Persistence.Redis> | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.Query; | ||
using Akka.Persistence.Redis.Query; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Redis.Cluster.Tests.Query | ||
{ | ||
[Collection("RedisClusterSpec")] | ||
public class RedisEventsByPersistenceIdSpec : EventsByPersistenceIdSpec | ||
{ | ||
public static Config Config(RedisClusterFixture fixture) | ||
{ | ||
DbUtils.Initialize(fixture); | ||
|
||
return ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.redis"" | ||
akka.persistence.journal.redis {{ | ||
class = ""Akka.Persistence.Redis.Journal.RedisJournal, Akka.Persistence.Redis"" | ||
plugin-dispatcher = ""akka.actor.default-dispatcher"" | ||
configuration-string = ""{fixture.ConnectionString}"" | ||
}} | ||
akka.test.single-expect-default = 3s") | ||
.WithFallback(RedisPersistence.DefaultConfig()); | ||
} | ||
|
||
public RedisEventsByPersistenceIdSpec(ITestOutputHelper output, RedisClusterFixture fixture) | ||
: base(Config(fixture), nameof(RedisEventsByPersistenceIdSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
DbUtils.Clean(); | ||
base.Dispose(disposing); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/Akka.Persistence.Redis.Tests/Query/RedisCurrentEventsByPersistenceIdSpec.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using Akka.Persistence.Redis; | ||
using Akka.Persistence.Redis.Tests; | ||
|
||
//----------------------------------------------------------------------- | ||
// <copyright file="RedisCurrentEventsByPersistenceIdSpec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2017 Akka.NET Contrib <https://github.com/AkkaNetContrib/Akka.Persistence.Redis> | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.Query; | ||
using Akka.Persistence.Redis.Query; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Redis.Tests.Query | ||
{ | ||
[Collection("RedisSpec")] | ||
public class RedisCurrentEventsByPersistenceIdSpec : CurrentEventsByPersistenceIdSpec | ||
{ | ||
public const int Database = 1; | ||
|
||
public static Config Config(RedisFixture fixture, int id) | ||
{ | ||
DbUtils.Initialize(fixture); | ||
|
||
return ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.redis"" | ||
akka.persistence.journal.redis {{ | ||
class = ""Akka.Persistence.Redis.Journal.RedisJournal, Akka.Persistence.Redis"" | ||
plugin-dispatcher = ""akka.actor.default-dispatcher"" | ||
configuration-string = ""{fixture.ConnectionString}"" | ||
database = {id} | ||
}} | ||
akka.test.single-expect-default = 3s") | ||
.WithFallback(RedisPersistence.DefaultConfig()); | ||
} | ||
|
||
public RedisCurrentEventsByPersistenceIdSpec(ITestOutputHelper output, RedisFixture fixture) | ||
: base(Config(fixture, Database), nameof(RedisCurrentEventsByPersistenceIdSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
DbUtils.Clean(Database); | ||
base.Dispose(disposing); | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/Akka.Persistence.Redis.Tests/Query/RedisEventsByPersistenceIdSpec.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="RedisEventsByPersistenceIdSpec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2017 Akka.NET Contrib <https://github.com/AkkaNetContrib/Akka.Persistence.Redis> | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.Persistence.Query; | ||
using Akka.Persistence.Redis.Query; | ||
using Akka.Persistence.TCK.Query; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Persistence.Redis.Tests.Query | ||
{ | ||
[Collection("RedisSpec")] | ||
public class RedisEventsByPersistenceIdSpec : EventsByPersistenceIdSpec | ||
{ | ||
public const int Database = 1; | ||
|
||
public static Config Config(RedisFixture fixture, int id) | ||
{ | ||
DbUtils.Initialize(fixture); | ||
|
||
return ConfigurationFactory.ParseString($@" | ||
akka.loglevel = INFO | ||
akka.persistence.journal.plugin = ""akka.persistence.journal.redis"" | ||
akka.persistence.journal.redis {{ | ||
class = ""Akka.Persistence.Redis.Journal.RedisJournal, Akka.Persistence.Redis"" | ||
plugin-dispatcher = ""akka.actor.default-dispatcher"" | ||
configuration-string = ""{fixture.ConnectionString}"" | ||
database = {id} | ||
}} | ||
akka.test.single-expect-default = 3s") | ||
.WithFallback(RedisPersistence.DefaultConfig()); | ||
} | ||
|
||
public RedisEventsByPersistenceIdSpec(ITestOutputHelper output, RedisFixture fixture) : base(Config(fixture, Database), nameof(RedisEventsByPersistenceIdSpec), output) | ||
{ | ||
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
DbUtils.Clean(Database); | ||
base.Dispose(disposing); | ||
} | ||
} | ||
} |
107 changes: 0 additions & 107 deletions
107
src/Akka.Persistence.Redis.Tests/RedisClusterFixture.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.