-
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.
Implement support for connecting to ClusterTests
Fixes #95 * Start adding Uris to ConnectionSettings. * Add ClusterTests file.
- Loading branch information
1 parent
e8118c7
commit f7ebd0e
Showing
5 changed files
with
70 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,46 @@ | ||
// 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 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); | ||
ConnectionSettings 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; | ||
} | ||
} |