52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using Akka.Configuration;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Cluster.Tests;
|
|
|
|
public sealed class HoconLoaderTests
|
|
{
|
|
[Fact]
|
|
public void LoadBaseConfig_returns_nonempty_string()
|
|
{
|
|
var hocon = HoconLoader.LoadBaseConfig();
|
|
hocon.ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact]
|
|
public void Base_config_parses_to_cluster_provider()
|
|
{
|
|
var cfg = ConfigurationFactory.ParseString(HoconLoader.LoadBaseConfig());
|
|
cfg.GetString("akka.actor.provider").ShouldBe("cluster");
|
|
}
|
|
|
|
[Fact]
|
|
public void Split_brain_resolver_is_keep_oldest()
|
|
{
|
|
var cfg = ConfigurationFactory.ParseString(HoconLoader.LoadBaseConfig());
|
|
cfg.GetString("akka.cluster.split-brain-resolver.active-strategy").ShouldBe("keep-oldest");
|
|
}
|
|
|
|
[Fact]
|
|
public void Stable_after_is_15_seconds()
|
|
{
|
|
var cfg = ConfigurationFactory.ParseString(HoconLoader.LoadBaseConfig());
|
|
cfg.GetTimeSpan("akka.cluster.split-brain-resolver.stable-after")
|
|
.ShouldBe(TimeSpan.FromSeconds(15));
|
|
}
|
|
|
|
[Fact]
|
|
public void Failure_detector_threshold_is_10()
|
|
{
|
|
var cfg = ConfigurationFactory.ParseString(HoconLoader.LoadBaseConfig());
|
|
cfg.GetDouble("akka.cluster.failure-detector.threshold").ShouldBe(10.0);
|
|
}
|
|
|
|
[Fact]
|
|
public void Opcua_synchronized_dispatcher_is_pinned()
|
|
{
|
|
var cfg = ConfigurationFactory.ParseString(HoconLoader.LoadBaseConfig());
|
|
cfg.GetString("opcua-synchronized-dispatcher.type").ShouldBe("PinnedDispatcher");
|
|
}
|
|
}
|