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-protonj2.git
The following commit(s) were added to refs/heads/main by this push:
new f0d8d2d PROTON-2418 Fix test not being called and update checks
f0d8d2d is described below
commit f0d8d2d8b25f3f908156500138ec864380ab8e28
Author: Timothy Bish <[email protected]>
AuthorDate: Tue Aug 24 13:25:30 2021 -0400
PROTON-2418 Fix test not being called and update checks
Check that the receive call throws when link state becomes closed or
detached during blocked operation.
---
.../org/apache/qpid/protonj2/client/impl/ReceiverTest.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git
a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java
b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java
index f23c639..a753362 100644
---
a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java
+++
b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java
@@ -1292,9 +1292,9 @@ public class ReceiverTest extends
ImperativeClientTestCase {
receiver.addCredit(10);
try {
- assertNull(receiver.receive());
+ receiver.receive();
+ fail("Should throw to indicate that receiver was closed");
} catch (ClientException ise) {
- // Can happen if receiver closed before the receive call gets
executed.
}
connection.closeAsync().get();
@@ -1305,12 +1305,12 @@ public class ReceiverTest extends
ImperativeClientTestCase {
@Test
public void testBlockingReceiveCancelledWhenReceiverRemotelyClosed()
throws Exception {
- doTtestBlockingReceiveCancelledWhenReceiverClosedOrDetached(true);
+
doTtestBlockingReceiveCancelledWhenReceiverRemotelyClosedOrDetached(true);
}
@Test
public void testBlockingReceiveCancelledWhenReceiverRemotelyDetached()
throws Exception {
- doTtestBlockingReceiveCancelledWhenReceiverClosedOrDetached(false);
+
doTtestBlockingReceiveCancelledWhenReceiverRemotelyClosedOrDetached(false);
}
public void
doTtestBlockingReceiveCancelledWhenReceiverRemotelyClosedOrDetached(boolean
close) throws Exception {
@@ -1338,9 +1338,9 @@ public class ReceiverTest extends
ImperativeClientTestCase {
receiver.openFuture().get();
try {
- assertNull(receiver.receive());
- } catch (IllegalStateException ise) {
- // Can happen if receiver closed before the receive call gets
executed.
+ receiver.receive();
+ fail("Client should throw to indicate remote closed the
receiver forcibly.");
+ } catch (ClientIllegalStateException ise) {
}
connection.closeAsync().get();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]