-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start adding Uris to ConnectionSettings.
* Add ClusterTests file.
- Loading branch information
1 parent
b1c3a58
commit f33e585
Showing
5 changed files
with
72 additions
and
7 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// This source code is dual-licensed under the Apache License, version 2.0, | ||
// and the Mozilla Public License, version 2.0. | ||
// Copyright (c) 2017-2024 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using RabbitMQ.AMQP.Client; | ||
using RabbitMQ.AMQP.Client.Impl; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Tests; | ||
|
||
public class ClusterTests(ITestOutputHelper testOutputHelper) | ||
: IntegrationTest(testOutputHelper, setupConnectionAndManagement: false) | ||
{ | ||
[SkippableFact] | ||
public Task CreateConnectionWithEnvironmentAndMultipleUris() | ||
{ | ||
Skip.IfNot(SystemUtils.IsCluster); | ||
|
||
Assert.Null(_connection); | ||
Assert.Null(_management); | ||
|
||
Uri uri0 = new("amqp://localhost:5672"); | ||
Uri uri1 = new("amqp://localhost:5673"); | ||
Uri uri2 = new("amqp://localhost:5674"); | ||
List<Uri> uris = [uri0, uri1, uri2]; | ||
|
||
ConnectionSettingBuilder connectionSettingBuilder = new(); | ||
connectionSettingBuilder.Uris(uris); | ||
IConnectionSettings connectionSettings = connectionSettingBuilder.Build(); | ||
|
||
/* | ||
IEnvironment env = AmqpEnvironment.Create(ConnectionSettingBuilder.Create().Build()); | ||
IConnection connection = await env.CreateConnectionAsync(); | ||
Assert.NotNull(connection); | ||
Assert.NotEmpty(env.GetConnections()); | ||
await env.CloseAsync(); | ||
Assert.Equal(State.Closed, connection.State); | ||
Assert.Empty(env.GetConnections()); | ||
*/ | ||
|
||
return Task.CompletedTask; | ||
} | ||
} |