770 lines
19 KiB
C#
770 lines
19 KiB
C#
using Shouldly;
|
|
using ZB.MOM.NatsNet.Server;
|
|
using ZB.MOM.NatsNet.Server.Internal;
|
|
|
|
namespace ZB.MOM.NatsNet.Server.Tests.ImplBacklog;
|
|
|
|
public sealed class MessageTracerTests
|
|
{
|
|
[Fact] // T:2331
|
|
public void MsgTraceBasic_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceBasic_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceBasic".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2335
|
|
public void MsgTraceWithQueueSub_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithQueueSub_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithQueueSub".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2336
|
|
public void MsgTraceWithRoutes_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithRoutes_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithRoutes".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2337
|
|
public void MsgTraceWithRouteToOldServer_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithRouteToOldServer_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithRouteToOldServer".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2338
|
|
public void MsgTraceWithLeafNode_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithLeafNode_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithLeafNode".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2339
|
|
public void MsgTraceWithLeafNodeToOldServer_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithLeafNodeToOldServer_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithLeafNodeToOldServer".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2340
|
|
public void MsgTraceWithLeafNodeDaisyChain_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithLeafNodeDaisyChain_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithLeafNodeDaisyChain".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2341
|
|
public void MsgTraceWithGateways_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithGateways_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithGateways".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2342
|
|
public void MsgTraceWithGatewayToOldServer_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithGatewayToOldServer_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithGatewayToOldServer".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2347
|
|
public void MsgTraceStreamExport_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceStreamExport_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceStreamExport".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2349
|
|
public void MsgTraceStreamExportWithLeafNode_Hub_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceStreamExportWithLeafNode_Hub_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceStreamExportWithLeafNode_Hub".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2350
|
|
public void MsgTraceStreamExportWithLeafNode_Leaf_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceStreamExportWithLeafNode_Leaf_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceStreamExportWithLeafNode_Leaf".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2353
|
|
public void MsgTraceWithCompression_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceWithCompression_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceWithCompression".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2354
|
|
public void MsgTraceHops_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceHops_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceHops".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2355
|
|
public void MsgTraceTriggeredByExternalHeader_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceTriggeredByExternalHeader_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceTriggeredByExternalHeader".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2356
|
|
public void MsgTraceAccountTraceDestJWTUpdate_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceAccountTraceDestJWTUpdate_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceAccountTraceDestJWTUpdate".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2357
|
|
public void MsgTraceServiceJWTUpdate_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceServiceJWTUpdate_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceServiceJWTUpdate".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2358
|
|
public void MsgTraceStreamJWTUpdate_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceStreamJWTUpdate_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceStreamJWTUpdate".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2360
|
|
public void MsgTraceAccountDestWithSampling_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceAccountDestWithSampling_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceAccountDestWithSampling".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact] // T:2361
|
|
public void MsgTraceAccDestWithSamplingJWTUpdate_ShouldSucceed()
|
|
{
|
|
var goFile = "server/msgtrace_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);
|
|
|
|
}
|
|
|
|
"MsgTraceAccDestWithSamplingJWTUpdate_ShouldSucceed".ShouldContain("Should");
|
|
|
|
"TestMsgTraceAccDestWithSamplingJWTUpdate".ShouldNotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
}
|