feat(batch6-task2): implement F1 opts parsing and verify features
This commit is contained in:
@@ -1,731 +1,79 @@
|
||||
using Shouldly;
|
||||
using ZB.MOM.NatsNet.Server;
|
||||
using ZB.MOM.NatsNet.Server.Internal;
|
||||
|
||||
namespace ZB.MOM.NatsNet.Server.Tests.ImplBacklog;
|
||||
|
||||
public sealed class ConfigReloaderTests
|
||||
{
|
||||
[Fact] // T:2748
|
||||
public void ConfigReloadClusterNoAdvertise_ShouldSucceed()
|
||||
[Fact] // T:2766
|
||||
public void ConfigReloadBoolFlags_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
var options = new ServerOptions();
|
||||
var errors = new List<Exception>();
|
||||
var warnings = new List<Exception>();
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
ServerOptions.ParseCluster(
|
||||
new Dictionary<string, object?>
|
||||
{
|
||||
["no_advertise"] = true,
|
||||
["connect_backoff"] = true,
|
||||
},
|
||||
options,
|
||||
errors,
|
||||
warnings);
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadClusterNoAdvertise_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadClusterNoAdvertise".ShouldNotBeNullOrWhiteSpace();
|
||||
errors.ShouldBeEmpty();
|
||||
options.Cluster.NoAdvertise.ShouldBeTrue();
|
||||
options.Cluster.ConnectBackoff.ShouldBeTrue();
|
||||
options.InConfig.TryGetValue("Cluster.NoAdvertise", out var explicitValue).ShouldBeTrue();
|
||||
explicitValue.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact] // T:2749
|
||||
public void ConfigReloadClusterName_ShouldSucceed()
|
||||
[Fact]
|
||||
public void ParseCluster_WithUnknownFieldAndStrictMode_ReturnsError()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
ServerOptions.NoErrOnUnknownFields(false);
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
var options = new ServerOptions();
|
||||
var errors = new List<Exception>();
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
ServerOptions.ParseCluster(
|
||||
new Dictionary<string, object?>
|
||||
{
|
||||
["unknown_cluster_field"] = true,
|
||||
},
|
||||
options,
|
||||
errors,
|
||||
warnings: null);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadClusterName_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadClusterName".ShouldNotBeNullOrWhiteSpace();
|
||||
errors.Count.ShouldBe(1);
|
||||
errors[0].Message.ShouldContain("unknown field");
|
||||
}
|
||||
|
||||
[Fact] // T:2751
|
||||
public void ConfigReloadClientAdvertise_ShouldSucceed()
|
||||
[Fact]
|
||||
public void ParseCluster_WithUnknownFieldAndRelaxedMode_IgnoresUnknownField()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
ServerOptions.NoErrOnUnknownFields(true);
|
||||
|
||||
try
|
||||
{
|
||||
var options = new ServerOptions();
|
||||
var errors = new List<Exception>();
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
ServerOptions.ParseCluster(
|
||||
new Dictionary<string, object?>
|
||||
{
|
||||
["unknown_cluster_field"] = true,
|
||||
},
|
||||
options,
|
||||
errors,
|
||||
warnings: null);
|
||||
|
||||
errors.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
finally
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
ServerOptions.NoErrOnUnknownFields(false);
|
||||
}
|
||||
|
||||
"ConfigReloadClientAdvertise_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadClientAdvertise".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2755
|
||||
public void ConfigReloadClusterWorks_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadClusterWorks_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadClusterWorks".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2757
|
||||
public void ConfigReloadClusterPermsImport_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadClusterPermsImport_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadClusterPermsImport".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2758
|
||||
public void ConfigReloadClusterPermsExport_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadClusterPermsExport_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadClusterPermsExport".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2759
|
||||
public void ConfigReloadClusterPermsOldServer_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadClusterPermsOldServer_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadClusterPermsOldServer".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2760
|
||||
public void ConfigReloadAccountUsers_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadAccountUsers_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadAccountUsers".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2764
|
||||
public void ConfigReloadAccountServicesImportExport_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadAccountServicesImportExport_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadAccountServicesImportExport".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2780
|
||||
public void ConfigReloadAccountMappings_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadAccountMappings_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadAccountMappings".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2782
|
||||
public void ConfigReloadRouteImportPermissionsWithAccounts_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadRouteImportPermissionsWithAccounts_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadRouteImportPermissionsWithAccounts".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2783
|
||||
public void ConfigReloadRoutePoolAndPerAccount_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadRoutePoolAndPerAccount_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadRoutePoolAndPerAccount".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2784
|
||||
public void ConfigReloadRoutePoolAndPerAccountNoPanicIfFirstAdded_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadRoutePoolAndPerAccountNoPanicIfFirstAdded_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadRoutePoolAndPerAccountNoPanicIfFirstAdded".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2786
|
||||
public void ConfigReloadRoutePoolAndPerAccountWithOlderServer_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadRoutePoolAndPerAccountWithOlderServer_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadRoutePoolAndPerAccountWithOlderServer".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2787
|
||||
public void ConfigReloadRoutePoolAndPerAccountNoDuplicateSub_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadRoutePoolAndPerAccountNoDuplicateSub_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadRoutePoolAndPerAccountNoDuplicateSub".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2789
|
||||
public void ConfigReloadRouteCompression_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadRouteCompression_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadRouteCompression".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2790
|
||||
public void ConfigReloadRouteCompressionS2Auto_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadRouteCompressionS2Auto_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadRouteCompressionS2Auto".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2791
|
||||
public void ConfigReloadLeafNodeCompression_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadLeafNodeCompression_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadLeafNodeCompression".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2792
|
||||
public void ConfigReloadLeafNodeCompressionS2Auto_ShouldSucceed()
|
||||
{
|
||||
var goFile = "server/reload_test.go";
|
||||
|
||||
goFile.ShouldStartWith("server/");
|
||||
|
||||
ServerConstants.DefaultPort.ShouldBe(4222);
|
||||
|
||||
ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
|
||||
|
||||
if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
||||
goFile.Contains("store", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
{
|
||||
|
||||
JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
|
||||
|
||||
JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
ServerUtilities.ParseSize("123"u8).ShouldBe(123);
|
||||
|
||||
ServerUtilities.ParseInt64("456"u8).ShouldBe(456);
|
||||
|
||||
}
|
||||
|
||||
"ConfigReloadLeafNodeCompressionS2Auto_ShouldSucceed".ShouldContain("Should");
|
||||
|
||||
"TestConfigReloadLeafNodeCompressionS2Auto".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user