This is an automated email from the ASF dual-hosted git repository.
tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton-dotnet.git
The following commit(s) were added to refs/heads/main by this push:
new da5d24e PROTON-2799 Ensure source and target address values set are
matched
da5d24e is described below
commit da5d24e03e11107b0168c240b62b58583731531f
Author: Timothy Bish <[email protected]>
AuthorDate: Tue Feb 27 18:21:29 2024 -0500
PROTON-2799 Ensure source and target address values set are matched
Use consistent values for creating senders and receivers in the source
and target address element. Add tests to cover this expectation.
---
src/Proton.Client/Client/Implementation/ClientSenderBuilder.cs | 2 +-
.../Client/Implementation/ClientReceiverTest.cs | 8 +++++++-
.../Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs | 5 ++++-
.../Client/Implementation/ClientStreamReceiverTest.cs | 5 ++++-
.../Client/Implementation/ClientStreamSenderTest.cs | 3 ++-
5 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/Proton.Client/Client/Implementation/ClientSenderBuilder.cs
b/src/Proton.Client/Client/Implementation/ClientSenderBuilder.cs
index aedaee1..5eb9cf8 100644
--- a/src/Proton.Client/Client/Implementation/ClientSenderBuilder.cs
+++ b/src/Proton.Client/Client/Implementation/ClientSenderBuilder.cs
@@ -124,7 +124,7 @@ namespace Apache.Qpid.Proton.Client.Implementation
protonSender.DesiredCapabilities =
ClientConversionSupport.ToSymbolArray(options.DesiredCapabilities);
protonSender.Properties =
ClientConversionSupport.ToSymbolKeyedMap(options.Properties);
protonSender.Target = CreateTarget(address, options);
- protonSender.Source = CreateSource(senderId, options);
+ protonSender.Source = CreateSource(address, options);
IDeliveryTagGenerator tagGenerator =
options.DeliveryTagGeneratorSupplier == null ? null :
Objects.RequireNonNull(options.DeliveryTagGeneratorSupplier(),
diff --git
a/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs
b/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs
index d41a470..6059cec 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientReceiverTest.cs
@@ -55,7 +55,13 @@ namespace Apache.Qpid.Proton.Client.Implementation
peer.ExpectSASLAnonymousConnect();
peer.ExpectOpen().Respond();
peer.ExpectBegin().Respond();
-
peer.ExpectAttach().OfReceiver().WithSource().WithDistributionMode(Test.Driver.Matchers.Is.NullValue()).And().Respond();
+ peer.ExpectAttach().OfReceiver()
+
.WithSource().WithDistributionMode(Test.Driver.Matchers.Is.NullValue())
+ .WithAddress("test-queue")
+ .And()
+ .WithTarget().WithAddress("test-queue")
+ .And()
+ .Respond();
peer.ExpectFlow().WithLinkCredit(10);
peer.ExpectDetach().WithClosed(close).Respond();
peer.ExpectClose().Respond();
diff --git a/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs
b/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs
index 7cb31cd..088b93a 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientSenderTest.cs
@@ -55,7 +55,10 @@ namespace Apache.Qpid.Proton.Client.Implementation
peer.ExpectSASLAnonymousConnect();
peer.ExpectOpen().Respond();
peer.ExpectBegin().Respond();
- peer.ExpectAttach().OfSender().Respond();
+ peer.ExpectAttach().OfSender()
+ .WithSource().WithAddress("test-queue").And()
+ .WithTarget().WithAddress("test-queue").And()
+ .Respond();
peer.ExpectDetach().WithClosed(close).Respond();
peer.ExpectClose().Respond();
peer.Start();
diff --git
a/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs
b/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs
index a04330f..f7fa54f 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientStreamReceiverTest.cs
@@ -54,7 +54,10 @@ namespace Apache.Qpid.Proton.Client.Implementation
peer.ExpectSASLAnonymousConnect();
peer.ExpectOpen().Respond();
peer.ExpectBegin().Respond();
- peer.ExpectAttach().OfReceiver().Respond();
+ peer.ExpectAttach().OfReceiver()
+ .WithSource().WithAddress("test-queue").And()
+ .WithTarget().WithAddress("test-queue").And()
+ .Respond();
peer.ExpectFlow().WithLinkCredit(10);
peer.ExpectDetach().WithClosed(close).Respond();
peer.ExpectEnd().Respond();
diff --git
a/test/Proton.Client.Tests/Client/Implementation/ClientStreamSenderTest.cs
b/test/Proton.Client.Tests/Client/Implementation/ClientStreamSenderTest.cs
index c5b8f11..54656ba 100644
--- a/test/Proton.Client.Tests/Client/Implementation/ClientStreamSenderTest.cs
+++ b/test/Proton.Client.Tests/Client/Implementation/ClientStreamSenderTest.cs
@@ -162,7 +162,8 @@ namespace Apache.Qpid.Proton.Client.Implementation
peer.ExpectOpen().Respond();
peer.ExpectBegin().Respond();
peer.ExpectAttach().OfSender()
- .WithTarget().WithCapabilities("queue").And()
+
.WithTarget().WithAddress("test-queue").WithCapabilities("queue").And()
+ .WithSource().WithAddress("test-queue").And()
.Respond();
peer.ExpectDetach().Respond();
peer.ExpectEnd().Respond();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]