Ports 36 JetStream super-cluster tests from jetstream_super_cluster_test.go, 3 JetStream leaf-node tests from jetstream_leafnode_test.go, and 14 leaf-node tests from leafnode_test.go into the integration test project. Creates the required harness infrastructure (TestSuperCluster, TestCluster, IntegrationTestBase, CheckHelper, ConfigHelper, NatsTestClient, TestServerHelper). All 53 tests are marked [Fact(Skip = "...")] pending full multi-server cluster runtime.
25 lines
808 B
C#
25 lines
808 B
C#
// Copyright 2020-2025 The NATS Authors
|
|
// Licensed under the Apache License, Version 2.0
|
|
|
|
using NATS.Client.Core;
|
|
|
|
namespace ZB.MOM.NatsNet.Server.IntegrationTests.Helpers;
|
|
|
|
/// <summary>
|
|
/// Helpers for connecting NATS test clients to running servers.
|
|
/// </summary>
|
|
public static class NatsTestClient
|
|
{
|
|
/// <summary>Connects to the given NATS URL.</summary>
|
|
public static async Task<NatsConnection> Connect(string url)
|
|
{
|
|
var conn = new NatsConnection(new NatsOpts { Url = url });
|
|
await conn.ConnectAsync();
|
|
return conn;
|
|
}
|
|
|
|
/// <summary>Connects to the client URL of the supplied server handle.</summary>
|
|
public static Task<NatsConnection> ConnectToServer(object server) =>
|
|
throw new NotImplementedException("Requires a running server instance.");
|
|
}
|